megamarc / Tilengine

Free 2D graphics engine with raster effects for retro/classic style game development
https://www.tilengine.org
Mozilla Public License 2.0
847 stars 95 forks source link

Support for Tiled animation? #56

Closed ghost closed 4 years ago

ghost commented 4 years ago

Tiled provides an animation editor: https://doc.mapeditor.org/en/stable/manual/editing-tilesets/#tile-animation-editor

Are animated tiles in background supported by Tileengine?

Is there a way to load sprite sequence from a tmx map?

megamarc commented 4 years ago

Tile animations created in Tiled editor are supported in Tilengine. Just load a layer that has some animated tiles in its tileset, and they will be automatically assigned to free animation slots and played. No other action is required. The foreground tileset in samples/assets/sonic/Sonic_md_fg1.tsx, and the foreground layer in PythonPlatformer assets/layer_foreground.tsx have this feature. Just run them and you'll see the animations playing.

The animations reside in the tileset (tsx), not in the tilemap (tmx). You can use the function TLN_GetTilesetSequencePack() to obtain them, but this isn't usually needed.