subsystem_Backgrounds

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


Methods

ReturnsMethod
SubViewportContaineradd_background_node ( scene: PackedScene, parent: DialogicNode_BackgroundHolder )
voidclear_game_state ( _clear_flag: int = 0 )
boolhas_background ( )
voidload_game_state ( _load_flag: int = 0 )
voidupdate_background ( scene: String = "", argument: String = "", fade_time: float = 0.0, transition_path: String = <unknown>, force: bool = false )

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 ------------------------------------ scene | The scene path of the new background. argument | Information given to the background on its update routine. fade_time | The time the background may take to transition in. same_scene | If the new background uses the same Godot scene.


Property Descriptions

var default_background_scene =

The default background Dialogic will use.


var default_transition =

The default transition Dialogic will use.


Method Descriptions

func add_background_node ( scene: PackedScene, parent: DialogicNode_BackgroundHolder ) ⇒ SubViewportContainer

Adds sub-viewport with the given background scene as child to Dialogic scene.


func clear_game_state ( _clear_flag: int = 0 ) ⇒ void

Empties the current background state.


func has_background ( ) ⇒ bool

Whether a background is set.


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 = <unknown>, 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.