0 votes

I am trying to scale a label. The scene is set up so that there is a Node2D with 2 child nodes: Label, the label, and Tween, the tween.

func _ready():
    var labelRef = get_node("Label")
    $Tween.interpolate_property(labelRef, "scale", Vector2(1, 1), Vector2(10, 10), 3, Tween.TRANS_LINEAR, Tween.EASE_IN)

The above code runs, but does not change the size of the label text.

in Engine by (16 points)

1 Answer

0 votes

The above scales the label's text area. To scale the text, scale the font directly, e.g.

var mainlabelfont = getnode("MainLabel").get("customfonts/font")
var FinalSize = 800
$Tween.interpolateproperty(mainlabelfont, "size", FinalSize / 10, FinalSize, 3,
#scaling text outline
FinalSize = 150
property(mainlabelfont, "outlinesize", FinalSize / 10, FinalSize, 3,

by (16 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.