@@ -15,10 +15,21 @@ Print text
15
15
// Prints a message to standard output.
16
16
print_line("Message");
17
17
18
+ // Non-String arguments are automatically converted to String for printing.
19
+ // If passing several arguments, they will be concatenated together with a
20
+ // space between each argument.
21
+ print_line("There are", 123, "nodes");
22
+
18
23
// Prints a message to standard output, but only when the engine
19
24
// is started with the `--verbose` command line argument.
20
25
print_verbose("Message");
21
26
27
+ // Prints a rich-formatted message using BBCode to standard output.
28
+ // This supports a subset of BBCode tags supported by RichTextLabel
29
+ // and will also appear formatted in the editor Output panel.
30
+ // On Windows, this requires Windows 10 or later to work in the terminal.
31
+ print_line_rich("[b]Bold[/b], [color=red]Red text[/color]")
32
+
22
33
// Prints a formatted error or warning message with a trace.
23
34
ERR_PRINT("Message");
24
35
WARN_PRINT("Message");
@@ -54,15 +65,16 @@ makes for more readable code.
54
65
Convert an integer or float to a string
55
66
---------------------------------------
56
67
57
- This is mainly useful when printing numbers directly.
68
+ This is not needed when printing numbers using ``print_line() ``, but you may
69
+ still need to perform manual conversion for some other use cases.
58
70
59
71
.. code-block :: cpp
60
72
61
- // Prints "42" using integer-to-string conversion.
62
- print_line( itos(42) );
73
+ // Stores the string "42" using integer-to-string conversion.
74
+ String int_to_string = itos(42);
63
75
64
- // Prints "123.45" using real-to-string conversion.
65
- print_line( rtos(123.45) );
76
+ // Stores the string "123.45" using real-to-string conversion.
77
+ String real_to_string = rtos(123.45);
66
78
67
79
Internationalize a string
68
80
-------------------------
0 commit comments