Topic was automatically imported from the old Question2Answer platform.
Asked By
pferft
Hi everyone,
I have two templates set up in a RichTextLabel:
var templateAlwaysAllRight = "[right]{alwaysAllRight}[/right]"
var templateGap = "[right][offset x=-10 y=0]{firstDigit}[/offset]{remainingDigits}[/right]"
The first one works wonderfully. But the second one (supposed to separate the first digit a bit from the rest) doesn’t, instead it actually displays “[offset x=-10 y=0]{firstDigit}[/offset]{remainingDigits}” directly in the label. It does right-align though!
I believe it’s with your parameter in the second one.
In your example you are providing 2 parameters (dictionaries) instead of one dictionary with two elements.
Although I’m positive that you are right, unfortunately this still doesn’t solve the issue. For whatever reason the format-text still appears in the label. Any other hint is much appreciated.
pferft | 2022-03-28 21:43
Ok, I checked this out in Godot itself this time and got it working.
offset does not exist as a bbcode tag, but can be implemented as a custom tag.
You can see a code file for “RichTextOffset” in that post.
Afterwards on your richtextlabel you have to add this extra tag.
In the inspector find the “custom effects” and add the Richtextoffset.
That should do it.
aipie | 2022-03-29 17:59
It’s rather funny that you linked my own post from over a year ago, isn’t it? So technically I should have been able to make things work, but for whatever reason this time I wasn’t, so there must be something else going on. I’ll find out, thanks for your help!