CORE/docs/references/SceneManager.md

80 lines
3 KiB
Markdown
Raw Normal View History

---
hide:
- navigation
---
# Scene Manager (/root/CORE/SceneManager)
Responsible for displaying scenes using overlays.
## Overlays
The scene manager uses something called **overlays**. A overlay can either hold one scene or multiple scenes and are used to keep scenes in order.
### Overlay #1 - `debug`
- description `The overlay with the highest priority and is displayed over all other overlays. Should contain debug scenes.`
- more than one scene `yes`
- adding a scene **[add_debug()](#add_debug)**
- removing a scene **[remove_debug()](#remove_debug)**
### Overlay #2 - `cutscene`
- description `Has the second highest priority and is displayed over all overlays except debug. Should contain... well cutscenes.`
- more than one scene `no`
- adding a scene **[add_cutscene()](#add_cutscene)**
- removing a scene **[remove_cutscene()](#remove_cutscene)**
### Overlay #3 - `menu`
- description `The overlay with the second lowest priority. Should contain menus.`
- more than one scene `yes`
- adding a scene **[add_menu()](#add_menu)**
- removing a scene **[remove_menu()](#remove_menu)**
### Overlay #4 - `action`
- description `Has the lowest priority. This overlay should contain your main menu, your program's main interface or your level.`
- more than one scene `no`
- adding a scene **[add_action()](#add_action)**
- removing a scene **[remove_action()](#remove_action)**
## Methods
### add_debug()
- returns `bool`
- description `Adds a PackedScene to the debug overlay.`
- argument `resource_name`
- type `String`
- mandatory `yes`
- description `Used for loading the scene and the loaded scene name.`
### remove_debug()
- returns `bool`
- description `Removes a menu scene from the debug overlay.`
- argument `scene_name`
- type `String`
- mandatory `yes`
- description `Should be the same as the "resource_name" argument used previously in add_debug().`
### add_cutscene()
- returns `bool`
- description `Adds a PackedScene to the cutscene overlay.`
- argument `resource_name`
- type `String`
- mandatory `yes`
- description `Used for loading the scene and the loaded scene name.`
### remove_cutscene()
- returns `bool`
- description `Removes the game scene from the cutscene overlay.`
### add_menu()
- returns `bool`
- description `Adds a PackedScene to the menu overlay.`
- argument `resource_name`
- type `String`
- mandatory `yes`
- description `Used for loading the scene and the loaded scene name.`
### remove_menu()
- returns `bool`
- description `Removes a menu scene from the menu overlay.`
- argument `scene_name`
- type `String`
- mandatory `yes`
- description `Should be the same as the "resource_name" argument used previously in add_menu().`
### add_action()
- returns `bool`
- description `Adds a PackedScene to the action overlay.`
- argument `resource_name`
- type `String`
- mandatory `yes`
- description `Used for loading the scene and the loaded scene name.`
### remove_action()
- returns `bool`
- description `Removes the game scene from the action overlay.`