Substate Functions
Functions for Custom Substates, useful for in-game menus and mechanics.
openCustomSubstate
openCustomSubstate(name:String, ?pauseGame:Bool = false):Void
Opens an empty custom substate.
- name - Identifier used for the Lua/HScript callbacks.
- pauseGame (Optional) - Game stays paused while substate is open.
Examples:
- openCustomSubstate('custom_substate') - Opens a substate.
- openCustomSubstate('custom_pause_menu', true) - Pauses game and open a substate.
Note: By default, the substate is completely blank when open, you can add Objects to it with "insertToCustomSubstate".
closeCustomSubstate
Usage: closeCustomSubstate()
Closes the custom substate.
insertToCustomSubstate
insertToCustomSubstate(tag:String, ?pos:Int = -1):Void
Inserts a Lua Sprite into the currently active Custom Substate.
- tag - Lua Object tag to add.
- pos (Optional) - Layering, default value is -1 and it inserts on top of everything.
Examples:
- insertToCustomSubstate('mySprite') - Insert Lua Sprite with tag "mySprite" at the top.
- insertToCustomSubstate('mySprite', 0) - Insert Lua Sprite with tag "mySprite" at the bottom.