Jump to content


  • Content Count

  • Joined

  • Last visited

About troyedwardsjr

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Updated my TypeScript boilerplate with a more complete example: https://github.com/troyedwardsjr/phaser3-typescript-webpack
  2. I believe so. One way I know of is copying the typescript definition file to the root of your phaser folder in node_modules, and changing the phaser package.json file to have the field "types" : "./phaser.d.ts" in it. Then either restart the TypeScript server in VS Code by pressing CTRL + SHIFT + P and searching "Restart TS Server" or just restarting VS Code. So as long as you're using NPM and RequireJS or ES6 Import, you should be able to use it with vanilla Javascript or ES6. https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html https://code.visualstudio.
  3. I haven't tested everything yet but using my modified version of Antriel's official (WIP) Phaser 3 typescript definitions build, I was able to get scene properties (plugins) to work using a hacky generator by stepping through Phaser code with the browser debugger, converting any useful runtime data to JSON, writing it to disk, then converting it with a simple script, and injecting it into Antriel's build. End result: Everything appears to be compiling in the typescript compiler so far, with code hinting, autocompletion/intellisense, ect. in VS Code (and I imagine similar editors). N
  4. Are member variables working for you? They don't appear to be working for me in your build: Have you found a solution to this yet because I haven't found a solution other than to manually add JSDocs (which would require changes to the source / PR requests), or possibly hacky importing and evaluating of modules from the source and writing a custom parser afterwards from any useful data in the middle of my tsd compilation/transpilation process. Which would be a problem since Scenes appear to have properties or as phaser calls it "plugins" dynamically added to them at runtime and Phaser regi
  5. Making good progress on writing my Phaser 3 typescript definition generator/transpiler. First full build: https://github.com/troyedwardsjr/phaser3-tsd/blob/master/build/phaser.d.ts
  6. I've started writing a generator for Phaser 3 typescript definitions using Richard's JSDoc annotations. If anyone is interested in helping: https://github.com/troyedwardsjr/phaser3-tsd
  • Create New...