|
Moai SDK
1.5 revision 1 (MoaiEdition)
|
Computes a camera fitting for a given world rect along with an optional screen space padding. To do a fitting, compute the world rect based on whatever you are fitting to, use this method to get the fitting, then animate the camera to match.
function getFitting ( MOAILayer self, number xMin, number yMin, number xMax, number yMax [, number xPad, number yPad ] )
| self | ( MOAILayer ) |
| xMin | ( number ) |
| yMin | ( number ) |
| xMax | ( number ) |
| yMax | ( number ) |
| xPad | ( number ) Optional. |
| yPad | ( number ) Optional. |
Returns the partition (if any) currently attached to this layer.
function getPartition ( MOAILayer self )
| self | ( MOAILayer ) |
Return the scalar applied to axis sorts.
function getSortScale ( MOAILayer2D self )
| self | ( MOAILayer2D ) |
Sets a Box2D world for debug drawing.
function setBox2DWorld ( MOAILayer self, MOAIBox2DWorld world )
| self | ( MOAILayer ) |
| world | ( MOAIBox2DWorld ) |
Sets a camera for the layer. If no camera is supplied, layer will render using the identity matrix as view/proj.
function setCamera ( MOAILayer self [, MOAICamera camera ] )
| self | ( MOAILayer ) |
| camera | ( MOAICamera ) Optional. Default value is nil. |
function setCamera ( MOAILayer self [, MOAICamera2D camera ] )
| self | ( MOAILayer ) |
| camera | ( MOAICamera2D ) Optional. Default value is nil. |
Sets a Chipmunk space for debug drawing.
function setCpSpace ( MOAILayer self, MOAICpSpace space )
| self | ( MOAILayer ) |
| space | ( MOAICpSpace ) |
Sets the parallax scale for this layer. This is simply a scalar applied to the view transform before rendering.
function setParallax ( MOAILayer self [, number xParallax, number yParallax, number zParallax ] )
| self | ( MOAILayer ) |
| xParallax | ( number ) Optional. Default value is 1. |
| yParallax | ( number ) Optional. Default value is 1. |
| zParallax | ( number ) Optional. Default value is 1. |
Sets a partition for the layer to use. The layer will automatically create a partition when the first prop is added if no partition has been set.
function setPartition ( MOAILayer self, MOAIPartition partition )
| self | ( MOAILayer ) |
| partition | ( MOAIPartition ) |
Set the sort mode for rendering.
function setSortMode ( MOAILayer self, number sortMode )
| self | ( MOAILayer ) |
| sortMode | ( number ) One of MOAILayer.SORT_NONE, MOAILayer.SORT_PRIORITY_ASCENDING, MOAILayer.SORT_PRIORITY_DESCENDING, MOAILayer.SORT_X_ASCENDING, MOAILayer.SORT_X_DESCENDING, MOAILayer.SORT_Y_ASCENDING, MOAILayer.SORT_Y_DESCENDING, MOAILayer.SORT_Z_ASCENDING, MOAILayer.SORT_Z_DESCENDING |
Set the scalar applied to axis sorts.
function setSortScale ( MOAILayer self [, number x, number y, number z, number priority ] )
| self | ( MOAILayer ) |
| x | ( number ) Optional. Default value is 0. |
| y | ( number ) Optional. Default value is 0. |
| z | ( number ) Optional. Default value is 0. |
| priority | ( number ) Optional. Default value is 1. |
Set the layer's viewport.
function setViewport ( MOAILayer self, MOAIViewport viewport )
| self | ( MOAILayer ) |
| viewport | ( MOAIViewport ) |
Project a point from window space into world space and return a normal vector representing a ray cast from the point into the world away from the camera (suitable for 3D picking).
function wndToWorld ( MOAILayer self, number x, number y, number z )
| self | ( MOAILayer ) |
| x | ( number ) |
| y | ( number ) |
| z | ( number ) |