mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 11:43:19 +08:00
Adding Animation#paint
This commit is contained in:
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user