ImpulseAdventure / GUIslice-Builder

Cross-platform drag & drop GUI builder for GUIslice
Other
166 stars 35 forks source link

Use multiline text for text button #147

Closed daybyter closed 2 years ago

daybyter commented 3 years ago

Hi!

Just tried to use a text like "line1\nline2" for a button, but it seems the guislice builder doesn't wrap the text as I would expect it?

Is there some feature, that has to be checked for this feature to be enabled?

Thanks in advance, Andreas

Pconti31 commented 3 years ago

No. Its just not currently supported by the Builder. The multiple lines do work with Adafruit's GFX but not with all drivers that GUIslice API supports. TFT_eSPI for example just eats the newline. I'll consider this for a future release.

MikeyMoMo commented 2 years ago

I need this now for a project. I hope it can be added soon.

Pconti31 commented 2 years ago

@MikeyMoMo Checked in support Release 0.17.b03. Tested using Arduino mega and Adafruit GFX libraries. NOTE: Sizing of a Text button using multiple lines of text is the users responsibility. You will need to set the height and width manually. Ending each line inside the Label with \n. Example, "line1\nline2\nline3". The Builder will remove each \n and replace with a decimal 10 (newline) when you press enter key.

I attached a zip file the sample I created for testing.

ex_multiline.zip

Paul--

MikeyMoMo commented 2 years ago

Sizing the button manually is not a problem. I do that already. I will check out the code you sent. Thanks.

I thought this had not been implemented since there was no update on the issue post.

On Sat, Jan 29, 2022, 3:27 AM Paul Conti @.***> wrote:

Closed #147 https://github.com/ImpulseAdventure/GUIslice-Builder/issues/147.

— Reply to this email directly, view it on GitHub https://github.com/ImpulseAdventure/GUIslice-Builder/issues/147#event-5972895869, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADYPSIIDWJ2SIJ6JHTEFHE3UYLU2TANCNFSM4VYJLY5A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.*** .com>

Pconti31 commented 2 years ago

@MikeyMoMo Actually, I only implemented this yesterday after I saw your post. It's not perfect and its not very well tested but hopefully you can use it. Paul--