]> Untitled Git - wolf-seeking-sheep.git/blob - addons/dialogic/Modules/Background/dialogic_background.gd
9e84a91afeaab7775b417a29b2a789afd2f19108
[wolf-seeking-sheep.git] / addons / dialogic / Modules / Background / dialogic_background.gd
1 extends Node
2 class_name DialogicBackground
3
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.
7
8
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
13
14
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:
19         pass
20
21
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:
25         return false
26
27
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:
31         return false
32
33
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:
37         return false
38