- Animated tiles: a tileset <animation>'s {tileid, duration} frames advance as a
pure function of the fixed 60/s engine frame counter (the same clock SpriteAnim
rides), so an animated GID resolves at draw to the current frame's GID with its
flip flags preserved — deterministic, frame-identical across runs, ticks for
free. Tiled.frame_gid(map, gid, frame) / Tiled.animated(map, gid) expose it;
Tiled.draw_anim(map, camx, camy, frame) draws a map with animations advanced.
- Tile objects: object-layer entries with a `gid` draw the tile image (with their
own flip flags), bottom-anchored at the object position, as placeable sprites;
tmap_draw_full now renders object layers alongside tile layers.
Proven by library/tiled_p3.ludic (14 assertions): frame advance at authored
durations + wrap, flip flags riding an animation swap, tile-object parse + draw +
flip mirroring, and the design's named rpg/beach_tileset.tsx (33 <animation>
blocks / 131 frames). x test: 94 passed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
14 lines
355 B
Markdown
14 lines
355 B
Markdown
---
|
|
id: tiled-animated
|
|
name: Tiled.animated
|
|
category: tiled
|
|
kind: namespace-method
|
|
tokens: Tiled.animated
|
|
sig: Tiled.animated(map, gid: int) -> int
|
|
tip: Whether a GID's tile is animated.
|
|
order: 19
|
|
ns: Tiled
|
|
member: animated
|
|
---
|
|
|
|
Returns <code>1</code> if the tile a GID resolves to carries a non-empty <code><animation></code>, else <code>0</code>.
|