Matthias Elephant Posted April 19, 2016 Share Posted April 19, 2016 Hi, i would like to extend the Sprite, but without a texture or a texture loaded from atlas. Someone know how to do this? MonsterBunny = function (game, x, y) { Phaser.Sprite.call(this, game, x, y, 'bunny'); //how to initialize without a texture }; One trial: Phaser.Sprite.call(FallBall.game, 50,50, PIXI.Texture.emptyTexture) //didn't work I use texture atlas, so i can't do it like the example. http://phaser.io/examples/v2/sprites/extending-sprite-demo-1 Thanks for help. Link to comment Share on other sites More sharing options...
VitaZheltyakov Posted April 19, 2016 Share Posted April 19, 2016 Phaser.Sprite.call(FallBall.game, 50,50, 'atlas', 'key') Link to comment Share on other sites More sharing options...
Matthias Elephant Posted April 20, 2016 Author Share Posted April 20, 2016 Thank you for your answer, but i'm sure, that you didn't test this. This can't work. The parameter is a texture, not "atlas and key". Link to comment Share on other sites More sharing options...
drhayes Posted April 20, 2016 Share Posted April 20, 2016 You do this: MonsterBunny = function (game, x, y) { Phaser.Sprite.call(this, game, x, y); }; Was this not working? Matthias Elephant 1 Link to comment Share on other sites More sharing options...
Matthias Elephant Posted April 20, 2016 Author Share Posted April 20, 2016 I'm confused. I'm pretty sure, that this was my first test yesterday. The error was: phaser.js:15150 Uncaught TypeError: this.onTextureUpdate is not a function(…) But know it seems to work. Oo Sorry for the question Link to comment Share on other sites More sharing options...
Recommended Posts