mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-18 05:38:39 +08:00
Merge pull request #220 from wenxiangjiang/add-loop
Adding loop for AnimationComponent.sequenced()
This commit is contained in:
@@ -71,6 +71,7 @@ class Animation {
|
|||||||
double textureWidth,
|
double textureWidth,
|
||||||
double textureHeight,
|
double textureHeight,
|
||||||
double stepTime = 0.1,
|
double stepTime = 0.1,
|
||||||
|
this.loop = true,
|
||||||
}) {
|
}) {
|
||||||
frames = List<Frame>(amount);
|
frames = List<Frame>(amount);
|
||||||
for (var i = 0; i < amount; i++) {
|
for (var i = 0; i < amount; i++) {
|
||||||
@@ -94,6 +95,7 @@ class Animation {
|
|||||||
double textureY = 0.0,
|
double textureY = 0.0,
|
||||||
double textureWidth,
|
double textureWidth,
|
||||||
double textureHeight,
|
double textureHeight,
|
||||||
|
this.loop = true,
|
||||||
}) {
|
}) {
|
||||||
frames = List<Frame>(amount);
|
frames = List<Frame>(amount);
|
||||||
for (var i = 0; i < amount; i++) {
|
for (var i = 0; i < amount; i++) {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ class AnimationComponent extends PositionComponent {
|
|||||||
double textureWidth,
|
double textureWidth,
|
||||||
double textureHeight,
|
double textureHeight,
|
||||||
double stepTime,
|
double stepTime,
|
||||||
|
bool loop = true,
|
||||||
this.destroyOnFinish = false,
|
this.destroyOnFinish = false,
|
||||||
}) {
|
}) {
|
||||||
this.width = width;
|
this.width = width;
|
||||||
@@ -37,6 +38,7 @@ class AnimationComponent extends PositionComponent {
|
|||||||
textureWidth: textureWidth,
|
textureWidth: textureWidth,
|
||||||
textureHeight: textureHeight,
|
textureHeight: textureHeight,
|
||||||
stepTime: stepTime ?? 0.1,
|
stepTime: stepTime ?? 0.1,
|
||||||
|
loop: loop,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user