You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi folks, I've been tinkering with this plugin today using TypeScript, phaser-ce v2.8.0, using gulp as my build manager. I encountered a few issues along the way and thought I would detail my process, and/or see if there is a better way of doing this.
Accessing the module globally
Firstly I had to get the TypeScript compiler to make use of the definitions, as the PhaserInput module was not available to me. To do this, I:
Created node_modules/@orange-games/phaser-input/build/typings.json which contains:
This way I'm not dependant on external projects having typings or not
Hmm, I still mostly work on Phaser 2.6.2, so that might be a change in the -ce addition. I don't test my plugins on the ce version, but I'll add this info to the readme
Hi folks, I've been tinkering with this plugin today using TypeScript, phaser-ce v2.8.0, using gulp as my build manager. I encountered a few issues along the way and thought I would detail my process, and/or see if there is a better way of doing this.
Accessing the module globally
Firstly I had to get the TypeScript compiler to make use of the definitions, as the PhaserInput module was not available to me. To do this, I:
node_modules/@orange-games/phaser-input/build/typings.json
which contains:./typings.json
, to add aphaser-input
field toglobalDevDependencies
.The file now contains:
typings install
in the project root directoryThis allowed me to access the PhaserInput module globally.
Adding the plugin
Next up I was unable to add the plugin to the game, as I was getting this error:
Argument of type 'typeof Plugin' is not assignable to parameter of type 'Plugin'. Property 'active' is missing in type 'typeof Plugin'.
After a browse at some other plugins, I notice they use this method (which also works in this case)
Gaining access to game.add.inputField()
When trying to use the
game.add.inputField()
method I was getting the following error:Property 'inputField' does not exist on type 'GameObjectFactory'.
To fix this I added the following member variable to the
Phaser.State
I am creatingThe text was updated successfully, but these errors were encountered: