Random beginner-question: bbcode for part of already bbcoded text

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By pferft

Hi everyone,

only a couple of numbers and one comma can be entered into my RichTextLabel. It’s bbcoded quite a bit (align right, change color at a certain number of digits, some offset for the first digit and such things…). There are several different bbcode-templates kicking in on different occasions.

Now I want that comma to have an extra offset, so I wonder if it’s possible to apply bbcode to an already bbcoded text, as “layering another bbcode on top”, or “have two bbcodes running on the same thing simultaneously”. Because adding some extra comma-offset into each of the templates seems unpractical to me.

I’m thinking about something like

var templateCommaHigher = "[offset x=0 y=15]{CommaHigher}[/offset]"
var comma = text.find(",")
if comma:
	bbcode_text.comma = templateCommaHigher.format({ "commaHigher" : text })

so this addresses only the comma no matter which other template is already on. Is that possible?