SpriteAnimation.lua
Tile.lua
Neo3D.lua
QuadTree.lua
Widget.lua
Sprite.lua
Collision.lua
OEntity.lua
Button.lua
Graphics2D.lua
InputField.lua
LuaUnit.lua
Tests.lua
OCamera.lua
Object3d.lua
class.lua
OLight.lua
SpriteSheet.lua
OSound.lua
Utils.lua
Canvas.lua
Label.lua
Api.lua

The SpriteAnimation class

Contains the primitives to play animations using a sprite sheet.

Parameter

start

First frame of the animation

length

The length of the animation. The last frame shown is (start + length)

delay

The delay between frames in milliseconds

looping

A boolean which contains whether or not too loop the animation.

currentFrame

the current frame

lastTime

The last time the frame got switched. DO NOT MODIFY!

SpriteAnimation(start,length,delay,looping)

Create a SpriteAnimation object.

Parameter

start

The first frame of the animation in the sprite sheet.

length

The length of the animation in frames.

delay

The delay between frames in milliseconds.

looping

A boolean specifying if the animation should loop after finishing.

function SpriteAnimation:nextFrame()

Calculates the next frame in the animation
and returns the new frame number in the sprite sheet as a number.

Return: The next frame number.