Package com.nevergarden.myna.display
Class TPSpriteAnimation
- java.lang.Object
 - 
- com.nevergarden.myna.events.EventDispatcher
 - 
- com.nevergarden.myna.display.DisplayObject
 - 
- com.nevergarden.myna.display.Quad
 - 
- com.nevergarden.myna.display.TPSpriteAnimation
 
 
 
 
 
- 
- All Implemented Interfaces:
 Animatable,Drawable
public class TPSpriteAnimation extends Quad implements Animatable
TexturePacker Sprite Animation Item. 
- 
- 
Field Summary
Fields Modifier and Type Field Description java.lang.IntegercurrentFramejava.lang.IntegerframeRate- 
Fields inherited from class com.nevergarden.myna.display.Quad
color, height, modelMatrix, width 
- 
Fields inherited from class com.nevergarden.myna.display.DisplayObject
parent, pivot, position, rotation, scale, transform 
- 
Fields inherited from class com.nevergarden.myna.events.EventDispatcher
eventListeners 
 - 
 
- 
Constructor Summary
Constructors Constructor Description TPSpriteAnimation(TPAtlas atlas, Color color, int width, int height)Constructor with 24 frame per secondTPSpriteAnimation(TPAtlas atlas, Color color, int width, int height, int frameRate)Default Constructor. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddraw(int frame)Draws the drawable on the given frame.java.lang.IntegergetFrameCount()Total animation frames.java.lang.IntegergetFrameRate()Get frame count updated per second.java.lang.BooleanisLoop()Checks if animation is loop.voidplay()Plays the animation.voidsetFrameRate(java.lang.Integer frameRate)Sets frame counts updated per second.voidsetLooping(java.lang.Boolean isLoop)Set looping value.voidstop()Stops the animation.- 
Methods inherited from class com.nevergarden.myna.display.Quad
recalculateMatrix 
- 
Methods inherited from class com.nevergarden.myna.display.DisplayObject
getPosition, removeFromParent, rotate, setLocalX, setLocalY, setParent, setPivot, setPivotX, setPivotY, setPosition, setRotation, setScale, setScaleX, setScaleY 
- 
Methods inherited from class com.nevergarden.myna.events.EventDispatcher
addEventListener, dispatchEvent, dispatchEventWith, dispatchEventWith, dispose, hasEventListener, invokeEvent, removeEventListener, removeEventListeners 
 - 
 
 - 
 
- 
- 
Method Detail
- 
draw
public void draw(int frame)
Description copied from interface:DrawableDraws the drawable on the given frame. 
- 
play
public void play()
Description copied from interface:AnimatablePlays the animation.- Specified by:
 playin interfaceAnimatable
 
- 
stop
public void stop()
Description copied from interface:AnimatableStops the animation.- Specified by:
 stopin interfaceAnimatable
 
- 
isLoop
public java.lang.Boolean isLoop()
Description copied from interface:AnimatableChecks if animation is loop.- Specified by:
 isLoopin interfaceAnimatable
 
- 
setLooping
public void setLooping(java.lang.Boolean isLoop)
Description copied from interface:AnimatableSet looping value.- Specified by:
 setLoopingin interfaceAnimatable
 
- 
getFrameRate
public java.lang.Integer getFrameRate()
Description copied from interface:AnimatableGet frame count updated per second.- Specified by:
 getFrameRatein interfaceAnimatable
 
- 
setFrameRate
public void setFrameRate(java.lang.Integer frameRate)
Description copied from interface:AnimatableSets frame counts updated per second.- Specified by:
 setFrameRatein interfaceAnimatable
 
- 
getFrameCount
public java.lang.Integer getFrameCount()
Description copied from interface:AnimatableTotal animation frames.- Specified by:
 getFrameCountin interfaceAnimatable
 
 - 
 
 -