Open justjoeyuk opened 5 years ago
@justjoeyuk This is excellent! 100% want this in core excalibur.
The team has talked about implementing some form of gesture api like this #475, this would be an excellent start to this.
@eonarheim That's brilliant to hear. However, I've began adding a "enableKeyboard" for the SwipeTracker (mainly to debug on Desktop). I've encountered an error with the imports and now it won't compile. When I add import {KeyEvent, Keys } from "excalibur/dist/Input";
I get the following compiler warnings:
WARNING in ./node_modules/excalibur/dist/Input/Index.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* C:\Users\Buxbo\Desktop\Games\Meteor\node_modules\excalibur\dist\Input\Index.js
Used by 10 module(s), i. e.
C:\Users\Buxbo\Desktop\Games\Meteor\node_modules\excalibur\dist\Engine.js
* C:\Users\Buxbo\Desktop\Games\Meteor\node_modules\excalibur\dist\Input\index.js
Used by 1 module(s), i. e.
It builds but refuses to run now. Any ideas?
@justjoeyuk Sadly, loading individual types like Import {KeyEvent, Keys } from "excalibur/dist/Input
from files isn't super friendly at the moment for excalibur and doesn't provide a lot of tree shaking benefits yet (we need more discipline in our imports
in the core library).
import * as ex from 'excalibur'
, we have sampleInput
is pulling in the loader stuff)It's concerning that there appears to be 2 index files Index.js
and index.js
in the node module Input directory. I don't see it in a fresh install of latest excalibur though?
What does your file system show?
Hey @eonarheim ,
I added the CSS file loader and that's fine, that error is gone. I'll start to use the imports as you described now.
However, I'm interested in contributing to this project and would like more information about how to do so whilst building a project I'm working on. Do you have Discord or anything along those lines? I'd love to be able to modify the engine directly whilst working on my current project.
Regards
@eonarheim The directory only contains "Index.ts" but it looks like by default, import x from y
looks for index.ts
which seems accurate from my experience.
@eonarheim It works now, I used import * as ex from 'excalibur';
instead. However, I do believe that all Index.ts
should be index.ts
which is the conventional way for module resolves to be handled. It can alternative partially fixed by doing import {PointerEvent} from 'excalibur/dist/Input/Index'
but then you get compiler errors saying that Document isn't a property of undefined
on PointerScope for whatever reason.
@justjoeyuk Hmm good point, we should definitely open a bug on the capitalization of the Index.ts
barrels. That import looks pretty un-ideal.
It may be a bigger question for the team, should we open an additional issue switch to all lowercase files in excalibur to match closer to node @excaliburjs/core-contributors?
@justjoeyuk As for working on the engine while building a game I've done a couple approaches
I'll make an issue later to update our readme to include this in our documentation 👍
This issue hasn't had any recent activity lately and is being marked as stale automatically.
This issue hasn't had any recent activity lately and is being marked as stale automatically.
I made this same issue previously, but on an alternate account where I would not be subscribed properly to this issue. I've remade it.
It would be useful to have a feature that allows you to track swipes on a mobile device. I've created my own using Excaliburs' current features. I'm not sure if it's suitable for the engines' scope, however. The code is below for reference, but I believe that a utility for swipe gestures would be handy.
The math isn't fantastic in this Swipe Tracker either. I'm still playing around with it.
Usage: