TilemapAnimator class

Component tracking animated tiles for a tilemap.

Attached to the Tilemap entity when the map contains animated tiles. Updated each frame by the TileAnimationSystem.

Example:

// Check if a tilemap has animations
final animator = world.get<TilemapAnimator>(mapEntity);
if (animator != null) {
  print('Map has ${animator.animations.length} animated tiles');
}

// Get current frame for an animated tile during extraction
final currentFrame = animator?.getCurrentFrame(tile.localId) ?? tile.localId;

Constructors

TilemapAnimator({required Map<int, TileAnimation> animations})

Properties

animations → Map<int, TileAnimation>
Map of tile local ID to animation data.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
time ↔ double
Current global animation time accumulator in seconds.
getter/setter pair

Methods

getCurrentFrame(int localId) → int
Gets the current frame index for an animated tile.
hasAnimation(int localId) → bool
Returns true if a tile has an animation.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets all animation timers.
toString() → String
A string representation of this object.
inherited
update(double dt) → void
Updates all animations with delta time.

Operators

operator ==(Object other) → bool
The equality operator.
inherited