How to make a label grow from the center to hold large values

Godot Version

4.6.3 stable

Question

In my match 3 game as the numbers scale up they keep advancing to the right when i’ve tried alot with horizontal alingment and pivot offset to no avail

2 Questions:

you’ve set alignment to center and it still scales to the corner?

also check if label is scaling with font, then it might be anchors problem, not font itself

the scaling to the corner of the small numbers confuses me as i have the exact same function for the bigger number (pivot offset = Vector2(size/2)) and it works fine there though its not shown in the clip as in this case it never gets the chance to shrink, and i went back and set anchor preset to center for all the labels but whenever the size of the number increases it still expands to the right instead of from the center, which is what im trying to achieve so it looks nice and doesnt interfere with other labels as much

i think pivot offset might be responsible for this, maybe try with positions if you can? iirc i had some problem with pivots in the past - also from what i know pivots and anchors don’t work together, so that might be a case

still havnet figured it out but for now i just used a cop out system where it manually moves the label backwards based on character count, which is working decently well but i feel that there is likley a very obvious answer as on paper this really should not be complicated but hey thats programming

Anchor presets are different than the Control.pivot_offset. In this case you’ll want to set the pivot_offset or Control.pivot_offset_ratio to the middle of your Label and use Control.scale to scale it up or down. Read carefully the documentation of each property to understand how they work.