diff --git a/CHANGELOG.md b/CHANGELOG.md index f8584ecce..8a93aca72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Adding Component#onDestroy - Adding Keyboard events API - Adding Box2DGame, an extension of BaseGame to simplify lifecycle of Box2D components +- Adding AnimationComponent#paint ## 0.18.2 - Add loop for AnimationComponent.sequenced() (thanks @wenxiangjiang) diff --git a/lib/components/animation_component.dart b/lib/components/animation_component.dart index b57c120e1..112f4162c 100644 --- a/lib/components/animation_component.dart +++ b/lib/components/animation_component.dart @@ -5,6 +5,7 @@ import 'package:flame/animation.dart'; class AnimationComponent extends PositionComponent { Animation animation; + Paint paint; bool destroyOnFinish = false; AnimationComponent(double width, double height, this.animation, @@ -53,7 +54,7 @@ class AnimationComponent extends PositionComponent { @override void render(Canvas canvas) { prepareCanvas(canvas); - animation.getSprite().render(canvas, width: width, height: height); + animation.getSprite().render(canvas, width: width, height: height, overridePaint: paint); } @override