Sign post: Wrap long lines - #2891
Conversation
Give the label a maximum horizontal size of 300, and keep -1 for the maximum vertical size. Also change autowrap mode to "Words", and reset vertical and alignment to the default (top). Give the LabelContainer (the first Control node) a custom minimum size of 320 x 32. This is in the X axis, the max size of the label plus the horizontal margins (10 on each side). And on the Y axis, the size of a line of text plus the vertical margins (5 on each side). And to allow smaller sizes (for example a signpost saying "Go!"), set the horizontal container sizing of the PanelContainer child to Shrink Center.
As a test of how this looks, before changing all of it in batch.
This was making the signpost panel look odd.
|
Play this branch at https://play.threadbare.game/branches/endlessm/signposts-wrap-lines/. (This launches the game from the start, not directly at the change(s) in this pull request.) |
| direction = 1 | ||
| text = "Go! | ||
| " | ||
| text = "Go!" |
wjt
left a comment
There was a problem hiding this comment.
Nice improvement!
If the message is really long then the label ends up obscuring the signpost. One way to solve this would be to make the label grow upwards. I think this could be done by adjusting the anchor/pivot position of the controls, though I tried and failed to make it work. However the real solution is “Don't do that”. For longer text, the sign could be made interactible and the text could be shown as dialogue.
Good point! We can revisit the anchoring. I was even considering adding an InteractArea plus a TalkBehavior to signposts and use the dialogue bubble for displaying the text. Maybe we can consider further changes in the future, for now I wanted to unblock the Spanish translation of Dev Archipelago. |





Give the label a maximum horizontal size of 300, and keep -1 for the maximum
vertical size. Also change autowrap mode to "Words", and reset vertical and
alignment to the default (top).
Give the LabelContainer (the first Control node) a custom minimum size of 320 x
32. This is in the X axis, the max size of the label plus the horizontal margins
(10 on each side). And on the Y axis, the size of a line of text plus the
vertical margins (5 on each side). And to allow smaller sizes (for example a
signpost saying "Go!"), set the horizontal container sizing of the
PanelContainer child to Shrink Center.
Dev Basics: Remove line breaks from text in signposts
As a test of how this looks, before changing all of it in batch.
Update Spanish translation.
Fix #2843