Closed MgSam closed 7 years ago
So what I usually do, is that I start out with a simple game interface that extends the default Phaser.Game, and then I inject my custom plugins like so:
/**
* Add any other OG plugins here after loading them in app.ts
* e.g. phaser-nineslice
*/
interface IGame extends Phaser.Game {
add: PhaserInput.InputFieldObjectFactory;
}
Then in my State I always declare a public property game (well, actully override) and use the custom Interface as the type:
class GameView extends Phaser.State {
//private moreGamesMenu: Fabrique.MoreGames.Menu;
public game: IGame;
constructor() {
super();
}
}
That should make it work :)
Sorry for the stupid request- but could you provide an example of using the .d.ts file? I cannot get the definitions to successfully merge with phaser.comments.d.ts (from Phaser proper).