File hp/display/Layer.lua
Functions
M:copyParams (params) | Set the parameter setter function. |
M:getScreenHeight () | Returns the size of the layer on the screen. |
M:getScreenSize () | Returns the size of the layer on the screen. |
M:getScreenWidth () | Returns the size of the layer on the screen. |
M:getViewHeight () | Returns the viewport size of the layer. |
M:getViewScale () | Returns the scale of the screen and viewport. |
M:getViewScaleX () | Returns the scale of the screen and viewport. |
M:getViewScaleY () | Returns the scale of the screen and viewport. |
M:getViewSize () | Returns the viewport size of the layer. |
M:getViewWidth () | Returns the viewport size of the layer. |
M:init (params) | The constructor. |
M:setOffset (offsetX, offsetY) | Sets the offset of the viewport. |
M:setScene (scene) | Sets the scene. By setting the scene, and then draw in the scene. |
M:setScreenSize (width, height) | Sets the size of the layer on the screen. |
M:setViewSize (width, height) | Sets the viewport size of the layer. |
Tables
Layer | This class inherits the MOAILayer. |
Functions
- M:copyParams (params)
-
Set the parameter setter function.
Parameters
-
params: Parameter is set to Object.
-
params: Parameter is set to Object.
- M:getScreenHeight ()
-
Returns the size of the layer on the screen.
Return value:
Height of screen. - M:getScreenSize ()
-
Returns the size of the layer on the screen.
Return value:
width, height - M:getScreenWidth ()
-
Returns the size of the layer on the screen.
Return value:
Width of screen. - M:getViewHeight ()
-
Returns the viewport size of the layer.
Return value:
viewHeight. - M:getViewScale ()
-
Returns the scale of the screen and viewport.
Return value:
scaleX, scaleY. - M:getViewScaleX ()
-
Returns the scale of the screen and viewport.
Return value:
scaleX - M:getViewScaleY ()
-
Returns the scale of the screen and viewport.
Return value:
scaleY. - M:getViewSize ()
-
Returns the viewport size of the layer.
Return value:
viewWidth, viewHeight. - M:getViewWidth ()
-
Returns the viewport size of the layer.
Return value:
viewWidth. - M:init (params)
-
The constructor.
Parameters
-
params: (option)Parameter is set to Object.
-
params: (option)Parameter is set to Object.
- M:setOffset (offsetX, offsetY)
-
Sets the offset of the viewport.
Parameters
- offsetX: offsetX.
- offsetY: offsetY.
- M:setScene (scene)
-
Sets the scene.
By setting the scene, and then draw in the scene.Parameters
- scene: scene.
- M:setScreenSize (width, height)
-
Sets the size of the layer on the screen.
Parameters
- width: Width of the screen.
- height: Height of the screen.
- M:setViewSize (width, height)
-
Sets the viewport size of the layer.
Parameters
- width: Width of the viewport.
- height: Height of the viewport.