I've read in Godot 4.0 there is a [bgcolor] BBCode tag. I've also read Godot 4.0 isn't entirely stable.
Before I decide to migrate this massive project for a single BBcode tag, have you any ideas to hack the same effect into Godot 3.5.1?
The closest equivalent I've found is Block Mode Caret in the TextEdit node.
Share methods to draw a background color behind characters
- Edited
packrat have you any ideas to hack the same effect into Godot 3.5.1?
If it's static text that doesn't change at runtime, you could use an image texture instead of a RichTextLabel.
Alternatively, convince someone to backport it into 3.6 or 3.7.
- Edited
DaveTheCoder backport it into 3.6 or 3.7
if this question sucks, forgive me for I have sinned:
on a scale: 1(easy) -- 10(impossible): how difficult would backporting be?
- Edited
It depends on how that feature is implemented. If it's just a matter of adding a few lines in a file or two, it should be easy.
I don't know enough about the source code to figure that out.
But this looks like the place to start:
https://github.com/godotengine/godot/blob/master/scene/gui/rich_text_label.cpp
An add-on might also be a possibility.
- Edited
I am a genius.
A Label or RichTextLabel can be duplicated and placed above the first Label/RichTextLabel on the tree.
It can then be modulated to any color, assuming the original font color is #ffffff.
Then, assuming a compatible monospaced font, a script can copy the text of the first Label to the background Label, and replace every character, excluding newline, with █(Unicode: U+2588).
The default Godot font, besides not being monospaced, does not support that unicode character.
This may be my hackiest work yet, and I'm unashamed.
I am always open to more solutions. This hack is very limited:
- One color per RichTextLabel. More Colors == More Nodes == More overhead
- Monospace style fonts only
- Font must support █ U+2588
- No anti-aliasing
- Plenty of string processing.