oxysoft Posted March 14, 2015 Share Posted March 14, 2015 I am trying to use TypeScript with phaser and I am getting the following errorsError 7 Class 'TileSprite' incorrectly extends base class 'TilingSprite': Types of property 'destroy' are incompatible: Type '(destroyChildren: boolean) => void' is not assignable to type '() => void'. c:\Users\oxysoft\documents\visual studio 2013\Projects\flint-game\flint-game\phaser.d.ts 4270 11 flint-game I have added Phaser.js, Phaser.js.min, Phaser.d.ts and Pixi.d.ts and it is not working Thanks Link to comment Share on other sites More sharing options...
Huggz Posted March 15, 2015 Share Posted March 15, 2015 I had that problem too. I just changed the 'TilingSprite.destroy' definition in pixi.d.ts to match the TileSprite.destroy definition in Phaser.d.ts (maybe the other way around...), so that they both read:destroy(destroyChildren: boolean): void;Just make sure you choose to add function parameters rather than remove them. If one application doesn't use them it's not going to hurt for them to be there... yay javascript Link to comment Share on other sites More sharing options...
Jman420 Posted March 15, 2015 Share Posted March 15, 2015 I also had this problem and noticed that it is fixed in the dev branch by simply changing the TileSprite.destroy(destroyChildren: boolean) to TileSprite.destroy(destroyChildren?: boolean). This makes the parameter optional and there is already logic in the TileSprite.destroy() method to handle the parameter not being provided. This is probably a safer work-around. Link to comment Share on other sites More sharing options...
Recommended Posts