[FEATURE REQUEST] Word-wrap for buttons

Started by Dave Gilbert, Tue 08/10/2024 20:26:55

Previous topic - Next topic

Dave Gilbert

Currently, the text on buttons doesn't word wrap. If I want to wordwrap text on a button, I have to use a text label and place it on top of the button. Normally, no big deal. But this can be a bit annoying when I want to add a lot of buttons like this:



For each of those buttons, I had to create individual text labels and place them on top of each button. Very time consuming and a bit of a faff to keep track of which label is on top of which button. If the text on the button could word-wrap, that would save a lot of time and effort.

Thanks!

-Dave

Crimson Wizard

I suppose this could be done.
I'd probably add a gui control flag which tells whether wrap text or not for backwards compatibility, and in case someone wants strictly non-wrapped text (e.g. if they worry that it gets unexpectedly wrapped after translation).


Dave Gilbert


Crimson Wizard

#4
Well, I sort of made it:
https://github.com/adventuregamestudio/ags/pull/2547

but this needs more testing.

Crimson Wizard

#5
Here's a test build (based on 3.6.2 Beta release):
https://cirrus-ci.com/task/6557944643321856

Added following:
- Labels have full TextAlignment selection (includes vertical alignment)
- Buttons have WrapText property
- Buttons have TextHorizontalPadding and TextVerticalPadding properties.

Crimson Wizard

Which kind of naming seems better:

- TextHorizontalPadding, TextVerticalPadding

or

- TextPaddingHorizontal, TextPaddingVertical

?

RootBound

Quote from: Crimson Wizard on Thu 10/10/2024 15:39:35Which kind of naming seems better:

- TextHorizontalPadding, TextVerticalPadding

or

- TextPaddingHorizontal, TextPaddingVertical

?

I'd prefer the second version, since that would make both properties show up together in the list if this is called from the script API.
They/them. Here are some of my games:

SMF spam blocked by CleanTalk