[Submitted A Feature Request] Changing Text Size Of Buttons

Resolution: Got some help and realized how EASY it was to change the extension myself to add the font size changer!

Original Post:
Hey! I am using buttons in my game that have text in them, and I’m wondering if there is any way to change the font size with an event. I know you can in the editor, but in a specific case I need to change the size it with an event. Anyone got any ideas?

Thanks in advance!
– Snowy

Edit: I can also provide more info if needed :smile:

In the editor? as in you do you want the button to tween if someone hovers over the button?

1 Like

What I want to happen is if the text in a button is over a certain length, the font size shrinks making it so the text still all fits in one line.

1 Like

If there aren’t any functions to change the font size then you could modify the button. Either add events to make it automatically resize the text or just add functions to get and set the text size.

Another option would be to create your own button or use a blank button and place a text object on top of it. You could then adjust the size of the text object.

It wouldn’t also hurt to submit a feature request.

2 Likes

Good idea! i hope @SnowyRawrGamer will attempt to do it!

1 Like

If every button has a different text size, won’t it look strange and hard to read if texts get too small?

3 Likes

Yeah, consistency is important. Botton text probably should be kept brief. Either let the text wrap or use a wider button within reason.

Another option would be using text below the object or maybe a tooltip or status bar. Although, tooltips only work well on devices with mice not so much on touch screens. It’s not as intuitive.

Hey @davy!
Every button having a different font size doesn’t actually change too much. What I am trying to do right now is make some sort of font resizer so if text is over a certain length, it changes the font size to fit the text still in the button. If this feature isn’t possible to add, maybe you could add an automatic font feature? It would be so helpful in games where we have text that constantly changes size but still has to fit in a certain boundry. Engines such as roblox studio have it and it would be so nice. If not, just a button text resized works!

True except in that case all my button would look weird being different sizes. I’m using the same few buttons for a multiple choice quiz, and the answers to questions are anywhere from 1 character to 20 characters long, meaning that it would be almost impossible to read the 1 character answers if I set the font small enough that 20 character answers could fit.

1 Like

Thanks for the added context. I’m not sure what the issue is. It doesn’t seem like it would be too tough to fit a question and 4 answers into a scene.

Can you post a screenshot of your vision?

This is a very crude mokeup of what I’m imagining. A question with 4 possible answers.

Or

A long question could always be scrollable.

1 Like

The second mark up explains it mostly! The problem is if I have an answer that is too long, it takes up a second row in the button. Here are some photos:


This is how my questions are laid out.

This is what my answer looks like when I type “Example Answe” without the R.

As soon as I add the R, the lines overlap but since there isn’t a second line, it completely bugs out.

2 Likes

Hi all!

@SnowyRawrGamer: i think you can’t avoid having 2 lines (i.e. 2 strings) in each response button.
I know, it is not the best but it resolve the issue.

A+
Xierra

1 Like

True. I just wish there was a way to resize it, especially if the answer has a really long word that is 14+ letters. I submitted a feature request just in case, we’ll see what happens!