-
Notifications
You must be signed in to change notification settings - Fork 4
Animation API
An internal function to set internal variables for the animation to some default values!
Updates the animation! You would normally never update an animation manually and leave it all to animX by doing animx.update(dt)
!
Renders the Animation based on given parameters. Basically love.draw
parameters starting from x
!
The addFrame concept was stolen from BartBes' animation library. Anyways what this func does is create a new quad and associate it with the given animation. The frame would be appended to the last of the framelist!
Handler fn
called when an entire animation is over
Handler fn
called when an animation cycle is over
Handler fn
called when an animation is just started
Handler fn
called when an animation is restarted (using Animation:restart()
Handler fn
called when an animation proceeds to new frame!
Handler fn
called at every frame regardless of whether the animation is running or not!
Rewind the entire animation any number of times, (nil or negative)=>infinite
Bounces the animation each time a cycle is complete! rewind
and bounce
may look familiar but the way they function are completely different in that rewind
does its job when the entire animation is over and not just a cycle (two cycles make up an animation for this context)! Also bounce
by default reverses only once while rewind
rewinds forever
Loops the animation in obverse or reverse direction (obverse by default) any number of times or infinitely (if times
is nil or negative)
Same as loop just direction is always reversed
Executes an animation once in the obverse direction!
Gets the total number of frames in animation
Gets the total number of times the animation has been played
Gets the current Frame of the animation
Gets the current quad that's being rendered
Gets whether or not is the animation active!
Gets the dimensions of the current frame
Gets the width of the current frame
Gets the height of the current frame
Sets the style for the source/atlas of the animation! Basically rough
or smooth
each making it more or less pixelated!
Returns the source (image) for the animation
Sometimes you may want to change the atlas (maybe for something like character clothes) This function changes the texture for the animation
Sets the current frame as n
!
Restarts the animation from where it was originally!
Stops the animation! Use animation.active=false
if you don't want to trigger any callback!
Gets the duration of the given frame or current frame if provided nil
Sets the delay for all the frames
Sets the duration of the given frame!
Gets the current animation mode
Check if current mode is equal to one of the given modes
Flips the animation along given axes (boolean values)
Flips the animation along x-axis if b
is some truthy value.
Flips the animation along y-axis if b
is some truthy value.
Exports the animation to XML!
Animation.getTexture=Animation.getAtlas
Animation.getImage=Animation.getAtlas
Animation.getSource=Animation.getAtlas
Animation.setTexture=Animation.setAtlas
Animation.setSource=Animation.setAtlas
Animation.setImage=Animation.setAtlas
Animation.getTotalFrames=Animation.getTimes
Animation.draw=Animation.render
Animation.goToFrame=Animation.jumpToFrame
Animation.setFrame=Animation.jumpToFrame
Animation.getActive=Animation.isActive
Animation.onAnimationStart=Animation.onAnimStart
Animation.onAnimationOver=Animation.onAnimOver
Animation.onAnimationRestart=Animation.onAnimRestart
Animation.onFrameChange=Animation.onChange
Animation.onTick=Animation.onUpdate