Moai SDK  2.0
MOAIViewport Class Reference

Inherits MOAILuaObject, and ZLMetaRect< TYPE >.

Function List

setOffset
 
setRotation
 
setScale
 
setSize
 

Function Documentation

setOffset

Sets the viewport offset in normalized view space (size of viewport is -1 to 1 in both directions).


function setOffset ( MOAIViewport self, number xOff, number yOff )

Parameters
MOAIViewportself
numberxOff
numberyOff
Returns
nil
setRotation

Sets global rotation to be added to camera transform.


function setRotation ( MOAIViewport self, number rotation )

Parameters
MOAIViewportself
numberrotation
Returns
nil
setScale

Sets the number of world units visible of the viewport for one or both dimensions. Set 0 for one of the dimensions to use a derived value based on the other dimension and the aspect ratio. Negative values are also OK. It is typical to set the scale to the number of pixels visible in the this-> This practice is neither endorsed nor condemned. Note that the while the contents of the viewport will appear to stretch or shrink to match the dimensions of the viewport given by setSize, the number of world units visible will remain constant.


function setScale ( MOAIViewport self, number xScale, number yScale )

Parameters
MOAIViewportself
numberxScale
numberyScale
Returns
nil
setSize

Sets the dimensions of the this->


function setSize ( MOAIViewport self, number width, number height )

Parameters
MOAIViewportself
numberwidth
numberheight
Returns
nil
Note

function setSize ( MOAIViewport self, number left, number top, number right, number bottom )

Parameters
MOAIViewportself
numberleft
numbertop
numberright
numberbottom
Returns
nil
Note