File hp/display/Scene.lua
Functions
M:addChild (child, Child) | Add a child object. |
M:getRenderTable () | Returns the rendering table. |
M:getVisible () | Returns the visible. |
M:init () | The constructor. |
M:onCreate (params) | Called when it is created. |
M:onDestroy () | Called when destroyed. |
M:onEnterFrame () | Called when updated. |
M:onKeyDown (event) | Called when keyboard input. |
M:onKeyUp (event) | Called when keyboard input. |
M:onPause () | Called when paused. |
M:onResume () | Called when resumed. |
M:onStart () | Called when it is started. |
M:onStop () | Called when stoped. |
M:onTouchCancel (event) | Called when screen touched. |
M:onTouchDown (event) | Called when screen touched. |
M:onTouchMove (event) | Called when screen touched. |
M:onTouchUp (event) | Called when screen touched. |
M:orderToBack () | Display to the back Scene. |
M:orderToFront () | Display to the front Scene. |
M:removeChild (child, Child) | Remove the child object. |
M:setVisible (value) | Sets the visible. If set to false, excluded from the target rendering. |
Tables
Scene | This class is a top-level container to build a scene graph. |
Functions
- M:addChild (child, Child)
-
Add a child object.
Parameters
- child:
- Child: to inherit the MOAILayer.
- M:getRenderTable ()
-
Returns the rendering table.
Return value:
renderTable. - M:getVisible ()
-
Returns the visible.
Return value:
visible. - M:init ()
- The constructor.
- M:onCreate (params)
-
Called when it is created.
Parameters
- params:
- M:onDestroy ()
- Called when destroyed.
- M:onEnterFrame ()
- Called when updated.
- M:onKeyDown (event)
-
Called when keyboard input.
Parameters
- event: Keybord event.
- M:onKeyUp (event)
-
Called when keyboard input.
Parameters
- event: Keybord event.
- M:onPause ()
- Called when paused.
- M:onResume ()
- Called when resumed.
- M:onStart ()
- Called when it is started.
- M:onStop ()
- Called when stoped.
- M:onTouchCancel (event)
-
Called when screen touched.
Parameters
- event: Event.
- M:onTouchDown (event)
-
Called when screen touched.
Parameters
- event: Event.
- M:onTouchMove (event)
-
Called when screen touched.
Parameters
- event: Event.
- M:onTouchUp (event)
-
Called when screen touched.
Parameters
- event: Event.
- M:orderToBack ()
- Display to the back Scene.
- M:orderToFront ()
- Display to the front Scene.
- M:removeChild (child, Child)
-
Remove the child object.
Parameters
- child:
- Child: to inherit the MOAILayer.
- M:setVisible (value)
-
Sets the visible.
If set to false, excluded from the target rendering.
Parameters
- value: visible.
Tables
- Scene
- This class is a top-level container to build a scene graph.
Use this class to build a game scene.
Scene is managed by the SceneManager.
Use by specifying the module from the SceneManager.
Scene will be generated internally.
The Scene is the life cycle exists.
It is important to understand the life cycle.
1. onCreate(params)
Called when created.
Initializes the scene graph in this function.
2. onStart()
Called when started.
Called after the animation is complete.
3. onResume()
Called when resumed. 4. onPause()
Called when paused.
5. onStop()
Called when the stoped.
6. onDestroy()
Called when destroyed.