Module systems_scenes
Loads, starts, and unloads configured game scenes.
Info:
- Author: Sharper Dev
Functions
| ScenesSystem.loadScene (sceneIndex) | Loads the configured scene at the index, first requesting unload of active scenes. |
| ScenesSystem.startReadyScenes () | Calls start on components in scenes loaded since the previous start pass. |
| ScenesSystem.getUniversalScene () | Returns the universal scene loaded by loadUniversalScene. |
| ScenesSystem.loadUniversalScene () | Loads the engine's universal scene from its built-in asset path. |
| ScenesSystem.unloadScene (sceneIndex) | Disables the indexed active scene and requests its runtime unload. |
| ScenesSystem.removeSceneFromTable (index) | Removes the scene at the index from the active-scenes list. |
| ScenesSystem.getActiveScenes () | Returns the active-scenes list. |
Functions
- ScenesSystem.loadScene (sceneIndex)
-
Loads the configured scene at the index, first requesting unload of active scenes.
Parameters:
- sceneIndex
integer Index into
M2D_SETTINGS.SCENES.
Usage:
ScenesSystem.loadScene(1)
- sceneIndex
integer Index into
- ScenesSystem.startReadyScenes ()
-
Calls
starton components in scenes loaded since the previous start pass.Usage:
ScenesSystem.startReadyScenes() - ScenesSystem.getUniversalScene ()
-
Returns the universal scene loaded by loadUniversalScene.
Returns:
-
Scene|nil Universal scene, or
nilbefore it is loaded.Usage:
local scene = ScenesSystem.getUniversalScene()
- ScenesSystem.loadUniversalScene ()
- Loads the engine's universal scene from its built-in asset path.
- ScenesSystem.unloadScene (sceneIndex)
-
Disables the indexed active scene and requests its runtime unload.
Parameters:
- sceneIndex integer Index in the active-scenes list.
Usage:
ScenesSystem.unloadScene(1)
- ScenesSystem.removeSceneFromTable (index)
-
Removes the scene at the index from the active-scenes list.
Parameters:
- index integer Index in the active-scenes list.
Usage:
ScenesSystem.removeSceneFromTable(1)
- ScenesSystem.getActiveScenes ()
-
Returns the active-scenes list.
Returns:
-
table Active scenes.
Usage:
local scenes = ScenesSystem.getActiveScenes()