-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.x] Support multiline strings in buttons #41464
Conversation
458fde4
to
8b5747b
Compare
This information really should have been supplied in the original issue so that people don't waste there time trying to fix something that is never going to get merged |
8b5747b
to
7642d2a
Compare
Since I've been working with 3.2 anyway, I just switched this PR to the changes I've been working with. |
Actually I just noticed that this was for 3.x branch, sorry. The issue still exists in there. |
71cb8d3
to
c58391c
Compare
fb73258
to
d57495f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and it works, code looks good overall (left some minor comments).
Needs a check from @bruvzg probably, for the String methods. I'm not sure about the \r
thing.
d57495f
to
8defa0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about adding String::split_lines
and Font::get_multiline_string_size
for a single use. Otherwise, code looks fine.
Would they potentially be worth exporting and documenting for users in GDScript? Or should I just inline them? |
Do we even need |
8defa0f
to
199f3d9
Compare
You're right, looks like all the places that deal with |
Thanks! |
Added new
String::split_lines
andFont::get_multiline_string_size
methods to make this and possible future features easier. Then I simply put the button text rendering logic in a for loop that loops over each line. Perhaps there's a more efficient method for rendering a block of text, but this changed as little code as possible, and I tried to make sure it was as efficient as I could.Fixes #2967