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 Sprite class

The sprite class contains primitives to load, display and
manipulate sprites.

See also: Widget

Example:


dofile("SDK/Graphics2D.lua")

-- Load a sprite without caption
sprite = Sprite(20,20,90,90,"maps/sprite.png", "")

-- Add sprite to the main canvas
mainCanvas:addWidget(sprite)

function onSceneUpdate()
    -- Rotate sprite by 2° every frame
    sprite:rotate(2)
end

Sprite(x,y,w,h,file,text)

Loads a texture into memory and creates a Sprite object with it.

Parameter

x

The x position on the canvas

y

The y position on the canvas

w

The width of the widget

h

The height of the widget

file

The image file to load

text

(optional) The label of the widget