classref: Sync with latest 4.0-alpha

This commit is contained in:
Rémi Verschelde
2022-03-11 13:46:38 +01:00
parent 664f6a1cbd
commit c80ee83362
98 changed files with 2514 additions and 1298 deletions

View File

@@ -299,8 +299,8 @@ Returns an array with the given range. Range can be 1 argument ``N`` (0 to ``N``
Returns an array with the given range. ``range()`` can have 1 argument N (``0`` to ``N - 1``), two arguments (``initial``, ``final - 1``) or three arguments (``initial``, ``final - 1``, ``increment``). ``increment`` can be negative. If ``increment`` is negative, ``final - 1`` will become ``final + 1``. Also, the initial value must be greater than the final value for the loop to run.
::
\ ``range()(/code] converts all arguments to :ref:`int<class_int>` before processing.
[codeblock]
print(range(4))
print(range(2, 5))
print(range(0, 6, 2))
@@ -331,6 +331,21 @@ Output:
6
3
To iterate over :ref:`float<class_float>`, convert them in the loop.
::
for i in range (3, 0, -1):
print(i / 10.0)
Output:
::
0.3
0.2
0.1
----
.. _class_@GDScript_method_str: