Topic was automatically imported from the old Question2Answer platform.
Asked By
dennisb
Old Version
Published before Godot 3 was released.
So I have this label that shows the score, and I want to tween its scale property whenever the player got a score. Well the tween works but the anchor point of the scale stays on the upper left side of the label. I’ve tried to change the anchor point to center but nothing works. Do I have to set the anchor point by script ?
im not sure what you want to do, if you want to set
the anchor points you can set it in the Label Settings or
code using set_anchor() function for script.
but judging in your post, you might also want to try
the font alignment, set it to center in the Label info
or you may use set_align() and set_valign() to make the text
centered in the anchor points.
What I wanted to do was to scale the text from the center not the upper left corner and I already did set the anchor to the center but whenever I scale the label still scales from the upper left corner. Haven’t tried it with code yet though, but thanks for the suggestion.
Proper anchor handling of GUI components is implemented on 3.0 (alpha), but not 2.x
I had the same issue and fixed by adding another Control node as parent.
And using it as an anchor point and scaling it.
Thank you so much for this reply, I spent hours trying to figure out what I did wrong.