diff --git a/tutorials/ui/bbcode_in_richtextlabel.rst b/tutorials/ui/bbcode_in_richtextlabel.rst index 24b1a4c93c1..a0a900017d9 100644 --- a/tutorials/ui/bbcode_in_richtextlabel.rst +++ b/tutorials/ui/bbcode_in_richtextlabel.rst @@ -1147,3 +1147,26 @@ This will add a few new BBCode commands, which can be used like so: [center][ghost]This is a custom [matrix]effect[/matrix][/ghost] made in [pulse freq=5.0 height=2.0][pulse color=#00FFAA freq=2.0]GDScript[/pulse][/pulse].[/center] + +Printing rich text to the console +--------------------------------- + +Using :ref:`print_rich`, you can print +rich text to the editor Output panel and standard output (visible when the user +runs the project from a terminal). This works by converting the BBCode to +`ANSI escape codes `__ that the +terminal understands. + +In the editor output, all BBCode tags are recognized as usual. In the terminal +output, only a subset of BBCode tags will work, as documented in the linked +``print_rich()`` method description above. In the terminal, the colors will look +different depending on the user's theme, while colors in the editor will use the +same colors as they would in the project. + +.. note:: + + To print error and warning messages that can be filtered by type in the + editor Output panel, use + :ref:`@GlobalScope.push_error` and + :ref:`@GlobalScope.push_warning` + instead of ``print_rich()``.