[SUGGESTION] Adding an outline and more text alignment options to labels

Started by Gal Shemesh, Mon 04/09/2023 14:54:59

Previous topic - Next topic

Gal Shemesh

Just found that GUI labels text can only be aligned to either left, center or right, while buttons text on the other hand has the flexibility of aligning their text to every edge and corner of its boundaries. I think that it would be nice if labels could have the same flexibility.

Besides, I think that labels and any other element that can utilize text should also have the properties that Fonts have, such as OutlineStyle, AutoOutlineStyle, AutoOutlineThickness, LineSpacing, and SizeMultiplier... I found this missing when I tried to use a text label as a static speech text location, which works quite nice yet missing these features to look better.

Thanks
Gal Shemesh,
goldeng

Crimson Wizard

Quote from: Gal Shemesh on Mon 04/09/2023 14:54:59Besides, I think that labels and any other element that can utilize text should also have the properties that Fonts have, such as OutlineStyle, AutoOutlineStyle, AutoOutlineThickness, LineSpacing, and SizeMultiplier... I found this missing when I tried to use a text label as a static speech text location, which works quite nice yet missing these features to look better.

Font properties are supposed to be applied to anything that draws a text using this Font. If you like to have a specific look on a label, then you need to create a separate Font with different set of properties.

Right now this may be inconvenient, since duplicating a font will also clone the font file, increasing game size.
This is why there's an open ticket which suggests to separate Font Settings from the font files:
https://github.com/adventuregamestudio/ags/issues/996

But in the end, these are supposed to be Font settings, not Label settings.

Gal Shemesh

Thanks CW. I actually have set my speech to use Font1 and it has its outline settings applied and showing correctly during runtime. But the labels that I set to use this Font1 only get the 'naked' font without any outline applied to it during runtime...
Gal Shemesh,
goldeng

Crimson Wizard

Quote from: Gal Shemesh on Mon 04/09/2023 15:33:38Thanks CW. I actually have set my speech to use Font1 and it has its outline settings applied and showing correctly during runtime. But the labels that I set to use this Font1 only get the 'naked' font without any outline applied to it during runtime...

I think this may be a bug. I will need to test this.

Crimson Wizard

Well, I tested this in 3.6.0.51, and the labels correctly draw outlined font at runtime, as expected.
Other font settings (thickness, offset) are also applied.

They don't do this in the editor's preview, but this is an old problem.

Gal Shemesh

Thanks for the quick testing. Appreciate it. That's really odd - I'm using July's 3.6.0 and on my end although the font is set up with outline and showing correctly for speech during runtime, when I passed a Character* .Say string into it the text shows only with the the character's speech color, but no outline... I will re-check this shortly this evening and update here.

EDIT:
Checked and confirm that it works - it appears that I probably changed the label's font unintendedly to Font0 which is the very same font as the speech font. Hence it didn't show the outline.

As for the label text alignment, such as aligning to bottom center, until such feature is implemented (or not), I made a simple code for changing the label's Y position, based on whether the its length is less than its Width or above it.
Gal Shemesh,
goldeng

SMF spam blocked by CleanTalk