You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As Tiled supports animated tiles, it would be nice to have this supported in cocos.
I've been trying to work on adding this to the load_tmx() function myself by stepping through the relevant tags in the tileset and building AnimationFrames which can then be compiled into an Animation at the end and stored instead of the original tile image. However, I'm getting strange behaviour as the screen moves to show and away from such tiles repeatedly; specifically the animation's frame timings are all going wrong, switching frames at irregular intervals and I suspect some frames cycling so fast you can't even see them.
Here's the modified version of load_tmx() that resulted from my efforts: load_tmx.txt
You can clearly see the areas I've messed with as I've marked them with big begin/end butchery comments. (I was expecting it to be more involved than it was).
Note that whilst at it, I also threw in some code to handle map-level properties too.
The text was updated successfully, but these errors were encountered:
I think I've found why the animations are appearing to go wrong. It seems that _update_sprite_set() in MapLayer isn't properly cleaning up the old sprites. I'm unsure of the exact issue involved but adding"self._sprites[k].delete()" just before the del statement appears to do the job nicely.
As Tiled supports animated tiles, it would be nice to have this supported in cocos.
I've been trying to work on adding this to the load_tmx() function myself by stepping through the relevant tags in the tileset and building AnimationFrames which can then be compiled into an Animation at the end and stored instead of the original tile image. However, I'm getting strange behaviour as the screen moves to show and away from such tiles repeatedly; specifically the animation's frame timings are all going wrong, switching frames at irregular intervals and I suspect some frames cycling so fast you can't even see them.
Here's the modified version of load_tmx() that resulted from my efforts: load_tmx.txt
You can clearly see the areas I've messed with as I've marked them with big begin/end butchery comments. (I was expecting it to be more involved than it was).
Note that whilst at it, I also threw in some code to handle map-level properties too.
The text was updated successfully, but these errors were encountered: