2 class_name DialogicBackground
4 ## This is the base class for dialogic backgrounds.
5 ## Extend it and override it's methods when you create a custom background.
6 ## You can take a look at the default background to get an idea of how it's working.
9 ## The subviewport container that holds this background. Set when instanced.
10 var viewport_container: SubViewportContainer
11 ## The viewport that holds this background. Set when instanced.
12 var viewport: SubViewport
15 ## Load the new background in here.
16 ## The time argument is given for when [_should_do_background_update] returns true
17 ## (then you have to do a transition in here)
18 func _update_background(_argument:String, _time:float) -> void:
22 ## If a background event with this scene is encountered while this background is used,
23 ## this decides whether to create a new instance and call fade_out or just call [_update_background] # on this scene. Default is false
24 func _should_do_background_update(_argument:String) -> bool:
28 ## Called by dialogic when first created.
29 ## If you return false (by default) it will attempt to animate the "modulate" property.
30 func _custom_fade_in(_time:float) -> bool:
34 ## Called by dialogic before removing (done by dialogic).
35 ## If you return false (by default) it will attempt to animate the "modulate" property.
36 func _custom_fade_out(_time:float) -> bool: