phaser3-plugin-isometric icon indicating copy to clipboard operation
phaser3-plugin-isometric copied to clipboard

Using atlas, can not add frame

Open Octagon-X opened this issue 5 years ago • 0 comments

I can not add an "isoSprite" with the correct frame. I am using atlas to load the sprites. Atlas data is loaded correctly. As I can add a normal sprite like this:

this.scene.add.sprite( xx, yy, 'tileset', 'tile1'); Works fine. "tile1" is loaded. Can be done for any other tile.

this.scene.add.isoSprite( xx, yy, 0, 'tileset', 'tile1'); Does not work. TypeError: h.add is not a function.

this.scene.add.isoSprite( xx, yy, 0, 'tileset'); If I remove the frame, then it will always and only load the first frame. This will load "tile1" as it's the first frame.

I have tried any variation and looked at the sourcecode/constructor so I think the example should work.

Also tried an older Version, demo, with phaser 2, where it actually does work like this. this.game.add.isoSprite( State.size * x, State.size * y, 0, 'tileset', Level.groundNames[Level.ground[y][x]], this.groundGroup );

Code from the phaser 2 isometric demo, where this does work. I compared the older version with this, and think that it should work, the way I tried.

Am I missing something? I just can't get this to work, any hints about this?

Octagon-X avatar Sep 21 '20 07:09 Octagon-X