AnimationBatchCompiler class

Utility class to merge multiple animated components into one big component Usage example:

final mapComponent = await TiledComponent.load('map.tmx', Vector2.all(16));
final animationCompiler = AnimationBatchCompiler();
TileProcessor.processTileType(
        tileMap: tiledComponent.tileMap,
        processorByType: <String, TileProcessorFunc>{
          'water': ((tile, position, size) {
            animationCompiler.addTile(position, tile);
          }),
        },
        layersToLoad: [
          'water',
        ]);
final animatedWater = await animationCompiler.compile();
animatedWater.priority = RenderPriority.water.priority;
add(animatedWater);

Constructors

AnimationBatchCompiler()

Properties

animation ↔ SpriteAnimation?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
positions List<Vector2>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addTile(Vector2 position, TileProcessor tileProcessor) Future
compile() Future<SpriteAnimationComponent>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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