Skip to content

Commit daa7ae3

Browse files
committed
Scale and Rotate actions didn't work with ui actors.
1 parent d855503 commit daa7ae3

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

blade-engine/src/com/bladecoder/engine/actions/RotateAction.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import com.bladecoder.engine.model.World;
2424
import com.bladecoder.engine.util.InterpolationMode;
2525

26-
@ActionDescription(name = "RotateAnim", value= "Sets an actor Rotate animation")
26+
@ActionDescription(name = "RotateAnim", value = "Sets an actor Rotate animation")
2727
public class RotateAction implements Action {
2828
@ActionPropertyDescription("The target actor")
2929
@ActionProperty(type = Type.SPRITE_ACTOR)
@@ -52,24 +52,23 @@ public class RotateAction implements Action {
5252
@ActionProperty
5353
@ActionPropertyDescription("The interpolation mode")
5454
private InterpolationMode interpolation;
55-
55+
5656
private World w;
57-
57+
5858
@Override
5959
public void init(World w) {
6060
this.w = w;
6161
}
6262

6363
@Override
64-
public boolean run(VerbRunner cb) {
65-
SpriteActor a = (SpriteActor) w.getCurrentScene().getActor(actor, false);
66-
64+
public boolean run(VerbRunner cb) {
65+
SpriteActor a = (SpriteActor) w.getCurrentScene().getActor(actor, true);
66+
6767
SpriteRotateTween t = new SpriteRotateTween();
68-
t.start(a, repeat, count, rotation, speed, interpolation,
69-
wait ? cb : null);
70-
68+
t.start(a, repeat, count, rotation, speed, interpolation, wait ? cb : null);
69+
7170
a.addTween(t);
72-
71+
7372
return wait;
7473
}
7574

blade-engine/src/com/bladecoder/engine/actions/ScaleAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void init(World w) {
6262

6363
@Override
6464
public boolean run(VerbRunner cb) {
65-
SpriteActor a = (SpriteActor) w.getCurrentScene().getActor(actor, false);
65+
SpriteActor a = (SpriteActor) w.getCurrentScene().getActor(actor, true);
6666

6767
SpriteScaleTween t = new SpriteScaleTween();
6868
t.start(a, repeat, count, scale, scale, speed, interpolation, wait ? cb : null);

blade-engine/src/com/bladecoder/engine/actions/ScaleAnimActionXY.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import com.bladecoder.engine.model.World;
2525
import com.bladecoder.engine.util.InterpolationMode;
2626

27-
@ActionDescription(name = "ScaleAnimXY", value= "Scale animation for sprite actors")
27+
@ActionDescription(name = "ScaleAnimXY", value = "Scale animation for sprite actors")
2828
public class ScaleAnimActionXY implements Action {
2929
@ActionPropertyDescription("The target actor")
3030
@ActionProperty(type = Type.SPRITE_ACTOR)
@@ -53,24 +53,23 @@ public class ScaleAnimActionXY implements Action {
5353
@ActionProperty
5454
@ActionPropertyDescription("The interpolation mode")
5555
private InterpolationMode interpolation;
56-
56+
5757
private World w;
58-
58+
5959
@Override
6060
public void init(World w) {
6161
this.w = w;
6262
}
6363

6464
@Override
65-
public boolean run(VerbRunner cb) {
66-
SpriteActor a = (SpriteActor) w.getCurrentScene().getActor(actor, false);
67-
65+
public boolean run(VerbRunner cb) {
66+
SpriteActor a = (SpriteActor) w.getCurrentScene().getActor(actor, true);
67+
6868
SpriteScaleTween t = new SpriteScaleTween();
69-
t.start(a, repeat, count, scale.x, scale.y, speed, interpolation,
70-
wait ? cb : null);
71-
69+
t.start(a, repeat, count, scale.x, scale.y, speed, interpolation, wait ? cb : null);
70+
7271
a.addTween(t);
73-
72+
7473
return wait;
7574
}
7675

0 commit comments

Comments
 (0)