This contains the source code documentation of the class subsystem_Backgrounds.
subsystem_Backgrounds
Inherits: DialogicSubsystem
Subsystem for managing backgrounds.
Description
This subsystem has many different helper methods for managing backgrounds. For instance, you can listen to background changes via background_changed.
Properties
| Name | Type | Default |
|---|---|---|
| default_background_scene | PackedScene | load(...) |
| default_transition | String | path_join(...) |
Methods
| Returns | Method |
|---|---|
| void | clear_game_state ( _clear_flag: int = 0 ) |
| void | load_game_state ( _load_flag: int = 0 ) |
| void | update_background ( scene: String = "", argument: String = "", fade_time: float = 0.0, transition_path: String = default_transition, force: bool = false ) |
| SubViewportContainer | add_background_node ( scene: PackedScene, parent: DialogicNode_BackgroundHolder ) |
| bool | has_background ( ) |
Signals
signal background_changed ( info: Dictionary )
Whenever a new background is set, this signal is emitted and contains a dictionary with the following keys:
| Key | Value Type | Value |
|---|---|---|
scene | String | The scene path of the new background. |
argument | String | Information given to the background on its update routine. |
fade_time | float | The time the background may take to transition in. |
same_scene | bool | If the new background uses the same Godot scene. |
Property Descriptions
var default_background_scene = load(...)
The default background scene Dialogic will use.
var default_transition = path_join(...)
The default transition Dialogic will use.
Method Descriptions
func clear_game_state ( _clear_flag: int = 0 ) ⇒ void
Empties the current background state.
func load_game_state ( _load_flag: int = 0 ) ⇒ void
Loads the background state from the current state info.
func update_background ( scene: String = "", argument: String = "", fade_time: float = 0.0, transition_path: String = default_transition, force: bool = false ) ⇒ void
Method that adds a given scene as child of the DialogicNode_BackgroundHolder. It will call [_update_background()] on that scene with the given argument . It will call [_fade_in()] on that scene with the given fade time. Will call fade_out on previous backgrounds scene. If the scene is the same as the last background you can bypass another instantiating and use the same scene. To do so implement [_should_do_background_update()] on the custom background scene. Then [_update_background()] will be called directly on that previous scene.
func add_background_node ( scene: PackedScene, parent: DialogicNode_BackgroundHolder ) ⇒ SubViewportContainer
Adds sub-viewport with the given background scene as child to Dialogic scene.
func has_background ( ) ⇒ bool
Whether a background is set.