How do I scale a label with a Tween?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By grantsellis

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.

:bust_in_silhouette: Reply From: grantsellis

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

var main_label_font = get_node(“MainLabel”).get(“custom_fonts/font”)
var FinalSize = 800
$Tween.interpolate_property(main_label_font, “size”, FinalSize / 10, FinalSize, 3,
Tween.TRANS_LINEAR, Tween.EASE_IN)
#scaling text outline
FinalSize = 150
$Tween.interpolate_property(main_label_font, “outline_size”, FinalSize / 10, FinalSize, 3,
Tween.TRANS_LINEAR, Tween.EASE_IN)

:bust_in_silhouette: Reply From: dydokamil

replace scale with rect_scale