Jump to content

Typescript Definition Error on Phaser.TileSprite


Jman420
 Share

Recommended Posts

I am new to Phaser and TypeScript, so hopefully this question hasn't been answered already.  I just downloaded the Phaser Javascript & TypeScript definition files, created a new project and added the Phaser files.  I tried to build without adding any other files (just the default TypeScript Greeter Project) and got build errors saying that Phaser.TileSprite can not extend PIXI.TilingSprite because the signatures for the destroy() methods are incompatible.  The PIXI.TilingSprite destroy has no parameters and the Phaser.TileSprite destroy has a boolean parameter.  I'm not sure how to resolve this issue.  I know that in pure Javascript this would be totally legal and the undefined check on the Phaser.TileSprite parameter would cause any calls from PIXI to default to true, but Typescript is less forgiving.  Does anyone have any suggestions?

Link to comment
Share on other sites

I've managed to work around the compiler error by simply removing the boolean parameter from the Phaser.TileSprite destroy() method, but I believe that this will hide/disable the ability to destroy a TileSprite without destroying its children. 

Link to comment
Share on other sites

I've found the proper fix for this issue.  The issue has been fixed in the DEV branch, so I just took the TypeScript Definitions and Phaser.JS from the DEV Branch and updated to the current version of TypeScript.  Everything compiles smoothly now.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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