Lua API  0.4.0
Game Engine
 All Files Functions
Animation.lua File Reference

Functions

 getCurrentAnimation (object)
 Retrieve the current animation ID the given object uses. More...
 
 changeAnimation (object, animationId)
 Plays an animation. More...
 
 isAnimationOver (object)
 Checks if the current animation has finished playing. More...
 
 getAnimationSpeed (object)
 Retrieves the speed of the current animation. More...
 
 setAnimationSpeed (object, speed)
 Changes the speed of the current animation. More...
 
 getCurrentFrame (object)
 Retrieves the current frame in the current animation. More...
 
 setCurrentFrame (object, frame)
 Jumps to the given frame of the current animation. More...
 

Function Documentation

changeAnimation ( object  ,
animationId   
)

Plays an animation.

Changes the current animation to the given one. No animation blending is done.

Parameters
objectThe animated object.
animationIdThe new animation to play.
getAnimationSpeed ( object  )

Retrieves the speed of the current animation.

TODO: Get data about the speed unit!

Parameters
objectThe animated object.
Returns
The animation speed.
getCurrentAnimation ( object  )

Retrieve the current animation ID the given object uses.

Parameters
objectThe object which is animated.
Returns
The animation ID as a number.
getCurrentFrame ( object  )

Retrieves the current frame in the current animation.

Parameters
objectThe animated object.
Returns
The current frame as a number.
isAnimationOver ( object  )

Checks if the current animation has finished playing.

Also returns true for looped animations if the animation finished this frame.

Parameters
objectThe animated object.
Returns
A boolean value.
setAnimationSpeed ( object  ,
speed   
)

Changes the speed of the current animation.

TODO: Get data about the speed unit!

Parameters
objectThe animated object.
speedThe animation speed.
setCurrentFrame ( object  ,
frame   
)

Jumps to the given frame of the current animation.

Parameters
objectThe animated object.
frameThe the frame to jump to.