Use existing Rich Text Effects in a custom one

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

So, as you probably know, you can enable Bbcode on a RichTextLabel.
Some examples of that are [b] [i] etc.
The thing is, I want to make a custom one, to be a preset of some of there, and maybe some changes. [b] + [i] + a custom effect.

I dont want to have to add all the tags each time that I want to use that, but a custom one that applies all those effects. For example
[custom_one] The text [/custom_one]
being the same as
[i][another] The text [/i][/another]

I find it even more important when you are passing parameters.

Is that possible?

:bust_in_silhouette: Reply From: spaceyjase

You can create custom effects as noted in the docs: BBCode in RichTextLabel — Godot Engine (stable) documentation in English

Note the example [matrix]text[/matrix], backed by a method to implement the effect. I figure you can have a [customtag]text[/customtag] that implements your defaults.

Good luck!

Yes. I know about custom effects thanks. The problem is having a collection of those elements being called at the same time by just one tag.

I created a new proposal for it: Add a BBCode collection of tags · Issue #6560 · godotengine/godot-proposals · GitHub

axvemi | 2023-03-25 13:17

I see, that’s cool and was my other suggestion. In a current project, there’s a custom resource that inherits from the rich text node with appropriate text fields. This references a constant class with the tag definitions in another resource; essentially what you’re proposing be built into the engine.

spaceyjase | 2023-03-25 13:49