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)
ScenesSystem.startReadyScenes ()
Calls start on 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 nil before 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()
generated by LDoc 1.5.0 Last updated 2026-10-04 12:53:32