Version 0.3.2
LÖVE Documentation
OverviewLicenseCreditsInstallingGetting started
Devices
love.graphicslove.audiolove.keyboardlove.mouselove.filesystemlove.timerlove.system
Types
AnimationColorFontFileImageMusicParticleSystemSound
Callbacks
loadupdatedrawmousepressedmousereleasedkeypressedkeyreleased
Miscellaneous
ConstantsConfig filesKeyboard shortcuts
Function
love.graphics.newAnimation( image, fw, fh, delay, frames )
This method assumes that
  1. The frames are all of equal size
  2. The frames are ordered from top-left to bottom-right
  3. 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
imageThe source Image for the Animation.
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
Animation
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)