import com.badlogic.gdx.scenes.scene2d.Action;\r
import com.badlogic.gdx.scenes.scene2d.OnActionCompleted;\r
import com.badlogic.gdx.scenes.scene2d.Stage;\r
-import com.badlogic.gdx.scenes.scene2d.actions.FadeTo;\r
-import com.badlogic.gdx.scenes.scene2d.actions.MoveBy;\r
+import com.badlogic.gdx.scenes.scene2d.actions.Delay;\r
+import com.badlogic.gdx.scenes.scene2d.actions.FadeIn;\r
+import com.badlogic.gdx.scenes.scene2d.actions.FadeOut;\r
import com.badlogic.gdx.scenes.scene2d.actions.Parallel;\r
import com.badlogic.gdx.scenes.scene2d.actions.Remove;\r
-import com.badlogic.gdx.scenes.scene2d.actions.Repeat;\r
-import com.badlogic.gdx.scenes.scene2d.actions.RotateBy;\r
import com.badlogic.gdx.scenes.scene2d.actions.ScaleTo;\r
import com.badlogic.gdx.scenes.scene2d.actions.Sequence;\r
import com.badlogic.gdx.scenes.scene2d.actors.Image;\r
+import com.badlogic.gdx.scenes.scene2d.interpolators.DecelerateInterpolator;\r
import com.badlogic.gdx.tests.utils.GdxTest;\r
\r
public class ActionTest extends GdxTest implements OnActionCompleted {\r
// )\r
// ); \r
\r
- Action action = Repeat.$(Sequence.$(\r
- MoveBy.$(8, 0, 0.03f),\r
- MoveBy.$(-16, 0, 0.03f),\r
- MoveBy.$(8, 8, 0.03f),\r
- MoveBy.$(0, -8, 0.03f)), 20);\r
-\r
- Action action2 = action.copy();\r
- img.action(action2);\r
+// Action action = Repeat.$(Sequence.$(\r
+// MoveBy.$(8, 0, 0.03f),\r
+// MoveBy.$(-16, 0, 0.03f),\r
+// MoveBy.$(8, 8, 0.03f),\r
+// MoveBy.$(0, -8, 0.03f)), 20);\r
+//\r
+// Action action2 = action.copy();\r
+// img.action(action2);\r
+ float scale = 1;\r
+ float showDuration = 1;\r
+ ScaleTo scaleCountdown = ScaleTo.$(scale * 1.0f, scale * 1.0f, 1.0f);\r
+ scaleCountdown.setInterpolator(DecelerateInterpolator.$(3.0f));\r
+ Parallel parallel = Parallel.$(scaleCountdown);//,\r
+ // Sequence.$(FadeIn.$(0.25f), Delay.$(FadeOut.$(0.25f), 0.5f)));\r
+ Sequence cdAnim = Sequence.$(Delay.$(parallel, showDuration), Remove.$());\r
+ cdAnim.setCompletionListener(new OnActionCompleted() { \r
+ @Override public void completed (Action action) {\r
+ System.out.println("completed Action: " + action);\r
+ }\r
+ });\r
+ img.action(cdAnim);\r
\r
stage.addActor(img);\r
}\r