OSDN Git Service

[changed] AnimationAction has a new method called getTarget() which returns the Actor...
authorbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Tue, 8 Feb 2011 18:49:45 +0000 (18:49 +0000)
committerbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Tue, 8 Feb 2011 18:49:45 +0000 (18:49 +0000)
gdx/src/com/badlogic/gdx/scenes/scene2d/Action.java
gdx/src/com/badlogic/gdx/scenes/scene2d/AnimationAction.java
gdx/src/com/badlogic/gdx/scenes/scene2d/OnActionCompleted.java
gdx/src/com/badlogic/gdx/scenes/scene2d/actions/Delay.java

index d117396..376f38b 100644 (file)
@@ -30,7 +30,7 @@ public abstract class Action {
         * \r
         * @param actor the actor.\r
         */\r
-       public abstract void setTarget (Actor actor);\r
+       public abstract void setTarget (Actor actor);   \r
 \r
        /**\r
         * Apply the action.\r
index 1520b2e..648c875 100644 (file)
@@ -64,4 +64,11 @@ public abstract class AnimationAction extends Action {
                        return interpolatedTime * invDuration;\r
                }\r
        }\r
+       \r
+       /**\r
+        * @return the {@link Actor} this Action applies to.\r
+        */\r
+       public Actor getTarget() {\r
+               return target;\r
+       }\r
 }\r
index 6010cd7..b24b3d6 100644 (file)
@@ -12,7 +12,9 @@ public interface OnActionCompleted {
        /**\r
         * Called when the {@link Action} is completed. Note that this\r
         * might get called multiple times in case the Action is part of\r
-        * a {@link Repeat} Action.\r
+        * a {@link Repeat} Action. If the Action is an {@link AnimationAction}\r
+        * then you can cast to this class and receive the targeted {link Actor}\r
+        * via {@link AnimationAction#getTarget()}.\r
         * @param action the Action.\r
         */\r
        public void completed(Action action);\r
index b751273..93a0698 100644 (file)
@@ -58,5 +58,5 @@ public class Delay extends Action {
 \r
        @Override public Action copy () {\r
                return $(action.copy(), duration);\r
-       }\r
+       }       \r
 }\r