Jump to content

'Phaser.TileSprite' cannot extend 'PIXI.TiliingSprite'


markloika
 Share

Recommended Posts

I'm trying to get up and running with Phaser and TypeScript.

 

Following the instructions here:

http://www.photonstorm.com/phaser/how-to-use-phaser-with-typescript

 

This does appear to be out of date though as phaser.d.ts is not in the build folder, so I copied phaser.js and phaser.min.js from the build folder and phaser.d.ts and pixi.d.ts from the typescript folder, and added these 4 files to my project.

 

Now when trying to compile in VS, I get the following two errors:

Error 1 Class 'Phaser.TileSprite' cannot extend class 'PIXI.TilingSprite':Types of property 'destroy' of types 'TileSprite' and 'PIXI.TilingSprite' are incompatible:Call signatures of types '(destroyChildren: boolean) => void' and '() => void' are incompatible:Call signature expects 0 or fewer parameters. C:\Users\Mark\Product Development\In Progress\TypeScript Learning\TypeScryptHelloWorld\TypeScryptHelloWorld\phaser.d.ts 4270 11 TypeScriptHelloWorldError 2 Build: Class 'Phaser.TileSprite' cannot extend class 'PIXI.TilingSprite': C:\Users\Mark\Product Development\In Progress\TypeScript Learning\TypeScryptHelloWorld\TypeScryptHelloWorld\phaser.d.ts 4270 11 TypeScriptHelloWorld
I found a post from 2013 that would seem to indicate this issue was solved literally years ago:
 

 

 

Actually sorry this is a mistake on my part. TileSprite shouldn't extend Phaser.Sprite at all. I've updated the code and docs to remove this. The issue is that TileSprites work so differently from normal Pixi sprites that you simply can't extend them in the same way. Getting Input to work would require rewriting Pixi.TileSprite which I don't want to do right now, sorry.

 

 
 
So I'm pretty confused as to what's going on as I just now downloaded Phaser from the git repo. Any help would be appreciated!
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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