render method

  1. @override
void render(
  1. Canvas canvas
)
override

Implementation

@override
void render(Canvas canvas) {
  super.render(canvas);
  if (isVisible && !isRemoving) {
    if (_fastAnimation != null) {
      if (_strockePaint != null) {
        _fastAnimation?.render(
          canvas,
          position:
              _strokePosition + (spriteAnimationOffset ?? Vector2.zero()),
          size: _strokeSize,
          overridePaint: _strockePaint,
        );
      }
      _fastAnimation?.render(canvas, overridePaint: paint);
    } else {
      if (_strockePaint != null) {
        _animationRender?.render(
          canvas,
          position:
              _strokePosition + (spriteAnimationOffset ?? Vector2.zero()),
          size: _strokeSize,
          overridePaint: _strockePaint,
        );
      }
      _animationRender?.render(
        canvas,
        position: spriteAnimationOffset,
        overridePaint: paint,
        size: size,
      );
    }
  }
}