love.graphics.newAnimation( image, fw, fh, delay, frames )
This method assumes that
- The frames are all of equal size
- The frames are ordered from top-left to bottom-right
- The frame size fx*fh must also fit with the width and height of the source image.
Usage
love.graphics.newAnimation( image, fw, fh, delay, frames )Arguments
fwThe width of each frame.
fhThe height of each frame.
delayThe delay (seconds) between each frame.
framesThe number of frames to include. (0 = all)
Returns
Examples
Example 1:
-- * We have a source Image of total size 128x64.
-- * Each frame is 32x32, which means that two rows with four
-- frames each.
-- * We want all the frames of the source Image to be included
-- in the Animation.
src = love.graphics.newImage("animation_src.png")
-- Frame size: 32x32
-- Number of frames: all (0)
-- Delay between each frame: 0.1 seconds.
animation = love.graphics.newAnimation(src, 32, 32, 0.1, 0)