summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorVoylin <0voylin0@gmail.com>2022-05-03 08:29:38 +0900
committerVoylin <0voylin0@gmail.com>2022-06-29 00:41:29 +0900
commitc6291bcd8a49055ce2158f88759a487de5b8d1bd (patch)
treef7fed88c41db90a5af0e1cf1165d1f0e1fbb1ea8 /doc/classes
parent622b656c40f9d8d9c8fdd45d6727f416952636d7 (diff)
Adding print_rich for printing with BBCode
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/@GlobalScope.xml10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index 1a0253a28b..1943221309 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -657,6 +657,16 @@
[b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print]. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed.
</description>
</method>
+ <method name="print_rich" qualifiers="vararg">
+ <description>
+ Converts one or more arguments of any type to string in the best way possible and prints them to the console. The following BBCode tags are supported: b, i, u, s, indent, code, url, center, right, color, bgcolor, fgcolor. Color tags only support named colors such as [code]red[/code], [i]not[/i] hexadecimal color codes. Unsupported tags will be left as-is in standard output.
+ When printing to standard output, the supported subset of BBCode is converted to ANSI escape codes for the terminal emulator to display. Displaying ANSI escape codes is currently only supported on Linux and macOS. Support for ANSI escape codes may vary across terminal emulators, especially for italic and strikethrough.
+ [codeblock]
+ print_rich("[code][b]Hello world![/b][/code]") # Prints out: [b]Hello world![/b]
+ [/codeblock]
+ [b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print] or [method print_rich]. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed.
+ </description>
+ </method>
<method name="print_verbose" qualifiers="vararg">
<description>
If verbose mode is enabled ([method OS.is_stdout_verbose] returning [code]true[/code]), converts one or more arguments of any type to string in the best way possible and prints them to the console.