OSDN Git Service

Add additional setAnimation method
authorXoppa <contact@xoppa.nl>
Sun, 22 Sep 2013 23:14:19 +0000 (01:14 +0200)
committerXoppa <contact@xoppa.nl>
Sun, 22 Sep 2013 23:14:19 +0000 (01:14 +0200)
gdx/src/com/badlogic/gdx/graphics/g3d/utils/AnimationController.java

index 9e01293..33ec890 100644 (file)
@@ -184,6 +184,16 @@ public class AnimationController extends BaseAnimationController {
        public AnimationDesc setAnimation(final String id) {
                return setAnimation(id, 1, 1.0f, null);
        }
+       
+       /** Set the active animation, replacing any current animation.
+        * @param id The ID of the {@link Animation} within the {@link ModelInstance}.
+        * @param loopCount The number of times to loop the animation, zero to play the animation only once, 
+        * negative to continuously loop the animation.
+        * @return The {@link AnimationDesc} which can be read to get the progress of the animation. Will be invalid when the
+        * animation is completed. */
+       public AnimationDesc setAnimation(final String id, int loopCount) {
+               return setAnimation(id, loopCount, 1.0f, null);
+       }
 
        /** Set the active animation, replacing any current animation.
         * @param id The ID of the {@link Animation} within the {@link ModelInstance}.