Class TPSpriteAnimation

    • Field Detail

      • currentFrame

        public java.lang.Integer currentFrame
      • frameRate

        public java.lang.Integer frameRate
    • Constructor Detail

      • TPSpriteAnimation

        public TPSpriteAnimation​(TPAtlas atlas,
                                 Color color,
                                 int width,
                                 int height)
        Constructor with 24 frame per second
      • TPSpriteAnimation

        public TPSpriteAnimation​(TPAtlas atlas,
                                 Color color,
                                 int width,
                                 int height,
                                 int frameRate)
        Default Constructor.
    • Method Detail

      • draw

        public void draw​(int frame)
        Description copied from interface: Drawable
        Draws the drawable on the given frame.
        Specified by:
        draw in interface Drawable
        Overrides:
        draw in class Quad
      • play

        public void play()
        Description copied from interface: Animatable
        Plays the animation.
        Specified by:
        play in interface Animatable
      • stop

        public void stop()
        Description copied from interface: Animatable
        Stops the animation.
        Specified by:
        stop in interface Animatable
      • isLoop

        public java.lang.Boolean isLoop()
        Description copied from interface: Animatable
        Checks if animation is loop.
        Specified by:
        isLoop in interface Animatable
      • setLooping

        public void setLooping​(java.lang.Boolean isLoop)
        Description copied from interface: Animatable
        Set looping value.
        Specified by:
        setLooping in interface Animatable
      • getFrameRate

        public java.lang.Integer getFrameRate()
        Description copied from interface: Animatable
        Get frame count updated per second.
        Specified by:
        getFrameRate in interface Animatable
      • setFrameRate

        public void setFrameRate​(java.lang.Integer frameRate)
        Description copied from interface: Animatable
        Sets frame counts updated per second.
        Specified by:
        setFrameRate in interface Animatable
      • getFrameCount

        public java.lang.Integer getFrameCount()
        Description copied from interface: Animatable
        Total animation frames.
        Specified by:
        getFrameCount in interface Animatable