#How to scale label depending on label length

28 messages · Page 1 of 1 (latest)

dim sigil
#

If the label is too small or too big, how do I make it always fit inside the circle no matter the length of the label

mental heron
#

Usually, the label goes under the circle for a profile icon like that

#

But

#

To answer your question

#

You probably want to enable text wrap

#

Oooor

#

You put the label inside a container node

#

And then setup the container to have it's children scale down in size to fit the container

dim sigil
#

In this case it's for a game and I want their usernames to be inside the profile. Like this except always fitting to the size of the circle

dim sigil
mental heron
#

Either

#

Both are valid options

dim sigil
mental heron
#

Hello Godotneers! Building a nice-looking user interface Godot that works across screen sizes and aspect ratios can be quite a daunting task. This video will provide you with the basics that you need to build your very own user interfaces with the Godot game engine that work everywhere. With it you get a good foundation on which you can build in...

▶ Play video
#

This will teach you about Godot UI

#

After watching that, you should be able to do what you want

dim sigil
#

Funny enough I actually watched this video already, I don't think it addresses my problem tho

mental heron
#

Yes it does. There's a spot in the video where he is addressing text inside a box

#

It should be basically the same thing

dim sigil
#

Does that spot in the vidoe scale the text? does it make the text larger if the text is too short?

mental heron
#

Good question

#

Let me double check

#

I could be speaking out my ass here

#

Ok you're right. My apologies.

dim sigil
#

I'll give it a try right now

dim sigil