You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently working on a text-driven game. Part horror investigation, par turn-based RPG. Text formatting is absolutely essential because there are almost no images, all interactions happen with the text, and all the information is held in the text while being highlighted in proper ways in order to guide the player. Also, all the events that take place during play happen, you guessed it, to the text.
Describe the problem or limitation you are having in your project
I need a way to bring forward certain words in the text. I need them as eye-popping as possible.
Also, and this is a related addition, I need to be able to dynamically obscure text. Some displayed texts need to be obscured when the player is missing information.
All this without using an image of a text, since text is generated, and I need it to be dynamic (be able to change the content in real time and modify the style of individual words, and be able to have parts of it hoverable and clickable).
Describe how this feature / enhancement will help you overcome this problem or limitation
Highlighting text is arguably the most eye-popping text styling option. It is a great way to bring forward crucial information, like enemy names in my game.
Redacted text is part of investigation visual tropes, that's why I'm looking to reproduce it, and am choosing it as the way my game will obscure parts of a text.
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work
Highlighted text:
Redacted text :
Describe implementation detail for your proposal (in code), if possible
Unfortunately, I'm not familiar enough with the inner working of text styling in the Godot source. But hightlighting could be a BBCode tag. Or perhaps RichTextEffect could take care of this. Since highlighting is actually painting the background of a character, BBCode tags for highlighting could look like this:
[background=yellow]highlighted text[/background]
or [bgcolor=yellow]highlighted text[/background] which seems more common.
As for redacted text: [redacted]redactedtext[/redacted]
Which would paint a black color over the text. And would probably need to remove the actual characters, so they can't in any way be selected. It is basically the same as highlighting, but color is painted over the text, and not under it. So we could also make it more generic: [overlay=black]redacted text[/overlay]
I tried using a RichTextEffect to replace tagged letters with the full block character █ but no luck: there's space displayed instead of the characters. And replacing the letters this way does not remove them (selecting, copying and pasting reveals they are still there).
If this enhancement will not be used often, can it be worked around with a few lines of script?
Probably not. At least, I don't see how you could alter the background color of certain characters within a text node using only scripts.
Is there a reason why this should be core and not an add-on in the asset library?
If there's a way to make this into an addon, I don't see why not. But it's not a heavy addition, and only expands upon common text styling options to make RichTextLabel more versatile.
The text was updated successfully, but these errors were encountered:
CawawaC
changed the title
RichTextLabel missing features
RichTextLabel additional features
Jan 8, 2020
@CawawaCgodotengine/godot#35608 added foreground and background text for RichTextLabel, however the "redacted" text needs some workarounds to be unselectable. Does that satisfy the proposal though?
Describe the project you are working on
I'm currently working on a text-driven game. Part horror investigation, par turn-based RPG. Text formatting is absolutely essential because there are almost no images, all interactions happen with the text, and all the information is held in the text while being highlighted in proper ways in order to guide the player. Also, all the events that take place during play happen, you guessed it, to the text.
Describe the problem or limitation you are having in your project
I need a way to bring forward certain words in the text. I need them as eye-popping as possible.
Also, and this is a related addition, I need to be able to dynamically obscure text. Some displayed texts need to be obscured when the player is missing information.
All this without using an image of a text, since text is generated, and I need it to be dynamic (be able to change the content in real time and modify the style of individual words, and be able to have parts of it hoverable and clickable).
Describe how this feature / enhancement will help you overcome this problem or limitation
Highlighting text is arguably the most eye-popping text styling option. It is a great way to bring forward crucial information, like enemy names in my game.
Redacted text is part of investigation visual tropes, that's why I'm looking to reproduce it, and am choosing it as the way my game will obscure parts of a text.
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work
Highlighted text:
Redacted text :
Describe implementation detail for your proposal (in code), if possible
Unfortunately, I'm not familiar enough with the inner working of text styling in the Godot source. But hightlighting could be a BBCode tag. Or perhaps
RichTextEffect
could take care of this. Since highlighting is actually painting the background of a character, BBCode tags for highlighting could look like this:[background=yellow]highlighted text[/background]
or
[bgcolor=yellow]highlighted text[/background]
which seems more common.As for redacted text:
[redacted]redactedtext[/redacted]
Which would paint a black color over the text. And would probably need to remove the actual characters, so they can't in any way be selected. It is basically the same as highlighting, but color is painted over the text, and not under it. So we could also make it more generic:
[overlay=black]redacted text[/overlay]
I tried using a
RichTextEffect
to replace tagged letters with the full block character █ but no luck: there's space displayed instead of the characters. And replacing the letters this way does not remove them (selecting, copying and pasting reveals they are still there).If this enhancement will not be used often, can it be worked around with a few lines of script?
Probably not. At least, I don't see how you could alter the background color of certain characters within a text node using only scripts.
Is there a reason why this should be core and not an add-on in the asset library?
If there's a way to make this into an addon, I don't see why not. But it's not a heavy addition, and only expands upon common text styling options to make
RichTextLabel
more versatile.The text was updated successfully, but these errors were encountered: