Jump to content

Phaser 2.4.2 - TypeScript - VS2015 - Issue with Intellisense comments


jordan001
 Share

Recommended Posts

Hello all,

I'm trying to set up Phaser 2.4.2 in Visual Studio 2015 using TypeScript, and I'm having issues getting the IntelliSense to properly show all of the functions and comments without generating hundreds of errors.

 

I've copied the following files into the root directory of my TypeScript project:

 

'p2.d.ts'

'phaser.d.ts'

'pixi.d.ts'

'pixi.comments.d.ts'

'phaser.comments.d.ts'

'phaser.js'

 

I've added the existing item, 'phaser.d.ts', to my TypeScript project.  My game is working properly, but it doesn't show the IntelliSense comments unless I add the existing items 'phaser.comments.d.ts' and/or 'pixi.comments.d.ts' to my TypeScript project.  However, when I add either of these two comment files to my project I get hundreds of (600+) errors; all of the errors are code TS2300 - Duplicate  identifier.  I've also noticed that sometimes the IntelliSense doesn't work.  For instance when I use this.mysprite.body. no code hinting shows after body, but it works with most other methods.  If someone has experience with this issue I would really appreciate some guidance.  I would love to use Phaser but without the IntelliSense working it's very hard to learn; it feels like I'm blindly coding.  Thanks guys!  If you need any more info from me or screenshots please let me know.

Link to comment
Share on other sites

  • 11 months later...

Hi, try to create "lib" directory and put .d.ts files into it (delete it from all other locations).

This is my project structure in VS 2015. Not all directories are in it:

Project.png

This is complete project sturcture on disk:

Disc.png

There is rest of directories: assets, js. You can have it in VS or not - depends on you. I do not have it in VS as I do not access assets through it. Bin and obj are dirs created by VS during compilation.

Link to comment
Share on other sites

  • 2 months later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...