1
\$\begingroup\$

I have many buttons in my game. There are different texts on them every time. But some texts are too long and get split up into two different lines. Is there any way I can fix this without resizing the button. How do I limit the button to one line. p.s I do have best fit on and need it.

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

Just change the horizontal overflow to Overflow: enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ But then the long words will end up outside the button, I want the text to shrink \$\endgroup\$
    – LukaxH
    Commented Nov 4, 2015 at 21:05
  • 1
    \$\begingroup\$ That's what "Best Fit" is meant to solve. Maybe you need to change the min/max font size you give it? \$\endgroup\$ Commented Nov 4, 2015 at 21:28
0
\$\begingroup\$

My solution would be to re-evaluate you button text to something that fits with in the buttons as they are. You either reduce the font uniformly across all buttons (reduces readability) or simply reduc the amount of text they contain, this may make make it more difficult to understand the UIs purpose but this can be offset by tool-tips and icons and button groupings. For example:

Launch Fire and Forget Missle

Launch Heat Seaking Missle

Launch Chaff

Launch Big Bomb of Instant Death

Rather:

-------LAUNCH CONTROL---------

FIRE AND FORGET

HEAT SEEKER

CHAFF

BBID!

There are a lot of resources out there on UX design and the best way to give the user the information he/she needs as easily and efficiently as possible.

The reason I say this is because Unity recommends using BestFit sparingly (See Here).

Also setting your text to overflow has it own set of problems but you could over flow to an ellipses (See Here) however this could leave your button text rather ambiguous.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .