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)
    $Tween.start()

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

asked Jul 1 in Projects by grantsellis (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,
Tween.TRANS
LINEAR, Tween.EASEIN)
#scaling text outline
FinalSize = 150
$Tween.interpolate
property(mainlabelfont, "outlinesize", FinalSize / 10, FinalSize, 3,
Tween.TRANS
LINEAR, Tween.EASE_IN)

answered Jul 1 by grantsellis (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.