new SpriteAnimateRenderable(myTexture) → {SpriteAnimateRenderable}
Constructor of SpriteAnimateRenderable object.
Parameters:
Name | Type | Description |
---|---|---|
myTexture |
Texture | Texture to be associated by object. |
Returns:
Instance of this SpriteAnimateRenderable object
Members
eAnimationType :enum|eAnimationType
Assumption is that the first sprite in an animation is always the left-most element.
Type:
- enum | eAnimationType
Methods
incAnimationSpeed(deltaInterval) → {void}
Increment the animation frame change speed
Parameters:
Name | Type | Description |
---|---|---|
deltaInterval |
Number | increment by number of update calls between animation frames |
Returns:
- Type
- void
setAnimationSpeed(tickInterval) → {void}
Set the frame change speed
Parameters:
Name | Type | Description |
---|---|---|
tickInterval |
Number | number of update calls between animation frames |
Returns:
- Type
- void
setAnimationType(animationType) → {void}
Set animation type (eAnimateRight, eAnimateLeft, eAnimateSwing)
Parameters:
Name | Type | Description |
---|---|---|
animationType |
eAnimationType | enum | enum of animation type |
Returns:
- Type
- void
setSpriteSequence(topPixel, leftPixel, elmWidthInPixel, elmHeightInPixel, numElements, wPaddingInPixel) → {void}
Set the Sprite animation sequence parameters
Always set the left-most element to be the first
Parameters:
Name | Type | Description |
---|---|---|
topPixel |
Number | Top of the sprite row in pixel |
leftPixel |
Number | left most pixel of the first animation frame in pixel |
elmWidthInPixel |
Number | width of the animation in pixel |
elmHeightInPixel |
Number | height of the animation in pixel |
numElements |
Number | number of animation frames |
wPaddingInPixel |
Number | pixel padding between animation frames |
Returns:
- Type
- void
updateAnimation() → {void}
Update the animation interval
Returns:
- Type
- void