File AnAL.lua
Functions
animation:addFrame (x, y, w, h, delay) | Add a frame |
animation:draw (x, y, angle, sx, sy, ox, oy) | Draw the animation |
animation:getCurrentFrame () | Get the currently shown frame |
animation:getHeight () | Get the height of the current frame |
animation:getSize () | Get the number of frames |
animation:getWidth () | Get the width of the current frame |
animation:play () | Play the animation Starts it if it was stopped. |
animation:reset () | Reset Go back to the first frame. |
animation:seek (frame) | Seek to a frame |
animation:setDelay (frame, delay) | Set the delay between frames |
animation:setMode (mode) | Set the play mode Could be "loop" to loop it, "once" to play it once, or "bounce" to play it, reverse it, and play it again (looping) |
animation:setSpeed (speed) | Set the speed |
animation:stop () | Stop the animation |
animation:update (dt) | Update the animation |
newAnimation (image, fw, fh, delay, frames) | Create a new animation Replaces love.graphics.newAnimation |
Functions
- animation:addFrame (x, y, w, h, delay)
-
Add a frame
Parameters
- x: The X coordinate of the frame on the original image
- y: The Y coordinate of the frame on the original image
- w: The width of the frame
- h: The height of the frame
- delay: The delay before the next frame is shown
- animation:draw (x, y, angle, sx, sy, ox, oy)
-
Draw the animation
Parameters
- x: The X coordinate
- y: The Y coordinate
- angle: The angle to draw at (radians)
- sx: The scale on the X axis
- sy: The scale on the Y axis
- ox: The X coordinate of the origin
- oy: The Y coordinate of the origin
- animation:getCurrentFrame ()
-
Get the currently shown frame
Return value:
The current frame - animation:getHeight ()
-
Get the height of the current frame
Return value:
The height of the current frame - animation:getSize ()
-
Get the number of frames
Return value:
The number of frames - animation:getWidth ()
-
Get the width of the current frame
Return value:
The width of the current frame - animation:play ()
- Play the animation Starts it if it was stopped. Basically makes sure it uses the delays to switch to the next frame.
- animation:reset ()
- Reset Go back to the first frame.
- animation:seek (frame)
-
Seek to a frame
Parameters
- frame: The frame to display now
- animation:setDelay (frame, delay)
-
Set the delay between frames
Parameters
- frame: Which frame to set the delay for
- delay: The delay
- animation:setMode (mode)
-
Set the play mode Could be "loop" to loop it, "once" to play it once, or "bounce" to play it, reverse it, and play it again (looping)
Parameters
- mode: The mode: one of the above
- animation:setSpeed (speed)
-
Set the speed
Parameters
- speed: The speed to play at (1 is normal, 2 is double, etc)
- animation:stop ()
- Stop the animation
- animation:update (dt)
-
Update the animation
Parameters
- dt: Time that has passed since last call
- newAnimation (image, fw, fh, delay, frames)
-
Create a new animation Replaces love.graphics.newAnimation
Parameters
- image: The image that contains the frames
- fw: The frame width
- fh: The frame height
- delay: The delay between two frames
- frames: The number of frames, 0 for autodetect
Return value:
The created animation