Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | wombatTurkey | |
Old Version | Published before Godot 3 was released. |
For example, this script extends the WindowDialog
class
extends WindowDialog
var c_node = null
func _ready():
connect("about_to_show", self, "black_backdrop")
connect("popup_hide", self, "black_backdrop_remove")
c_node = get_tree().get_current_scene()
func black_backdrop():
GF.PlayTween({node = c_node, type = "set_opacity", from = 1, to = 0.5, seconds = 0.2, tween1 = 1, tween2 = 2})
print("Modal is about to be shown")
func black_backdrop_remove():
GF.PlayTween({node = c_node, type = "set_opacity", from = 0.5, to = 1, seconds = 0.2, tween1 = 1, tween2 = 2})
print("Modal is removed")
And I am using it as a Autoload Singleton
My question is, when I create a new WindowDialog
on any scene, it’s not extending it unless I attach it this script.
I am trying to attach or extend the WindowDialog
class globally wherever I use a WindowDialog
node in any scene, is that possible?