Page 1 of 1

Special text formatting/markup/bbcode

Posted: Fri Jan 14, 2022 12:43 pm
by Gunroar:Cannon()
Is that what it's called?
Is there a way to make a special format option to change text colors (and fonts? Fints aren't that inportant) on the fly, in a function that overwrites love.graphics.print/printf?

Image
Yeah right!

https://kivy.org/doc/stable/api-kivy.co ... arkup.html

Re: Special text formatting/markup/bbcode

Posted: Fri Jan 14, 2022 1:39 pm
by Nikki
in https://love2d.org/wiki/love.graphics.printf there are already options to change text colors within a single call

Code: Select all

 love.graphics.printf({{1,0,0},"red pill " , {0,0,1}, " blue pill"}, 25,25, 200)
there are more options to that call:

Code: Select all

limit, align, angle, sx, sy, ox, oy, kx, ky 
but they will be applied to all the text in the call

edit: seems https://love2d.org/wiki/Text:addf could be uses to add newly formatted text onto existing

Re: Special text formatting/markup/bbcode

Posted: Fri Jan 14, 2022 4:04 pm
by Gunroar:Cannon()
Oh, ok. Thank you. It's not as fancy as others but I guess it will do :)

Re: Special text formatting/markup/bbcode

Posted: Fri Jan 14, 2022 7:32 pm
by Froyok
Gunroar:Cannon() wrote: Fri Jan 14, 2022 12:43 pm Is that what it's called?
To answer you first question, in case you want to dive further into the subject, in UI terminology this is called "rich text".

Some examples:

Re: Special text formatting/markup/bbcode

Posted: Fri Jan 14, 2022 7:42 pm
by Gunroar:Cannon()
Ahhh, yes.
Image
*rich*

But, really, thanks. I should have pieced that together (from rich text editors, rich text files, etc.) :ultrahappy: