Moai SDK  1.5 revision 1 (MoaiEdition)
MOAITileDeck2D Class Reference
Inheritance diagram for MOAITileDeck2D:
MOAIDeck MOAIGridSpace

List of all members.

Function List

  setQuad
  setRect
  setUVQuad
  setUVRect
  setSize
  transform
  transformUV

Function Documentation

Set model space quad. Vertex order is clockwise from upper left (xMin, yMax)


function setQuad ( MOAITileDeck2D self, number x0, number y0, number x1, number y1, number x2, number y2, number x3, number y3 )
Parameters:
self ( MOAITileDeck2D )
x0 ( number )
y0 ( number )
x1 ( number )
y1 ( number )
x2 ( number )
y2 ( number )
x3 ( number )
y3 ( number )
Returns:
nil

Set the model space dimensions of a single tile. When grid drawing, this should be a unit rect centered at the origin for tiles that fit each grid cell. Growing or shrinking the rect will cause tiles to overlap or leave gaps between them.


function setRect ( MOAITileDeck2D self, number xMin, number yMin, number xMax, number yMax )
Parameters:
self ( MOAITileDeck2D )
xMin ( number )
yMin ( number )
xMax ( number )
yMax ( number )
Returns:
nil

Controls how the texture is subdivided into tiles. Default behavior is to subdivide the texture into N by M tiles, but is tile dimensions are provided (in UV space) then the resulting tile set will be N * tileWidth by M * tileHeight in UV space. This means the tile set does not have to fill all of the texture. The upper left hand corner of the tile set will always be at UV 0, 0.


function setSize ( MOAITileDeck2D self, number width, number height [, number cellWidth, number cellHeight, number xOff, number yOff, number tileWidth, number tileHeight ] )
Parameters:
self ( MOAITileDeck2D )
width ( number ) Width of the tile deck in tiles.
height ( number ) Height of the tile deck in tiles.
cellWidth ( number ) Optional. Width of individual tile in UV space. Defaults to 1 / width.
cellHeight ( number ) Optional. Height of individual tile in UV space. Defaults to 1 / height.
xOff ( number ) Optional. X offset of the tile from the cell. Defaults to 0.
yOff ( number ) Optional. Y offset of the tile from the cell. Defaults to 0.
tileWidth ( number ) Optional. Default value is cellWidth.
tileHeight ( number ) Optional. Default value is cellHeight.
Returns:
nil

Reimplemented from MOAIGridSpace.

Set the UV space dimensions of the quad. Vertex order is clockwise from upper left (xMin, yMax)


function setUVQuad ( MOAITileDeck2D self, number x0, number y0, number x1, number y1, number x2, number y2, number x3, number y3 )
Parameters:
self ( MOAITileDeck2D )
x0 ( number )
y0 ( number )
x1 ( number )
y1 ( number )
x2 ( number )
y2 ( number )
x3 ( number )
y3 ( number )
Returns:
nil

Set the UV space dimensions of the quad.


function setUVRect ( MOAITileDeck2D self, number xMin, number yMin, number xMax, number yMax )
Parameters:
self ( MOAITileDeck2D )
xMin ( number )
yMin ( number )
xMax ( number )
yMax ( number )
Returns:
nil

Apply the given MOAITransform to all the vertices in the deck.


function transform ( MOAITileDeck2D self, MOAITransform transform )
Parameters:
self ( MOAITileDeck2D )
transform ( MOAITransform )
Returns:
nil

Apply the given MOAITransform to all the uv coordinates in the deck.


function transformUV ( MOAITileDeck2D self, MOAITransform transform )
Parameters:
self ( MOAITileDeck2D )
transform ( MOAITransform )
Returns:
nil