mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
Sync classref with 4.5 branch
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Area2D.xml.
|
||||
.. meta::
|
||||
:keywords: trigger
|
||||
|
||||
.. _class_Area2D:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Area3D.xml.
|
||||
.. meta::
|
||||
:keywords: trigger
|
||||
|
||||
.. _class_Area3D:
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Array
|
||||
Описание
|
||||
----------------
|
||||
|
||||
Структура данных массива, которая может содержать последовательность элементов любого типа :ref:`Variant<class_Variant>`. Доступ к элементам осуществляется по числовому индексу, начиная с ``0``. Отрицательные индексы используются для отсчета с конца (``-1`` — последний элемент, ``-2`` — предпоследний и т. д.).
|
||||
An array data structure that can contain a sequence of elements of any :ref:`Variant<class_Variant>` type by default. Values can optionally be constrained to a specific type by creating a *typed array*. Elements are accessed by a numerical index starting at ``0``. Negative indices are used to count from the back (``-1`` is the last element, ``-2`` is the second to last, etc.).
|
||||
|
||||
|
||||
.. tabs::
|
||||
@@ -28,6 +28,10 @@ Array
|
||||
print(array[1]) # Prints "Second"
|
||||
print(array[-3]) # Prints "Second"
|
||||
|
||||
# This typed array can only contain integers.
|
||||
# Attempting to add any other type will result in an error.
|
||||
var typed_array: Array[int] = [1, 2, 3]
|
||||
|
||||
.. code-tab:: csharp
|
||||
|
||||
Godot.Collections.Array array = ["First", 2, 3, "Last"];
|
||||
@@ -39,13 +43,17 @@ Array
|
||||
GD.Print(array[1]); // Prints "Second"
|
||||
GD.Print(array[^3]); // Prints "Second"
|
||||
|
||||
// This typed array can only contain integers.
|
||||
// Attempting to add any other type will result in an error.
|
||||
Godot.Collections.Array<int> typedArray = [1, 2, 3];
|
||||
|
||||
|
||||
\ **Примечание:** Массивы всегда передаются по **ссылке**. Чтобы получить копию массива, которую можно изменять независимо от исходного массива, используйте :ref:`duplicate()<class_Array_method_duplicate>`.
|
||||
|
||||
\ **Примечание:** Стирание элементов при итерации по массивам **не** поддерживается и приведет к непредсказуемому поведению.
|
||||
\ **Note:** Arrays are always passed by **reference**. To get a copy of an array that can be modified independently of the original array, use :ref:`duplicate()<class_Array_method_duplicate>`.
|
||||
|
||||
\ **Различия между упакованными массивами, типизированными массивами и нетипизированными массивами:** Упакованные массивы, как правило, быстрее итерируются и изменяются по сравнению с типизированным массивом того же типа (например, :ref:`PackedInt64Array<class_PackedInt64Array>` по сравнению с ``Array[int]``). Кроме того, упакованные массивы потребляют меньше памяти. Недостатком упакованных массивов является то, что они менее гибкие, поскольку не предлагают столько удобных методов, как :ref:`map()<class_Array_method_map>`. Типизированные массивы, в свою очередь, быстрее итерируются и изменяются, чем нетипизированные массивы.
|
||||
\ **Note:** Erasing elements while iterating over arrays is **not** supported and will result in unpredictable behavior.
|
||||
|
||||
\ **Differences between packed arrays, typed arrays, and untyped arrays:** Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. :ref:`PackedInt64Array<class_PackedInt64Array>` versus ``Array[int]``). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as :ref:`map()<class_Array_method_map>`. Typed arrays are in turn faster to iterate on and modify than untyped arrays.
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioListener2D.xml.
|
||||
.. meta::
|
||||
:keywords: sound
|
||||
|
||||
.. _class_AudioListener2D:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioListener3D.xml.
|
||||
.. meta::
|
||||
:keywords: sound
|
||||
|
||||
.. _class_AudioListener3D:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioStreamPlayer.xml.
|
||||
.. meta::
|
||||
:keywords: sound, music, song
|
||||
|
||||
.. _class_AudioStreamPlayer:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioStreamPlayer2D.xml.
|
||||
.. meta::
|
||||
:keywords: sound, sfx
|
||||
|
||||
.. _class_AudioStreamPlayer2D:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioStreamPlayer3D.xml.
|
||||
.. meta::
|
||||
:keywords: sound, sfx
|
||||
|
||||
.. _class_AudioStreamPlayer3D:
|
||||
|
||||
|
||||
@@ -366,13 +366,13 @@ Basis
|
||||
|
||||
:ref:`float<class_float>` **determinant**\ (\ ) |const| :ref:`🔗<class_Basis_method_determinant>`
|
||||
|
||||
Возвращает `определитель <https://en.wikipedia.org/wiki/Determinant>`__ матрицы этого базиса. Для продвинутой математики это число может использоваться для определения нескольких атрибутов:
|
||||
Returns the `determinant <https://en.wikipedia.org/wiki/Determinant>`__ of this basis's matrix. For advanced math, this number can be used to determine a few attributes:
|
||||
|
||||
- Если определитель равен точно ``0.0``, базис необратим (см. :ref:`inverse()<class_Basis_method_inverse>`).
|
||||
- If the determinant is exactly ``0.0``, the basis is not invertible (see :ref:`inverse()<class_Basis_method_inverse>`).
|
||||
|
||||
- Если определитель — отрицательное число, базис представляет собой отрицательный масштаб.
|
||||
- If the determinant is a negative number, the basis represents a negative scale.
|
||||
|
||||
\ **Примечание:** Если масштаб базиса одинаков для каждой оси, его определитель всегда равен этому масштабу в степени 2.
|
||||
\ **Note:** If the basis's scale is the same for every axis, its determinant is always that scale by the power of 3.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/BoneAttachment3D.xml.
|
||||
.. meta::
|
||||
:keywords: tag
|
||||
|
||||
.. _class_BoneAttachment3D:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ButtonGroup.xml.
|
||||
.. meta::
|
||||
:keywords: radio
|
||||
|
||||
.. _class_ButtonGroup:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/CanvasModulate.xml.
|
||||
.. meta::
|
||||
:keywords: color
|
||||
|
||||
.. _class_CanvasModulate:
|
||||
|
||||
|
||||
@@ -439,7 +439,9 @@ enum **PlatformOnLeave**: :ref:`🔗<enum_CharacterBody2D_PlatformOnLeave>`
|
||||
- |void| **set_velocity**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
|
||||
- :ref:`Vector2<class_Vector2>` **get_velocity**\ (\ )
|
||||
|
||||
Текущий вектор скорости в пикселях в секунду, используемый и изменяемый во время вызовов :ref:`move_and_slide()<class_CharacterBody2D_method_move_and_slide>`.
|
||||
Current velocity vector in pixels per second, used and modified during calls to :ref:`move_and_slide()<class_CharacterBody2D_method_move_and_slide>`.
|
||||
|
||||
This property should not be set to a value multiplied by ``delta``, because this happens internally in :ref:`move_and_slide()<class_CharacterBody2D_method_move_and_slide>`. Otherwise, the simulation will run at an incorrect speed.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -702,15 +704,17 @@ enum **PlatformOnLeave**: :ref:`🔗<enum_CharacterBody2D_PlatformOnLeave>`
|
||||
|
||||
:ref:`bool<class_bool>` **move_and_slide**\ (\ ) :ref:`🔗<class_CharacterBody2D_method_move_and_slide>`
|
||||
|
||||
Перемещает тело на основе :ref:`velocity<class_CharacterBody2D_property_velocity>`. Если тело сталкивается с другим, оно будет скользить вдоль другого тела (по умолчанию только по полу), а не останавливаться немедленно. Если другое тело — **CharacterBody2D** или :ref:`RigidBody2D<class_RigidBody2D>`, оно также будет затронуто движением другого тела. Вы можете использовать это, чтобы создавать движущиеся и вращающиеся платформы или заставлять узлы толкать другие узлы.
|
||||
Moves the body based on :ref:`velocity<class_CharacterBody2D_property_velocity>`. If the body collides with another, it will slide along the other body (by default only on floor) rather than stop immediately. If the other body is a **CharacterBody2D** or :ref:`RigidBody2D<class_RigidBody2D>`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
|
||||
|
||||
Изменяет :ref:`velocity<class_CharacterBody2D_property_velocity>`, если произошло столкновение слайда. Чтобы получить последнее столкновение, вызовите :ref:`get_last_slide_collision()<class_CharacterBody2D_method_get_last_slide_collision>`, для получения подробной информации о произошедших столкновениях используйте :ref:`get_slide_collision()<class_CharacterBody2D_method_get_slide_collision>`.
|
||||
This method should be used in :ref:`Node._physics_process()<class_Node_private_method__physics_process>` (or in a method called by :ref:`Node._physics_process()<class_Node_private_method__physics_process>`), as it uses the physics step's ``delta`` value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
|
||||
|
||||
Когда тело касается движущейся платформы, скорость платформы автоматически добавляется к движению тела. Если столкновение происходит из-за движения платформы, оно всегда будет первым в столкновениях скольжения.
|
||||
Modifies :ref:`velocity<class_CharacterBody2D_property_velocity>` if a slide collision occurred. To get the latest collision call :ref:`get_last_slide_collision()<class_CharacterBody2D_method_get_last_slide_collision>`, for detailed information about collisions that occurred, use :ref:`get_slide_collision()<class_CharacterBody2D_method_get_slide_collision>`.
|
||||
|
||||
Общее поведение и доступные свойства изменяются в соответствии с :ref:`motion_mode<class_CharacterBody2D_property_motion_mode>`.
|
||||
When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions.
|
||||
|
||||
Возвращает ``true``, если тело столкнулось, в противном случае возвращает ``false``.
|
||||
The general behavior and available properties change according to the :ref:`motion_mode<class_CharacterBody2D_property_motion_mode>`.
|
||||
|
||||
Returns ``true`` if the body collided, otherwise, returns ``false``.
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (Этот метод обычно должен быть переопределен пользователем, чтобы иметь какой-либо эффект.)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
|
||||
@@ -443,7 +443,9 @@ enum **PlatformOnLeave**: :ref:`🔗<enum_CharacterBody3D_PlatformOnLeave>`
|
||||
- |void| **set_velocity**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
|
||||
- :ref:`Vector3<class_Vector3>` **get_velocity**\ (\ )
|
||||
|
||||
Текущий вектор скорости (обычно метры в секунду), используемый и изменяемый во время вызовов :ref:`move_and_slide()<class_CharacterBody3D_method_move_and_slide>`.
|
||||
Current velocity vector (typically meters per second), used and modified during calls to :ref:`move_and_slide()<class_CharacterBody3D_method_move_and_slide>`.
|
||||
|
||||
This property should not be set to a value multiplied by ``delta``, because this happens internally in :ref:`move_and_slide()<class_CharacterBody3D_method_move_and_slide>`. Otherwise, the simulation will run at an incorrect speed.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -697,13 +699,15 @@ enum **PlatformOnLeave**: :ref:`🔗<enum_CharacterBody3D_PlatformOnLeave>`
|
||||
|
||||
:ref:`bool<class_bool>` **move_and_slide**\ (\ ) :ref:`🔗<class_CharacterBody3D_method_move_and_slide>`
|
||||
|
||||
Перемещает тело на основе :ref:`velocity<class_CharacterBody3D_property_velocity>`. Если тело сталкивается с другим, оно будет скользить вдоль другого тела, а не останавливаться немедленно. Если другое тело является **CharacterBody3D** или :ref:`RigidBody3D<class_RigidBody3D>`, оно также будет затронуто движением другого тела. Вы можете использовать это, чтобы заставить движущиеся и вращающиеся платформы или заставить узлы толкать другие узлы.
|
||||
Moves the body based on :ref:`velocity<class_CharacterBody3D_property_velocity>`. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a **CharacterBody3D** or :ref:`RigidBody3D<class_RigidBody3D>`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
|
||||
|
||||
Изменяет :ref:`velocity<class_CharacterBody3D_property_velocity>`, если произошло столкновение скольжения. Чтобы получить последнее столкновение, вызовите :ref:`get_last_slide_collision()<class_CharacterBody3D_method_get_last_slide_collision>`, для получения более подробной информации о произошедших столкновениях используйте :ref:`get_slide_collision()<class_CharacterBody3D_method_get_slide_collision>`.
|
||||
This method should be used in :ref:`Node._physics_process()<class_Node_private_method__physics_process>` (or in a method called by :ref:`Node._physics_process()<class_Node_private_method__physics_process>`), as it uses the physics step's ``delta`` value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
|
||||
|
||||
Когда тело касается движущейся платформы, скорость платформы автоматически добавляется к движению тела. Если столкновение происходит из-за движения платформы, оно всегда будет первым в столкновениях скольжения.
|
||||
Modifies :ref:`velocity<class_CharacterBody3D_property_velocity>` if a slide collision occurred. To get the latest collision call :ref:`get_last_slide_collision()<class_CharacterBody3D_method_get_last_slide_collision>`, for more detailed information about collisions that occurred, use :ref:`get_slide_collision()<class_CharacterBody3D_method_get_slide_collision>`.
|
||||
|
||||
Возвращает ``true``, если тело столкнулось, в противном случае возвращает ``false``.
|
||||
When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions.
|
||||
|
||||
Returns ``true`` if the body collided, otherwise, returns ``false``.
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (Этот метод обычно должен быть переопределен пользователем, чтобы иметь какой-либо эффект.)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/CheckButton.xml.
|
||||
.. meta::
|
||||
:keywords: switch, toggle
|
||||
|
||||
.. _class_CheckButton:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Decal.xml.
|
||||
.. meta::
|
||||
:keywords: stain
|
||||
|
||||
.. _class_Decal:
|
||||
|
||||
|
||||
@@ -12,39 +12,39 @@ Dictionary
|
||||
Описание
|
||||
----------------
|
||||
|
||||
Dictionaries — это ассоциативные контейнеры, содержащие значения, на которые ссылаются уникальные ключи. Словари сохраняют порядок добавления новых записей. В других языках программирования эта структура данных часто называется хэш-картой или ассоциативным массивом.
|
||||
Dictionaries are associative containers that contain values referenced by unique keys. Dictionaries will preserve the insertion order when adding new entries. In other programming languages, this data structure is often referred to as a hash map or an associative array.
|
||||
|
||||
Вы можете определить словарь, поместив список пар ``ключ: значение``, разделённых запятыми, в фигурные скобки ``{}``.
|
||||
You can define a dictionary by placing a comma-separated list of ``key: value`` pairs inside curly braces ``{}``.
|
||||
|
||||
Создание словаря:
|
||||
Creating a dictionary:
|
||||
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. code-tab:: gdscript
|
||||
|
||||
var my_dict = {} # Создает пустой словарь.
|
||||
var my_dict = {} # Creates an empty dictionary.
|
||||
|
||||
var dict_variable_key = "Еще одно ключевое имя"
|
||||
var dict_variable_value = "значение2"
|
||||
var dict_variable_key = "Another key name"
|
||||
var dict_variable_value = "value2"
|
||||
var another_dict = {
|
||||
"Какое-то ключевое имя": "значение1",
|
||||
"Some key name": "value1",
|
||||
dict_variable_key: dict_variable_value,
|
||||
}
|
||||
|
||||
var points_dict = { "White": 50, "Yellow": 75, "Orange": 100 }
|
||||
|
||||
# Альтернативный синтаксис в стиле Lua.
|
||||
# Не требует заключения ключей в кавычки, но в качестве имен ключей можно использовать только строковые константы.
|
||||
# Кроме того, имена ключей должны начинаться с буквы или символа подчеркивания.
|
||||
# Здесь `some_key` — это строковый литерал, а не переменная!
|
||||
# Alternative Lua-style syntax.
|
||||
# Doesn't require quotes around keys, but only string constants can be used as key names.
|
||||
# Additionally, key names must start with a letter or an underscore.
|
||||
# Here, `some_key` is a string literal, not a variable!
|
||||
another_dict = {
|
||||
some_key = 42,
|
||||
}
|
||||
|
||||
.. code-tab:: csharp
|
||||
|
||||
var myDict = new Godot.Collections.Dictionary(); // Создает пустой словарь.
|
||||
var myDict = new Godot.Collections.Dictionary(); // Creates an empty dictionary.
|
||||
var pointsDict = new Godot.Collections.Dictionary
|
||||
{
|
||||
{ "White", 50 },
|
||||
@@ -54,7 +54,7 @@ Dictionaries — это ассоциативные контейнеры, сод
|
||||
|
||||
|
||||
|
||||
Вы можете получить доступ к значению словаря, указав соответствующий ключ. В примере выше ``points_dict["White"]`` вернёт ``50``. Вы также можете написать ``points_dict.White``, что эквивалентно. Однако вам придётся использовать скобки, если ключ, по которому вы обращаетесь к словарю, не является фиксированной строкой (например, числом или переменной).
|
||||
You can access a dictionary's value by referencing its corresponding key. In the above example, ``points_dict["White"]`` will return ``50``. You can also write ``points_dict.White``, which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable).
|
||||
|
||||
|
||||
.. tabs::
|
||||
@@ -64,7 +64,7 @@ Dictionaries — это ассоциативные контейнеры, сод
|
||||
@export_enum("White", "Yellow", "Orange") var my_color: String
|
||||
var points_dict = { "White": 50, "Yellow": 75, "Orange": 100 }
|
||||
func _ready():
|
||||
# Здесь мы не можем использовать точечный синтаксис, поскольку `my_color` — это переменная.
|
||||
# We can't use dot syntax here as `my_color` is a variable.
|
||||
var points = points_dict[my_color]
|
||||
|
||||
.. code-tab:: csharp
|
||||
@@ -85,9 +85,9 @@ Dictionaries — это ассоциативные контейнеры, сод
|
||||
|
||||
|
||||
|
||||
В приведённом выше коде ``points`` будет присвоено значение, соответствующее цвету, выбранному в ``my_color``.
|
||||
In the above code, ``points`` will be assigned the value that is paired with the appropriate color selected in ``my_color``.
|
||||
|
||||
Словари могут содержать более сложные данные:
|
||||
Dictionaries can contain more complex data:
|
||||
|
||||
|
||||
.. tabs::
|
||||
@@ -95,7 +95,7 @@ Dictionaries — это ассоциативные контейнеры, сод
|
||||
.. code-tab:: gdscript
|
||||
|
||||
var my_dict = {
|
||||
"First Array": [1, 2, 3, 4] # Назначает массив строковому ключу.
|
||||
"First Array": [1, 2, 3, 4] # Assigns an Array to a String key.
|
||||
}
|
||||
|
||||
.. code-tab:: csharp
|
||||
@@ -107,7 +107,7 @@ Dictionaries — это ассоциативные контейнеры, сод
|
||||
|
||||
|
||||
|
||||
Чтобы добавить ключ в существующий словарь, получите к нему доступ как к существующему ключу и назначьте ему:
|
||||
To add a key to an existing dictionary, access it like an existing key and assign to it:
|
||||
|
||||
|
||||
.. tabs::
|
||||
@@ -115,7 +115,7 @@ Dictionaries — это ассоциативные контейнеры, сод
|
||||
.. code-tab:: gdscript
|
||||
|
||||
var points_dict = { "White": 50, "Yellow": 75, "Orange": 100 }
|
||||
points_dict["Blue"] = 150 # Добавьте "Blue" в качестве ключа и присвойте ему значение 150.
|
||||
points_dict["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value.
|
||||
|
||||
.. code-tab:: csharp
|
||||
|
||||
@@ -125,20 +125,20 @@ Dictionaries — это ассоциативные контейнеры, сод
|
||||
{ "Yellow", 75 },
|
||||
{ "Orange", 100 },
|
||||
};
|
||||
pointsDict["Blue"] = 150; // Добавьте "Blue" в качестве ключа и присвойте ему значение 150.
|
||||
pointsDict["Blue"] = 150; // Add "Blue" as a key and assign 150 as its value.
|
||||
|
||||
|
||||
|
||||
Наконец, словари могут содержать различные типы ключей и значений в одном и том же словаре:
|
||||
Finally, untyped dictionaries can contain different types of keys and values in the same dictionary:
|
||||
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. code-tab:: gdscript
|
||||
|
||||
# Это действительный словарь.
|
||||
# Чтобы получить доступ к строке "Nested value" ниже, используйте `my_dict.sub_dict.sub_key` или `my_dict["sub_dict"]["sub_key"]`.
|
||||
# Стили индексации можно комбинировать и подбирать в зависимости от ваших потребностей.
|
||||
# This is a valid dictionary.
|
||||
# To access the string "Nested value" below, use `my_dict.sub_dict.sub_key` or `my_dict["sub_dict"]["sub_key"]`.
|
||||
# Indexing styles can be mixed and matched depending on your needs.
|
||||
var my_dict = {
|
||||
"String Key": 5,
|
||||
4: [1, 2, 3],
|
||||
@@ -148,8 +148,8 @@ Dictionaries — это ассоциативные контейнеры, сод
|
||||
|
||||
.. code-tab:: csharp
|
||||
|
||||
// Это действительный словарь.
|
||||
// Чтобы получить доступ к строке "Nested value" ниже, используйте `((Godot.Collections.Dictionary)myDict["sub_dict"])["sub_key"]`.
|
||||
// This is a valid dictionary.
|
||||
// To access the string "Nested value" below, use `((Godot.Collections.Dictionary)myDict["sub_dict"])["sub_key"]`.
|
||||
var myDict = new Godot.Collections.Dictionary {
|
||||
{ "String Key", 5 },
|
||||
{ 4, new Godot.Collections.Array { 1, 2, 3 } },
|
||||
@@ -159,7 +159,7 @@ Dictionaries — это ассоциативные контейнеры, сод
|
||||
|
||||
|
||||
|
||||
Ключи словаря можно перебирать с помощью ключевого слова ``for``:
|
||||
The keys of a dictionary can be iterated with the ``for`` keyword:
|
||||
|
||||
|
||||
.. tabs::
|
||||
@@ -175,14 +175,53 @@ Dictionaries — это ассоциативные контейнеры, сод
|
||||
var groceries = new Godot.Collections.Dictionary { { "Orange", 20 }, { "Apple", 2 }, { "Banana", 4 } };
|
||||
foreach (var (fruit, amount) in groceries)
|
||||
{
|
||||
// `fruit` — ключ, `amount` — значение.
|
||||
// `fruit` is the key, `amount` is the value.
|
||||
}
|
||||
|
||||
|
||||
|
||||
\ **Примечание:** Словари всегда передаются по ссылке. Чтобы получить копию словаря, которую можно изменять независимо от исходного, используйте :ref:`duplicate()<class_Dictionary_method_duplicate>`.
|
||||
To enforce a certain type for keys and values, you can create a *typed dictionary*. Typed dictionaries can only contain keys and values of the given types, or that inherit from the given classes:
|
||||
|
||||
\ **Примечание:** Удаление элементов при итерации по словарям **не** поддерживается и приведёт к непредсказуемому поведению.
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. code-tab:: gdscript
|
||||
|
||||
# Creates a typed dictionary with String keys and int values.
|
||||
# Attempting to use any other type for keys or values will result in an error.
|
||||
var typed_dict: Dictionary[String, int] = {
|
||||
"some_key": 1,
|
||||
"some_other_key": 2,
|
||||
}
|
||||
|
||||
# Creates a typed dictionary with String keys and values of any type.
|
||||
# Attempting to use any other type for keys will result in an error.
|
||||
var typed_dict_key_only: Dictionary[String, Variant] = {
|
||||
"some_key": 12.34,
|
||||
"some_other_key": "string",
|
||||
}
|
||||
|
||||
.. code-tab:: csharp
|
||||
|
||||
// Creates a typed dictionary with String keys and int values.
|
||||
// Attempting to use any other type for keys or values will result in an error.
|
||||
var typedDict = new Godot.Collections.Dictionary<String, int> {
|
||||
{"some_key", 1},
|
||||
{"some_other_key", 2},
|
||||
};
|
||||
|
||||
// Creates a typed dictionary with String keys and values of any type.
|
||||
// Attempting to use any other type for keys will result in an error.
|
||||
var typedDictKeyOnly = new Godot.Collections.Dictionary<String, Variant> {
|
||||
{"some_key", 12.34},
|
||||
{"some_other_key", "string"},
|
||||
};
|
||||
|
||||
|
||||
|
||||
\ **Note:** Dictionaries are always passed by reference. To get a copy of a dictionary which can be modified independently of the original dictionary, use :ref:`duplicate()<class_Dictionary_method_duplicate>`.
|
||||
|
||||
\ **Note:** Erasing elements while iterating over dictionaries is **not** supported and will result in unpredictable behavior.
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/DirAccess.xml.
|
||||
.. meta::
|
||||
:keywords: directory, path, folder
|
||||
|
||||
.. _class_DirAccess:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/DirectionalLight2D.xml.
|
||||
.. meta::
|
||||
:keywords: sun
|
||||
|
||||
.. _class_DirectionalLight2D:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/DirectionalLight3D.xml.
|
||||
.. meta::
|
||||
:keywords: sun
|
||||
|
||||
.. _class_DirectionalLight3D:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/FoldableContainer.xml.
|
||||
.. meta::
|
||||
:keywords: expandable, collapsible, collapse
|
||||
|
||||
.. _class_FoldableContainer:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/FoldableGroup.xml.
|
||||
.. meta::
|
||||
:keywords: expandable, collapsible, collapse
|
||||
|
||||
.. _class_FoldableGroup:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/modules/gridmap/doc_classes/GridMap.xml.
|
||||
.. meta::
|
||||
:keywords: tilemap
|
||||
|
||||
.. _class_GridMap:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/modules/gridmap/doc_classes/GridMapEditorPlugin.xml.
|
||||
.. meta::
|
||||
:keywords: tilemap
|
||||
|
||||
.. _class_GridMapEditorPlugin:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/InputEventJoypadButton.xml.
|
||||
.. meta::
|
||||
:keywords: gamepad, controller
|
||||
|
||||
.. _class_InputEventJoypadButton:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/InputEventJoypadMotion.xml.
|
||||
.. meta::
|
||||
:keywords: gamepad, controller
|
||||
|
||||
.. _class_InputEventJoypadMotion:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/InputEventMouseButton.xml.
|
||||
.. meta::
|
||||
:keywords: click, press
|
||||
|
||||
.. _class_InputEventMouseButton:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/IP.xml.
|
||||
.. meta::
|
||||
:keywords: dns
|
||||
|
||||
.. _class_IP:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Label.xml.
|
||||
.. meta::
|
||||
:keywords: text
|
||||
|
||||
.. _class_Label:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Label3D.xml.
|
||||
.. meta::
|
||||
:keywords: text
|
||||
|
||||
.. _class_Label3D:
|
||||
|
||||
|
||||
@@ -508,7 +508,9 @@ enum **BakeMode**: :ref:`🔗<enum_Light3D_BakeMode>`
|
||||
- |void| **set_cull_mask**\ (\ value\: :ref:`int<class_int>`\ )
|
||||
- :ref:`int<class_int>` **get_cull_mask**\ (\ )
|
||||
|
||||
Свет будет влиять на объекты в выбранных слоях.
|
||||
The light will affect objects in the selected layers.
|
||||
|
||||
\ **Note:** The light cull mask is ignored by :ref:`VoxelGI<class_VoxelGI>`, SDFGI, :ref:`LightmapGI<class_LightmapGI>`, and volumetric fog. These will always render lights in a way that ignores the cull mask. See also :ref:`VisualInstance3D.layers<class_VisualInstance3D_property_layers>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/LineEdit.xml.
|
||||
.. meta::
|
||||
:keywords: text, input
|
||||
|
||||
.. _class_LineEdit:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/MarginContainer.xml.
|
||||
.. meta::
|
||||
:keywords: padding
|
||||
|
||||
.. _class_MarginContainer:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/MenuButton.xml.
|
||||
.. meta::
|
||||
:keywords: dropdown
|
||||
|
||||
.. _class_MenuButton:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/MultiMesh.xml.
|
||||
.. meta::
|
||||
:keywords: batch
|
||||
|
||||
.. _class_MultiMesh:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/MultiMeshInstance2D.xml.
|
||||
.. meta::
|
||||
:keywords: batch
|
||||
|
||||
.. _class_MultiMeshInstance2D:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/MultiMeshInstance3D.xml.
|
||||
.. meta::
|
||||
:keywords: batch
|
||||
|
||||
.. _class_MultiMeshInstance3D:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/MultiplayerAPI.xml.
|
||||
.. meta::
|
||||
:keywords: network
|
||||
|
||||
.. _class_MultiplayerAPI:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/MultiplayerAPIExtension.xml.
|
||||
.. meta::
|
||||
:keywords: network
|
||||
|
||||
.. _class_MultiplayerAPIExtension:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/MultiplayerPeer.xml.
|
||||
.. meta::
|
||||
:keywords: network
|
||||
|
||||
.. _class_MultiplayerPeer:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/MultiplayerPeerExtension.xml.
|
||||
.. meta::
|
||||
:keywords: network
|
||||
|
||||
.. _class_MultiplayerPeerExtension:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/modules/multiplayer/doc_classes/MultiplayerSpawner.xml.
|
||||
.. meta::
|
||||
:keywords: network
|
||||
|
||||
.. _class_MultiplayerSpawner:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/modules/multiplayer/doc_classes/MultiplayerSynchronizer.xml.
|
||||
.. meta::
|
||||
:keywords: network
|
||||
|
||||
.. _class_MultiplayerSynchronizer:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Node3D.xml.
|
||||
.. meta::
|
||||
:keywords: spatial
|
||||
|
||||
.. _class_Node3D:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/OmniLight3D.xml.
|
||||
.. meta::
|
||||
:keywords: point
|
||||
|
||||
.. _class_OmniLight3D:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/OptionButton.xml.
|
||||
.. meta::
|
||||
:keywords: select, dropdown
|
||||
|
||||
.. _class_OptionButton:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/PhysicalBone2D.xml.
|
||||
.. meta::
|
||||
:keywords: ragdoll
|
||||
|
||||
.. _class_PhysicalBone2D:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/PhysicalBone3D.xml.
|
||||
.. meta::
|
||||
:keywords: ragdoll
|
||||
|
||||
.. _class_PhysicalBone3D:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/PointLight2D.xml.
|
||||
.. meta::
|
||||
:keywords: omni, spot
|
||||
|
||||
.. _class_PointLight2D:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ReflectionProbe.xml.
|
||||
.. meta::
|
||||
:keywords: environment, envmap
|
||||
|
||||
.. _class_ReflectionProbe:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/SpinBox.xml.
|
||||
.. meta::
|
||||
:keywords: number, numeric, input
|
||||
|
||||
.. _class_SpinBox:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/StatusIndicator.xml.
|
||||
.. meta::
|
||||
:keywords: tray
|
||||
|
||||
.. _class_StatusIndicator:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/TextEdit.xml.
|
||||
.. meta::
|
||||
:keywords: textarea
|
||||
|
||||
.. _class_TextEdit:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/TileMap.xml.
|
||||
.. meta::
|
||||
:keywords: gridmap
|
||||
|
||||
.. _class_TileMap:
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ Tween
|
||||
Описание
|
||||
----------------
|
||||
|
||||
Подростки в основном полезны для анимаций, требующих интерполяции числового свойства по диапазону значений. Название *tween* происходит от *in-betweening*, техники анимации, при которой вы указываете *ключевые кадры*, а компьютер интерполирует кадры, которые появляются между ними. Анимация чего-либо с помощью **Tween** называется созданием промежуточных кадров.
|
||||
Tween, в основном, полезны для анимаций, требующих интерполяции числового свойства по диапазону значений. Название *tween* происходит от *in-betweening*, техники анимации, при которой вы указываете *ключевые кадры*, а компьютер интерполирует кадры, которые появляются между ними. Анимация чего-либо с помощью **Tween** называется созданием промежуточных кадров.
|
||||
|
||||
\ **Tween** больше подходит, чем :ref:`AnimationPlayer<class_AnimationPlayer>`, для анимаций, где заранее неизвестны конечные значения. Например, интерполяцию динамически выбранного значения масштабирования камеры лучше всего осуществлять с помощью **Tween**; сделать то же самое с помощью узла :ref:`AnimationPlayer<class_AnimationPlayer>` будет сложно. Анимированные анимации также более легковесны, чем :ref:`AnimationPlayer<class_AnimationPlayer>`, поэтому они отлично подходят для простых анимаций или общих задач, не требующих визуальной настройки, предоставляемой редактором. Их можно использовать по принципу «запустил и забыл» для некоторой логики, которая обычно выполняется с помощью кода. Например, можно заставить что-то периодически стрелять, используя циклический :ref:`CallbackTweener<class_CallbackTweener>` с задержкой.
|
||||
|
||||
@@ -217,7 +217,7 @@ Tween
|
||||
|
||||
**finished**\ (\ ) :ref:`🔗<class_Tween_signal_finished>`
|
||||
|
||||
Вызывается, когда **Tween** завершил все промежуточные кадры. Никогда не вызывается, когда **Tween** установлен на бесконечный цикл (см. :ref:`set_loops()<class_Tween_method_set_loops>`).
|
||||
Срабатывает, когда **Tween** завершил все промежуточные кадры. Никогда не срабатывает, когда **Tween** установлен на бесконечный цикл (см. :ref:`set_loops()<class_Tween_method_set_loops>`).
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -229,7 +229,7 @@ Tween
|
||||
|
||||
**loop_finished**\ (\ loop_count\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Tween_signal_loop_finished>`
|
||||
|
||||
Выдается при завершении полного цикла (см. :ref:`set_loops()<class_Tween_method_set_loops>`), предоставляя индекс цикла. Этот сигнал не выдается после последнего цикла, вместо этого используйте :ref:`finished<class_Tween_signal_finished>` для этого случая.
|
||||
Срабатывает при завершении полного цикла (см. :ref:`set_loops()<class_Tween_method_set_loops>`), предоставляя индекс цикла. Этот сигнал не срабатывает после последнего цикла, вместо этого используйте :ref:`finished<class_Tween_signal_finished>` для этого случая.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -241,7 +241,7 @@ Tween
|
||||
|
||||
**step_finished**\ (\ idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Tween_signal_step_finished>`
|
||||
|
||||
Выдается, когда один шаг **Tween** завершен, предоставляя индекс шага. Один шаг — это либо один :ref:`Tweener<class_Tweener>`, либо группа :ref:`Tweener<class_Tweener>`, работающих параллельно.
|
||||
Срабатывает, когда один шаг **Tween** завершен, предоставляя индекс шага. Один шаг — это либо один :ref:`Tweener<class_Tweener>`, либо группа :ref:`Tweener<class_Tweener>`, работающих параллельно.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
@@ -1065,13 +1065,13 @@ enum **EaseType**: :ref:`🔗<enum_Tween_EaseType>`
|
||||
subtween.tween_property(self, "rotation_degrees", 45.0, 1.0)
|
||||
subtween.tween_property(self, "rotation_degrees", 0.0, 1.0)
|
||||
|
||||
# Родительский твин выполнит субтвин как один из своих шагов.
|
||||
# Родительский tween выполнит subtween как один из своих шагов.
|
||||
var tween = create_tween()
|
||||
tween.tween_property(self, "position:x", 500, 3.0)
|
||||
tween.tween_subtween(subtween)
|
||||
tween.tween_property(self, "position:x", 300, 2.0)
|
||||
|
||||
\ **Примечание:** Методы :ref:`pause()<class_Tween_method_pause>`, :ref:`stop()<class_Tween_method_stop>` и :ref:`set_loops()<class_Tween_method_set_loops>` могут привести к тому, что родительский **Tween** застрянет на шаге субтвина; для получения дополнительной информации см. документацию по этим методам.
|
||||
\ **Примечание:** Методы :ref:`pause()<class_Tween_method_pause>`, :ref:`stop()<class_Tween_method_stop>` и :ref:`set_loops()<class_Tween_method_set_loops>` могут привести к тому, что родительский **Tween** застрянет на шаге subtween; для получения дополнительной информации см. документацию по этим методам.
|
||||
|
||||
\ **Примечание:** Режимы паузы и обработки, установленные :ref:`set_pause_mode()<class_Tween_method_set_pause_mode>` и :ref:`set_process_mode()<class_Tween_method_set_process_mode>` в ``subtween``, будут переопределены настройками родительского **Tween**.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/WorldEnvironment.xml.
|
||||
.. meta::
|
||||
:keywords: background, sky
|
||||
|
||||
.. _class_WorldEnvironment:
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
:github_url: hide
|
||||
:allow_comments: False
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.5/doc/tools/make_rst.py.
|
||||
|
||||
.. _doc_class_reference:
|
||||
|
||||
Все классы
|
||||
|
||||
Reference in New Issue
Block a user