Home

Awesome

Walt

An animation library for LÖVE.

Table of Contents

Usage

local animator = require 'path.to.walt'

function love.load()
	local image = love.graphics.newImage( 'Path/to/image.png' )
	anim = animator.newAnimation( { image }, 1 )
end

function love.update( dt )
	anim:update( dt )
end

function love.draw()
	anim:draw()
end

And that's it!

Name

Functions

animator.merge

animator.newAnimation

FormatExampleDescription
Flat{ .1, .2, .1, .5 }A numbered list, representing the corresponding frame. In this case, makes frame 1 have a duration of .1, 2 a duration of .2, etc.
List{ ['1 - 5'] = 1 }A table key, listing the frame numbers, in the style of lower - larger. Can have 0-unlimited spaces between the -. In this case, frames 1 through 5 each have a duration of 1 second
Key{ ['1, 3, 5'] = 1 }Frame numbers are seperated by ,. Can have 0-unlimited spaces after the ,. In this case, frames 1, 3, and 5 have a duration of 1 second.

anim:draw

anim:getActive

anim:getCurrentFrame

anim:getDimensions

anim:getHeight

anim:getLooping

anim:getOnAnimationChange

anim:getOnAnimationEnd

anim:getOnLoop

anim:getPauseAtEnd

anim:getPaused

anim:getWidth

anim:pause

anim:pauseAtEnd

anim:restart

anim:resume

anim:setActive

anim:setCurrentFrame

anim:setLooping

anim:setOnAnimationChange

anim:setOnAnimationEnd

anim:setOnLoop

anim:setPauseAtEnd

anim:setPaused

anim:togglePause

anim:toggleActive

anim:toggleLooping

anim:togglePauseAtEnd

anim:update

animator.newGrid

grid:getFrames

Grid

local image = love.graphics.newImage( 'grid.png' )
local grid = animator.newGrid( 32, 32, image, 32, 32, 288, 224 )
local anim = animator.newAnimation( grid.getFrames( 1,1  2,1  3,1  '4 - 7',1,  8, '1 - 6' ), 1, image )
-- You have to remember to pass the image that the quads are from.

Alisases

AliasCorresponding Function
anim:isActiveanim:getActive
anim:isLoopinganim:getLooping
anim:isPausedanim:getPaused
anim:getFrameanim:getGetCurrentFrame
anim:gotoFrameanim:setCurrentFrame
anim:setAnimationChangeanim:setOnAnimationChange
anim:setAnimationEndanim:setOnAnimationEnd
anim:setFrameanim:setCurrentFrame
grid:__callgrid:getFrames

Examples

See Examples.