Forráskód Böngészése

Update GDscript operators. (#1645)

* Update GDscript operators.

Fixes #1524

* Change $ to be shorthand for get_node()

* Added missing code tags
FeralBytes 7 éve
szülő
commit
32d0fe5465
1 módosított fájl, 23 hozzáadás és 17 törlés
  1. 23 17
      getting_started/scripting/gdscript/gdscript_basics.rst

+ 23 - 17
getting_started/scripting/gdscript/gdscript_basics.rst

@@ -252,7 +252,7 @@ The following is the list of supported operators and their precedence.
 +---------------------------------------------------------------+-----------------------------------------+
 | ``~``                                                         | Bitwise NOT                             |
 +---------------------------------------------------------------+-----------------------------------------+
-| ``-x``                                                        | Negative                                |
+| ``-x``                                                        | Negative / Unary Negation               |
 +---------------------------------------------------------------+-----------------------------------------+
 | ``*`` ``/`` ``%``                                             | Multiplication / Division / Remainder   |
 |                                                               |                                         |
@@ -264,8 +264,12 @@ The following is the list of supported operators and their precedence.
 |                                                               | operands is a float, then the result is |
 |                                                               | a float: float(1)/10 or 1.0/10 return   |
 |                                                               | both 0.1.                               |
+|                                                               | NOTE2: Remainder/Modulo only works on   |
+|                                                               | int. For floats use built in fmod()     |
 +---------------------------------------------------------------+-----------------------------------------+
-| ``+`` ``-``                                                   | Addition / Subtraction                  |
+| ``+``                                                         | Addition / Concatenation of Arrays      |
++---------------------------------------------------------------+-----------------------------------------+
+| ``-``                                                         | Subtraction                             |
 +---------------------------------------------------------------+-----------------------------------------+
 | ``<<`` ``>>``                                                 | Bit Shifting                            |
 +---------------------------------------------------------------+-----------------------------------------+
@@ -293,21 +297,23 @@ The following is the list of supported operators and their precedence.
 Literals
 ~~~~~~~~
 
-+--------------------------+--------------------------------+
-| **Literal**              | **Type**                       |
-+--------------------------+--------------------------------+
-| ``45``                   | Base 10 integer                |
-+--------------------------+--------------------------------+
-| ``0x8F51``               | Base 16 (hex) integer          |
-+--------------------------+--------------------------------+
-| ``3.14``, ``58.1e-10``   | Floating point number (real)   |
-+--------------------------+--------------------------------+
-| ``"Hello"``, ``"Hi"``    | Strings                        |
-+--------------------------+--------------------------------+
-| ``"""Hello"""``          | Multiline string               |
-+--------------------------+--------------------------------+
-| ``@"Node/Label"``        | NodePath or StringName         |
-+--------------------------+--------------------------------+
++--------------------------+----------------------------------------+
+| **Literal**              | **Type**                               |
++--------------------------+----------------------------------------+
+| ``45``                   | Base 10 integer                        |
++--------------------------+----------------------------------------+
+| ``0x8F51``               | Base 16 (hex) integer                  |
++--------------------------+----------------------------------------+
+| ``3.14``, ``58.1e-10``   | Floating point number (real)           |
++--------------------------+----------------------------------------+
+| ``"Hello"``, ``"Hi"``    | Strings                                |
++--------------------------+----------------------------------------+
+| ``"""Hello"""``          | Multiline string                       |
++--------------------------+----------------------------------------+
+| ``@"Node/Label"``        | NodePath or StringName                 |
++--------------------------+----------------------------------------+
+| ``$NodePath``            | Shorthand for ``get_node("NodePath")`` |
++--------------------------+----------------------------------------+
 
 Comments
 ~~~~~~~~