OSDN Git Service

[added] regression to ActionTest
authorbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Wed, 27 Apr 2011 19:32:43 +0000 (19:32 +0000)
committerbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Wed, 27 Apr 2011 19:32:43 +0000 (19:32 +0000)
tests/gdx-tests-jogl/src/com/badlogic/gdx/tests/jogl/JoglDebugStarter.java
tests/gdx-tests/src/com/badlogic/gdx/tests/ActionTest.java

index df254d8..4cfc5f3 100644 (file)
@@ -20,6 +20,6 @@ import com.badlogic.gdx.backends.jogl.JoglApplication;
 public class JoglDebugStarter {\r
 \r
        public static void main (String[] argv) {\r
-               new JoglApplication(new com.badlogic.gdx.tests.UITest(), "Debug Test", 480, 320, false);\r
+               new JoglApplication(new com.badlogic.gdx.tests.ActionTest(), "Debug Test", 480, 320, false);\r
        }\r
 }\r
index a92b3bf..cf6337d 100644 (file)
@@ -22,15 +22,15 @@ import com.badlogic.gdx.graphics.Texture.TextureFilter;
 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
@@ -105,14 +105,27 @@ public class ActionTest extends GdxTest implements OnActionCompleted {
 //                  )\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