Moai SDK  2.0
MOAITileDeck2D Class Reference
+ Inheritance diagram for MOAITileDeck2D:

Function List

setQuad
 
setRect
 
setUVQuad
 
setUVRect
 
setSize
 
transform
 
transformUV
 

Additional Inherited Members

- Function List inherited from MOAIDeck
getBounds
 
- Function List inherited from MOAIGridSpace
cellAddrToCoord
 
getCellAddr
 
getCellSize
 
getOffset
 
getSize
 
getTileLoc
 
getTileSize
 
initAxialHexGrid
 
initDiamondGrid
 
initHexGrid
 
initObliqueGrid
 
initRectGrid
 
locToCellAddr
 
locToCoord
 
setRepeat
 
setShape
 
setSize
 
wrapCoord
 

Function Documentation

setQuad

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
MOAITileDeck2Dself
numberx0
numbery0
numberx1
numbery1
numberx2
numbery2
numberx3
numbery3
Returns
nil
setRect

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
MOAITileDeck2Dself
numberxMin
numberyMin
numberxMax
numberyMax
Returns
nil
setSize

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
MOAITileDeck2Dself
numberwidth Width of the tile deck in tiles.
numberheight Height of the tile deck in tiles.
numbercellWidth Optional. Width of individual tile in UV space. Defaults to 1 / width.
numbercellHeight Optional. Height of individual tile in UV space. Defaults to 1 / height.
numberxOff Optional. X offset of the tile from the cell. Defaults to 0.
numberyOff Optional. Y offset of the tile from the cell. Defaults to 0.
numbertileWidth Optional. Default value is cellWidth.
numbertileHeight Optional. Default value is cellHeight.
Returns
nil
setUVQuad

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
MOAITileDeck2Dself
numberx0
numbery0
numberx1
numbery1
numberx2
numbery2
numberx3
numbery3
Returns
nil
setUVRect

Set the UV space dimensions of the quad.


function setUVRect ( MOAITileDeck2D self, number xMin, number yMin, number xMax, number yMax )

Parameters
MOAITileDeck2Dself
numberxMin
numberyMin
numberxMax
numberyMax
Returns
nil
transform

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


function transform ( MOAITileDeck2D self, MOAITransform transform )

Parameters
MOAITileDeck2Dself
MOAITransformtransform
Returns
nil
transformUV

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


function transformUV ( MOAITileDeck2D self, MOAITransform transform )

Parameters
MOAITileDeck2Dself
MOAITransformtransform
Returns
nil