animation property

SpriteAnimation? get animation

Returns the current SpriteAnimation.

Implementation

SpriteAnimation? get animation => _animationTicker?.spriteAnimation;
set animation (SpriteAnimation? value)

Sets the given value as current animation.

Implementation

set animation(SpriteAnimation? value) {
  if (animation != value) {
    if (value != null) {
      _animationTicker = value.createTicker();
    } else {
      _animationTicker = null;
    }
    _resizeToSprite();
  }
}