I have a label that I want to use to display the amount of happiness in the player's tribe. I'm storing the happiness value as an int attribute in a global class/script called "Resources".
I'm trying to use signals to update the Label's text whenever Resources.happiness is modified, but I can't figure it out.
How can I get the label to update it's text whenever happiness is modified?
I have looked at tutorials and such for this, but I can't seem to find anything that explains how to connect an attribute without using the 2d-editor. I don't think I can use the 2d-editor if the script isn't connected to a scene. I don't want to arbitrarily connect the script to a scene just to do this.
get_node("happiness_amount").connect("happiness", self, "updateHappiness")
get_node("happiness_amount").text = str(Resources.getHappiness())
var happiness = 25
happiness = value