mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-03 20:36:31 +08:00
Adding Animation#paint
This commit is contained in:
@ -2,6 +2,7 @@
|
|||||||
- Adding Component#onDestroy
|
- Adding Component#onDestroy
|
||||||
- Adding Keyboard events API
|
- Adding Keyboard events API
|
||||||
- Adding Box2DGame, an extension of BaseGame to simplify lifecycle of Box2D components
|
- Adding Box2DGame, an extension of BaseGame to simplify lifecycle of Box2D components
|
||||||
|
- Adding AnimationComponent#paint
|
||||||
|
|
||||||
## 0.18.2
|
## 0.18.2
|
||||||
- Add loop for AnimationComponent.sequenced() (thanks @wenxiangjiang)
|
- Add loop for AnimationComponent.sequenced() (thanks @wenxiangjiang)
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import 'package:flame/animation.dart';
|
|||||||
|
|
||||||
class AnimationComponent extends PositionComponent {
|
class AnimationComponent extends PositionComponent {
|
||||||
Animation animation;
|
Animation animation;
|
||||||
|
Paint paint;
|
||||||
bool destroyOnFinish = false;
|
bool destroyOnFinish = false;
|
||||||
|
|
||||||
AnimationComponent(double width, double height, this.animation,
|
AnimationComponent(double width, double height, this.animation,
|
||||||
@ -53,7 +54,7 @@ class AnimationComponent extends PositionComponent {
|
|||||||
@override
|
@override
|
||||||
void render(Canvas canvas) {
|
void render(Canvas canvas) {
|
||||||
prepareCanvas(canvas);
|
prepareCanvas(canvas);
|
||||||
animation.getSprite().render(canvas, width: width, height: height);
|
animation.getSprite().render(canvas, width: width, height: height, overridePaint: paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in New Issue
Block a user