mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
tutorials/scripting: Mention % literal syntax
It was unclear to me what that '%' literal syntax does, add examples in the appropriate places.
This commit is contained in:
@@ -289,27 +289,29 @@ The following is the list of supported operators and their precedence.
|
||||
Literals
|
||||
~~~~~~~~
|
||||
|
||||
+--------------------------+----------------------------------------+
|
||||
| **Literal** | **Type** |
|
||||
+--------------------------+----------------------------------------+
|
||||
| ``45`` | Base 10 integer |
|
||||
+--------------------------+----------------------------------------+
|
||||
| ``0x8f51`` | Base 16 (hexadecimal) integer |
|
||||
+--------------------------+----------------------------------------+
|
||||
| ``0b101010`` | Base 2 (binary) integer |
|
||||
+--------------------------+----------------------------------------+
|
||||
| ``3.14``, ``58.1e-10`` | Floating-point number (real) |
|
||||
+--------------------------+----------------------------------------+
|
||||
| ``"Hello"``, ``'Hi'`` | Strings |
|
||||
+--------------------------+----------------------------------------+
|
||||
| ``"""Hello"""`` | Multiline string |
|
||||
+--------------------------+----------------------------------------+
|
||||
| ``&"name"`` | :ref:`StringName <class_StringName>` |
|
||||
+--------------------------+----------------------------------------+
|
||||
| ``^"Node/Label"`` | :ref:`NodePath <class_NodePath>` |
|
||||
+--------------------------+----------------------------------------+
|
||||
| ``$NodePath`` | Shorthand for ``get_node("NodePath")`` |
|
||||
+--------------------------+----------------------------------------+
|
||||
+--------------------------+-------------------------------------------+
|
||||
| **Literal** | **Type** |
|
||||
+--------------------------+-------------------------------------------+
|
||||
| ``45`` | Base 10 integer |
|
||||
+--------------------------+-------------------------------------------+
|
||||
| ``0x8f51`` | Base 16 (hexadecimal) integer |
|
||||
+--------------------------+-------------------------------------------+
|
||||
| ``0b101010`` | Base 2 (binary) integer |
|
||||
+--------------------------+-------------------------------------------+
|
||||
| ``3.14``, ``58.1e-10`` | Floating-point number (real) |
|
||||
+--------------------------+-------------------------------------------+
|
||||
| ``"Hello"``, ``'Hi'`` | Strings |
|
||||
+--------------------------+-------------------------------------------+
|
||||
| ``"""Hello"""`` | Multiline string |
|
||||
+--------------------------+-------------------------------------------+
|
||||
| ``&"name"`` | :ref:`StringName <class_StringName>` |
|
||||
+--------------------------+-------------------------------------------+
|
||||
| ``^"Node/Label"`` | :ref:`NodePath <class_NodePath>` |
|
||||
+--------------------------+-------------------------------------------+
|
||||
| ``$NodePath`` | Shorthand for ``get_node("NodePath")`` |
|
||||
+--------------------------+-------------------------------------------+
|
||||
| ``%UniqueNode`` | Shorthand for ``get_node("%UniqueNode")`` |
|
||||
+--------------------------+-------------------------------------------+
|
||||
|
||||
Integers and floats can have their numbers separated with ``_`` to make them more readable.
|
||||
The following ways to write numbers are all valid::
|
||||
|
||||
Reference in New Issue
Block a user