mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
Merge Sphinx translations with Weblate translations, sync classref
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/modules/gdscript/doc_classes/@GDScript.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/modules/gdscript/doc_classes/@GDScript.xml.
|
||||
|
||||
.. _class_@GDScript:
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`assert<class_@GDScript_method_assert>`\ (\ condition\: :ref:`bool<class_bool>`, message\: :ref:`String<class_String>` = ""\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`char<class_@GDScript_method_char>`\ (\ char\: :ref:`int<class_int>`\ ) |
|
||||
| :ref:`String<class_String>` | :ref:`char<class_@GDScript_method_char>`\ (\ code\: :ref:`int<class_int>`\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Variant<class_Variant>` | :ref:`convert<class_@GDScript_method_convert>`\ (\ what\: :ref:`Variant<class_Variant>`, type\: :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>`\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
@@ -57,6 +57,8 @@
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Resource<class_Resource>` | :ref:`load<class_@GDScript_method_load>`\ (\ path\: :ref:`String<class_String>`\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`ord<class_@GDScript_method_ord>`\ (\ char\: :ref:`String<class_String>`\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Resource<class_Resource>` | :ref:`preload<class_@GDScript_method_preload>`\ (\ path\: :ref:`String<class_String>`\ ) |
|
||||
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`print_debug<class_@GDScript_method_print_debug>`\ (\ ...\ ) |vararg| |
|
||||
@@ -109,7 +111,9 @@
|
||||
|
||||
**NAN** = ``nan`` :ref:`🔗<class_@GDScript_constant_NAN>`
|
||||
|
||||
“Not a Number”(非数),一个无效的浮点数值。\ :ref:`NAN<class_@GDScript_constant_NAN>` 有许多特殊的性质,比如 ``!=`` 始终返回 ``true``\ ,而其他比较运算符都始终返回 ``false``\ 。即便是和自己比较也是如此(\ ``NAN == NAN`` 返回 ``false``\ ,而 ``NAN != NAN`` 返回 ``true``\ )。部分无效运算会返回这个值,例如将浮点数 ``0.0`` 除以 ``0.0``\ 。
|
||||
“Not a Number”(非数)是一个无效的浮点数值。部分无效运算会返回这个值,例如将浮点数 ``0.0`` 除以 ``0.0``\ 。
|
||||
|
||||
\ :ref:`NAN<class_@GDScript_constant_NAN>` 有许多特殊的性质,包括 ``!=`` 始终返回 ``true``\ ,而其他比较运算符都始终返回 ``false``\ 。即便是和自己比较也是如此(\ ``NAN == NAN`` 返回 ``false``\ ,而 ``NAN != NAN`` 返回 ``true``\ )。因此,你必须使用 :ref:`@GlobalScope.is_nan()<class_@GlobalScope_method_is_nan>` 来判断数值是否等于 :ref:`NAN<class_@GDScript_constant_NAN>`\ 。
|
||||
|
||||
\ **警告:**\ “非数”只是浮点数的概念,整数中没有对应的概念。将整数 ``0`` 除以 ``0`` 不会得到 :ref:`NAN<class_@GDScript_constant_NAN>`\ ,而是会产生运行时错误。
|
||||
|
||||
@@ -120,6 +124,37 @@
|
||||
注解
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@abstract:
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@abstract**\ (\ ) :ref:`🔗<class_@GDScript_annotation_@abstract>`
|
||||
|
||||
将类或方法标记为抽象。
|
||||
|
||||
抽象类是一种无法直接实例化的类,主要功能是被其他类继承。尝试实例化抽象类会报错。
|
||||
|
||||
抽象方法是一种没有实现的方法,因此函数头之后应当为换行或分号。抽象方法定义的是派生类所必须遵守的契约,覆盖方法时签名必须兼容。派生类必须为所有抽象方法都提供实现,否则就必须将它标记为抽象类。如果类中至少存在一个抽象方法(可以是自己定义的,也可以是继承但没实现的),那么也必须标记为抽象类。
|
||||
|
||||
反之则不然:抽象类可以不包含抽象方法。
|
||||
|
||||
::
|
||||
|
||||
@abstract class Shape:
|
||||
@abstract func draw()
|
||||
|
||||
class Circle extends Shape:
|
||||
func draw():
|
||||
print("画个圆形。")
|
||||
|
||||
class Square extends Shape:
|
||||
func draw():
|
||||
print("画个方形。")
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export:
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
@@ -131,27 +166,27 @@
|
||||
::
|
||||
|
||||
extends Node
|
||||
|
||||
|
||||
enum Direction {LEFT, RIGHT, UP, DOWN}
|
||||
|
||||
|
||||
# 内置类型。
|
||||
@export var string = ""
|
||||
@export var int_number = 5
|
||||
@export var float_number: float = 5
|
||||
|
||||
|
||||
# 枚举。
|
||||
@export var type: Variant.Type
|
||||
@export var format: Image.Format
|
||||
@export var direction: Direction
|
||||
|
||||
|
||||
# 资源。
|
||||
@export var image: Image
|
||||
@export var custom_resource: CustomResource
|
||||
|
||||
|
||||
# 节点。
|
||||
@export var node: Node
|
||||
@export var custom_node: CustomNode
|
||||
|
||||
|
||||
# 类型数组。
|
||||
@export var int_array: Array[int]
|
||||
@export var direction_array: Array[Direction]
|
||||
@@ -259,7 +294,7 @@
|
||||
@export_enum("Warrior", "Magician", "Thief") var character_class: int
|
||||
@export_enum("Slow:30", "Average:60", "Very Fast:200") var character_speed: int
|
||||
@export_enum("Rebecca", "Mary", "Leah") var character_name: String
|
||||
|
||||
|
||||
@export_enum("Sword", "Spear", "Mace") var character_items: Array[int]
|
||||
@export_enum("double_jump", "climb", "dash") var character_skills: Array[String]
|
||||
|
||||
@@ -275,7 +310,7 @@
|
||||
|
||||
enum CharacterName {REBECCA, MARY, LEAH}
|
||||
@export var character_name: CharacterName
|
||||
|
||||
|
||||
enum CharacterItem {SWORD, SPEAR, MACE}
|
||||
@export var character_items: Array[CharacterItem]
|
||||
|
||||
@@ -310,7 +345,7 @@
|
||||
|
||||
**@export_file**\ (\ filter\: :ref:`String<class_String>` = "", ...\ ) |vararg| :ref:`🔗<class_@GDScript_annotation_@export_file>`
|
||||
|
||||
导出 :ref:`String<class_String>`\ 、\ :ref:`Array<class_Array>`\ \[:ref:`String<class_String>`\ \[ 或 :ref:`PackedStringArray<class_PackedStringArray>` 属性,用作指向文件的路径。该路径会被限制在项目文件夹及其子文件夹中。要允许在整个文件系统中选取,见 :ref:`@export_global_file<class_@GDScript_annotation_@export_global_file>`\ 。
|
||||
导出 :ref:`String<class_String>`\ 、\ :ref:`Array<class_Array>`\ \[:ref:`String<class_String>`\ \] 或 :ref:`PackedStringArray<class_PackedStringArray>` 属性,用作指向文件的路径。该路径会被限制在项目文件夹及其子文件夹中。要允许在整个文件系统中选取,见 :ref:`@export_global_file<class_@GDScript_annotation_@export_global_file>`\ 。
|
||||
|
||||
如果提供了 ``filter``\ ,则只有匹配的文件可供选取。
|
||||
|
||||
@@ -322,6 +357,20 @@
|
||||
@export_file("*.txt") var notes_path: String
|
||||
@export_file var level_paths: Array[String]
|
||||
|
||||
\ **注意:**\ 如果文件的 UID 可用,则会以 UID 形式进行存储和引用。这样可以保证即便文件发生移动,引用也仍然有效。可以使用 :ref:`ResourceUID<class_ResourceUID>` 中的方法将 UID 转换为路径。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_file_path:
|
||||
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_file_path**\ (\ filter\: :ref:`String<class_String>` = "", ...\ ) |vararg| :ref:`🔗<class_@GDScript_annotation_@export_file_path>`
|
||||
|
||||
与 :ref:`@export_file<class_@GDScript_annotation_@export_file>` 相同,但是文件以原始路径的形式存储。这意味着移动文件后可能失效。导出 :ref:`Resource<class_Resource>` 路径时,请考虑改用 :ref:`@export_file<class_@GDScript_annotation_@export_file>`\ 。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
@@ -564,11 +613,11 @@
|
||||
@export_group("Racer Properties")
|
||||
@export var nickname = "Nick"
|
||||
@export var age = 26
|
||||
|
||||
|
||||
@export_group("Car Properties", "car_")
|
||||
@export var car_label = "Speedy"
|
||||
@export var car_number = 3
|
||||
|
||||
|
||||
@export_group("", "")
|
||||
@export var ungrouped_number = 3
|
||||
|
||||
@@ -655,10 +704,10 @@
|
||||
@export_range(-10, 20) var number
|
||||
@export_range(-10, 20, 0.2) var number: float
|
||||
@export_range(0, 20) var numbers: Array[float]
|
||||
|
||||
|
||||
@export_range(0, 100, 1, "or_greater") var power_percent
|
||||
@export_range(0, 100, 1, "or_greater", "or_less") var health_delta
|
||||
|
||||
|
||||
@export_range(-180, 180, 0.001, "radians_as_degrees") var angle_radians
|
||||
@export_range(0, 360, 1, "degrees") var angle_degrees
|
||||
@export_range(-8, 8, 2, "suffix:px") var target_offset
|
||||
@@ -700,7 +749,7 @@
|
||||
@export_group("Racer Properties")
|
||||
@export var nickname = "Nick"
|
||||
@export var age = 26
|
||||
|
||||
|
||||
@export_subgroup("Car Properties", "car_")
|
||||
@export var car_label = "Speedy"
|
||||
@export var car_number = 3
|
||||
@@ -742,14 +791,14 @@
|
||||
|
||||
@tool
|
||||
extends Sprite2D
|
||||
|
||||
|
||||
@export_tool_button("你好") var hello_action = hello
|
||||
@export_tool_button("随机颜色!", "ColorRect")
|
||||
var randomize_color_action = randomize_color
|
||||
|
||||
|
||||
func hello():
|
||||
print("你好世界!")
|
||||
|
||||
|
||||
func randomize_color():
|
||||
var undo_redo = EditorInterface.get_editor_undo_redo()
|
||||
undo_redo.create_action("随机设置 Sprite2D 的颜色")
|
||||
@@ -831,13 +880,15 @@
|
||||
|
||||
@rpc
|
||||
func fn(): pass
|
||||
|
||||
|
||||
@rpc("any_peer", "unreliable_ordered")
|
||||
func fn_update_pos(): pass
|
||||
|
||||
|
||||
@rpc("authority", "call_remote", "unreliable", 0) # 等价于 @rpc
|
||||
func fn_default(): pass
|
||||
|
||||
\ **注意:**\ 使用 :ref:`@rpc<class_@GDScript_annotation_@rpc>` 注解的方法无法接收在 :ref:`Object._init()<class_Object_private_method__init>` 中定义了必要参数的对象。更多详情,请参阅 :ref:`Object._init()<class_Object_private_method__init>`\ 。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
@@ -997,15 +1048,16 @@
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`String<class_String>` **char**\ (\ char\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GDScript_method_char>`
|
||||
:ref:`String<class_String>` **char**\ (\ code\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GDScript_method_char>`
|
||||
|
||||
返回给定的 Unicode 码位(与 ASCII 码兼容)对应的单个字符(形式为 :ref:`String<class_String>`\ )。
|
||||
返回给定 Unicode 码位 ``code`` 的单个字符(作为长度为 1 的 :ref:`String<class_String>`\ )。
|
||||
|
||||
::
|
||||
|
||||
var upper = char(65) # upper 是 "A"
|
||||
var lower = char(65 + 32) # lower 是 "a"
|
||||
var euro = char(8364) # euro 是 "€"
|
||||
print(char(65)) # 打印 "A"
|
||||
print(char(129302)) # 打印 "🤖" (机器人脸的emoji)
|
||||
|
||||
这是 :ref:`ord()<class_@GDScript_method_ord>` 的逆运算。参见 :ref:`String.chr()<class_String_method_chr>` 和 :ref:`String.unicode_at()<class_String_method_unicode_at>`\ 。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -1025,7 +1077,7 @@
|
||||
|
||||
var a = [4, 2.5, 1.2]
|
||||
print(a is Array) # 输出 true
|
||||
|
||||
|
||||
var b = convert(a, TYPE_PACKED_BYTE_ARRAY)
|
||||
print(b) # 输出 [4, 2, 1]
|
||||
print(b is Array) # 输出 false
|
||||
@@ -1060,10 +1112,10 @@
|
||||
|
||||
func _ready():
|
||||
foo()
|
||||
|
||||
|
||||
func foo():
|
||||
bar()
|
||||
|
||||
|
||||
func bar():
|
||||
print(get_stack())
|
||||
|
||||
@@ -1073,9 +1125,9 @@
|
||||
|
||||
[{function:bar, line:12, source:res://script.gd}, {function:foo, line:9, source:res://script.gd}, {function:_ready, line:6, source:res://script.gd}]
|
||||
|
||||
\ **注意:**\ 只有在运行的实例连接到调试服务器(即编辑器实例)后,该函数才有效。\ :ref:`get_stack()<class_@GDScript_method_get_stack>` 不适用于以发布模式导出的项目;或者在未连接到调试服务器的情况下,以调试模式导出的项目。
|
||||
参见 :ref:`print_debug()<class_@GDScript_method_print_debug>`\ ,\ :ref:`print_stack()<class_@GDScript_method_print_stack>` 和 :ref:`Engine.capture_script_backtraces()<class_Engine_method_capture_script_backtraces>`\ 。
|
||||
|
||||
\ **注意:**\ 不支持从 :ref:`Thread<class_Thread>` 调用此函数,这样做将返回一个空数组。
|
||||
\ **注意:** 默认情况下,调用堆栈跟踪仅在编辑器构建和调试构建中可用。若要为发布构建启用该功能,您需要启用 :ref:`ProjectSettings.debug/settings/gdscript/always_track_call_stacks<class_ProjectSettings_property_debug/settings/gdscript/always_track_call_stacks>`\ 。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -1089,7 +1141,7 @@
|
||||
|
||||
**已弃用:** Consider using :ref:`JSON.from_native()<class_JSON_method_from_native>` or :ref:`Object.get_property_list()<class_Object_method_get_property_list>` instead.
|
||||
|
||||
返回传入的\ ``instance``\ 并转换为一个字典。对序列化很有用。
|
||||
将传入的实例 ``instance`` 转换为 :ref:`Dictionary<class_Dictionary>` 并返回。适用于序列化。
|
||||
|
||||
::
|
||||
|
||||
@@ -1106,9 +1158,9 @@
|
||||
[@subpath, @path, foo]
|
||||
[, res://test.gd, bar]
|
||||
|
||||
\ **提醒:**\ 这个函数只能用于序列化附加了另存为文件的\ :ref:`GDScript<class_GDScript>`\ 对象。对象没有附加脚本、附加脚本用其他语言编写、附加了内建脚本的情况下是不支持的。
|
||||
\ **注意:**\ 只有附加了存储在单独文件中的 :ref:`GDScript<class_GDScript>` 的对象才能够被这个函数序列化。不支持未附加脚本的对象、使用其他语言脚本的对象、使用内置脚本的对象。
|
||||
|
||||
\ **提醒:**\ 这个函数不是递归的,这意味着嵌套的对象将不会被表示为字典。并且,以引用方式(\ :ref:`Object<class_Object>`\ 、\ :ref:`Dictionary<class_Dictionary>`\ 、\ :ref:`Array<class_Array>`, 以及打包数组(packed arrays))传入的属性也是以引用方式复制,而不是建立副本。
|
||||
\ **注意:**\ 这个函数不会进行递归操作,嵌套的对象不会以字典形式表示。另外,按引用传递的属性(\ :ref:`Object<class_Object>`\ 、\ :ref:`Dictionary<class_Dictionary>`\ 、\ :ref:`Array<class_Array>`\ 、紧缩数组等)会按引用进行复制,不会制作副本。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -1128,7 +1180,7 @@
|
||||
|
||||
- :ref:`Script<class_Script>`\ (可以用任何类,包括内部类)。
|
||||
|
||||
\ ``type`` 可以不是常量,这一点与 ``is`` 的右操作数不同,\ ``is`` 运算符支持的功能更多(例如类型化数组)。如果你不需要动态类型检查,请使用该运算符,不要使用此方法。
|
||||
\ ``type`` 可以不是常量,这一点与 ``is`` 的右操作数不同,\ ``is`` 运算符支持的功能更多(例如类型化数组)。如果你不需要动态地检查类型,请使用该运算符,不要使用此方法。
|
||||
|
||||
\ **示例:**\
|
||||
|
||||
@@ -1139,7 +1191,7 @@
|
||||
print(is_instance_of(a, MyClass))
|
||||
print(is_instance_of(a, MyClass.InnerClass))
|
||||
|
||||
\ **注意:**\ 如果 ``value`` 和/或 ``type`` 为已释放的对象(见 :ref:`@GlobalScope.is_instance_valid()<class_@GlobalScope_method_is_instance_valid>`\ ),或者 ``type`` 的数值不为以上选项中的任何一项,则此方法会报运行时错误。
|
||||
\ **注意:**\ 如果 ``value`` 和/或 ``type`` 为已释放的对象(见 :ref:`@GlobalScope.is_instance_valid()<class_@GlobalScope_method_is_instance_valid>`\ ),或者 ``type`` 不为以上选项中的任何一项,则此方法会报运行时错误。
|
||||
|
||||
另见 :ref:`@GlobalScope.typeof()<class_@GlobalScope_method_typeof>`\ 、\ :ref:`type_exists()<class_@GDScript_method_type_exists>`\ 、\ :ref:`Array.is_same_typed()<class_Array_method_is_same_typed>`\ (以及其他 :ref:`Array<class_Array>` 方法)。
|
||||
|
||||
@@ -1159,7 +1211,7 @@
|
||||
|
||||
var a = [1, 2, 3, 4]
|
||||
len(a) # 返回 4
|
||||
|
||||
|
||||
var b = "Hello!"
|
||||
len(b) # 返回 6
|
||||
|
||||
@@ -1194,6 +1246,25 @@
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_ord:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`int<class_int>` **ord**\ (\ char\: :ref:`String<class_String>`\ ) :ref:`🔗<class_@GDScript_method_ord>`
|
||||
|
||||
返回一个整数,表示给定字符 ``char`` 的 Unicode 码位,该字符应为长度为 1 的字符串。
|
||||
|
||||
::
|
||||
|
||||
print(ord(“A”)) # 输出 65
|
||||
print(ord(“🤖”)) # 输出 129302
|
||||
|
||||
这是 :ref:`char()<class_@GDScript_method_char>` 的逆运算。参见 :ref:`String.chr()<class_String_method_chr>` 和 :ref:`String.unicode_at()<class_String_method_unicode_at>`\ 。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_preload:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
@@ -1230,7 +1301,9 @@
|
||||
Test print
|
||||
At: res://test.gd:15:_process()
|
||||
|
||||
\ **注意:**\ 不支持从 :ref:`Thread<class_Thread>` 中调用此方法,这样做会输出线程 ID。
|
||||
参见 :ref:`print_stack()<class_@GDScript_method_print_stack>`\ ,\ :ref:`get_stack()<class_@GDScript_method_get_stack>` 和 :ref:`Engine.capture_script_backtraces()<class_Engine_method_capture_script_backtraces>`\ 。
|
||||
|
||||
\ **注意:** 默认情况下,调用堆栈仅在编辑器构建和调试构建中可用。若要使其在发布构建中也可用,您需要启用 :ref:`ProjectSettings.debug/settings/gdscript/always_track_call_stacks<class_ProjectSettings_property_debug/settings/gdscript/always_track_call_stacks>`\ 。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -1242,17 +1315,17 @@
|
||||
|
||||
|void| **print_stack**\ (\ ) :ref:`🔗<class_@GDScript_method_print_stack>`
|
||||
|
||||
输出当前代码位置的栈追踪。另见 :ref:`get_stack()<class_@GDScript_method_get_stack>`\ 。
|
||||
在当前代码位置打印堆栈跟踪。
|
||||
|
||||
控制台中的输出是类似这样的:
|
||||
控制台输出可能类似于以下内容:
|
||||
|
||||
.. code:: text
|
||||
|
||||
Frame 0 - res://test.gd:16 in function '_process'
|
||||
|
||||
\ **注意:**\ 只有在运行的实例连接到调试服务器(即编辑器实例)后,该函数才有效。\ :ref:`print_stack()<class_@GDScript_method_print_stack>` 不适用于以发布模式导出的项目;或者在未连接到调试服务器的情况下,以调试模式导出的项目。
|
||||
参见 :ref:`print_debug()<class_@GDScript_method_print_debug>`\ ,\ :ref:`get_stack()<class_@GDScript_method_get_stack>` 和 :ref:`Engine.capture_script_backtraces()<class_Engine_method_capture_script_backtraces>`\ 。
|
||||
|
||||
\ **注意:**\ 不支持从 :ref:`Thread<class_Thread>` 调用此函数,这样做将改为打印线程 ID。
|
||||
\ **注意:** 默认情况下,堆栈跟踪仅在编辑器构建和调试构建中可用。若要使其在发布构建中也可用,需启用 :ref:`ProjectSettings.debug/settings/gdscript/always_track_call_stacks<class_ProjectSettings_property_debug/settings/gdscript/always_track_call_stacks>`\ 。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -1334,6 +1407,7 @@
|
||||
type_exists("NonExistentClass") # 返回 false
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/@GlobalScope.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/@GlobalScope.xml.
|
||||
|
||||
.. _class_@GlobalScope:
|
||||
|
||||
@@ -2837,7 +2837,7 @@ enum **JoyAxis**: :ref:`🔗<enum_@GlobalScope_JoyAxis>`
|
||||
|
||||
:ref:`JoyAxis<enum_@GlobalScope_JoyAxis>` **JOY_AXIS_TRIGGER_RIGHT** = ``5``
|
||||
|
||||
游戏控制器左扳机轴。
|
||||
游戏控制器右扳机轴。
|
||||
|
||||
.. _class_@GlobalScope_constant_JOY_AXIS_SDL_MAX:
|
||||
|
||||
@@ -3052,7 +3052,7 @@ enum **Error**: :ref:`🔗<enum_@GlobalScope_Error>`
|
||||
var error = method_that_returns_error()
|
||||
if error != OK:
|
||||
printerr("失败!")
|
||||
|
||||
|
||||
# 或者也可以:
|
||||
if error:
|
||||
printerr("还是失败!")
|
||||
@@ -3587,7 +3587,7 @@ enum **PropertyHint**: :ref:`🔗<enum_@GlobalScope_PropertyHint>`
|
||||
|
||||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_FILE** = ``13``
|
||||
|
||||
提示 :ref:`String<class_String>` 属性为文件的路径。编辑时会弹出选取路径的文件对话框。提示字符串可以设为一组带有通配符的筛选器,例如 ``"*.png,*.jpg"``\ 。
|
||||
提示 :ref:`String<class_String>` 属性为文件的路径。编辑时会弹出选取路径的文件对话框。提示字符串可以设为一组带有通配符的筛选器,例如 ``"*.png,*.jpg"``\ 。默认情况下,如果文件的 UID 可用,则会以 UID 形式进行存储。可以使用 :ref:`ResourceUID<class_ResourceUID>` 中的方法将 UID 转换回路径。要存储原始路径,请使用 :ref:`PROPERTY_HINT_FILE_PATH<class_@GlobalScope_constant_PROPERTY_HINT_FILE_PATH>`\ 。
|
||||
|
||||
.. _class_@GlobalScope_constant_PROPERTY_HINT_DIR:
|
||||
|
||||
@@ -3671,6 +3671,8 @@ enum **PropertyHint**: :ref:`🔗<enum_@GlobalScope_PropertyHint>`
|
||||
|
||||
如果属性为 :ref:`Array<class_Array>`\ ,则提示编辑器如何显示其中的元素。\ ``hint_string`` 必须使用 ``":"`` 和 ``"/"`` 对内嵌的类型进行编码。
|
||||
|
||||
如果属性为 :ref:`Dictionary<class_Dictionary>`\ ,则提示编辑器如何显示其中的元素。\ ``hint_string`` 与 :ref:`Array<class_Array>` 相同,使用 ``";"`` 分隔键和值。
|
||||
|
||||
|
||||
.. tabs::
|
||||
|
||||
@@ -3713,7 +3715,7 @@ enum **PropertyHint**: :ref:`🔗<enum_@GlobalScope_PropertyHint>`
|
||||
hint_string = "%d/%d:Zero,One,Three:3,Six:6" % [TYPE_INT, PROPERTY_HINT_ENUM] # 整数数组(枚举)。
|
||||
hint_string = "%d/%d:*.png" % [TYPE_STRING, PROPERTY_HINT_FILE] # 字符串数组(文件路径)。
|
||||
hint_string = "%d/%d:Texture2D" % [TYPE_OBJECT, PROPERTY_HINT_RESOURCE_TYPE] # 纹理数组。
|
||||
|
||||
|
||||
hint_string = "%d:%d:" % [TYPE_ARRAY, TYPE_FLOAT] # 浮点数二维数组。
|
||||
hint_string = "%d:%d/%d:" % [TYPE_ARRAY, TYPE_STRING, PROPERTY_HINT_MULTILINE_TEXT] # 多行字符串二维数组。
|
||||
hint_string = "%d:%d/%d:-1,1,0.1" % [TYPE_ARRAY, TYPE_FLOAT, PROPERTY_HINT_RANGE] # 浮点数二维数组(范围为 -1 到 1)。
|
||||
@@ -3726,7 +3728,7 @@ enum **PropertyHint**: :ref:`🔗<enum_@GlobalScope_PropertyHint>`
|
||||
hintString = $"{Variant.Type.Int:D}/{PropertyHint.Enum:D}:Zero,One,Three:3,Six:6"; // 整数数组(枚举)。
|
||||
hintString = $"{Variant.Type.String:D}/{PropertyHint.File:D}:*.png"; // 字符串数组(文件路径)。
|
||||
hintString = $"{Variant.Type.Object:D}/{PropertyHint.ResourceType:D}:Texture2D"; // 纹理数组。
|
||||
|
||||
|
||||
hintString = $"{Variant.Type.Array:D}:{Variant.Type.Float:D}:"; // 浮点数二维数组。
|
||||
hintString = $"{Variant.Type.Array:D}:{Variant.Type.String:D}/{PropertyHint.MultilineText:D}:"; // 多行字符串二维数组。
|
||||
hintString = $"{Variant.Type.Array:D}:{Variant.Type.Float:D}/{PropertyHint.Range:D}:-1,1,0.1"; // 浮点数二维数组(范围为 -1 到 1)。
|
||||
@@ -3802,7 +3804,9 @@ enum **PropertyHint**: :ref:`🔗<enum_@GlobalScope_PropertyHint>`
|
||||
|
||||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_ARRAY_TYPE** = ``31``
|
||||
|
||||
提示属性是一个 :ref:`Array<class_Array>`\ ,其存储类型在提示字符串中指定。
|
||||
提示属性为 :ref:`Array<class_Array>`\ ,其中所存储的类型在提示字符串中指定。提示字符串中包含的是数组的类型(例如 ``"String"``\ )。
|
||||
|
||||
对存储的类型进行更精细的控制请使用 :ref:`PROPERTY_HINT_TYPE_STRING<class_@GlobalScope_constant_PROPERTY_HINT_TYPE_STRING>` 中的提示字符串。
|
||||
|
||||
.. _class_@GlobalScope_constant_PROPERTY_HINT_DICTIONARY_TYPE:
|
||||
|
||||
@@ -3810,7 +3814,9 @@ enum **PropertyHint**: :ref:`🔗<enum_@GlobalScope_PropertyHint>`
|
||||
|
||||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_DICTIONARY_TYPE** = ``38``
|
||||
|
||||
提示属性是一个 :ref:`Dictionary<class_Dictionary>`\ ,其存储类型在提示字符串中指定。
|
||||
提示属性为 :ref:`Dictionary<class_Dictionary>`\ ,其中所存储的类型在提示字符串中指定。提示字符串中包含的是键和值的类型,由英文分号分隔(例如 ``"int;String"``\ )。
|
||||
|
||||
对存储的类型进行更精细的控制请使用 :ref:`PROPERTY_HINT_TYPE_STRING<class_@GlobalScope_constant_PROPERTY_HINT_TYPE_STRING>` 中的提示字符串。
|
||||
|
||||
.. _class_@GlobalScope_constant_PROPERTY_HINT_LOCALE_ID:
|
||||
|
||||
@@ -3875,11 +3881,41 @@ enum **PropertyHint**: :ref:`🔗<enum_@GlobalScope_PropertyHint>`
|
||||
|
||||
提示一个属性在设置后仍会自动被改变,例如\ :ref:`AudioStreamPlayer.playing<class_AudioStreamPlayer_property_playing>`\ 或\ :ref:`GPUParticles3D.emitting<class_GPUParticles3D_property_emitting>`\ 。
|
||||
|
||||
.. _class_@GlobalScope_constant_PROPERTY_HINT_GROUP_ENABLE:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_GROUP_ENABLE** = ``42``
|
||||
|
||||
提示布尔值属性会启用属性所在分组对应的功能。属性会以复选框的形式在分组标题上显示。仅在分组或子分组中有效。
|
||||
|
||||
默认情况下,禁用该属性会隐藏分组中的所有属性。请使用可选的提示字符串 ``"checkbox_only"`` 禁用该行为。
|
||||
|
||||
.. _class_@GlobalScope_constant_PROPERTY_HINT_INPUT_NAME:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_INPUT_NAME** = ``43``
|
||||
|
||||
提示 :ref:`String<class_String>` 和 :ref:`StringName<class_StringName>` 属性为输入动作的名称。允许选择项目设置“输入映射”中的动作名称。提示字符串可以包含两个选项,由英文逗号分隔:
|
||||
|
||||
- 如果包含 ``"show_builtin"`` 则选项中包含内置输入动作。
|
||||
|
||||
- 如果包含 ``"loose_mode"`` 则启用宽松模式,允许插入任意动作名称,可以是输入映射中不存在的名称。
|
||||
|
||||
.. _class_@GlobalScope_constant_PROPERTY_HINT_FILE_PATH:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_FILE_PATH** = ``44``
|
||||
|
||||
与 :ref:`PROPERTY_HINT_FILE<class_@GlobalScope_constant_PROPERTY_HINT_FILE>` 类似,但是属性以原始路径的形式存储,不使用 UID。这意味着移动文件后引用可能损坏。请尽量使用 :ref:`PROPERTY_HINT_FILE<class_@GlobalScope_constant_PROPERTY_HINT_FILE>`\ 。
|
||||
|
||||
.. _class_@GlobalScope_constant_PROPERTY_HINT_MAX:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_MAX** = ``42``
|
||||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_MAX** = ``45``
|
||||
|
||||
代表 :ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` 枚举的大小。
|
||||
|
||||
@@ -4225,7 +4261,7 @@ flags **MethodFlags**: :ref:`🔗<enum_@GlobalScope_MethodFlags>`
|
||||
|
||||
:ref:`MethodFlags<enum_@GlobalScope_MethodFlags>` **METHOD_FLAG_VIRTUAL_REQUIRED** = ``128``
|
||||
|
||||
必选虚方法的标志。
|
||||
必选虚方法的标志。GDScript 会为抽象函数设置该标志。
|
||||
|
||||
.. _class_@GlobalScope_constant_METHOD_FLAGS_DEFAULT:
|
||||
|
||||
@@ -5261,19 +5297,19 @@ enum **Variant.Operator**: :ref:`🔗<enum_@GlobalScope_Variant.Operator>`
|
||||
|
||||
var a = abs(-1)
|
||||
# a=1
|
||||
|
||||
|
||||
var b = abs(-1.2)
|
||||
# b=1.2
|
||||
|
||||
|
||||
var c = abs(Vector2(-3.5, -4))
|
||||
# c=(3.5, 4)
|
||||
|
||||
|
||||
var d = abs(Vector2i(-5, -6))
|
||||
# d=(5, 6)
|
||||
|
||||
|
||||
var e = abs(Vector3(-7, 8.5, -3.8))
|
||||
# e=(7, 8.5, 3.8)
|
||||
|
||||
|
||||
var f = abs(Vector3i(-7, -8, -9))
|
||||
# f=(7, 8, 9)
|
||||
|
||||
@@ -5346,7 +5382,7 @@ enum **Variant.Operator**: :ref:`🔗<enum_@GlobalScope_Variant.Operator>`
|
||||
|
||||
var a = acosh(2) # 返回 1.31695789692482
|
||||
cosh(a) # 返回 2
|
||||
|
||||
|
||||
var b = acosh(-1) # 返回 0
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
@@ -5451,7 +5487,7 @@ enum **Variant.Operator**: :ref:`🔗<enum_@GlobalScope_Variant.Operator>`
|
||||
|
||||
var a = atanh(0.9) # 返回 1.47221948958322
|
||||
tanh(a) # 返回 0.9
|
||||
|
||||
|
||||
var b = atanh(-2) # 返回 -inf
|
||||
tanh(b) # 返回 -1
|
||||
|
||||
@@ -5572,7 +5608,7 @@ enum **Variant.Operator**: :ref:`🔗<enum_@GlobalScope_Variant.Operator>`
|
||||
|
||||
var a = clamp(-10, -1, 5)
|
||||
# a 是 -1
|
||||
|
||||
|
||||
var b = clamp(8.1, 0.9, 5.5)
|
||||
# b 是 5.5
|
||||
|
||||
@@ -5596,7 +5632,7 @@ enum **Variant.Operator**: :ref:`🔗<enum_@GlobalScope_Variant.Operator>`
|
||||
|
||||
var speed = 42.1
|
||||
var a = clampf(speed, 1.0, 20.5) # a 是 20.5
|
||||
|
||||
|
||||
speed = -10.0
|
||||
var b = clampf(speed, -1.0, 1.0) # b 是 -1.0
|
||||
|
||||
@@ -5616,7 +5652,7 @@ enum **Variant.Operator**: :ref:`🔗<enum_@GlobalScope_Variant.Operator>`
|
||||
|
||||
var speed = 42
|
||||
var a = clampi(speed, 1, 20) # a 是 20
|
||||
|
||||
|
||||
speed = -10
|
||||
var b = clampi(speed, -1, 1) # b 是 -1
|
||||
|
||||
@@ -5943,7 +5979,7 @@ enum **Variant.Operator**: :ref:`🔗<enum_@GlobalScope_Variant.Operator>`
|
||||
.. code-tab:: gdscript
|
||||
|
||||
var drink = "water"
|
||||
|
||||
|
||||
func _ready():
|
||||
var id = get_instance_id()
|
||||
var instance = instance_from_id(id)
|
||||
@@ -5954,7 +5990,7 @@ enum **Variant.Operator**: :ref:`🔗<enum_@GlobalScope_Variant.Operator>`
|
||||
public partial class MyNode : Node
|
||||
{
|
||||
public string Drink { get; set; } = "water";
|
||||
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
ulong id = GetInstanceId();
|
||||
@@ -5982,7 +6018,7 @@ enum **Variant.Operator**: :ref:`🔗<enum_@GlobalScope_Variant.Operator>`
|
||||
# 下面的 `lerp()` 调用时的插值比例是 0.75。
|
||||
var middle = lerp(20, 30, 0.75)
|
||||
# middle 现在是 27.5。
|
||||
|
||||
|
||||
# 现在,我们假装忘记了原来的比例,想要找到是多少。
|
||||
var ratio = inverse_lerp(20, 30, 27.5)
|
||||
# ratio 现在是 0.75。
|
||||
@@ -6015,7 +6051,7 @@ enum **Variant.Operator**: :ref:`🔗<enum_@GlobalScope_Variant.Operator>`
|
||||
|
||||
:ref:`bool<class_bool>` **is_finite**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_is_finite>`
|
||||
|
||||
返回 ``x`` 是否为有限值,即不是 :ref:`@GDScript.NAN<class_@GDScript_constant_NAN>`\ 、正无穷大或负无穷大。
|
||||
返回 ``x`` 是否为有限值,即不是 :ref:`@GDScript.NAN<class_@GDScript_constant_NAN>`\ 、正无穷大或负无穷大。另见 :ref:`is_inf()<class_@GlobalScope_method_is_inf>` 和 :ref:`is_nan()<class_@GlobalScope_method_is_nan>`\ 。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -6027,7 +6063,7 @@ enum **Variant.Operator**: :ref:`🔗<enum_@GlobalScope_Variant.Operator>`
|
||||
|
||||
:ref:`bool<class_bool>` **is_inf**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_is_inf>`
|
||||
|
||||
如果 ``x`` 是正无穷大或负无穷大,则返回 ``true`` 。
|
||||
如果 ``x`` 是正无穷大或负无穷大,则返回 ``true`` 。另见 :ref:`is_finite()<class_@GlobalScope_method_is_finite>` 和 :ref:`is_nan()<class_@GlobalScope_method_is_nan>`\ 。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -6063,7 +6099,7 @@ enum **Variant.Operator**: :ref:`🔗<enum_@GlobalScope_Variant.Operator>`
|
||||
|
||||
:ref:`bool<class_bool>` **is_nan**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_is_nan>`
|
||||
|
||||
如果 ``x`` 是 NaN(“非数字”或无效)值,则返回 ``true`` 。
|
||||
如果 ``x`` 为 NaN 值(“Not a Number”,不是数字,即无效值),则返回 ``true``\ 。存在的该方法必要性在于 :ref:`@GDScript.NAN<class_@GDScript_constant_NAN>` 与自身不相等,即无法使用 ``x == NAN`` 来判断是否为 NaN。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -6086,7 +6122,7 @@ enum **Variant.Operator**: :ref:`🔗<enum_@GlobalScope_Variant.Operator>`
|
||||
is_same(vec2_a, vec2_a) # true
|
||||
is_same(vec2_a, vec2_b) # true
|
||||
is_same(vec2_a, vec2_c) # false
|
||||
|
||||
|
||||
# Array 是引用类型
|
||||
var arr_a = []
|
||||
var arr_b = []
|
||||
@@ -6357,7 +6393,7 @@ enum **Variant.Operator**: :ref:`🔗<enum_@GlobalScope_Variant.Operator>`
|
||||
nearest_po2(3) # 返回 4
|
||||
nearest_po2(4) # 返回 4
|
||||
nearest_po2(5) # 返回 8
|
||||
|
||||
|
||||
nearest_po2(0) # 返回 0(可能出乎意料)
|
||||
nearest_po2(-1) # 返回 0(可能出乎意料)
|
||||
|
||||
@@ -6500,8 +6536,6 @@ URL 标签仅支持在 URL 标签中包含 URL,不支持使用不同标题的
|
||||
|
||||
\ **注意:**\ 请考虑使用 :ref:`push_error()<class_@GlobalScope_method_push_error>` 和 :ref:`push_warning()<class_@GlobalScope_method_push_warning>` 来打印错误和警告消息,而不是 :ref:`print()<class_@GlobalScope_method_print>` 或 :ref:`print_rich()<class_@GlobalScope_method_print_rich>`\ 。这将它们与用于调试目的的打印消息区分开来,同时还会在打印错误或警告时显示堆栈跟踪。
|
||||
|
||||
\ **注意:**\ 在 Windows 中,只有 Windows 10 及后续版本能够在标准输出中正确显示 ANSI 转义码。
|
||||
|
||||
\ **注意:**\ 在编辑器中显示的输出支持可点击的 ``[url=address]文本[/url]`` 标签。点击时, ``[url]`` 标签的 ``address`` 值由 :ref:`OS.shell_open()<class_OS_method_shell_open>` 处理。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
@@ -6711,7 +6745,7 @@ URL 标签仅支持在 URL 标签中包含 URL,不支持使用不同标题的
|
||||
::
|
||||
|
||||
var a = rand_from_seed(4)
|
||||
|
||||
|
||||
print(a[0]) # 输出 2879024997
|
||||
print(a[1]) # 输出 4
|
||||
|
||||
@@ -7018,7 +7052,7 @@ URL 标签仅支持在 URL 标签中包含 URL,不支持使用不同标题的
|
||||
sign(0.0) # 返回 0
|
||||
sign(6.0) # 返回 1
|
||||
sign(NAN) # 返回 0
|
||||
|
||||
|
||||
sign(Vector3(-6.0, 0.0, 6.0)) # 返回 (-1, 0, 1)
|
||||
|
||||
\ **注意:**\ 为了更好的类型安全,请使用 :ref:`signf()<class_@GlobalScope_method_signf>`\ 、\ :ref:`signi()<class_@GlobalScope_method_signi>`\ 、\ :ref:`Vector2.sign()<class_Vector2_method_sign>`\ 、\ :ref:`Vector2i.sign()<class_Vector2i_method_sign>`\ 、\ :ref:`Vector3.sign()<class_Vector3_method_sign>`\ 、\ :ref:`Vector3i.sign()<class_Vector3i_method_sign>`\ 、\ :ref:`Vector4.sign()<class_Vector4_method_sign>` 或 :ref:`Vector4i.sign()<class_Vector4i_method_sign>`\ 。
|
||||
@@ -7143,7 +7177,7 @@ URL 标签仅支持在 URL 标签中包含 URL,不支持使用不同标题的
|
||||
|
||||
snapped(100, 32) # 返回 96
|
||||
snapped(3.14159, 0.01) # 返回 3.14
|
||||
|
||||
|
||||
snapped(Vector2(34, 70), Vector2(8, 8)) # 返回 (32, 72)
|
||||
|
||||
另见 :ref:`ceil()<class_@GlobalScope_method_ceil>`\ 、\ :ref:`floor()<class_@GlobalScope_method_floor>` 和 :ref:`round()<class_@GlobalScope_method_round>`\ 。
|
||||
@@ -7198,7 +7232,7 @@ URL 标签仅支持在 URL 标签中包含 URL,不支持使用不同标题的
|
||||
|
||||
:ref:`float<class_float>` **sqrt**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_sqrt>`
|
||||
|
||||
返回 ``x`` 的平方根,其中 ``x`` 是一个非负数。
|
||||
返回 ``x`` 的平方根,\ ``x`` 为非负数。
|
||||
|
||||
::
|
||||
|
||||
@@ -7467,7 +7501,7 @@ URL 标签仅支持在 URL 标签中包含 URL,不支持使用不同标题的
|
||||
|
||||
:ref:`Variant<class_Variant>` **wrap**\ (\ value\: :ref:`Variant<class_Variant>`, min\: :ref:`Variant<class_Variant>`, max\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_wrap>`
|
||||
|
||||
在 ``min`` 和 ``max`` 之间包裹 :ref:`Variant<class_Variant>` ``value``\ 。可用于创建类似循环的行为或无限曲面。
|
||||
在 ``min`` 和 ``max`` 之间包裹 :ref:`Variant<class_Variant>` ``value``\ 。\ ``min`` *包含*\ 端点,\ ``max`` 则\ *不包含*\ 。可用于创建类似循环的行为或无限表面。
|
||||
|
||||
支持变体类型 :ref:`int<class_int>` 和 :ref:`float<class_float>`\ 。如果任一参数是 :ref:`float<class_float>`\ ,则该函数返回 :ref:`float<class_float>`\ ,否则返回 :ref:`int<class_int>`\ 。
|
||||
|
||||
@@ -7475,10 +7509,10 @@ URL 标签仅支持在 URL 标签中包含 URL,不支持使用不同标题的
|
||||
|
||||
var a = wrap(4, 5, 10)
|
||||
# a 为 9 (整数类型)
|
||||
|
||||
|
||||
var a = wrap(7, 5, 10)
|
||||
# a 为 7 (整数类型)
|
||||
|
||||
|
||||
var a = wrap(10.5, 5, 10)
|
||||
# a 为 5.5 (浮点类型)
|
||||
|
||||
@@ -7492,7 +7526,7 @@ URL 标签仅支持在 URL 标签中包含 URL,不支持使用不同标题的
|
||||
|
||||
:ref:`float<class_float>` **wrapf**\ (\ value\: :ref:`float<class_float>`, min\: :ref:`float<class_float>`, max\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_wrapf>`
|
||||
|
||||
在 ``min`` 和 ``max`` 之间将浮点数 ``value`` 循环。可用于创建类似循环的行为或无限曲面。
|
||||
在 ``min`` 和 ``max`` 之间将浮点数 ``value`` 循环。\ ``min`` *包含*\ 端点,\ ``max`` 则\ *不包含*\ 。可用于创建类似循环的行为或无限表面。
|
||||
|
||||
::
|
||||
|
||||
@@ -7509,9 +7543,7 @@ URL 标签仅支持在 URL 标签中包含 URL,不支持使用不同标题的
|
||||
# 无限旋转(弧度)
|
||||
angle = wrapf(angle + 0.1, -PI, PI)
|
||||
|
||||
\ **注意:**\ 如果 ``min`` 为 ``0``\ ,则相当于 :ref:`fposmod()<class_@GlobalScope_method_fposmod>`\ ,因此请改用它。
|
||||
|
||||
通过让用户控制最小值,\ :ref:`wrapf()<class_@GlobalScope_method_wrapf>` 比使用 :ref:`fposmod()<class_@GlobalScope_method_fposmod>` 方法更灵活。
|
||||
\ **注意:**\ 如果 ``min`` 为 ``0``\ ,则相当于 :ref:`fposmod()<class_@GlobalScope_method_fposmod>`\ ,因此请优先使用后者。通过让用户控制最小值,\ :ref:`wrapf()<class_@GlobalScope_method_wrapf>` 比使用 :ref:`fposmod()<class_@GlobalScope_method_fposmod>` 方法更灵活。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -7523,7 +7555,7 @@ URL 标签仅支持在 URL 标签中包含 URL,不支持使用不同标题的
|
||||
|
||||
:ref:`int<class_int>` **wrapi**\ (\ value\: :ref:`int<class_int>`, min\: :ref:`int<class_int>`, max\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_wrapi>`
|
||||
|
||||
在 ``min`` 和 ``max`` 之间环绕整数 ``value``\ 。 可用于创建类似循环的行为或无限曲面。
|
||||
在 ``min`` 和 ``max`` 之间环绕整数 ``value``\ 。\ ``min`` *包含*\ 端点,\ ``max`` 则\ *不包含*\ 。可用于创建类似循环的行为或无限曲面。
|
||||
|
||||
::
|
||||
|
||||
@@ -7536,6 +7568,7 @@ URL 标签仅支持在 URL 标签中包含 URL,不支持使用不同标题的
|
||||
var result = wrapi(-6, -5, -1)
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AABB.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AABB.xml.
|
||||
|
||||
.. _class_AABB:
|
||||
|
||||
@@ -286,7 +286,7 @@ AABB
|
||||
var a = AABB(Vector3(0, 0, 0), Vector3(4, 4, 4))
|
||||
var b = AABB(Vector3(1, 1, 1), Vector3(3, 3, 3))
|
||||
var c = AABB(Vector3(2, 2, 2), Vector3(8, 8, 8))
|
||||
|
||||
|
||||
print(a.encloses(a)) # 打印 true
|
||||
print(a.encloses(b)) # 打印 true
|
||||
print(a.encloses(c)) # 打印 false
|
||||
@@ -296,7 +296,7 @@ AABB
|
||||
var a = new Aabb(new Vector3(0, 0, 0), new Vector3(4, 4, 4));
|
||||
var b = new Aabb(new Vector3(1, 1, 1), new Vector3(3, 3, 3));
|
||||
var c = new Aabb(new Vector3(2, 2, 2), new Vector3(8, 8, 8));
|
||||
|
||||
|
||||
GD.Print(a.Encloses(a)); // 打印 True
|
||||
GD.Print(a.Encloses(b)); // 打印 True
|
||||
GD.Print(a.Encloses(c)); // 打印 False
|
||||
@@ -321,11 +321,11 @@ AABB
|
||||
.. code-tab:: gdscript
|
||||
|
||||
var box = AABB(Vector3(0, 0, 0), Vector3(5, 2, 5))
|
||||
|
||||
|
||||
box = box.expand(Vector3(10, 0, 0))
|
||||
print(box.position) # 输出 (0.0, 0.0, 0.0)
|
||||
print(box.size) # 输出 (10.0, 2.0, 5.0)
|
||||
|
||||
|
||||
box = box.expand(Vector3(-5, 0, 5))
|
||||
print(box.position) # 输出 (-5.0, 0.0, 0.0)
|
||||
print(box.size) # 输出 (15.0, 2.0, 5.0)
|
||||
@@ -333,11 +333,11 @@ AABB
|
||||
.. code-tab:: csharp
|
||||
|
||||
var box = new Aabb(new Vector3(0, 0, 0), new Vector3(5, 2, 5));
|
||||
|
||||
|
||||
box = box.Expand(new Vector3(10, 0, 0));
|
||||
GD.Print(box.Position); // 输出 (0, 0, 0)
|
||||
GD.Print(box.Size); // 输出 (10, 2, 5)
|
||||
|
||||
|
||||
box = box.Expand(new Vector3(-5, 0, 5));
|
||||
GD.Print(box.Position); // 输出 (-5, 0, 0)
|
||||
GD.Print(box.Size); // 输出 (15, 2, 5)
|
||||
@@ -386,7 +386,7 @@ AABB
|
||||
.. code-tab:: gdscript
|
||||
|
||||
var box = AABB(Vector3(0, 0, 0), Vector3(2, 4, 8))
|
||||
|
||||
|
||||
print(box.get_longest_axis()) # 输出 (0.0, 0.0, 1.0)
|
||||
print(box.get_longest_axis_index()) # 输出 2
|
||||
print(box.get_longest_axis_size()) # 输出 8.0
|
||||
@@ -394,7 +394,7 @@ AABB
|
||||
.. code-tab:: csharp
|
||||
|
||||
var box = new Aabb(new Vector3(0, 0, 0), new Vector3(2, 4, 8));
|
||||
|
||||
|
||||
GD.Print(box.GetLongestAxis()); // 输出 (0, 0, 1)
|
||||
GD.Print(box.GetLongestAxisIndex()); // 输出 Z
|
||||
GD.Print(box.GetLongestAxisSize()); // 输出 8
|
||||
@@ -449,7 +449,7 @@ AABB
|
||||
.. code-tab:: gdscript
|
||||
|
||||
var box = AABB(Vector3(0, 0, 0), Vector3(2, 4, 8))
|
||||
|
||||
|
||||
print(box.get_shortest_axis()) # 输出 (1.0, 0.0, 0.0)
|
||||
print(box.get_shortest_axis_index()) # 输出 0
|
||||
print(box.get_shortest_axis_size()) # 输出 2.0
|
||||
@@ -457,7 +457,7 @@ AABB
|
||||
.. code-tab:: csharp
|
||||
|
||||
var box = new Aabb(new Vector3(0, 0, 0), new Vector3(2, 4, 8));
|
||||
|
||||
|
||||
GD.Print(box.GetShortestAxis()); // 输出 (1, 0, 0)
|
||||
GD.Print(box.GetShortestAxisIndex()); // 输出 X
|
||||
GD.Print(box.GetShortestAxisSize()); // 输出 2
|
||||
@@ -538,7 +538,7 @@ AABB
|
||||
var a = AABB(Vector3(4, 4, 4), Vector3(8, 8, 8)).grow(4)
|
||||
print(a.position) # 输出 (0.0, 0.0, 0.0)
|
||||
print(a.size) # 输出 (16.0, 16.0, 16.0)
|
||||
|
||||
|
||||
var b = AABB(Vector3(0, 0, 0), Vector3(8, 4, 2)).grow(2)
|
||||
print(b.position) # 输出 (-2.0, -2.0, -2.0)
|
||||
print(b.size) # 输出 (12.0, 8.0, 6.0)
|
||||
@@ -548,7 +548,7 @@ AABB
|
||||
var a = new Aabb(new Vector3(4, 4, 4), new Vector3(8, 8, 8)).Grow(4);
|
||||
GD.Print(a.Position); // 输出 (0, 0, 0)
|
||||
GD.Print(a.Size); // 输出 (16, 16, 16)
|
||||
|
||||
|
||||
var b = new Aabb(new Vector3(0, 0, 0), new Vector3(8, 4, 2)).Grow(2);
|
||||
GD.Print(b.Position); // 输出 (-2, -2, -2)
|
||||
GD.Print(b.Size); // 输出 (12, 8, 6)
|
||||
@@ -612,7 +612,7 @@ AABB
|
||||
|
||||
var box1 = AABB(Vector3(0, 0, 0), Vector3(5, 2, 8))
|
||||
var box2 = AABB(Vector3(2, 0, 2), Vector3(8, 4, 4))
|
||||
|
||||
|
||||
var intersection = box1.intersection(box2)
|
||||
print(intersection.position) # 输出 (2.0, 0.0, 2.0)
|
||||
print(intersection.size) # 输出 (3.0, 2.0, 4.0)
|
||||
@@ -621,7 +621,7 @@ AABB
|
||||
|
||||
var box1 = new Aabb(new Vector3(0, 0, 0), new Vector3(5, 2, 8));
|
||||
var box2 = new Aabb(new Vector3(2, 0, 2), new Vector3(8, 4, 4));
|
||||
|
||||
|
||||
var intersection = box1.Intersection(box2);
|
||||
GD.Print(intersection.Position); // 输出 (2, 0, 2)
|
||||
GD.Print(intersection.Size); // 输出 (3, 2, 4)
|
||||
@@ -768,6 +768,7 @@ AABB
|
||||
\ **注意:**\ 由于浮点数精度误差,请考虑改用 :ref:`is_equal_approx()<class_AABB_method_is_equal_approx>`\ ,会更可靠。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AcceptDialog.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AcceptDialog.xml.
|
||||
|
||||
.. _class_AcceptDialog:
|
||||
|
||||
@@ -44,7 +44,11 @@ AcceptDialog
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | keep_title_visible | ``true`` (overrides :ref:`Window<class_Window_property_keep_title_visible>`) |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`ok_button_text<class_AcceptDialog_property_ok_button_text>` | ``"OK"`` |
|
||||
| :ref:`bool<class_bool>` | maximize_disabled | ``true`` (overrides :ref:`Window<class_Window_property_maximize_disabled>`) |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | minimize_disabled | ``true`` (overrides :ref:`Window<class_Window_property_minimize_disabled>`) |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`ok_button_text<class_AcceptDialog_property_ok_button_text>` | ``""`` |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | title | ``"Alert!"`` (overrides :ref:`Window<class_Window_property_title>`) |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||||
@@ -134,7 +138,7 @@ AcceptDialog
|
||||
|
||||
**custom_action**\ (\ action\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AcceptDialog_signal_custom_action>`
|
||||
|
||||
按下自定义按钮时发出。见 :ref:`add_button()<class_AcceptDialog_method_add_button>`\ 。
|
||||
按下带有动作的自定义按钮时发出。参见 :ref:`add_button()<class_AcceptDialog_method_add_button>`\ 。
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
@@ -173,7 +177,7 @@ AcceptDialog
|
||||
- |void| **set_close_on_escape**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||||
- :ref:`bool<class_bool>` **get_close_on_escape**\ (\ )
|
||||
|
||||
如果为 ``true``\ ,当按下退出键(\ :ref:`@GlobalScope.KEY_ESCAPE<class_@GlobalScope_constant_KEY_ESCAPE>`\ )时,对话框将被隐藏。
|
||||
如果为 ``true``\ ,则按下 ``ui_cancel`` 动作时会隐藏对话框(该动作默认绑定至 :ref:`@GlobalScope.KEY_ESCAPE<class_@GlobalScope_constant_KEY_ESCAPE>`\ )。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -219,14 +223,14 @@ AcceptDialog
|
||||
|
||||
.. rst-class:: classref-property
|
||||
|
||||
:ref:`String<class_String>` **ok_button_text** = ``"OK"`` :ref:`🔗<class_AcceptDialog_property_ok_button_text>`
|
||||
:ref:`String<class_String>` **ok_button_text** = ``""`` :ref:`🔗<class_AcceptDialog_property_ok_button_text>`
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- |void| **set_ok_button_text**\ (\ value\: :ref:`String<class_String>`\ )
|
||||
- :ref:`String<class_String>` **get_ok_button_text**\ (\ )
|
||||
|
||||
确定按钮(参见 :ref:`get_ok_button()<class_AcceptDialog_method_get_ok_button>`\ )显示的文本。
|
||||
确定按钮显示的文本(见 :ref:`get_ok_button()<class_AcceptDialog_method_get_ok_button>`\ )。留空时使用默认文本。
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
@@ -243,7 +247,9 @@ AcceptDialog
|
||||
|
||||
:ref:`Button<class_Button>` **add_button**\ (\ text\: :ref:`String<class_String>`, right\: :ref:`bool<class_bool>` = false, action\: :ref:`String<class_String>` = ""\ ) :ref:`🔗<class_AcceptDialog_method_add_button>`
|
||||
|
||||
将带有标签 ``text`` 和自定义 ``action`` 的按钮添加到对话框,并返回该创建的按钮。\ ``action`` 将在按钮被按下时传递给 :ref:`custom_action<class_AcceptDialog_signal_custom_action>` 信号。
|
||||
将带有标签 ``text`` 和自定义 ``action`` 的按钮添加到对话框,并返回该创建的按钮。
|
||||
|
||||
如果 ``action`` 不为空,按下按钮将发出具有指定动作字符串的 :ref:`custom_action<class_AcceptDialog_signal_custom_action>` 信号。
|
||||
|
||||
如果 ``right`` 为 ``true``\ ,按钮会被放置在所有同级按钮的右侧。
|
||||
|
||||
@@ -369,6 +375,7 @@ AcceptDialog
|
||||
填充窗口背景的面板。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AESContext.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AESContext.xml.
|
||||
|
||||
.. _class_AESContext:
|
||||
|
||||
@@ -27,9 +27,9 @@ AESContext
|
||||
.. code-tab:: gdscript
|
||||
|
||||
extends Node
|
||||
|
||||
|
||||
var aes = AESContext.new()
|
||||
|
||||
|
||||
func _ready():
|
||||
var key = "My secret key!!!" # 密钥必须是 16 或 32 字节。
|
||||
var data = "My secret text!!" # 数据大小必须是 16 字节的倍数,需要时添加补白。
|
||||
@@ -43,7 +43,7 @@ AESContext
|
||||
aes.finish()
|
||||
# ECB 校验
|
||||
assert(decrypted == data.to_utf8_buffer())
|
||||
|
||||
|
||||
var iv = "My secret iv!!!!" # IV 必须是 16 字节。
|
||||
# CBC 加密
|
||||
aes.start(AESContext.MODE_CBC_ENCRYPT, key.to_utf8_buffer(), iv.to_utf8_buffer())
|
||||
@@ -60,11 +60,11 @@ AESContext
|
||||
|
||||
using Godot;
|
||||
using System.Diagnostics;
|
||||
|
||||
|
||||
public partial class MyNode : Node
|
||||
{
|
||||
private AesContext _aes = new AesContext();
|
||||
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
string key = "My secret key!!!"; // 密钥必须是 16 或 32 字节。
|
||||
@@ -79,7 +79,7 @@ AESContext
|
||||
_aes.Finish();
|
||||
// ECB 校验
|
||||
Debug.Assert(decrypted == data.ToUtf8Buffer());
|
||||
|
||||
|
||||
string iv = "My secret iv!!!!"; // IV 必须是 16 字节。
|
||||
// CBC 加密
|
||||
_aes.Start(AesContext.Mode.EcbEncrypt, key.ToUtf8Buffer(), iv.ToUtf8Buffer());
|
||||
@@ -227,6 +227,7 @@ AES 密码封锁器链式解密模式。
|
||||
\ **注意:**\ ``src`` 的大小必须是 16 倍的倍数。如果需要,应用一些填充。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
197
classes/zh_CN/class_aimmodifier3d.rst
Normal file
197
classes/zh_CN/class_aimmodifier3d.rst
Normal file
@@ -0,0 +1,197 @@
|
||||
:github_url: hide
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AimModifier3D.xml.
|
||||
|
||||
.. _class_AimModifier3D:
|
||||
|
||||
AimModifier3D
|
||||
=============
|
||||
|
||||
**继承:** :ref:`BoneConstraint3D<class_BoneConstraint3D>` **<** :ref:`SkeletonModifier3D<class_SkeletonModifier3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||||
|
||||
**AimModifier3D** 会旋转骨骼,让它看向某个目标。
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
描述
|
||||
----
|
||||
|
||||
这是 :ref:`LookAtModifier3D<class_LookAtModifier3D>` 的简易版本,只允许骨骼指向参考项,不带角度限制、基于时间的插值等高级选项。
|
||||
|
||||
功能虽简,但实现了无需欧拉值的平滑跟踪,见 :ref:`set_use_euler()<class_AimModifier3D_method_set_use_euler>`\ 。
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
属性
|
||||
----
|
||||
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-----------------------+------------------------------------------------------------------+-------+
|
||||
| :ref:`int<class_int>` | :ref:`setting_count<class_AimModifier3D_property_setting_count>` | ``0`` |
|
||||
+-----------------------+------------------------------------------------------------------+-------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
方法
|
||||
----
|
||||
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` | :ref:`get_forward_axis<class_AimModifier3D_method_get_forward_axis>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
|
||||
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Axis<enum_Vector3_Axis>` | :ref:`get_primary_rotation_axis<class_AimModifier3D_method_get_primary_rotation_axis>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
|
||||
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_using_euler<class_AimModifier3D_method_is_using_euler>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
|
||||
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_using_secondary_rotation<class_AimModifier3D_method_is_using_secondary_rotation>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
|
||||
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`set_forward_axis<class_AimModifier3D_method_set_forward_axis>`\ (\ index\: :ref:`int<class_int>`, axis\: :ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>`\ ) |
|
||||
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`set_primary_rotation_axis<class_AimModifier3D_method_set_primary_rotation_axis>`\ (\ index\: :ref:`int<class_int>`, axis\: :ref:`Axis<enum_Vector3_Axis>`\ ) |
|
||||
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`set_use_euler<class_AimModifier3D_method_set_use_euler>`\ (\ index\: :ref:`int<class_int>`, enabled\: :ref:`bool<class_bool>`\ ) |
|
||||
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`set_use_secondary_rotation<class_AimModifier3D_method_set_use_secondary_rotation>`\ (\ index\: :ref:`int<class_int>`, enabled\: :ref:`bool<class_bool>`\ ) |
|
||||
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
属性说明
|
||||
--------
|
||||
|
||||
.. _class_AimModifier3D_property_setting_count:
|
||||
|
||||
.. rst-class:: classref-property
|
||||
|
||||
:ref:`int<class_int>` **setting_count** = ``0`` :ref:`🔗<class_AimModifier3D_property_setting_count>`
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- |void| **set_setting_count**\ (\ value\: :ref:`int<class_int>`\ )
|
||||
- :ref:`int<class_int>` **get_setting_count**\ (\ )
|
||||
|
||||
修改器中设置的数量。
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
方法说明
|
||||
--------
|
||||
|
||||
.. _class_AimModifier3D_method_get_forward_axis:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` **get_forward_axis**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_AimModifier3D_method_get_forward_axis>`
|
||||
|
||||
返回骨骼的向前轴。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AimModifier3D_method_get_primary_rotation_axis:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Axis<enum_Vector3_Axis>` **get_primary_rotation_axis**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_AimModifier3D_method_get_primary_rotation_axis>`
|
||||
|
||||
返回第一个旋转的转轴。仅在 :ref:`is_using_euler()<class_AimModifier3D_method_is_using_euler>` 为 ``true`` 时启用。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AimModifier3D_method_is_using_euler:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **is_using_euler**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_AimModifier3D_method_is_using_euler>`
|
||||
|
||||
如果提供的旋转使用欧拉值则返回 ``true``\ 。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AimModifier3D_method_is_using_secondary_rotation:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **is_using_secondary_rotation**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_AimModifier3D_method_is_using_secondary_rotation>`
|
||||
|
||||
如果提供的旋转是根据两个轴得到的,则返回 ``true``\ 。仅在 :ref:`is_using_euler()<class_AimModifier3D_method_is_using_euler>` 为 ``true`` 时启用。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AimModifier3D_method_set_forward_axis:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
|void| **set_forward_axis**\ (\ index\: :ref:`int<class_int>`, axis\: :ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>`\ ) :ref:`🔗<class_AimModifier3D_method_set_forward_axis>`
|
||||
|
||||
设置骨骼的向前轴。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AimModifier3D_method_set_primary_rotation_axis:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
|void| **set_primary_rotation_axis**\ (\ index\: :ref:`int<class_int>`, axis\: :ref:`Axis<enum_Vector3_Axis>`\ ) :ref:`🔗<class_AimModifier3D_method_set_primary_rotation_axis>`
|
||||
|
||||
设置第一个旋转的转轴。仅在 :ref:`is_using_euler()<class_AimModifier3D_method_is_using_euler>` 为 ``true`` 时启用。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AimModifier3D_method_set_use_euler:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
|void| **set_use_euler**\ (\ index\: :ref:`int<class_int>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_AimModifier3D_method_set_use_euler>`
|
||||
|
||||
如果将 ``enabled`` 设为 ``true``\ ,则提供的旋转使用欧拉值。
|
||||
|
||||
如果将 ``enabled`` 设为 ``false``\ ,则提供的旋转使用根据向前轴向量与指向参考的向量生成的旋转弧。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AimModifier3D_method_set_use_secondary_rotation:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
|void| **set_use_secondary_rotation**\ (\ index\: :ref:`int<class_int>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_AimModifier3D_method_set_use_secondary_rotation>`
|
||||
|
||||
如果将 ``enabled`` 设为 ``true``\ ,则提供的旋转是根据两个轴得到的,仅在 :ref:`is_using_euler()<class_AimModifier3D_method_is_using_euler>` 为 ``true`` 时启用。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
.. |static| replace:: :abbr:`static (调用本方法无需实例,可直接使用类名进行调用。)`
|
||||
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效运算符。)`
|
||||
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列位标志构成位掩码的整数。)`
|
||||
.. |void| replace:: :abbr:`void (无返回值。)`
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimatableBody2D.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimatableBody2D.xml.
|
||||
|
||||
.. _class_AnimatableBody2D:
|
||||
|
||||
@@ -23,6 +23,15 @@ AnimatableBody2D
|
||||
|
||||
\ **AnimatableBody2D** 发生移动时,会对线速度和角速度进行估算,并用于影响其路径上的其他物理物体。因此适用于移动平台、门等移动的对象。
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
教程
|
||||
----
|
||||
|
||||
- :doc:`物理介绍 <../tutorials/physics/physics_introduction>`
|
||||
|
||||
- :doc:`排查物理问题 <../tutorials/physics/troubleshooting_physics_issues>`
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
属性
|
||||
@@ -58,6 +67,7 @@ AnimatableBody2D
|
||||
如果为 ``true``\ ,则物体的运动将与物理帧同步。当通过 :ref:`AnimationPlayer<class_AnimationPlayer>` 为运动设置动画时,例如在移动的平台上,这个功能很有用。\ **不要**\ 与\ :ref:`PhysicsBody2D.move_and_collide()<class_PhysicsBody2D_method_move_and_collide>`\ 一起使用。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimatableBody3D.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimatableBody3D.xml.
|
||||
|
||||
.. _class_AnimatableBody3D:
|
||||
|
||||
@@ -28,6 +28,10 @@ AnimatableBody3D
|
||||
教程
|
||||
----
|
||||
|
||||
- :doc:`物理介绍 <../tutorials/physics/physics_introduction>`
|
||||
|
||||
- :doc:`排查物理问题 <../tutorials/physics/troubleshooting_physics_issues>`
|
||||
|
||||
- `3D 物理测试演示 <https://godotengine.org/asset-library/asset/2747>`__
|
||||
|
||||
- `第三人称射击(TPS)演示 <https://godotengine.org/asset-library/asset/2710>`__
|
||||
@@ -69,6 +73,7 @@ AnimatableBody3D
|
||||
如果为 ``true``\ ,则实体的运动将与物理帧同步。当通过 :ref:`AnimationPlayer<class_AnimationPlayer>` 为运动设置动画时,例如在移动的平台上,这个功能很有用。请\ **不要**\ 与 :ref:`PhysicsBody3D.move_and_collide()<class_PhysicsBody3D_method_move_and_collide>` 函数一起使用。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimatedSprite2D.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimatedSprite2D.xml.
|
||||
|
||||
.. _class_AnimatedSprite2D:
|
||||
|
||||
@@ -413,19 +413,18 @@ AnimatedSprite2D
|
||||
|
||||
|void| **set_frame_and_progress**\ (\ frame\: :ref:`int<class_int>`, progress\: :ref:`float<class_float>`\ ) :ref:`🔗<class_AnimatedSprite2D_method_set_frame_and_progress>`
|
||||
|
||||
将 :ref:`frame<class_AnimatedSprite2D_property_frame>` 和 :ref:`frame_progress<class_AnimatedSprite2D_property_frame_progress>` 设置为给定的值。与直接设置 :ref:`frame<class_AnimatedSprite2D_property_frame>` 不同,此方法不会隐式地将 :ref:`frame_progress<class_AnimatedSprite2D_property_frame_progress>` 重置为 ``0.0``\ 。
|
||||
将帧设置为 :ref:`frame<class_AnimatedSprite2D_property_frame>`\ 、帧进度设置为 :ref:`frame_progress<class_AnimatedSprite2D_property_frame_progress>`\ 。与直接设置 :ref:`frame<class_AnimatedSprite2D_property_frame>` 不同,此方法不会隐式地将 :ref:`frame_progress<class_AnimatedSprite2D_property_frame_progress>` 重置为 ``0.0``\ 。
|
||||
|
||||
\ **示例:** 在保持相同的 :ref:`frame<class_AnimatedSprite2D_property_frame>` 和 :ref:`frame_progress<class_AnimatedSprite2D_property_frame_progress>` 的情况下更改动画:
|
||||
\ **示例:**\ 在保持相同的 :ref:`frame<class_AnimatedSprite2D_property_frame>` 和 :ref:`frame_progress<class_AnimatedSprite2D_property_frame_progress>` 的情况下更改动画:
|
||||
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. code-tab:: gdscript
|
||||
|
||||
# 更改动画的同时保留帧索引和进度。
|
||||
var current_frame = animated_sprite.get_frame()
|
||||
var current_progress = animated_sprite.get_frame_progress()
|
||||
animated_sprite.play("walk_another_skin")
|
||||
animated_sprite.play("行走动画_换皮版")
|
||||
animated_sprite.set_frame_and_progress(current_frame, current_progress)
|
||||
|
||||
|
||||
@@ -443,6 +442,7 @@ AnimatedSprite2D
|
||||
停止当前正在播放的动画。会将动画的位置重置为 ``0``\ ,并将 ``custom_speed`` 重置为 ``1.0``\ 。另见 :ref:`pause()<class_AnimatedSprite2D_method_pause>`\ 。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimatedSprite3D.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimatedSprite3D.xml.
|
||||
|
||||
.. _class_AnimatedSprite3D:
|
||||
|
||||
@@ -333,19 +333,18 @@ AnimatedSprite3D
|
||||
|
||||
|void| **set_frame_and_progress**\ (\ frame\: :ref:`int<class_int>`, progress\: :ref:`float<class_float>`\ ) :ref:`🔗<class_AnimatedSprite3D_method_set_frame_and_progress>`
|
||||
|
||||
将 :ref:`frame<class_AnimatedSprite3D_property_frame>` 和 :ref:`frame_progress<class_AnimatedSprite3D_property_frame_progress>` 设置为给定的值。与直接设置 :ref:`frame<class_AnimatedSprite3D_property_frame>` 不同,此方法不会隐式地将 :ref:`frame_progress<class_AnimatedSprite3D_property_frame_progress>` 重置为 ``0.0``\ 。
|
||||
将帧设置为 :ref:`frame<class_AnimatedSprite3D_property_frame>`\ 、帧进度设置为 :ref:`frame_progress<class_AnimatedSprite3D_property_frame_progress>`\ 。与直接设置 :ref:`frame<class_AnimatedSprite3D_property_frame>` 不同,此方法不会隐式地将 :ref:`frame_progress<class_AnimatedSprite3D_property_frame_progress>` 重置为 ``0.0``\ 。
|
||||
|
||||
\ **示例:** 在保持相同的 :ref:`frame<class_AnimatedSprite3D_property_frame>` 和 :ref:`frame_progress<class_AnimatedSprite3D_property_frame_progress>` 的情况下更改动画:
|
||||
\ **示例:**\ 在保持相同的 :ref:`frame<class_AnimatedSprite3D_property_frame>` 和 :ref:`frame_progress<class_AnimatedSprite3D_property_frame_progress>` 的情况下更改动画:
|
||||
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. code-tab:: gdscript
|
||||
|
||||
# 更改动画的同时保留帧索引和进度。
|
||||
var current_frame = animated_sprite.get_frame()
|
||||
var current_progress = animated_sprite.get_frame_progress()
|
||||
animated_sprite.play("walk_another_skin")
|
||||
animated_sprite.play("行走动画_换皮版")
|
||||
animated_sprite.set_frame_and_progress(current_frame, current_progress)
|
||||
|
||||
|
||||
@@ -363,6 +362,7 @@ AnimatedSprite3D
|
||||
停止当前正在播放的动画。会将动画的位置重置为 ``0``\ ,并将 ``custom_speed`` 重置为 ``1.0``\ 。另见 :ref:`pause()<class_AnimatedSprite3D_method_pause>`\ 。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimatedTexture.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimatedTexture.xml.
|
||||
|
||||
.. _class_AnimatedTexture:
|
||||
|
||||
@@ -234,6 +234,7 @@ AnimatedTexture
|
||||
最多可以定义 :ref:`MAX_FRAMES<class_AnimatedTexture_constant_MAX_FRAMES>` 个纹理,但要记住,只有 0 到 :ref:`frames<class_AnimatedTexture_property_frames>` - 1 的帧会成为动画的一部分。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/Animation.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Animation.xml.
|
||||
|
||||
.. _class_Animation:
|
||||
|
||||
@@ -67,15 +67,15 @@ Animation
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+------------------------------------------+--------------------------------------------------------------------+---------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`capture_included<class_Animation_property_capture_included>` | ``false`` |
|
||||
+------------------------------------------+--------------------------------------------------------------------+---------------+
|
||||
| :ref:`float<class_float>` | :ref:`length<class_Animation_property_length>` | ``1.0`` |
|
||||
+------------------------------------------+--------------------------------------------------------------------+---------------+
|
||||
| :ref:`LoopMode<enum_Animation_LoopMode>` | :ref:`loop_mode<class_Animation_property_loop_mode>` | ``0`` |
|
||||
+------------------------------------------+--------------------------------------------------------------------+---------------+
|
||||
| :ref:`float<class_float>` | :ref:`step<class_Animation_property_step>` | ``0.0333333`` |
|
||||
+------------------------------------------+--------------------------------------------------------------------+---------------+
|
||||
+------------------------------------------+--------------------------------------------------------------------+-----------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`capture_included<class_Animation_property_capture_included>` | ``false`` |
|
||||
+------------------------------------------+--------------------------------------------------------------------+-----------------+
|
||||
| :ref:`float<class_float>` | :ref:`length<class_Animation_property_length>` | ``1.0`` |
|
||||
+------------------------------------------+--------------------------------------------------------------------+-----------------+
|
||||
| :ref:`LoopMode<enum_Animation_LoopMode>` | :ref:`loop_mode<class_Animation_property_loop_mode>` | ``0`` |
|
||||
+------------------------------------------+--------------------------------------------------------------------+-----------------+
|
||||
| :ref:`float<class_float>` | :ref:`step<class_Animation_property_step>` | ``0.033333335`` |
|
||||
+------------------------------------------+--------------------------------------------------------------------+-----------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
@@ -575,7 +575,7 @@ enum **FindMode**: :ref:`🔗<enum_Animation_FindMode>`
|
||||
- |void| **set_loop_mode**\ (\ value\: :ref:`LoopMode<enum_Animation_LoopMode>`\ )
|
||||
- :ref:`LoopMode<enum_Animation_LoopMode>` **get_loop_mode**\ (\ )
|
||||
|
||||
确定动画播放期间动画时间轴两端的行为。 这用于动画循环的正确插值,以及提示播放器必须重新启动动画。
|
||||
确定动画播放期间动画时间轴两端的行为。这指示动画是否应该以及应该如何重新启动,也用于动画循环的正确插值。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -585,7 +585,7 @@ enum **FindMode**: :ref:`🔗<enum_Animation_FindMode>`
|
||||
|
||||
.. rst-class:: classref-property
|
||||
|
||||
:ref:`float<class_float>` **step** = ``0.0333333`` :ref:`🔗<class_Animation_property_step>`
|
||||
:ref:`float<class_float>` **step** = ``0.033333335`` :ref:`🔗<class_Animation_property_step>`
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
@@ -1553,9 +1553,10 @@ enum **FindMode**: :ref:`🔗<enum_Animation_FindMode>`
|
||||
|
||||
|void| **value_track_set_update_mode**\ (\ track_idx\: :ref:`int<class_int>`, mode\: :ref:`UpdateMode<enum_Animation_UpdateMode>`\ ) :ref:`🔗<class_Animation_method_value_track_set_update_mode>`
|
||||
|
||||
设置值轨道的更新模式(请参阅 :ref:`UpdateMode<enum_Animation_UpdateMode>`\ )。
|
||||
设置值轨道的更新模式。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationLibrary.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationLibrary.xml.
|
||||
|
||||
.. _class_AnimationLibrary:
|
||||
|
||||
@@ -197,6 +197,7 @@ AnimationLibrary
|
||||
将与键 ``name`` 关联的 :ref:`Animation<class_Animation>` 的键更改为 ``newname``\ 。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationMixer.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationMixer.xml.
|
||||
|
||||
.. _class_AnimationMixer:
|
||||
|
||||
@@ -55,7 +55,7 @@ AnimationMixer
|
||||
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+--------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`reset_on_save<class_AnimationMixer_property_reset_on_save>` | ``true`` |
|
||||
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+--------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`root_motion_local<class_AnimationMixer_property_root_motion_local>` | |
|
||||
| :ref:`bool<class_bool>` | :ref:`root_motion_local<class_AnimationMixer_property_root_motion_local>` | ``false`` |
|
||||
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+--------------------+
|
||||
| :ref:`NodePath<class_NodePath>` | :ref:`root_motion_track<class_AnimationMixer_property_root_motion_track>` | ``NodePath("")`` |
|
||||
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+--------------------+
|
||||
@@ -167,7 +167,9 @@ AnimationMixer
|
||||
|
||||
**animation_started**\ (\ anim_name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationMixer_signal_animation_started>`
|
||||
|
||||
当动画开始播放时发出通知。
|
||||
动画开始播放时通知。
|
||||
|
||||
\ **注意:**\ 如果动画正在循环播放,则不会发出该信号。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -480,7 +482,7 @@ enum **AnimationCallbackModeDiscrete**: :ref:`🔗<enum_AnimationMixer_Animation
|
||||
|
||||
.. rst-class:: classref-property
|
||||
|
||||
:ref:`bool<class_bool>` **root_motion_local** :ref:`🔗<class_AnimationMixer_property_root_motion_local>`
|
||||
:ref:`bool<class_bool>` **root_motion_local** = ``false`` :ref:`🔗<class_AnimationMixer_property_root_motion_local>`
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
@@ -704,7 +706,7 @@ AnimationMixer 默认拥有一个全局库,键名为空字符串。要向这
|
||||
.. code-tab:: gdscript
|
||||
|
||||
var current_rotation
|
||||
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("animate"):
|
||||
current_rotation = get_quaternion()
|
||||
@@ -773,7 +775,7 @@ AnimationMixer 默认拥有一个全局库,键名为空字符串。要向这
|
||||
.. code-tab:: gdscript
|
||||
|
||||
var prev_root_motion_position_accumulator
|
||||
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("animate"):
|
||||
state_machine.travel("Animate")
|
||||
@@ -840,7 +842,7 @@ AnimationMixer 默认拥有一个全局库,键名为空字符串。要向这
|
||||
.. code-tab:: gdscript
|
||||
|
||||
var prev_root_motion_rotation_accumulator
|
||||
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("animate"):
|
||||
state_machine.travel("Animate")
|
||||
@@ -878,7 +880,7 @@ AnimationMixer 默认拥有一个全局库,键名为空字符串。要向这
|
||||
|
||||
var current_scale = Vector3(1, 1, 1)
|
||||
var scale_accum = Vector3(1, 1, 1)
|
||||
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("animate"):
|
||||
current_scale = get_scale()
|
||||
@@ -909,7 +911,7 @@ AnimationMixer 默认拥有一个全局库,键名为空字符串。要向这
|
||||
.. code-tab:: gdscript
|
||||
|
||||
var prev_root_motion_scale_accumulator
|
||||
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("animate"):
|
||||
state_machine.travel("Animate")
|
||||
@@ -971,6 +973,7 @@ AnimationMixer 默认拥有一个全局库,键名为空字符串。要向这
|
||||
将与键 ``name`` 关联的 :ref:`AnimationLibrary<class_AnimationLibrary>` 移动到键 ``newname``\ 。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNode.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNode.xml.
|
||||
|
||||
.. _class_AnimationNode:
|
||||
|
||||
@@ -31,9 +31,9 @@ AnimationNode
|
||||
|
||||
::
|
||||
|
||||
var current_length = $AnimationTree[parameters/AnimationNodeName/current_length]
|
||||
var current_position = $AnimationTree[parameters/AnimationNodeName/current_position]
|
||||
var current_delta = $AnimationTree[parameters/AnimationNodeName/current_delta]
|
||||
var current_length = $AnimationTree["parameters/AnimationNodeName/current_length"]
|
||||
var current_position = $AnimationTree["parameters/AnimationNodeName/current_position"]
|
||||
var current_delta = $AnimationTree["parameters/AnimationNodeName/current_delta"]
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
@@ -351,7 +351,7 @@ enum **FilterAction**: :ref:`🔗<enum_AnimationNode_FilterAction>`
|
||||
|
||||
按 ``blend`` 量混合一个动画(名称必须在链接的 :ref:`AnimationPlayer<class_AnimationPlayer>` 中有效)。可以传入时间 ``time`` 和增量 ``delta``\ ,以及表示是否发生寻道的 ``seeked``\ 。
|
||||
|
||||
\ ``looped_flag`` 在循环后立即由内部处理使用。另见 :ref:`LoopedFlag<enum_Animation_LoopedFlag>`\ 。
|
||||
\ ``looped_flag`` 在循环后立即由内部处理使用。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -363,7 +363,7 @@ enum **FilterAction**: :ref:`🔗<enum_AnimationNode_FilterAction>`
|
||||
|
||||
:ref:`float<class_float>` **blend_input**\ (\ input_index\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, seek\: :ref:`bool<class_bool>`, is_external_seeking\: :ref:`bool<class_bool>`, blend\: :ref:`float<class_float>`, filter\: :ref:`FilterAction<enum_AnimationNode_FilterAction>` = 0, sync\: :ref:`bool<class_bool>` = true, test_only\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_AnimationNode_method_blend_input>`
|
||||
|
||||
混合一个输入。这只对为 :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>` 创建的动画节点有用。时间参数 ``time`` 是一个相对的增量,除非 ``seek`` 是 ``true``\ ,此时它是绝对的。可以选择传入过滤模式(选项请参阅 :ref:`FilterAction<enum_AnimationNode_FilterAction>`\ )。
|
||||
混合一个输入。这只对为 :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>` 创建的动画节点有用。时间参数 ``time`` 是一个相对的增量,除非 ``seek`` 是 ``true``\ ,此时它是绝对的。可以选择传入过滤模式。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -512,6 +512,7 @@ enum **FilterAction**: :ref:`🔗<enum_AnimationNode_FilterAction>`
|
||||
设置一个自定义参数。这些参数被用作本地内存,因为资源可以在树或场景中重复使用。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeAdd2.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeAdd2.xml.
|
||||
|
||||
.. _class_AnimationNodeAdd2:
|
||||
|
||||
@@ -33,6 +33,7 @@ AnimationNodeAdd2
|
||||
- :doc:`使用 AnimationTree <../tutorials/animation/animation_tree>`
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeAdd3.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeAdd3.xml.
|
||||
|
||||
.. _class_AnimationNodeAdd3:
|
||||
|
||||
@@ -41,6 +41,7 @@ AnimationNodeAdd3
|
||||
- `第三人称射击(TPS)演示 <https://godotengine.org/asset-library/asset/2710>`__
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeAnimation.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeAnimation.xml.
|
||||
|
||||
.. _class_AnimationNodeAnimation:
|
||||
|
||||
@@ -241,6 +241,7 @@ enum **PlayMode**: :ref:`🔗<enum_AnimationNodeAnimation_PlayMode>`
|
||||
如果为 ``true``\ ,则 :ref:`AnimationNode<class_AnimationNode>` 会根据 :ref:`Animation<class_Animation>` 资源提供动画并调整部分参数。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeBlend2.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeBlend2.xml.
|
||||
|
||||
.. _class_AnimationNodeBlend2:
|
||||
|
||||
@@ -35,6 +35,7 @@ AnimationNodeBlend2
|
||||
- `第三人称射击(TPS)演示 <https://godotengine.org/asset-library/asset/2710>`__
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeBlend3.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeBlend3.xml.
|
||||
|
||||
.. _class_AnimationNodeBlend3:
|
||||
|
||||
@@ -39,6 +39,7 @@ AnimationNodeBlend3
|
||||
- :doc:`使用 AnimationTree <../tutorials/animation/animation_tree>`
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeBlendSpace1D.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeBlendSpace1D.xml.
|
||||
|
||||
.. _class_AnimationNodeBlendSpace1D:
|
||||
|
||||
@@ -137,7 +137,7 @@ enum **BlendMode**: :ref:`🔗<enum_AnimationNodeBlendSpace1D_BlendMode>`
|
||||
- |void| **set_blend_mode**\ (\ value\: :ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>`\ )
|
||||
- :ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` **get_blend_mode**\ (\ )
|
||||
|
||||
控制动画之间的插值。见 :ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` 常量。
|
||||
控制动画之间的插值。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -316,6 +316,7 @@ enum **BlendMode**: :ref:`🔗<enum_AnimationNodeBlendSpace1D_BlendMode>`
|
||||
更新混合轴上索引 ``point`` 处的点的位置。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeBlendSpace2D.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeBlendSpace2D.xml.
|
||||
|
||||
.. _class_AnimationNodeBlendSpace2D:
|
||||
|
||||
@@ -185,7 +185,7 @@ enum **BlendMode**: :ref:`🔗<enum_AnimationNodeBlendSpace2D_BlendMode>`
|
||||
- |void| **set_blend_mode**\ (\ value\: :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>`\ )
|
||||
- :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` **get_blend_mode**\ (\ )
|
||||
|
||||
控制动画之间的插值。见 :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` 常量。
|
||||
控制动画之间的插值。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -429,6 +429,7 @@ enum **BlendMode**: :ref:`🔗<enum_AnimationNodeBlendSpace2D_BlendMode>`
|
||||
更新混合空间中索引 ``point`` 处的点的位置。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeBlendTree.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeBlendTree.xml.
|
||||
|
||||
.. _class_AnimationNodeBlendTree:
|
||||
|
||||
@@ -50,25 +50,27 @@ AnimationNodeBlendTree
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`add_node<class_AnimationNodeBlendTree_method_add_node>`\ (\ name\: :ref:`StringName<class_StringName>`, node\: :ref:`AnimationNode<class_AnimationNode>`, position\: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)\ ) |
|
||||
+-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`connect_node<class_AnimationNodeBlendTree_method_connect_node>`\ (\ input_node\: :ref:`StringName<class_StringName>`, input_index\: :ref:`int<class_int>`, output_node\: :ref:`StringName<class_StringName>`\ ) |
|
||||
+-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`disconnect_node<class_AnimationNodeBlendTree_method_disconnect_node>`\ (\ input_node\: :ref:`StringName<class_StringName>`, input_index\: :ref:`int<class_int>`\ ) |
|
||||
+-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`get_node<class_AnimationNodeBlendTree_method_get_node>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||||
+-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`get_node_position<class_AnimationNodeBlendTree_method_get_node_position>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||||
+-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_node<class_AnimationNodeBlendTree_method_has_node>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||||
+-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`remove_node<class_AnimationNodeBlendTree_method_remove_node>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
|
||||
+-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`rename_node<class_AnimationNodeBlendTree_method_rename_node>`\ (\ name\: :ref:`StringName<class_StringName>`, new_name\: :ref:`StringName<class_StringName>`\ ) |
|
||||
+-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`set_node_position<class_AnimationNodeBlendTree_method_set_node_position>`\ (\ name\: :ref:`StringName<class_StringName>`, position\: :ref:`Vector2<class_Vector2>`\ ) |
|
||||
+-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
+------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`add_node<class_AnimationNodeBlendTree_method_add_node>`\ (\ name\: :ref:`StringName<class_StringName>`, node\: :ref:`AnimationNode<class_AnimationNode>`, position\: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)\ ) |
|
||||
+------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`connect_node<class_AnimationNodeBlendTree_method_connect_node>`\ (\ input_node\: :ref:`StringName<class_StringName>`, input_index\: :ref:`int<class_int>`, output_node\: :ref:`StringName<class_StringName>`\ ) |
|
||||
+------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`disconnect_node<class_AnimationNodeBlendTree_method_disconnect_node>`\ (\ input_node\: :ref:`StringName<class_StringName>`, input_index\: :ref:`int<class_int>`\ ) |
|
||||
+------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`get_node<class_AnimationNodeBlendTree_method_get_node>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||||
+------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] | :ref:`get_node_list<class_AnimationNodeBlendTree_method_get_node_list>`\ (\ ) |const| |
|
||||
+------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`get_node_position<class_AnimationNodeBlendTree_method_get_node_position>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||||
+------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_node<class_AnimationNodeBlendTree_method_has_node>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||||
+------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`remove_node<class_AnimationNodeBlendTree_method_remove_node>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
|
||||
+------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`rename_node<class_AnimationNodeBlendTree_method_rename_node>`\ (\ name\: :ref:`StringName<class_StringName>`, new_name\: :ref:`StringName<class_StringName>`\ ) |
|
||||
+------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`set_node_position<class_AnimationNodeBlendTree_method_set_node_position>`\ (\ name\: :ref:`StringName<class_StringName>`, position\: :ref:`Vector2<class_Vector2>`\ ) |
|
||||
+------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
@@ -223,6 +225,18 @@ AnimationNodeBlendTree
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNodeBlendTree_method_get_node_list:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] **get_node_list**\ (\ ) |const| :ref:`🔗<class_AnimationNodeBlendTree_method_get_node_list>`
|
||||
|
||||
返回包含该混合树中所有子动画节点名称的列表。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNodeBlendTree_method_get_node_position:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
@@ -280,6 +294,7 @@ AnimationNodeBlendTree
|
||||
修改子动画节点的位置。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeExtension.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeExtension.xml.
|
||||
|
||||
.. _class_AnimationNodeExtension:
|
||||
|
||||
@@ -31,13 +31,13 @@ AnimationNodeExtension
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedFloat32Array<class_PackedFloat32Array>` | :ref:`_process_animation_node<class_AnimationNodeExtension_private_method__process_animation_node>`\ (\ playback_info\: :ref:`PackedFloat64Array<class_PackedFloat64Array>`, test_only\: :ref:`bool<class_bool>`\ ) |virtual| |
|
||||
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_remaining_time<class_AnimationNodeExtension_method_get_remaining_time>`\ (\ node_info\: :ref:`PackedFloat32Array<class_PackedFloat32Array>`, break_loop\: :ref:`bool<class_bool>`\ ) |static| |
|
||||
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_looping<class_AnimationNodeExtension_method_is_looping>`\ (\ node_info\: :ref:`PackedFloat32Array<class_PackedFloat32Array>`\ ) |static| |
|
||||
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedFloat32Array<class_PackedFloat32Array>` | :ref:`_process_animation_node<class_AnimationNodeExtension_private_method__process_animation_node>`\ (\ playback_info\: :ref:`PackedFloat64Array<class_PackedFloat64Array>`, test_only\: :ref:`bool<class_bool>`\ ) |virtual| |required| |
|
||||
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_remaining_time<class_AnimationNodeExtension_method_get_remaining_time>`\ (\ node_info\: :ref:`PackedFloat32Array<class_PackedFloat32Array>`, break_loop\: :ref:`bool<class_bool>`\ ) |static| |
|
||||
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_looping<class_AnimationNodeExtension_method_is_looping>`\ (\ node_info\: :ref:`PackedFloat32Array<class_PackedFloat32Array>`\ ) |static| |
|
||||
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
@@ -52,7 +52,7 @@ AnimationNodeExtension
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedFloat32Array<class_PackedFloat32Array>` **_process_animation_node**\ (\ playback_info\: :ref:`PackedFloat64Array<class_PackedFloat64Array>`, test_only\: :ref:`bool<class_bool>`\ ) |virtual| :ref:`🔗<class_AnimationNodeExtension_private_method__process_animation_node>`
|
||||
:ref:`PackedFloat32Array<class_PackedFloat32Array>` **_process_animation_node**\ (\ playback_info\: :ref:`PackedFloat64Array<class_PackedFloat64Array>`, test_only\: :ref:`bool<class_bool>`\ ) |virtual| |required| :ref:`🔗<class_AnimationNodeExtension_private_method__process_animation_node>`
|
||||
|
||||
方法 :ref:`AnimationNode._process()<class_AnimationNode_private_method__process>` 的某个版本是供自定义节点覆盖所用。它会返回一个带有已处理过的动画数据的\ :ref:`PackedFloat32Array<class_PackedFloat32Array>`\ 。
|
||||
|
||||
@@ -85,6 +85,7 @@ AnimationNodeExtension
|
||||
如果给定的 ``node_info`` 对应的动画正在循环,则返回 ``true``\ 。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeOneShot.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeOneShot.xml.
|
||||
|
||||
.. _class_AnimationNodeOneShot:
|
||||
|
||||
@@ -32,22 +32,22 @@ AnimationNodeOneShot
|
||||
animation_tree.set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE)
|
||||
# 替代语法(与上述结果相同)。
|
||||
animation_tree["parameters/OneShot/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE
|
||||
|
||||
|
||||
# 中止连接到 “shot” 端口的子动画。
|
||||
animation_tree.set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_ABORT)
|
||||
# 替代语法(与上述结果相同)。
|
||||
animation_tree["parameters/OneShot/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_FADE_OUT
|
||||
|
||||
|
||||
# 使用淡出的方法中止连接到 “shot”端口的子动画。
|
||||
animation_tree.set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_FADE_OUT)
|
||||
# 替代语法(与上述结果相同)。
|
||||
animation_tree["parameters/OneShot/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_FADE_OUT
|
||||
|
||||
|
||||
# 获取当前状态(只读)。
|
||||
animation_tree.get("parameters/OneShot/active"))
|
||||
# 替代语法(与上述结果相同)。
|
||||
animation_tree["parameters/OneShot/active"]
|
||||
|
||||
|
||||
# 获取当前内部状态(只读)。
|
||||
animation_tree.get("parameters/OneShot/internal_active")
|
||||
# 替代语法(与上述结果相同)。
|
||||
@@ -57,16 +57,16 @@ AnimationNodeOneShot
|
||||
|
||||
// 播放连接到 “shot” 端口的子动画。
|
||||
animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.Fire);
|
||||
|
||||
|
||||
// 中止连接到 “shot” 端口的子动画。
|
||||
animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.Abort);
|
||||
|
||||
|
||||
// 使用淡出的方法中止连接到 “shot”端口的子动画。
|
||||
animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.FadeOut);
|
||||
|
||||
|
||||
// 获取当前状态(只读)。
|
||||
animationTree.Get("parameters/OneShot/active");
|
||||
|
||||
|
||||
// 获取当前内部状态(只读)。
|
||||
animationTree.Get("parameters/OneShot/internal_active");
|
||||
|
||||
@@ -291,7 +291,7 @@ enum **MixMode**: :ref:`🔗<enum_AnimationNodeOneShot_MixMode>`
|
||||
|
||||
淡入的持续时间。例如有一个长度为 5 秒的动画,如果将该属性设置为 ``1.0``\ ,就会生成一个从动画的 0 秒处开始、1 秒处结束的交叉渐变。
|
||||
|
||||
\ **注意:**\ **AnimationNodeOneShot** 是在淡入淡出结束后转换当前状态的。将 :ref:`AnimationNodeOutput<class_AnimationNodeOutput>` 视为最上游时,\ :ref:`fadein_time<class_AnimationNodeOneShot_property_fadein_time>` 会根据下游增量进行缩放。例如将该属性设置为 ``1.0`` 时,如果下游连接的是一个取值为 ``2.0`` 的 :ref:`AnimationNodeTimeScale<class_AnimationNodeTimeScale>`\ ,那么实际的处理时间就是 0.5 秒。
|
||||
\ **注意:**\ **AnimationNodeOneShot** 是在淡入淡出结束后转换当前状态的。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -327,7 +327,7 @@ enum **MixMode**: :ref:`🔗<enum_AnimationNodeOneShot_MixMode>`
|
||||
|
||||
淡出的持续时间。例如有一个长度为 5 秒的动画,如果将该属性设置为 ``1.0``\ ,就会生成一个从动画的 4 秒处开始、5 秒处结束的交叉渐变。
|
||||
|
||||
\ **注意:**\ **AnimationNodeOneShot** 是在淡入淡出结束后转换当前状态的。将 :ref:`AnimationNodeOutput<class_AnimationNodeOutput>` 视为最上游时,\ :ref:`fadein_time<class_AnimationNodeOneShot_property_fadein_time>` 会根据下游增量进行缩放。例如将该属性设置为 ``1.0`` 时,如果下游连接的是一个取值为 ``2.0`` 的 :ref:`AnimationNodeTimeScale<class_AnimationNodeTimeScale>`\ ,那么实际的处理时间就是 0.5 秒。
|
||||
\ **注意:**\ **AnimationNodeOneShot** 是在淡入淡出结束后转换当前状态的。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -347,6 +347,7 @@ enum **MixMode**: :ref:`🔗<enum_AnimationNodeOneShot_MixMode>`
|
||||
混合类型。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeOutput.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeOutput.xml.
|
||||
|
||||
.. _class_AnimationNodeOutput:
|
||||
|
||||
@@ -33,6 +33,7 @@ AnimationNodeOutput
|
||||
- `第三人称射击(TPS)演示 <https://godotengine.org/asset-library/asset/2710>`__
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeStateMachine.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeStateMachine.xml.
|
||||
|
||||
.. _class_AnimationNodeStateMachine:
|
||||
|
||||
@@ -76,6 +76,8 @@ AnimationNodeStateMachine
|
||||
+---------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`get_node<class_AnimationNodeStateMachine_method_get_node>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||||
+---------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] | :ref:`get_node_list<class_AnimationNodeStateMachine_method_get_node_list>`\ (\ ) |const| |
|
||||
+---------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`get_node_name<class_AnimationNodeStateMachine_method_get_node_name>`\ (\ node\: :ref:`AnimationNode<class_AnimationNode>`\ ) |const| |
|
||||
+---------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`get_node_position<class_AnimationNodeStateMachine_method_get_node_position>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||||
@@ -261,6 +263,18 @@ enum **StateMachineType**: :ref:`🔗<enum_AnimationNodeStateMachine_StateMachin
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNodeStateMachine_method_get_node_list:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] **get_node_list**\ (\ ) |const| :ref:`🔗<class_AnimationNodeStateMachine_method_get_node_list>`
|
||||
|
||||
返回包含状态机中所有动画节点名称的列表。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNodeStateMachine_method_get_node_name:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
@@ -438,6 +452,7 @@ enum **StateMachineType**: :ref:`🔗<enum_AnimationNodeStateMachine_StateMachin
|
||||
设置动画节点的坐标。用于在编辑器中显示。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeStateMachinePlayback.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeStateMachinePlayback.xml.
|
||||
|
||||
.. _class_AnimationNodeStateMachinePlayback:
|
||||
|
||||
@@ -91,6 +91,37 @@ AnimationNodeStateMachinePlayback
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
信号
|
||||
----
|
||||
|
||||
.. _class_AnimationNodeStateMachinePlayback_signal_state_finished:
|
||||
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
**state_finished**\ (\ state\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationNodeStateMachinePlayback_signal_state_finished>`
|
||||
|
||||
``state`` 播放完毕时发出。如果 ``state`` 是设置为编组模式的状态机,则其信号会以其名称作为前缀传递。
|
||||
|
||||
如果存在交叉淡入淡出,则它将在 :ref:`get_fading_from_node()<class_AnimationNodeStateMachinePlayback_method_get_fading_from_node>` 动画的影响不再存在时触发。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNodeStateMachinePlayback_signal_state_started:
|
||||
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
**state_started**\ (\ state\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationNodeStateMachinePlayback_signal_state_started>`
|
||||
|
||||
当 ``state`` 开始播放时发出。如果 ``state`` 是一个设置为编组模式的状态机,则其信号将以其名称作为前缀传递。
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
方法说明
|
||||
--------
|
||||
|
||||
@@ -221,6 +252,7 @@ AnimationNodeStateMachinePlayback
|
||||
如果 ``reset_on_teleport`` 为 ``true``\ ,当行进导致传送时,该动画将从头开始播放。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeStateMachineTransition.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeStateMachineTransition.xml.
|
||||
|
||||
.. _class_AnimationNodeStateMachineTransition:
|
||||
|
||||
@@ -322,6 +322,7 @@ enum **AdvanceMode**: :ref:`🔗<enum_AnimationNodeStateMachineTransition_Advanc
|
||||
\ **注意:**\ :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>` 是在淡入淡出结束后转换当前状态的。只能根据主动画推断精确的剩余时间。将 :ref:`AnimationNodeOutput<class_AnimationNodeOutput>` 视为最上游时,\ :ref:`xfade_time<class_AnimationNodeStateMachineTransition_property_xfade_time>` 不会根据下游增量进行缩放。另见 :ref:`AnimationNodeOneShot.fadeout_time<class_AnimationNodeOneShot_property_fadeout_time>`\ 。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeSub2.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeSub2.xml.
|
||||
|
||||
.. _class_AnimationNodeSub2:
|
||||
|
||||
@@ -35,6 +35,7 @@ AnimationNodeSub2
|
||||
- :doc:`AnimationTree <../tutorials/animation/animation_tree>`
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeSync.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeSync.xml.
|
||||
|
||||
.. _class_AnimationNodeSync:
|
||||
|
||||
@@ -67,6 +67,7 @@ AnimationNodeSync
|
||||
如果为 ``true``\ ,则强制混合动画以前进帧。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeTimeScale.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeTimeScale.xml.
|
||||
|
||||
.. _class_AnimationNodeTimeScale:
|
||||
|
||||
@@ -31,6 +31,7 @@ AnimationNodeTimeScale
|
||||
- `3D 平台跳跃演示 <https://godotengine.org/asset-library/asset/2748>`__
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeTimeSeek.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeTimeSeek.xml.
|
||||
|
||||
.. _class_AnimationNodeTimeSeek:
|
||||
|
||||
@@ -32,7 +32,7 @@ AnimationNodeTimeSeek
|
||||
animation_tree.set("parameters/TimeSeek/seek_request", 0.0)
|
||||
# 替代语法(与上述结果相同)。
|
||||
animation_tree["parameters/TimeSeek/seek_request"] = 0.0
|
||||
|
||||
|
||||
# 从 12 秒的时间戳开始播放子动画。
|
||||
animation_tree.set("parameters/TimeSeek/seek_request", 12.0)
|
||||
# 替代语法(与上述结果相同)。
|
||||
@@ -42,7 +42,7 @@ AnimationNodeTimeSeek
|
||||
|
||||
// 从开始处播放子动画。
|
||||
animationTree.Set("parameters/TimeSeek/seek_request", 0.0);
|
||||
|
||||
|
||||
// 从 12 秒的时间戳开始播放子动画。
|
||||
animationTree.Set("parameters/TimeSeek/seek_request", 12.0);
|
||||
|
||||
@@ -90,6 +90,7 @@ AnimationNodeTimeSeek
|
||||
如果为 ``true``\ ,某些旨在控制快进快退之间的帧的进程(例如计算根动态或寻找最接近的离散帧)将被执行。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationNodeTransition.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeTransition.xml.
|
||||
|
||||
.. _class_AnimationNodeTransition:
|
||||
|
||||
@@ -34,12 +34,12 @@ AnimationNodeTransition
|
||||
animation_tree.set("parameters/Transition/transition_request", "state_2")
|
||||
# 替代语法(与上述结果相同)。
|
||||
animation_tree["parameters/Transition/transition_request"] = "state_2"
|
||||
|
||||
|
||||
# 获取当前状态名称(只读)。
|
||||
animation_tree.get("parameters/Transition/current_state")
|
||||
# 替代语法(与上述结果相同)。
|
||||
animation_tree["parameters/Transition/current_state"]
|
||||
|
||||
|
||||
# 获取当前状态索引(只读)。
|
||||
animation_tree.get("parameters/Transition/current_index"))
|
||||
# 替代语法(与上述结果相同)。
|
||||
@@ -49,10 +49,10 @@ AnimationNodeTransition
|
||||
|
||||
// 播放连接到 “state_2” 端口的子动画。
|
||||
animationTree.Set("parameters/Transition/transition_request", "state_2");
|
||||
|
||||
|
||||
// 获取当前状态名称(只读)。
|
||||
animationTree.Get("parameters/Transition/current_state");
|
||||
|
||||
|
||||
// 获取当前状态索引(只读)。
|
||||
animationTree.Get("parameters/Transition/current_index");
|
||||
|
||||
@@ -262,6 +262,7 @@ AnimationNodeTransition
|
||||
如果为 ``true``\ ,则目标动画在动画过渡时重新启动。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationPlayer.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationPlayer.xml.
|
||||
|
||||
.. _class_AnimationPlayer:
|
||||
|
||||
@@ -787,7 +787,7 @@ enum **AnimationMethodCallMode**: :ref:`🔗<enum_AnimationPlayer_AnimationMetho
|
||||
|
||||
|void| **reset_section**\ (\ ) :ref:`🔗<class_AnimationPlayer_method_reset_section>`
|
||||
|
||||
如果设置了区域则重置当前区域。
|
||||
重置当前区域。如果尚未设置区域则不做任何事情。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -902,6 +902,7 @@ enum **AnimationMethodCallMode**: :ref:`🔗<enum_AnimationPlayer_AnimationMetho
|
||||
\ **注意:**\ 方法/音频/动画播放轨道不会被该方法处理。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationRootNode.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationRootNode.xml.
|
||||
|
||||
.. _class_AnimationRootNode:
|
||||
|
||||
@@ -33,6 +33,7 @@ AnimationRootNode
|
||||
- :doc:`使用 AnimationTree <../tutorials/animation/animation_tree>`
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AnimationTree.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationTree.xml.
|
||||
|
||||
.. _class_AnimationTree:
|
||||
|
||||
@@ -218,6 +218,7 @@ enum **AnimationProcessCallback**: :ref:`🔗<enum_AnimationTree_AnimationProces
|
||||
设置要更新动画的过程通知。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/Area2D.xml.
|
||||
.. 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.
|
||||
|
||||
.. _class_Area2D:
|
||||
|
||||
@@ -155,7 +155,7 @@ Area2D
|
||||
|
||||
var other_shape_owner = area.shape_find_owner( area_shape_index)
|
||||
var other_shape_node = area.shape_owner_get_owner(other_shape_owner)
|
||||
|
||||
|
||||
var local_shape_owner = shape_find_owner(local_shape_index)
|
||||
var local_shape_node = shape_owner_get_owner(local_shape_owner)
|
||||
|
||||
@@ -222,7 +222,7 @@ Area2D
|
||||
|
||||
var body_shape_owner = body.shape_find_owner(body_shape_index)
|
||||
var body_shape_node = body.shape_owner_get_owner(body_shape_owner)
|
||||
|
||||
|
||||
var local_shape_owner = shape_find_owner(local_shape_index)
|
||||
var local_shape_node = shape_owner_get_owner(local_shape_owner)
|
||||
|
||||
@@ -336,7 +336,7 @@ enum **SpaceOverride**: :ref:`🔗<enum_Area2D_SpaceOverride>`
|
||||
- |void| **set_angular_damp_space_override_mode**\ (\ value\: :ref:`SpaceOverride<enum_Area2D_SpaceOverride>`\ )
|
||||
- :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **get_angular_damp_space_override_mode**\ (\ )
|
||||
|
||||
此区域内的角阻尼计算的覆盖模式。有关可能的值,请参阅 :ref:`SpaceOverride<enum_Area2D_SpaceOverride>`\ 。
|
||||
此区域内的角阻尼计算的覆盖模式。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -474,7 +474,7 @@ enum **SpaceOverride**: :ref:`🔗<enum_Area2D_SpaceOverride>`
|
||||
- |void| **set_gravity_space_override_mode**\ (\ value\: :ref:`SpaceOverride<enum_Area2D_SpaceOverride>`\ )
|
||||
- :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **get_gravity_space_override_mode**\ (\ )
|
||||
|
||||
该区域内重力计算的覆盖模式。有关可能的值,请参阅 :ref:`SpaceOverride<enum_Area2D_SpaceOverride>`\ 。
|
||||
该区域内重力计算的覆盖模式。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -510,7 +510,7 @@ enum **SpaceOverride**: :ref:`🔗<enum_Area2D_SpaceOverride>`
|
||||
- |void| **set_linear_damp_space_override_mode**\ (\ value\: :ref:`SpaceOverride<enum_Area2D_SpaceOverride>`\ )
|
||||
- :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **get_linear_damp_space_override_mode**\ (\ )
|
||||
|
||||
该区域内线性阻尼计算的覆盖模式。可取的值见 :ref:`SpaceOverride<enum_Area2D_SpaceOverride>`\ 。
|
||||
该区域内线性阻尼计算的覆盖模式。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -655,6 +655,7 @@ enum **SpaceOverride**: :ref:`🔗<enum_Area2D_SpaceOverride>`
|
||||
参数 ``body`` 可以是 :ref:`PhysicsBody2D<class_PhysicsBody2D>` 实例,也可以是 :ref:`TileMap<class_TileMap>` 实例。TileMap 虽然不是物理物体,但会把图块的碰撞形状注册为虚拟物理物体。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/Area3D.xml.
|
||||
.. 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.
|
||||
|
||||
.. _class_Area3D:
|
||||
|
||||
@@ -169,7 +169,7 @@ Area3D
|
||||
|
||||
var other_shape_owner = area.shape_find_owner( area_shape_index)
|
||||
var other_shape_node = area.shape_owner_get_owner(other_shape_owner)
|
||||
|
||||
|
||||
var local_shape_owner = shape_find_owner(local_shape_index)
|
||||
var local_shape_node = shape_owner_get_owner(local_shape_owner)
|
||||
|
||||
@@ -236,7 +236,7 @@ Area3D
|
||||
|
||||
var body_shape_owner = body.shape_find_owner(body_shape_index)
|
||||
var body_shape_node = body.shape_owner_get_owner(body_shape_owner)
|
||||
|
||||
|
||||
var local_shape_owner = shape_find_owner(local_shape_index)
|
||||
var local_shape_node = shape_owner_get_owner(local_shape_owner)
|
||||
|
||||
@@ -350,7 +350,7 @@ enum **SpaceOverride**: :ref:`🔗<enum_Area3D_SpaceOverride>`
|
||||
- |void| **set_angular_damp_space_override_mode**\ (\ value\: :ref:`SpaceOverride<enum_Area3D_SpaceOverride>`\ )
|
||||
- :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` **get_angular_damp_space_override_mode**\ (\ )
|
||||
|
||||
此区域内的角阻尼计算的覆盖模式。有关可能的值,请参阅 :ref:`SpaceOverride<enum_Area3D_SpaceOverride>`\ 。
|
||||
此区域内的角阻尼计算的覆盖模式。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -488,7 +488,7 @@ enum **SpaceOverride**: :ref:`🔗<enum_Area3D_SpaceOverride>`
|
||||
- |void| **set_gravity_space_override_mode**\ (\ value\: :ref:`SpaceOverride<enum_Area3D_SpaceOverride>`\ )
|
||||
- :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` **get_gravity_space_override_mode**\ (\ )
|
||||
|
||||
该区域内重力计算的覆盖模式。有关可能的值,请参阅 :ref:`SpaceOverride<enum_Area3D_SpaceOverride>`\ 。
|
||||
该区域内重力计算的覆盖模式。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -524,7 +524,7 @@ enum **SpaceOverride**: :ref:`🔗<enum_Area3D_SpaceOverride>`
|
||||
- |void| **set_linear_damp_space_override_mode**\ (\ value\: :ref:`SpaceOverride<enum_Area3D_SpaceOverride>`\ )
|
||||
- :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` **get_linear_damp_space_override_mode**\ (\ )
|
||||
|
||||
该区域内线性阻尼计算的覆盖模式。可取的值见 :ref:`SpaceOverride<enum_Area3D_SpaceOverride>`\ 。
|
||||
该区域内线性阻尼计算的覆盖模式。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -794,6 +794,7 @@ enum **SpaceOverride**: :ref:`🔗<enum_Area3D_SpaceOverride>`
|
||||
参数 ``body`` 可以是 :ref:`PhysicsBody3D<class_PhysicsBody3D>` 实例,也可以是 :ref:`GridMap<class_GridMap>` 实例。GridMap 虽然不是物理物体,但会把图块的碰撞形状注册为虚拟物理物体。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/Array.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Array.xml.
|
||||
|
||||
.. _class_Array:
|
||||
|
||||
@@ -28,7 +28,7 @@ Array
|
||||
print(array[0]) # 输出“第一”
|
||||
print(array[2]) # 输出 3
|
||||
print(array[-1]) # 输出“最后”
|
||||
|
||||
|
||||
array[1] = "第二"
|
||||
print(array[1]) # 输出“第二”
|
||||
print(array[-3]) # 输出“第二”
|
||||
@@ -39,7 +39,7 @@ Array
|
||||
GD.Print(array[0]); // 输出“开头”
|
||||
GD.Print(array[2]); // 输出 3
|
||||
GD.Print(array[^1]); // 输出“最后”
|
||||
|
||||
|
||||
array[2] = "第二";
|
||||
GD.Print(array[1]); // 输出“第二”
|
||||
GD.Print(array[^3]); // 输出“第二”
|
||||
@@ -123,6 +123,8 @@ Array
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>` | :ref:`duplicate<class_Array_method_duplicate>`\ (\ deep\: :ref:`bool<class_bool>` = false\ ) |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>` | :ref:`duplicate_deep<class_Array_method_duplicate_deep>`\ (\ deep_subresources_mode\: :ref:`int<class_int>` = 1\ ) |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`erase<class_Array_method_erase>`\ (\ value\: :ref:`Variant<class_Variant>`\ ) |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`fill<class_Array_method_fill>`\ (\ value\: :ref:`Variant<class_Variant>`\ ) |
|
||||
@@ -267,10 +269,10 @@ Array
|
||||
|
||||
class_name Sword
|
||||
extends Node
|
||||
|
||||
|
||||
class Stats:
|
||||
pass
|
||||
|
||||
|
||||
func _ready():
|
||||
var a = Array([], TYPE_INT, "", null) # Array[int]
|
||||
var b = Array([], TYPE_OBJECT, "Node", null) # Array[Node]
|
||||
@@ -285,7 +287,7 @@ Array
|
||||
|
||||
var numbers: Array[float] = []
|
||||
var children: Array[Node] = [$Node, $Sprite2D, $RigidBody3D]
|
||||
|
||||
|
||||
var integers: Array[int] = [0.2, 4.5, -2.0]
|
||||
print(integers) # 输出 [0, 4, -2]
|
||||
|
||||
@@ -425,13 +427,13 @@ Array
|
||||
|
||||
func greater_than_5(number):
|
||||
return number > 5
|
||||
|
||||
|
||||
func _ready():
|
||||
print([6, 10, 6].all(greater_than_5)) # 输出 true (3/3 元素被评估为真)。
|
||||
print([4, 10, 4].all(greater_than_5)) # 输出 false (1/3 元素被评估为真)。
|
||||
print([4, 4, 4].all(greater_than_5)) # 输出 false (0/3 元素被评估为真)。
|
||||
print([].all(greater_than_5)) # 输出 true (0/0 元素被评估为真)。
|
||||
|
||||
|
||||
# 与上面的第一行相同,但使用 lambda 函数。
|
||||
print([6, 10, 6].all(func(element): return element > 5)) # 输出 true
|
||||
|
||||
@@ -441,7 +443,7 @@ Array
|
||||
{
|
||||
return number > 5;
|
||||
}
|
||||
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
// 输出 True (3/3 元素被评估为真)。
|
||||
@@ -452,7 +454,7 @@ Array
|
||||
GD.Print(new Godot.Collections.Array>int< { 4, 4, 4 }.All(GreaterThan5));
|
||||
// 输出 True (0/0 元素被评估为真)。
|
||||
GD.Print(new Godot.Collections.Array>int< { }.All(GreaterThan5));
|
||||
|
||||
|
||||
// 与上面的第一行相同,但使用 lambda 函数。
|
||||
GD.Print(new Godot.Collections.Array>int< { 6, 10, 6 }.All(element => element > 5)); // 输出 True
|
||||
}
|
||||
@@ -483,13 +485,13 @@ Array
|
||||
|
||||
func greater_than_5(number):
|
||||
return number > 5
|
||||
|
||||
|
||||
func _ready():
|
||||
print([6, 10, 6].any(greater_than_5)) # 输出 true (3 个元素被评估为真)。
|
||||
print([4, 10, 4].any(greater_than_5)) #输出 true (1 个元素被评估为真)。
|
||||
print([4, 4, 4].any(greater_than_5)) # 输出 false (0 个元素被评估为真)。
|
||||
print([].any(greater_than_5)) # 输出 false (0 个元素被评估为真)。
|
||||
|
||||
|
||||
# 与上面的第一行相同,但使用 lambda 函数。
|
||||
print([6, 10, 6].any(func(number): return number > 5)) # 输出 true
|
||||
|
||||
@@ -574,10 +576,10 @@ Array
|
||||
|
||||
var numbers = [2, 4, 8, 10]
|
||||
var idx = numbers.bsearch(7)
|
||||
|
||||
|
||||
numbers.insert(idx, 7)
|
||||
print(numbers) # 输出 [2, 4, 7, 8, 10]
|
||||
|
||||
|
||||
var fruits = ["Apple", "Lemon", "Lemon", "Orange"]
|
||||
print(fruits.bsearch("Lemon", true)) # 输出 1,位于第一个 "Lemon"。
|
||||
print(fruits.bsearch("Lemon", false)) # 输出 3,位于 "Orange"。
|
||||
@@ -606,18 +608,18 @@ Array
|
||||
if a[1] < b[1]:
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func _ready():
|
||||
var my_items = [["Tomato", 2], ["Kiwi", 5], ["Rice", 9]]
|
||||
|
||||
|
||||
var apple = ["Apple", 5]
|
||||
# "Apple" 被插入在 "Kiwi" 之前。
|
||||
my_items.insert(my_items.bsearch_custom(apple, sort_by_amount, true), apple)
|
||||
|
||||
|
||||
var banana = ["Banana", 5]
|
||||
# "Banana" 被插入在 "Kiwi" 之后。
|
||||
my_items.insert(my_items.bsearch_custom(banana, sort_by_amount, false), banana)
|
||||
|
||||
|
||||
# 输出 [["Tomato", 2], ["Apple", 5], ["Kiwi", 5], ["Banana", 5], ["Rice", 9]]
|
||||
print(my_items)
|
||||
|
||||
@@ -661,9 +663,23 @@ Array
|
||||
|
||||
返回数组的新副本。
|
||||
|
||||
默认情况下返回的是\ **浅拷贝**\ :嵌套的 **Array** 和 :ref:`Dictionary<class_Dictionary>` 元素与原数组共享。对这些元素的修改会影响另一个数组。
|
||||
默认情况下返回的是\ **浅拷贝**\ :嵌套的 **Array**\ 、\ :ref:`Dictionary<class_Dictionary>` 和 :ref:`Resource<class_Resource>` 元素与原数组共享。对这些元素的修改会影响另一个数组。
|
||||
|
||||
如果 ``deep`` 为 ``true`` 则会返回\ **深拷贝**\ :嵌套的数组和字典也会进行(递归的)复制。
|
||||
如果 ``deep`` 为 ``true`` 则会返回\ **深拷贝**\ :嵌套的数组和字典也会进行(递归的)复制。不过 :ref:`Resource<class_Resource>` 仍然是和原数组共享的。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Array_method_duplicate_deep:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Array<class_Array>` **duplicate_deep**\ (\ deep_subresources_mode\: :ref:`int<class_int>` = 1\ ) |const| :ref:`🔗<class_Array_method_duplicate_deep>`
|
||||
|
||||
深度复制该数组,类似 :ref:`duplicate()<class_Array_method_duplicate>`\ ``(true)``\ ,但能够额外控制子资源的处理方式。
|
||||
|
||||
\ ``deep_subresources_mode`` 必须是 :ref:`DeepDuplicateMode<enum_Resource_DeepDuplicateMode>` 中的一个值。默认只会(递归)复制内部资源。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -734,10 +750,10 @@ Array
|
||||
|
||||
func is_even(number):
|
||||
return number % 2 == 0
|
||||
|
||||
|
||||
func _ready():
|
||||
print([1, 4, 5, 8].filter(is_even)) # 输出 [4, 8]
|
||||
|
||||
|
||||
# 与上面相同,但使用 lambda 函数。
|
||||
print([1, 4, 5, 8].filter(func(number): return number % 2 == 0))
|
||||
|
||||
@@ -782,7 +798,7 @@ Array
|
||||
|
||||
func is_even(number):
|
||||
return number % 2 == 0
|
||||
|
||||
|
||||
func _ready():
|
||||
print([1, 3, 4, 7].find_custom(is_even.bind())) # 输出 2
|
||||
|
||||
@@ -812,7 +828,9 @@ Array
|
||||
|
||||
:ref:`Variant<class_Variant>` **get**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Array_method_get>`
|
||||
|
||||
返回数组中给定索引 ``index`` 位置的元素。这与使用 ``[]`` 运算符(\ ``array[index]``\ )是一样的。
|
||||
返回数组中索引为 ``index`` 的元素。如果 ``index`` 越界或为负数,则该方法失败并返回 ``null``\ 。
|
||||
|
||||
该方法类似于 ``[]`` 运算符(但不等价)。最显著的区别就是从编辑器中运行时,该方法失败不会暂停项目运行。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -916,7 +934,7 @@ Array
|
||||
|
||||
:ref:`int<class_int>` **insert**\ (\ position\: :ref:`int<class_int>`, value\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_Array_method_insert>`
|
||||
|
||||
在数组中给定索引(\ ``position``\ )处插入新元素(\ ``value``\ )。\ ``position`` 应介于 ``0`` 和数组的 :ref:`size()<class_Array_method_size>` 之间。
|
||||
在数组中给定索引(\ ``position``\ )处插入新元素(\ ``value``\ )。\ ``position`` 应介于 ``0`` 和数组的 :ref:`size()<class_Array_method_size>` 之间。如果为负数,则认为 ``position`` 为相对于数组结尾的索引。
|
||||
|
||||
如果成功,则返回 :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>`\ ;如果该方法失败,则返回其他 :ref:`Error<enum_@GlobalScope_Error>` 常量之一。
|
||||
|
||||
@@ -1011,10 +1029,10 @@ Array
|
||||
|
||||
func double(number):
|
||||
return number * 2
|
||||
|
||||
|
||||
func _ready():
|
||||
print([1, 2, 3].map(double)) # 输出 [2, 4, 6]
|
||||
|
||||
|
||||
# 与上面相同,但使用 lambda 函数。
|
||||
print([1, 2, 3].map(func(element): return element * 2))
|
||||
|
||||
@@ -1087,7 +1105,7 @@ Array
|
||||
|
||||
移除并返回数组中位于 ``position`` 索引处的元素。如果 ``position`` 为负数,则认为是相对于该数组末尾的值。如果数组为空,则返回 ``null``\ ;如果 ``position`` 超出范围,还会生成错误消息。
|
||||
|
||||
\ **注意:**\ 该方法将 ``position`` 之后每个元素的索引向后移动,这可能会产生明显的性能成本,尤其是在较大的数组上。
|
||||
\ **注意:**\ 该方法将 ``position`` 之后每个元素的索引向前移动,这可能会产生明显的性能成本,尤其是在较大的数组上。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -1159,11 +1177,11 @@ Array
|
||||
|
||||
func sum(accum, number):
|
||||
return accum + number
|
||||
|
||||
|
||||
func _ready():
|
||||
print([1, 2, 3].reduce(sum, 0)) # 输出 6
|
||||
print([1, 2, 3].reduce(sum, 10)) # 输出 16
|
||||
|
||||
|
||||
# 与上面相同,但是使用 lambda 函数。
|
||||
print([1, 2, 3].reduce(func(accum, number): return accum + number, 10))
|
||||
|
||||
@@ -1173,10 +1191,10 @@ Array
|
||||
|
||||
func _ready():
|
||||
var arr = [Vector2i(5, 0), Vector2i(3, 4), Vector2i(1, 2)]
|
||||
|
||||
|
||||
var longest_vec = arr.reduce(func(max, vec): return vec if is_length_greater(vec, max) else max)
|
||||
print(longest_vec) # 输出 (3, 4)
|
||||
|
||||
|
||||
func is_length_greater(a, b):
|
||||
return a.length() > b.length()
|
||||
|
||||
@@ -1186,7 +1204,7 @@ Array
|
||||
|
||||
func is_even(number):
|
||||
return number % 2 == 0
|
||||
|
||||
|
||||
func _ready():
|
||||
var arr = [1, 2, 3, 4, 5]
|
||||
# 当前元素为偶数则增加计数器,否则保持计数不变。
|
||||
@@ -1205,11 +1223,11 @@ Array
|
||||
|
||||
|void| **remove_at**\ (\ position\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Array_method_remove_at>`
|
||||
|
||||
从数组中移除指定索引(\ ``position``\ )处的元素。如果索引超出范围,则该方法失败。
|
||||
从数组中移除指定索引(\ ``position``\ )处的元素。如果索引超出范围,则该方法失败。如果为负数,则认为 ``position`` 为相对于数组结尾的索引。
|
||||
|
||||
如果需要返回被移除的元素,请使用 :ref:`pop_at()<class_Array_method_pop_at>`\ 。要按值移除元素,请改用 :ref:`erase()<class_Array_method_erase>`\ 。
|
||||
|
||||
\ **注意:**\ 该方法将 ``position`` 之后每个元素的索引向后移,这可能会产生明显的性能成本,尤其是在较大的数组上。
|
||||
\ **注意:**\ 该方法将 ``position`` 之后每个元素的索引向前移动,这可能会产生明显的性能成本,尤其是在较大的数组上。
|
||||
|
||||
\ **注意:**\ ``position`` 不能为负数。要移除相对于数组末尾的元素,请使用 ``arr.remove_at(arr.size() - (i + 1))``\ 。要从数组中移除最后一个元素,请使用 ``arr.resize(arr.size() - 1)``\ 。
|
||||
|
||||
@@ -1225,7 +1243,7 @@ Array
|
||||
|
||||
将数组的元素数设置为 ``size``\ 。如果 ``size`` 小于数组的当前大小,则移除末尾的元素。如果 ``size`` 大于数组的当前大小,则添加新的默认元素(通常为 ``null``\ ),具体取决于数组的类型。
|
||||
|
||||
如果成功,则返回 :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>`\ ;如果该方法失败,则返回其他 :ref:`Error<enum_@GlobalScope_Error>` 常量之一。
|
||||
如果成功则返回 :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>`\ ,如果该方法失败则返回其他 :ref:`Error<enum_@GlobalScope_Error>` 常量之一:数组只读时为 :ref:`@GlobalScope.ERR_LOCKED<class_@GlobalScope_constant_ERR_LOCKED>`\ ,大小为负数时为 :ref:`@GlobalScope.ERR_INVALID_PARAMETER<class_@GlobalScope_constant_ERR_INVALID_PARAMETER>`\ ,分配失败时为 :ref:`@GlobalScope.ERR_OUT_OF_MEMORY<class_@GlobalScope_constant_ERR_OUT_OF_MEMORY>`\ 。请使用 :ref:`size()<class_Array_method_size>` 查看数组调整后的实际大小。
|
||||
|
||||
\ **注意:**\ 调用该方法一次并分配新值,要比为每个新元素调用 :ref:`append()<class_Array_method_append>` 更快。
|
||||
|
||||
@@ -1319,16 +1337,16 @@ Array
|
||||
|
||||
如果 ``step`` 为负数,则该方法反向遍历数组,返回按反向顺序排列的切片数组。要使其起作用,\ ``begin`` 必须大于 ``end``\ 。
|
||||
|
||||
如果 ``deep`` 为 ``true``\ ,则切片数组中所有嵌套的 **Array** 和 :ref:`Dictionary<class_Dictionary>` 元素都将从原始元素中递归复制。另见 :ref:`duplicate()<class_Array_method_duplicate>`)。
|
||||
如果 ``deep`` 为 ``true``\ ,则切片数组中所有嵌套的 **Array** 和 :ref:`Dictionary<class_Dictionary>` 元素都将从原始元素中递归复制。另见 :ref:`duplicate()<class_Array_method_duplicate>`\ 。
|
||||
|
||||
::
|
||||
|
||||
var letters = ["A", "B", "C", "D", "E", "F"]
|
||||
|
||||
|
||||
print(letters.slice(0, 2)) # 输出 ["A", "B"]
|
||||
print(letters.slice(2, -2)) # 输出 ["C", "D"]
|
||||
print(letters.slice(-2, 6)) # 输出 ["E", "F"]
|
||||
|
||||
|
||||
print(letters.slice(0, 6, 2)) # 输出 ["A", "C", "E"]
|
||||
print(letters.slice(4, 1, -1)) # 输出 ["E", "D", "C"]
|
||||
|
||||
@@ -1383,12 +1401,12 @@ Array
|
||||
if a[1] < b[1]:
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func _ready():
|
||||
var my_items = [["Tomato", 5], ["Apple", 9], ["Rice", 4]]
|
||||
my_items.sort_custom(sort_ascending)
|
||||
print(my_items) # 输出 [["Rice", 4], ["Tomato", 5], ["Apple", 9]]
|
||||
|
||||
|
||||
# 使用 lambda 函数按降序排序。
|
||||
my_items.sort_custom(func(a, b): return a[0] > b[0])
|
||||
print(my_items) # 输出 [["Apple", 9], ["Tomato", 5], ["Rice", 4]]
|
||||
@@ -1537,6 +1555,7 @@ Array
|
||||
返回指定 ``index`` 处的 :ref:`Variant<class_Variant>` 元素。数组从索引 0 开始。如果 ``index`` 大于或等于 ``0``\ ,则从数组开头开始获取元素。如果 ``index`` 为负值,则从末尾开始获取元素。越界访问数组将导致运行时错误,从编辑器中运行时会暂停项目执行。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/ArrayMesh.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ArrayMesh.xml.
|
||||
|
||||
.. _class_ArrayMesh:
|
||||
|
||||
@@ -32,13 +32,13 @@ ArrayMesh
|
||||
vertices.push_back(Vector3(0, 1, 0))
|
||||
vertices.push_back(Vector3(1, 0, 0))
|
||||
vertices.push_back(Vector3(0, 0, 1))
|
||||
|
||||
|
||||
# 初始化 ArrayMesh。
|
||||
var arr_mesh = ArrayMesh.new()
|
||||
var arrays = []
|
||||
arrays.resize(Mesh.ARRAY_MAX)
|
||||
arrays[Mesh.ARRAY_VERTEX] = vertices
|
||||
|
||||
|
||||
# 创建 Mesh。
|
||||
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
|
||||
var m = MeshInstance3D.new()
|
||||
@@ -52,13 +52,13 @@ ArrayMesh
|
||||
new Vector3(1, 0, 0),
|
||||
new Vector3(0, 0, 1),
|
||||
];
|
||||
|
||||
|
||||
// 初始化 ArrayMesh。
|
||||
var arrMesh = new ArrayMesh();
|
||||
Godot.Collections.Array arrays = [];
|
||||
arrays.Resize((int)Mesh.ArrayType.Max);
|
||||
arrays[(int)Mesh.ArrayType.Vertex] = vertices;
|
||||
|
||||
|
||||
// 创建 Mesh。
|
||||
arrMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, arrays);
|
||||
var m = new MeshInstance3D();
|
||||
@@ -165,7 +165,7 @@ ArrayMesh
|
||||
- |void| **set_blend_shape_mode**\ (\ value\: :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>`\ )
|
||||
- :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` **get_blend_shape_mode**\ (\ )
|
||||
|
||||
将混合形状模式设置为 :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` 之一。
|
||||
混合形状模式。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -467,6 +467,7 @@ ArrayMesh
|
||||
该方法目前没有描述,请帮我们\ :ref:`贡献一个 <doc_updating_the_class_reference>`\ 吧!
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/ArrayOccluder3D.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ArrayOccluder3D.xml.
|
||||
|
||||
.. _class_ArrayOccluder3D:
|
||||
|
||||
@@ -121,6 +121,7 @@ ArrayOccluder3D
|
||||
设置 :ref:`indices<class_ArrayOccluder3D_property_indices>` 和 :ref:`vertices<class_ArrayOccluder3D_property_vertices>`\ ,同时会在两个值都被设置后仅更新一次最终遮挡物。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AspectRatioContainer.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AspectRatioContainer.xml.
|
||||
|
||||
.. _class_AspectRatioContainer:
|
||||
|
||||
@@ -203,6 +203,7 @@ enum **AlignmentMode**: :ref:`🔗<enum_AspectRatioContainer_AlignmentMode>`
|
||||
用来对齐子控件的拉伸模式。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AStar2D.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AStar2D.xml.
|
||||
|
||||
.. _class_AStar2D:
|
||||
|
||||
@@ -23,6 +23,25 @@ A\* 算法的一种实现,用于在 2D 空间中的连通图上找到两个顶
|
||||
|
||||
有关如何使用该类的更详尽的解释,请参阅 :ref:`AStar3D<class_AStar3D>`\ 。\ **AStar2D** 是 :ref:`AStar3D<class_AStar3D>` 的包装器,它强制执行 2D 坐标。
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
教程
|
||||
----
|
||||
|
||||
- `AStarGrid2D 的网格导航演示 <https://godotengine.org/asset-library/asset/2723>`__
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
属性
|
||||
----
|
||||
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------+--------------------------------------------------------------------------------+-----------+
|
||||
| :ref:`bool<class_bool>` | :ref:`neighbor_filter_enabled<class_AStar2D_property_neighbor_filter_enabled>` | ``false`` |
|
||||
+-------------------------+--------------------------------------------------------------------------------+-----------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
方法
|
||||
@@ -36,6 +55,8 @@ A\* 算法的一种实现,用于在 2D 空间中的连通图上找到两个顶
|
||||
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_estimate_cost<class_AStar2D_private_method__estimate_cost>`\ (\ from_id\: :ref:`int<class_int>`, end_id\: :ref:`int<class_int>`\ ) |virtual| |const| |
|
||||
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_filter_neighbor<class_AStar2D_private_method__filter_neighbor>`\ (\ from_id\: :ref:`int<class_int>`, neighbor_id\: :ref:`int<class_int>`\ ) |virtual| |const| |
|
||||
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`add_point<class_AStar2D_method_add_point>`\ (\ id\: :ref:`int<class_int>`, position\: :ref:`Vector2<class_Vector2>`, weight_scale\: :ref:`float<class_float>` = 1.0\ ) |
|
||||
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`are_points_connected<class_AStar2D_method_are_points_connected>`\ (\ id\: :ref:`int<class_int>`, to_id\: :ref:`int<class_int>`, bidirectional\: :ref:`bool<class_bool>` = true\ ) |const| |
|
||||
@@ -89,6 +110,28 @@ A\* 算法的一种实现,用于在 2D 空间中的连通图上找到两个顶
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
属性说明
|
||||
--------
|
||||
|
||||
.. _class_AStar2D_property_neighbor_filter_enabled:
|
||||
|
||||
.. rst-class:: classref-property
|
||||
|
||||
:ref:`bool<class_bool>` **neighbor_filter_enabled** = ``false`` :ref:`🔗<class_AStar2D_property_neighbor_filter_enabled>`
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- |void| **set_neighbor_filter_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||||
- :ref:`bool<class_bool>` **is_neighbor_filter_enabled**\ (\ )
|
||||
|
||||
如果为 ``true``\ ,则启用通过 :ref:`_filter_neighbor()<class_AStar2D_private_method__filter_neighbor>` 过滤邻接点。
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
方法说明
|
||||
--------
|
||||
|
||||
@@ -120,6 +163,20 @@ A\* 算法的一种实现,用于在 2D 空间中的连通图上找到两个顶
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStar2D_private_method__filter_neighbor:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **_filter_neighbor**\ (\ from_id\: :ref:`int<class_int>`, neighbor_id\: :ref:`int<class_int>`\ ) |virtual| |const| :ref:`🔗<class_AStar2D_private_method__filter_neighbor>`
|
||||
|
||||
进入邻接处理且 :ref:`neighbor_filter_enabled<class_AStar2D_property_neighbor_filter_enabled>` 为 ``true`` 时调用。如果返回 ``true``\ ,则不会处理对应的点。
|
||||
|
||||
请注意,这个函数在默认的 **AStar2D** 类中是隐藏的。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStar2D_method_add_point:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
@@ -301,12 +358,12 @@ A\* 算法的一种实现,用于在 2D 空间中的连通图上找到两个顶
|
||||
astar.add_point(2, Vector2(0, 1), 1) # 默认权重为 1
|
||||
astar.add_point(3, Vector2(1, 1))
|
||||
astar.add_point(4, Vector2(2, 0))
|
||||
|
||||
|
||||
astar.connect_points(1, 2, false)
|
||||
astar.connect_points(2, 3, false)
|
||||
astar.connect_points(4, 3, false)
|
||||
astar.connect_points(1, 4, false)
|
||||
|
||||
|
||||
var res = astar.get_id_path(1, 3) # 返回 [1, 2, 3]
|
||||
|
||||
.. code-tab:: csharp
|
||||
@@ -316,7 +373,7 @@ A\* 算法的一种实现,用于在 2D 空间中的连通图上找到两个顶
|
||||
astar.AddPoint(2, new Vector2(0, 1), 1); // 默认权重为 1
|
||||
astar.AddPoint(3, new Vector2(1, 1));
|
||||
astar.AddPoint(4, new Vector2(2, 0));
|
||||
|
||||
|
||||
astar.ConnectPoints(1, 2, false);
|
||||
astar.ConnectPoints(2, 3, false);
|
||||
astar.ConnectPoints(4, 3, false);
|
||||
@@ -361,10 +418,10 @@ A\* 算法的一种实现,用于在 2D 空间中的连通图上找到两个顶
|
||||
astar.add_point(2, Vector2(0, 1))
|
||||
astar.add_point(3, Vector2(1, 1))
|
||||
astar.add_point(4, Vector2(2, 0))
|
||||
|
||||
|
||||
astar.connect_points(1, 2, true)
|
||||
astar.connect_points(1, 3, true)
|
||||
|
||||
|
||||
var neighbors = astar.get_point_connections(1) # 返回 [2, 3]
|
||||
|
||||
.. code-tab:: csharp
|
||||
@@ -374,10 +431,10 @@ A\* 算法的一种实现,用于在 2D 空间中的连通图上找到两个顶
|
||||
astar.AddPoint(2, new Vector2(0, 1));
|
||||
astar.AddPoint(3, new Vector2(1, 1));
|
||||
astar.AddPoint(4, new Vector2(2, 0));
|
||||
|
||||
|
||||
astar.ConnectPoints(1, 2, true);
|
||||
astar.ConnectPoints(1, 3, true);
|
||||
|
||||
|
||||
long[] neighbors = astar.GetPointConnections(1); // 返回 [2, 3]
|
||||
|
||||
|
||||
@@ -416,13 +473,13 @@ A\* 算法的一种实现,用于在 2D 空间中的连通图上找到两个顶
|
||||
|
||||
:ref:`PackedVector2Array<class_PackedVector2Array>` **get_point_path**\ (\ from_id\: :ref:`int<class_int>`, to_id\: :ref:`int<class_int>`, allow_partial_path\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_AStar2D_method_get_point_path>`
|
||||
|
||||
返回一个数组,其中包含 AStar2D 在给定点之间找到的路径中的点。数组从路径的起点到终点进行排序。
|
||||
Returns an array with the points that are in the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path.
|
||||
|
||||
如果没有通往目标的有效路径并且 ``allow_partial_path`` 为 ``true``\ ,则会返回通往距离目标最近的可达点的路径。
|
||||
If there is no valid path to the target, and ``allow_partial_path`` is ``true``, returns a path to the point closest to the target that can be reached.
|
||||
|
||||
\ **注意:**\ 该方法不是线程安全的。如果从 :ref:`Thread<class_Thread>` 调用,它将返回一个空的 :ref:`PackedVector2Array<class_PackedVector2Array>` 并打印一条错误消息。
|
||||
\ **Note:** This method is not thread-safe; it can only be used from a single :ref:`Thread<class_Thread>` at a given time. Consider using :ref:`Mutex<class_Mutex>` to ensure exclusive access to one thread to avoid race conditions.
|
||||
|
||||
另外,如果 ``allow_partial_path`` 为 ``true`` 并且 ``to_id`` 处于禁用状态,搜索耗时可能异常地大。
|
||||
Additionally, when ``allow_partial_path`` is ``true`` and ``to_id`` is disabled the search may take an unusually long time to finish.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -494,7 +551,7 @@ A\* 算法的一种实现,用于在 2D 空间中的连通图上找到两个顶
|
||||
|
||||
|void| **reserve_space**\ (\ num_nodes\: :ref:`int<class_int>`\ ) :ref:`🔗<class_AStar2D_method_reserve_space>`
|
||||
|
||||
在内部为 ``num_nodes`` 个点预留空间。如果需要大批添加已知数量的点,例如网格上的点,则此函数很有用。新的容量必须大于或等于旧的容量。
|
||||
在内部预留 ``num_nodes`` 个点的空间。适用于需要一次性添加大量已知数量的点的情况,例如添加网格上的点。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -533,6 +590,7 @@ A\* 算法的一种实现,用于在 2D 空间中的连通图上找到两个顶
|
||||
为给定的 ``id`` 的点设置 ``weight_scale``\ 。在确定从邻接点到这个点的一段路程的总成本时,\ ``weight_scale`` 要乘以 :ref:`_compute_cost()<class_AStar2D_private_method__compute_cost>` 的结果。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AStar3D.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AStar3D.xml.
|
||||
|
||||
.. _class_AStar3D:
|
||||
|
||||
@@ -34,12 +34,12 @@ A\*(A 星)是一种用于寻路和图遍历的计算机算法,会根据一
|
||||
|
||||
class_name MyAStar3D
|
||||
extends AStar3D
|
||||
|
||||
|
||||
func _compute_cost(u, v):
|
||||
var u_pos = get_point_position(u)
|
||||
var v_pos = get_point_position(v)
|
||||
return abs(u_pos.x - v_pos.x) + abs(u_pos.y - v_pos.y) + abs(u_pos.z - v_pos.z)
|
||||
|
||||
|
||||
func _estimate_cost(u, v):
|
||||
var u_pos = get_point_position(u)
|
||||
var v_pos = get_point_position(v)
|
||||
@@ -48,7 +48,7 @@ A\*(A 星)是一种用于寻路和图遍历的计算机算法,会根据一
|
||||
.. code-tab:: csharp
|
||||
|
||||
using Godot;
|
||||
|
||||
|
||||
[GlobalClass]
|
||||
public partial class MyAStar3D : AStar3D
|
||||
{
|
||||
@@ -56,10 +56,10 @@ A\*(A 星)是一种用于寻路和图遍历的计算机算法,会根据一
|
||||
{
|
||||
Vector3 fromPoint = GetPointPosition(fromId);
|
||||
Vector3 toPoint = GetPointPosition(toId);
|
||||
|
||||
|
||||
return Mathf.Abs(fromPoint.X - toPoint.X) + Mathf.Abs(fromPoint.Y - toPoint.Y) + Mathf.Abs(fromPoint.Z - toPoint.Z);
|
||||
}
|
||||
|
||||
|
||||
public override float _EstimateCost(long fromId, long toId)
|
||||
{
|
||||
Vector3 fromPoint = GetPointPosition(fromId);
|
||||
@@ -76,6 +76,18 @@ A\*(A 星)是一种用于寻路和图遍历的计算机算法,会根据一
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
属性
|
||||
----
|
||||
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------+--------------------------------------------------------------------------------+-----------+
|
||||
| :ref:`bool<class_bool>` | :ref:`neighbor_filter_enabled<class_AStar3D_property_neighbor_filter_enabled>` | ``false`` |
|
||||
+-------------------------+--------------------------------------------------------------------------------+-----------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
方法
|
||||
----
|
||||
|
||||
@@ -87,6 +99,8 @@ A\*(A 星)是一种用于寻路和图遍历的计算机算法,会根据一
|
||||
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_estimate_cost<class_AStar3D_private_method__estimate_cost>`\ (\ from_id\: :ref:`int<class_int>`, end_id\: :ref:`int<class_int>`\ ) |virtual| |const| |
|
||||
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_filter_neighbor<class_AStar3D_private_method__filter_neighbor>`\ (\ from_id\: :ref:`int<class_int>`, neighbor_id\: :ref:`int<class_int>`\ ) |virtual| |const| |
|
||||
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`add_point<class_AStar3D_method_add_point>`\ (\ id\: :ref:`int<class_int>`, position\: :ref:`Vector3<class_Vector3>`, weight_scale\: :ref:`float<class_float>` = 1.0\ ) |
|
||||
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`are_points_connected<class_AStar3D_method_are_points_connected>`\ (\ id\: :ref:`int<class_int>`, to_id\: :ref:`int<class_int>`, bidirectional\: :ref:`bool<class_bool>` = true\ ) |const| |
|
||||
@@ -140,6 +154,28 @@ A\*(A 星)是一种用于寻路和图遍历的计算机算法,会根据一
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
属性说明
|
||||
--------
|
||||
|
||||
.. _class_AStar3D_property_neighbor_filter_enabled:
|
||||
|
||||
.. rst-class:: classref-property
|
||||
|
||||
:ref:`bool<class_bool>` **neighbor_filter_enabled** = ``false`` :ref:`🔗<class_AStar3D_property_neighbor_filter_enabled>`
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- |void| **set_neighbor_filter_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||||
- :ref:`bool<class_bool>` **is_neighbor_filter_enabled**\ (\ )
|
||||
|
||||
如果为 ``true``\ ,则启用通过 :ref:`_filter_neighbor()<class_AStar3D_private_method__filter_neighbor>` 过滤邻接点。
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
方法说明
|
||||
--------
|
||||
|
||||
@@ -171,6 +207,20 @@ A\*(A 星)是一种用于寻路和图遍历的计算机算法,会根据一
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStar3D_private_method__filter_neighbor:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **_filter_neighbor**\ (\ from_id\: :ref:`int<class_int>`, neighbor_id\: :ref:`int<class_int>`\ ) |virtual| |const| :ref:`🔗<class_AStar3D_private_method__filter_neighbor>`
|
||||
|
||||
进入邻接处理且 :ref:`neighbor_filter_enabled<class_AStar3D_property_neighbor_filter_enabled>` 为 ``true`` 时调用。如果返回 ``true``\ ,则不会处理对应的点。
|
||||
|
||||
请注意,这个函数在默认的 **AStar3D** 类中是隐藏的。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStar3D_method_add_point:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
@@ -352,12 +402,12 @@ A\*(A 星)是一种用于寻路和图遍历的计算机算法,会根据一
|
||||
astar.add_point(2, Vector3(0, 1, 0), 1) # 默认权重为 1
|
||||
astar.add_point(3, Vector3(1, 1, 0))
|
||||
astar.add_point(4, Vector3(2, 0, 0))
|
||||
|
||||
|
||||
astar.connect_points(1, 2, false)
|
||||
astar.connect_points(2, 3, false)
|
||||
astar.connect_points(4, 3, false)
|
||||
astar.connect_points(1, 4, false)
|
||||
|
||||
|
||||
var res = astar.get_id_path(1, 3) # 返回 [1, 2, 3]
|
||||
|
||||
.. code-tab:: csharp
|
||||
@@ -411,10 +461,10 @@ A\*(A 星)是一种用于寻路和图遍历的计算机算法,会根据一
|
||||
astar.add_point(2, Vector3(0, 1, 0))
|
||||
astar.add_point(3, Vector3(1, 1, 0))
|
||||
astar.add_point(4, Vector3(2, 0, 0))
|
||||
|
||||
|
||||
astar.connect_points(1, 2, true)
|
||||
astar.connect_points(1, 3, true)
|
||||
|
||||
|
||||
var neighbors = astar.get_point_connections(1) # 返回 [2, 3]
|
||||
|
||||
.. code-tab:: csharp
|
||||
@@ -426,7 +476,7 @@ A\*(A 星)是一种用于寻路和图遍历的计算机算法,会根据一
|
||||
astar.AddPoint(4, new Vector3(2, 0, 0));
|
||||
astar.ConnectPoints(1, 2, true);
|
||||
astar.ConnectPoints(1, 3, true);
|
||||
|
||||
|
||||
long[] neighbors = astar.GetPointConnections(1); // 返回 [2, 3]
|
||||
|
||||
|
||||
@@ -465,13 +515,13 @@ A\*(A 星)是一种用于寻路和图遍历的计算机算法,会根据一
|
||||
|
||||
:ref:`PackedVector3Array<class_PackedVector3Array>` **get_point_path**\ (\ from_id\: :ref:`int<class_int>`, to_id\: :ref:`int<class_int>`, allow_partial_path\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_AStar3D_method_get_point_path>`
|
||||
|
||||
返回一个数组,其中包含 AStar3D 在给定点之间找到的路径中的点。数组从路径的起点到终点进行排序。
|
||||
Returns an array with the points that are in the path found by AStar3D between the given points. The array is ordered from the starting point to the ending point of the path.
|
||||
|
||||
如果没有通往目标的有效路径并且 ``allow_partial_path`` 为 ``true``\ ,则会返回通往距离目标最近的可达点的路径。
|
||||
If there is no valid path to the target, and ``allow_partial_path`` is ``true``, returns a path to the point closest to the target that can be reached.
|
||||
|
||||
\ **注意:**\ 这种方法不是线程安全的。如果从 :ref:`Thread<class_Thread>` 调用,它将返回一个空的 :ref:`PackedVector3Array<class_PackedVector3Array>`\ ,并打印一条错误消息。
|
||||
\ **Note:** This method is not thread-safe; it can only be used from a single :ref:`Thread<class_Thread>` at a given time. Consider using :ref:`Mutex<class_Mutex>` to ensure exclusive access to one thread to avoid race conditions.
|
||||
|
||||
另外,如果 ``allow_partial_path`` 为 ``true`` 并且 ``to_id`` 处于禁用状态,搜索耗时可能异常地大。
|
||||
Additionally, when ``allow_partial_path`` is ``true`` and ``to_id`` is disabled the search may take an unusually long time to finish.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -543,7 +593,7 @@ A\*(A 星)是一种用于寻路和图遍历的计算机算法,会根据一
|
||||
|
||||
|void| **reserve_space**\ (\ num_nodes\: :ref:`int<class_int>`\ ) :ref:`🔗<class_AStar3D_method_reserve_space>`
|
||||
|
||||
该函数为 ``num_nodes`` 个点内部预留空间。如果一次添加了大量已知数量的点,例如网格上的点,则此函数很有用。新的容量必须大于或等于旧的容量。
|
||||
在内部预留 ``num_nodes`` 个点的空间。适用于需要一次性添加大量已知数量的点的情况,例如添加网格上的点。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -582,6 +632,7 @@ A\*(A 星)是一种用于寻路和图遍历的计算机算法,会根据一
|
||||
为给定的 ``id`` 的点设置 ``weight_scale``\ 。在确定从邻接点到这个点的一段路程的总成本时,\ ``weight_scale`` 要乘以 :ref:`_compute_cost()<class_AStar3D_private_method__compute_cost>` 的结果。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AStarGrid2D.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AStarGrid2D.xml.
|
||||
|
||||
.. _class_AStarGrid2D:
|
||||
|
||||
@@ -48,6 +48,13 @@ A\* 的一种实现,用于寻找疏松 2D 网格中两点之间的最短路径
|
||||
|
||||
要从寻路网格中移除某个点,必须使用 :ref:`set_point_solid()<class_AStarGrid2D_method_set_point_solid>` 将其设置为“实心”。
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
教程
|
||||
----
|
||||
|
||||
- `AStarGrid2D 的网格导航演示 <https://godotengine.org/asset-library/asset/2723>`__
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
属性
|
||||
@@ -569,13 +576,13 @@ enum **CellShape**: :ref:`🔗<enum_AStarGrid2D_CellShape>`
|
||||
|
||||
:ref:`PackedVector2Array<class_PackedVector2Array>` **get_point_path**\ (\ from_id\: :ref:`Vector2i<class_Vector2i>`, to_id\: :ref:`Vector2i<class_Vector2i>`, allow_partial_path\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_AStarGrid2D_method_get_point_path>`
|
||||
|
||||
返回一个数组,其中包含 **AStarGrid2D** 在给定点之间找到的路径上的点。数组从路径的起点到终点排序。
|
||||
Returns an array with the points that are in the path found by **AStarGrid2D** between the given points. The array is ordered from the starting point to the ending point of the path.
|
||||
|
||||
如果没有通往目标的有效路径并且 ``allow_partial_path`` 为 ``true``\ ,则会返回通往距离目标最近的可达点的路径。
|
||||
If there is no valid path to the target, and ``allow_partial_path`` is ``true``, returns a path to the point closest to the target that can be reached.
|
||||
|
||||
\ **注意:**\ 该方法不是线程安全的。如果从 :ref:`Thread<class_Thread>` 中调用它,它将返回一个空的 :ref:`PackedVector3Array<class_PackedVector3Array>` 并打印一条错误消息。
|
||||
\ **Note:** This method is not thread-safe; it can only be used from a single :ref:`Thread<class_Thread>` at a given time. Consider using :ref:`Mutex<class_Mutex>` to ensure exclusive access to one thread to avoid race conditions.
|
||||
|
||||
另外,如果 ``allow_partial_path`` 为 ``true`` 并且 ``to_id`` 处于禁用状态,搜索耗时可能异常地大。
|
||||
Additionally, when ``allow_partial_path`` is ``true`` and ``to_id`` is solid the search may take an unusually long time to finish.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -692,6 +699,7 @@ enum **CellShape**: :ref:`🔗<enum_AStarGrid2D_CellShape>`
|
||||
\ **注意:**\ 会清空所有点的数据(坚固以及权重比例)。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AtlasTexture.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AtlasTexture.xml.
|
||||
|
||||
.. _class_AtlasTexture:
|
||||
|
||||
@@ -119,6 +119,7 @@ AtlasTexture
|
||||
绘制 :ref:`atlas<class_AtlasTexture_property_atlas>` 的区域。如果区域在某个方向上大小为 ``0``\ ,则该方向会使用 :ref:`atlas<class_AtlasTexture_property_atlas>` 的大小。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioBusLayout.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioBusLayout.xml.
|
||||
|
||||
.. _class_AudioBusLayout:
|
||||
|
||||
@@ -22,6 +22,7 @@ AudioBusLayout
|
||||
存储位置、静音、独奏、旁通、效果、效果位置、音量以及总线之间的连接。使用方法见 :ref:`AudioServer<class_AudioServer>` 。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffect.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffect.xml.
|
||||
|
||||
.. _class_AudioEffect:
|
||||
|
||||
@@ -42,9 +42,9 @@ AudioEffect
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------+
|
||||
| :ref:`AudioEffectInstance<class_AudioEffectInstance>` | :ref:`_instantiate<class_AudioEffect_private_method__instantiate>`\ (\ ) |virtual| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------+
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------+
|
||||
| :ref:`AudioEffectInstance<class_AudioEffectInstance>` | :ref:`_instantiate<class_AudioEffect_private_method__instantiate>`\ (\ ) |virtual| |required| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
@@ -59,25 +59,26 @@ AudioEffect
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`AudioEffectInstance<class_AudioEffectInstance>` **_instantiate**\ (\ ) |virtual| :ref:`🔗<class_AudioEffect_private_method__instantiate>`
|
||||
:ref:`AudioEffectInstance<class_AudioEffectInstance>` **_instantiate**\ (\ ) |virtual| |required| :ref:`🔗<class_AudioEffect_private_method__instantiate>`
|
||||
|
||||
覆盖该方法以自定义新创建的 :ref:`AudioEffectInstance<class_AudioEffectInstance>`\ ,它是在编辑器的音频面板中将该效果应用于总线时,或通过 :ref:`AudioServer.add_bus_effect()<class_AudioServer_method_add_bus_effect>` 时创建的。
|
||||
|
||||
::
|
||||
|
||||
extends AudioEffect
|
||||
|
||||
|
||||
@export var strength = 4.0
|
||||
|
||||
|
||||
func _instantiate():
|
||||
var effect = CustomAudioEffectInstance.new()
|
||||
effect.base = self
|
||||
|
||||
|
||||
return effect
|
||||
|
||||
\ **注意:**\ 建议在新实例中保留对原始 **AudioEffect** 的引用。根据实现,这允许效果实例在运行时监听更改并进行相应的修改。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectAmplify.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectAmplify.xml.
|
||||
|
||||
.. _class_AudioEffectAmplify:
|
||||
|
||||
@@ -84,6 +84,7 @@ AudioEffectAmplify
|
||||
\ **注意:**\ 该成员会帮助修改 :ref:`volume_db<class_AudioEffectAmplify_property_volume_db>`\ 。返回的值等价于使用 :ref:`volume_db<class_AudioEffectAmplify_property_volume_db>` 调用 :ref:`@GlobalScope.db_to_linear()<class_@GlobalScope_method_db_to_linear>` 的结果。设置该成员等价于将 :ref:`volume_db<class_AudioEffectAmplify_property_volume_db>` 设置为使用新值调用 :ref:`@GlobalScope.linear_to_db()<class_@GlobalScope_method_linear_to_db>` 的结果。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectBandLimitFilter.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectBandLimitFilter.xml.
|
||||
|
||||
.. _class_AudioEffectBandLimitFilter:
|
||||
|
||||
@@ -29,6 +29,7 @@ AudioEffectBandLimitFilter
|
||||
- :doc:`音频总线 <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectBandPassFilter.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectBandPassFilter.xml.
|
||||
|
||||
.. _class_AudioEffectBandPassFilter:
|
||||
|
||||
@@ -29,6 +29,7 @@ AudioEffectBandPassFilter
|
||||
- :doc:`音频总线 <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectCapture.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectCapture.xml.
|
||||
|
||||
.. _class_AudioEffectCapture:
|
||||
|
||||
@@ -186,6 +186,7 @@ AudioEffectCapture 是一种 AudioEffect,可将所有音频帧从附加的音
|
||||
返回从音频总线插入的音频帧的数量。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectChorus.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectChorus.xml.
|
||||
|
||||
.. _class_AudioEffectChorus:
|
||||
|
||||
@@ -764,6 +764,7 @@ AudioEffectChorus
|
||||
该方法目前没有描述,请帮我们\ :ref:`贡献一个 <doc_updating_the_class_reference>`\ 吧!
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectCompressor.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectCompressor.xml.
|
||||
|
||||
.. _class_AudioEffectCompressor:
|
||||
|
||||
@@ -25,7 +25,7 @@ AudioEffectCompressor
|
||||
|
||||
压缩器在混音中的用途很多。
|
||||
|
||||
- 在主总线上压缩整个输出(虽然 :ref:`AudioEffectLimiter<class_AudioEffectLimiter>` 可能更好些)。
|
||||
- 在主总线上压缩整个输出(虽然 :ref:`AudioEffectHardLimiter<class_AudioEffectHardLimiter>` 可能更好些)。
|
||||
|
||||
- 在声音通道中,以确保它们听起来尽可能的平衡。
|
||||
|
||||
@@ -189,6 +189,7 @@ AudioEffectCompressor
|
||||
超过该电平,压缩将应用于音频。值的范围可以从 -60 到 0。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectDelay.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectDelay.xml.
|
||||
|
||||
.. _class_AudioEffectDelay:
|
||||
|
||||
@@ -293,6 +293,7 @@ AudioEffectDelay
|
||||
第二拍的声像位置。取值范围为 -1(完全向左)到 1(完全向右)。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectDistortion.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectDistortion.xml.
|
||||
|
||||
.. _class_AudioEffectDistortion:
|
||||
|
||||
@@ -202,6 +202,7 @@ enum **Mode**: :ref:`🔗<enum_AudioEffectDistortion_Mode>`
|
||||
在效果前增加或减少的音量,单位为分贝。取值范围从 -60 到 60。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectEQ.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectEQ.xml.
|
||||
|
||||
.. _class_AudioEffectEQ:
|
||||
|
||||
@@ -90,6 +90,7 @@ AudioEffectEQ 可用于频率控制。用它来弥补音频中不足之处。Aud
|
||||
设置指定索引处的波段增益,单位为 dB。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectEQ10.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectEQ10.xml.
|
||||
|
||||
.. _class_AudioEffectEQ10:
|
||||
|
||||
@@ -53,6 +53,7 @@ AudioEffectEQ10
|
||||
- :doc:`音频总线 <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectEQ21.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectEQ21.xml.
|
||||
|
||||
.. _class_AudioEffectEQ21:
|
||||
|
||||
@@ -75,6 +75,7 @@ AudioEffectEQ21
|
||||
- :doc:`音频总线 <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectEQ6.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectEQ6.xml.
|
||||
|
||||
.. _class_AudioEffectEQ6:
|
||||
|
||||
@@ -45,6 +45,7 @@ AudioEffectEQ6
|
||||
- :doc:`音频总线 <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectFilter.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectFilter.xml.
|
||||
|
||||
.. _class_AudioEffectFilter:
|
||||
|
||||
@@ -169,6 +169,7 @@ enum **FilterDB**: :ref:`🔗<enum_AudioEffectFilter_FilterDB>`
|
||||
在截断频率附近的频率范围内的提升量。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectHardLimiter.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectHardLimiter.xml.
|
||||
|
||||
.. _class_AudioEffectHardLimiter:
|
||||
|
||||
@@ -103,6 +103,7 @@ AudioEffectHardLimiter
|
||||
增益降低完全释放所需的时间(以秒为单位)。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectHighPassFilter.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectHighPassFilter.xml.
|
||||
|
||||
.. _class_AudioEffectHighPassFilter:
|
||||
|
||||
@@ -29,6 +29,7 @@ AudioEffectHighPassFilter
|
||||
- :doc:`音频总线 <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectHighShelfFilter.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectHighShelfFilter.xml.
|
||||
|
||||
.. _class_AudioEffectHighShelfFilter:
|
||||
|
||||
@@ -29,6 +29,7 @@ AudioEffectHighShelfFilter
|
||||
- :doc:`音频总线 <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectInstance.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectInstance.xml.
|
||||
|
||||
.. _class_AudioEffectInstance:
|
||||
|
||||
@@ -38,11 +38,11 @@ AudioEffectInstance
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`_process<class_AudioEffectInstance_private_method__process>`\ (\ src_buffer\: ``const void*``, dst_buffer\: ``AudioFrame*``, frame_count\: :ref:`int<class_int>`\ ) |virtual| |
|
||||
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_process_silence<class_AudioEffectInstance_private_method__process_silence>`\ (\ ) |virtual| |const| |
|
||||
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`_process<class_AudioEffectInstance_private_method__process>`\ (\ src_buffer\: ``const void*``, dst_buffer\: ``AudioFrame*``, frame_count\: :ref:`int<class_int>`\ ) |virtual| |required| |
|
||||
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_process_silence<class_AudioEffectInstance_private_method__process_silence>`\ (\ ) |virtual| |const| |
|
||||
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
@@ -57,7 +57,7 @@ AudioEffectInstance
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
|void| **_process**\ (\ src_buffer\: ``const void*``, dst_buffer\: ``AudioFrame*``, frame_count\: :ref:`int<class_int>`\ ) |virtual| :ref:`🔗<class_AudioEffectInstance_private_method__process>`
|
||||
|void| **_process**\ (\ src_buffer\: ``const void*``, dst_buffer\: ``AudioFrame*``, frame_count\: :ref:`int<class_int>`\ ) |virtual| |required| :ref:`🔗<class_AudioEffectInstance_private_method__process>`
|
||||
|
||||
由 :ref:`AudioServer<class_AudioServer>` 调用来处理该效果。当 :ref:`_process_silence()<class_AudioEffectInstance_private_method__process_silence>` 未被覆盖或返回 ``false`` 时,该方法仅在总线处于活动状态时调用。
|
||||
|
||||
@@ -78,6 +78,7 @@ AudioEffectInstance
|
||||
应返回 ``true`` 以强制 :ref:`AudioServer<class_AudioServer>` 始终调用 :ref:`_process()<class_AudioEffectInstance_private_method__process>`\ ,即使总线已静音或无法听到。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectLimiter.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectLimiter.xml.
|
||||
|
||||
.. _class_AudioEffectLimiter:
|
||||
|
||||
@@ -126,6 +126,7 @@ AudioEffectLimiter
|
||||
限制器开始生效的阈值,以分贝为单位。值的范围可以从 -30 到 0。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectLowPassFilter.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectLowPassFilter.xml.
|
||||
|
||||
.. _class_AudioEffectLowPassFilter:
|
||||
|
||||
@@ -29,6 +29,7 @@ AudioEffectLowPassFilter
|
||||
- :doc:`音频总线 <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectLowShelfFilter.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectLowShelfFilter.xml.
|
||||
|
||||
.. _class_AudioEffectLowShelfFilter:
|
||||
|
||||
@@ -29,6 +29,7 @@ AudioEffectLowShelfFilter
|
||||
- :doc:`音频总线 <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectNotchFilter.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectNotchFilter.xml.
|
||||
|
||||
.. _class_AudioEffectNotchFilter:
|
||||
|
||||
@@ -29,6 +29,7 @@ AudioEffectNotchFilter
|
||||
- :doc:`音频总线 <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectPanner.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectPanner.xml.
|
||||
|
||||
.. _class_AudioEffectPanner:
|
||||
|
||||
@@ -63,6 +63,7 @@ AudioEffectPanner
|
||||
声像位置。值的范围可以从 -1(完全左)到1(完全右)。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectPhaser.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectPhaser.xml.
|
||||
|
||||
.. _class_AudioEffectPhaser:
|
||||
|
||||
@@ -70,7 +70,7 @@ AudioEffectPhaser
|
||||
- |void| **set_depth**\ (\ value\: :ref:`float<class_float>`\ )
|
||||
- :ref:`float<class_float>` **get_depth**\ (\ )
|
||||
|
||||
控制滤波器频率扫描的高度。较低的值将主要影响低音频率。高值可以推高高音。值的范围可以从 0.1 到 4。
|
||||
控制滤波器频率扫描的高度。较低的值主要影响低音频率。较高的值可以推高高音。取值范围为 ``0.1`` 到 ``4.0``\ 。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -141,6 +141,7 @@ AudioEffectPhaser
|
||||
以 Hz 为单位调整效果在整个频率范围内上下扫描的速度。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectPitchShift.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectPitchShift.xml.
|
||||
|
||||
.. _class_AudioEffectPitchShift:
|
||||
|
||||
@@ -166,6 +166,7 @@ enum **FFTSize**: :ref:`🔗<enum_AudioEffectPitchShift_FFTSize>`
|
||||
要使用的音高缩放。\ ``1.0`` 是默认的音高,声音会按原样播放。\ :ref:`pitch_scale<class_AudioEffectPitchShift_property_pitch_scale>` 的范围从 ``0.0``\ (无限低的音高,听不见)到 ``16``\ (比初始音高要高 16 倍)。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectRecord.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectRecord.xml.
|
||||
|
||||
.. _class_AudioEffectRecord:
|
||||
|
||||
@@ -84,7 +84,7 @@ AudioEffectRecord
|
||||
- |void| **set_format**\ (\ value\: :ref:`Format<enum_AudioStreamWAV_Format>`\ )
|
||||
- :ref:`Format<enum_AudioStreamWAV_Format>` **get_format**\ (\ )
|
||||
|
||||
指定样本将被记录的格式。有关可用格式,请参阅 :ref:`Format<enum_AudioStreamWAV_Format>`\ 。
|
||||
指定样本的记录格式。
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
@@ -128,6 +128,7 @@ AudioEffectRecord
|
||||
如果为 ``true``\ ,将录制声音。请注意,重新开始录音将移除先前录音的样本。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectReverb.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectReverb.xml.
|
||||
|
||||
.. _class_AudioEffectReverb:
|
||||
|
||||
@@ -198,6 +198,7 @@ AudioEffectReverb
|
||||
修改后声音的输出百分比。为 0 时,只输出原始声音。取值范围是 0 到 1。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectSpectrumAnalyzer.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectSpectrumAnalyzer.xml.
|
||||
|
||||
.. _class_AudioEffectSpectrumAnalyzer:
|
||||
|
||||
@@ -170,6 +170,7 @@ enum **FFTSize**: :ref:`🔗<enum_AudioEffectSpectrumAnalyzer_FFTSize>`
|
||||
该属性目前没有描述,请帮我们\ :ref:`贡献一个 <doc_updating_the_class_reference>`\ 吧!
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectSpectrumAnalyzerInstance.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectSpectrumAnalyzerInstance.xml.
|
||||
|
||||
.. _class_AudioEffectSpectrumAnalyzerInstance:
|
||||
|
||||
@@ -90,9 +90,10 @@ enum **MagnitudeMode**: :ref:`🔗<enum_AudioEffectSpectrumAnalyzerInstance_Magn
|
||||
|
||||
返回从 ``from_hz`` 到 ``to_hz`` 频率范围内的幅度,使用线性能量单位,返回的是 Vector2。返回值的 ``x`` 分量代表左声道、\ ``y`` 分量代表右声道。
|
||||
|
||||
\ ``mode`` 决定的是频率范围的处理方式,见 :ref:`MagnitudeMode<enum_AudioEffectSpectrumAnalyzerInstance_MagnitudeMode>`\ 。
|
||||
\ ``mode`` 决定的是频率范围的处理方式。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioEffectStereoEnhance.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectStereoEnhance.xml.
|
||||
|
||||
.. _class_AudioEffectStereoEnhance:
|
||||
|
||||
@@ -101,6 +101,7 @@ AudioEffectStereoEnhance
|
||||
通过在偏移相位时结合\ :ref:`surround<class_AudioEffectStereoEnhance_property_surround>`\ 来拓宽声场。若\ :ref:`surround<class_AudioEffectStereoEnhance_property_surround>`\ 为0,则仅延迟右声道。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioListener2D.xml.
|
||||
.. 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.
|
||||
|
||||
.. _class_AudioListener2D:
|
||||
|
||||
@@ -86,6 +86,7 @@ AudioListener2D
|
||||
如果 **AudioListener2D** 未添加到 :ref:`SceneTree<class_SceneTree>`\ ,则该方法无效。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioListener3D.xml.
|
||||
.. 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.
|
||||
|
||||
.. _class_AudioListener3D:
|
||||
|
||||
@@ -26,6 +26,18 @@ AudioListener3D
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
属性
|
||||
----
|
||||
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+--------------------------------------------------------------+--------------------------------------------------------------------------+-------+
|
||||
| :ref:`DopplerTracking<enum_AudioListener3D_DopplerTracking>` | :ref:`doppler_tracking<class_AudioListener3D_property_doppler_tracking>` | ``0`` |
|
||||
+--------------------------------------------------------------+--------------------------------------------------------------------------+-------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
方法
|
||||
----
|
||||
|
||||
@@ -48,6 +60,69 @@ AudioListener3D
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
枚举
|
||||
----
|
||||
|
||||
.. _enum_AudioListener3D_DopplerTracking:
|
||||
|
||||
.. rst-class:: classref-enumeration
|
||||
|
||||
enum **DopplerTracking**: :ref:`🔗<enum_AudioListener3D_DopplerTracking>`
|
||||
|
||||
.. _class_AudioListener3D_constant_DOPPLER_TRACKING_DISABLED:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`DopplerTracking<enum_AudioListener3D_DopplerTracking>` **DOPPLER_TRACKING_DISABLED** = ``0``
|
||||
|
||||
禁用\ `多普勒效应 <https://en.wikipedia.org/wiki/Doppler_effect>`__\ 模拟(默认)。
|
||||
|
||||
.. _class_AudioListener3D_constant_DOPPLER_TRACKING_IDLE_STEP:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`DopplerTracking<enum_AudioListener3D_DopplerTracking>` **DOPPLER_TRACKING_IDLE_STEP** = ``1``
|
||||
|
||||
通过跟踪在 ``_process`` 中改变的物体位置来模拟\ `多普勒效应 <https://zh.wikipedia.org/wiki/%E5%A4%9A%E6%99%AE%E5%8B%92%E6%95%88%E5%BA%94>`__\ 。该监听器相对于这些物体的相对速度的变化会影响音频的感知方式(改变音频的 :ref:`AudioStreamPlayer3D.pitch_scale<class_AudioStreamPlayer3D_property_pitch_scale>`\ )。
|
||||
|
||||
.. _class_AudioListener3D_constant_DOPPLER_TRACKING_PHYSICS_STEP:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`DopplerTracking<enum_AudioListener3D_DopplerTracking>` **DOPPLER_TRACKING_PHYSICS_STEP** = ``2``
|
||||
|
||||
通过跟踪在 ``_process`` 中改变的物体位置来模拟\ `多普勒效应 <https://zh.wikipedia.org/wiki/%E5%A4%9A%E6%99%AE%E5%8B%92%E6%95%88%E5%BA%94>`__\ 。该监听器相对于这些物体的相对速度的变化会影响音频的感知方式(改变音频的 :ref:`AudioStreamPlayer3D.pitch_scale<class_AudioStreamPlayer3D_property_pitch_scale>`\ )。
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
属性说明
|
||||
--------
|
||||
|
||||
.. _class_AudioListener3D_property_doppler_tracking:
|
||||
|
||||
.. rst-class:: classref-property
|
||||
|
||||
:ref:`DopplerTracking<enum_AudioListener3D_DopplerTracking>` **doppler_tracking** = ``0`` :ref:`🔗<class_AudioListener3D_property_doppler_tracking>`
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- |void| **set_doppler_tracking**\ (\ value\: :ref:`DopplerTracking<enum_AudioListener3D_DopplerTracking>`\ )
|
||||
- :ref:`DopplerTracking<enum_AudioListener3D_DopplerTracking>` **get_doppler_tracking**\ (\ )
|
||||
|
||||
如果不是 :ref:`DOPPLER_TRACKING_DISABLED<class_AudioListener3D_constant_DOPPLER_TRACKING_DISABLED>`\ ,则该监听器将在特定的 ``_process`` 方法中,为变化的对象模拟\ `多普勒效应 <https://zh.wikipedia.org/wiki/%E5%A4%9A%E6%99%AE%E5%8B%92%E6%95%88%E5%BA%94>`__\ 。
|
||||
|
||||
\ **注意:**\ 多普勒效应仅在 :ref:`AudioStreamPlayer3D.doppler_tracking<class_AudioStreamPlayer3D_property_doppler_tracking>` 未设置为 :ref:`AudioStreamPlayer3D.DOPPLER_TRACKING_DISABLED<class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_DISABLED>` 时才会在 :ref:`AudioStreamPlayer3D<class_AudioStreamPlayer3D>` 上听到。
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
方法说明
|
||||
--------
|
||||
|
||||
@@ -98,6 +173,7 @@ AudioListener3D
|
||||
启用该监听器。将覆盖当前相机的监听器。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioSample.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioSample.xml.
|
||||
|
||||
.. _class_AudioSample:
|
||||
|
||||
@@ -24,6 +24,7 @@ AudioSample
|
||||
音频样本的基类。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioSamplePlayback.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioSamplePlayback.xml.
|
||||
|
||||
.. _class_AudioSamplePlayback:
|
||||
|
||||
@@ -24,6 +24,7 @@ AudioSamplePlayback
|
||||
用于播放音频样本的元类。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioServer.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioServer.xml.
|
||||
|
||||
.. _class_AudioServer:
|
||||
|
||||
@@ -923,6 +923,7 @@ enum **PlaybackType**: :ref:`🔗<enum_AudioServer_PlaybackType>`
|
||||
解锁音频驱动程序的主循环。(锁定后,你始终需要手动解锁它。)
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioStream.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioStream.xml.
|
||||
|
||||
.. _class_AudioStream:
|
||||
|
||||
@@ -57,6 +57,8 @@ AudioStream
|
||||
+------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`_get_stream_name<class_AudioStream_private_method__get_stream_name>`\ (\ ) |virtual| |const| |
|
||||
+------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Dictionary<class_Dictionary>` | :ref:`_get_tags<class_AudioStream_private_method__get_tags>`\ (\ ) |virtual| |const| |
|
||||
+------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_has_loop<class_AudioStream_private_method__has_loop>`\ (\ ) |virtual| |const| |
|
||||
+------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`_instantiate_playback<class_AudioStream_private_method__instantiate_playback>`\ (\ ) |virtual| |const| |
|
||||
@@ -178,6 +180,20 @@ AudioStream
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStream_private_method__get_tags:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Dictionary<class_Dictionary>` **_get_tags**\ (\ ) |virtual| |const| :ref:`🔗<class_AudioStream_private_method__get_tags>`
|
||||
|
||||
覆盖该方法,自定义音频流的标签。应当返回字符串构成的 :ref:`Dictionary<class_Dictionary>`\ ,标签为键,对应的内容为值。
|
||||
|
||||
常用标签包括标题 ``title``\ 、艺术家 ``artist``\ 、专辑 ``album``\ 、音轨号 ``tracknumber``\ 、日期 ``date``\ 。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStream_private_method__has_loop:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
@@ -248,7 +264,7 @@ AudioStream
|
||||
|
||||
:ref:`float<class_float>` **get_length**\ (\ ) |const| :ref:`🔗<class_AudioStream_method_get_length>`
|
||||
|
||||
返回音频流的长度,单位为秒。
|
||||
返回音频流的长度,单位为秒。如果是 :ref:`AudioStreamRandomizer<class_AudioStreamRandomizer>`\ ,则返回最近一次播放的音频流的长度。如果音频流的长度无限(如 :ref:`AudioStreamGenerator<class_AudioStreamGenerator>` 和 :ref:`AudioStreamMicrophone<class_AudioStreamMicrophone>`\ )则返回 ``0.0``\ 。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -287,6 +303,7 @@ AudioStream
|
||||
如果该音频流仅支持一个通道(\ *单声道*\ ),则返回 ``true``\ ;如果音频流支持两个或多个通道(\ *复调*\ ),则返回 ``false``\ 。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioStreamGenerator.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioStreamGenerator.xml.
|
||||
|
||||
.. _class_AudioStreamGenerator:
|
||||
|
||||
@@ -32,16 +32,16 @@ AudioStreamGenerator
|
||||
@onready var sample_hz = $AudioStreamPlayer.stream.mix_rate
|
||||
var pulse_hz = 440.0 # 声音波形的频率。
|
||||
var phase = 0.0
|
||||
|
||||
|
||||
func _ready():
|
||||
$AudioStreamPlayer.play()
|
||||
playback = $AudioStreamPlayer.get_stream_playback()
|
||||
fill_buffer()
|
||||
|
||||
|
||||
func fill_buffer():
|
||||
var increment = pulse_hz / sample_hz
|
||||
var frames_available = playback.get_frames_available()
|
||||
|
||||
|
||||
for i in range(frames_available):
|
||||
playback.push_frame(Vector2.ONE * sin(phase * TAU))
|
||||
phase = fmod(phase + increment, 1.0)
|
||||
@@ -49,12 +49,12 @@ AudioStreamGenerator
|
||||
.. code-tab:: csharp
|
||||
|
||||
[Export] public AudioStreamPlayer Player { get; set; }
|
||||
|
||||
|
||||
private AudioStreamGeneratorPlayback _playback; // 存放 AudioStreamGeneratorPlayback。
|
||||
private float _sampleHz;
|
||||
private float _pulseHz = 440.0f; // 音频波形的频率。
|
||||
private double phase = 0.0;
|
||||
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
if (Player.Stream is AudioStreamGenerator generator) // Type as a generator to access MixRate.
|
||||
@@ -65,12 +65,12 @@ AudioStreamGenerator
|
||||
FillBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void FillBuffer()
|
||||
{
|
||||
float increment = _pulseHz / _sampleHz;
|
||||
int framesAvailable = _playback.GetFramesAvailable();
|
||||
|
||||
|
||||
for (int i = 0; i < framesAvailable; i++)
|
||||
{
|
||||
_playback.PushFrame(Vector2.One * (float)Mathf.Sin(phase * Mathf.Tau));
|
||||
@@ -221,6 +221,7 @@ enum **AudioStreamGeneratorMixRate**: :ref:`🔗<enum_AudioStreamGenerator_Audio
|
||||
混音率模式。如果设为 :ref:`MIX_RATE_CUSTOM<class_AudioStreamGenerator_constant_MIX_RATE_CUSTOM>` 则会使用 :ref:`mix_rate<class_AudioStreamGenerator_property_mix_rate>`\ ,否则会使用 :ref:`AudioServer<class_AudioServer>` 的混音率。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioStreamGeneratorPlayback.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioStreamGeneratorPlayback.xml.
|
||||
|
||||
.. _class_AudioStreamGeneratorPlayback:
|
||||
|
||||
@@ -130,6 +130,7 @@ AudioStreamGeneratorPlayback
|
||||
将单个音频数据帧推送到缓冲区。这通常比 C# 中的以及通过 GDExtension 编译的语言中的 :ref:`push_buffer()<class_AudioStreamGeneratorPlayback_method_push_buffer>` 效率更低,但在 GDScript 中的 :ref:`push_frame()<class_AudioStreamGeneratorPlayback_method_push_frame>` 的效率可能\ *更高*\ 。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/modules/interactive_music/doc_classes/AudioStreamInteractive.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/modules/interactive_music/doc_classes/AudioStreamInteractive.xml.
|
||||
|
||||
.. _class_AudioStreamInteractive:
|
||||
|
||||
@@ -546,6 +546,7 @@ enum **AutoAdvanceMode**: :ref:`🔗<enum_AudioStreamInteractive_AutoAdvanceMode
|
||||
设置与当前剪辑关联的 :ref:`AudioStream<class_AudioStream>`\ 。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioStreamMicrophone.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioStreamMicrophone.xml.
|
||||
|
||||
.. _class_AudioStreamMicrophone:
|
||||
|
||||
@@ -33,6 +33,7 @@ AudioStreamMicrophone
|
||||
- `音频麦克风录音演示 <https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record>`__
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/modules/minimp3/doc_classes/AudioStreamMP3.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/modules/minimp3/doc_classes/AudioStreamMP3.xml.
|
||||
|
||||
.. _class_AudioStreamMP3:
|
||||
|
||||
@@ -229,6 +229,7 @@ MP3 音频流驱动。如果你想要在运行时加载 MP3 文件,请参阅 :
|
||||
从给定的文件路径新建 **AudioStreamMP3** 实例。文件必须为 MP3 格式。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/modules/vorbis/doc_classes/AudioStreamOggVorbis.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/modules/vorbis/doc_classes/AudioStreamOggVorbis.xml.
|
||||
|
||||
.. _class_AudioStreamOggVorbis:
|
||||
|
||||
@@ -49,6 +49,8 @@ AudioStreamOggVorbis 类是专用于处理 Ogg Vorbis 文件格式的 :ref:`Audi
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`OggPacketSequence<class_OggPacketSequence>` | :ref:`packet_sequence<class_AudioStreamOggVorbis_property_packet_sequence>` | |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`Dictionary<class_Dictionary>` | :ref:`tags<class_AudioStreamOggVorbis_property_tags>` | ``{}`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
@@ -177,6 +179,27 @@ AudioStreamOggVorbis 类是专用于处理 Ogg Vorbis 文件格式的 :ref:`Audi
|
||||
|
||||
包含用于这个流的原始 Ogg 数据。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStreamOggVorbis_property_tags:
|
||||
|
||||
.. rst-class:: classref-property
|
||||
|
||||
:ref:`Dictionary<class_Dictionary>` **tags** = ``{}`` :ref:`🔗<class_AudioStreamOggVorbis_property_tags>`
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- |void| **set_tags**\ (\ value\: :ref:`Dictionary<class_Dictionary>`\ )
|
||||
- :ref:`Dictionary<class_Dictionary>` **get_tags**\ (\ )
|
||||
|
||||
如果在 Ogg Vorbis 数据中存在标签,则包含用户定义的标签。
|
||||
|
||||
常用标签包括标题 ``title``\ 、艺术家 ``artist``\ 、专辑 ``album``\ 、音轨号 ``tracknumber``\ 、日期 ``date``\ (\ ``date`` 没有标准日期格式)。
|
||||
|
||||
\ **注意:**\ 无法\ *保证*\ 每个文件中都有某个标签,因此请考虑键可能不是始终存在。
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
@@ -207,6 +230,7 @@ AudioStreamOggVorbis 类是专用于处理 Ogg Vorbis 文件格式的 :ref:`Audi
|
||||
从给定的文件路径新建 **AudioStreamOggVorbis** 实例。文件必须为 Ogg Vorbis 格式。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioStreamPlayback.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioStreamPlayback.xml.
|
||||
|
||||
.. _class_AudioStreamPlayback:
|
||||
|
||||
@@ -38,45 +38,45 @@ AudioStreamPlayback
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_get_loop_count<class_AudioStreamPlayback_private_method__get_loop_count>`\ (\ ) |virtual| |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Variant<class_Variant>` | :ref:`_get_parameter<class_AudioStreamPlayback_private_method__get_parameter>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |virtual| |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_get_playback_position<class_AudioStreamPlayback_private_method__get_playback_position>`\ (\ ) |virtual| |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_is_playing<class_AudioStreamPlayback_private_method__is_playing>`\ (\ ) |virtual| |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_mix<class_AudioStreamPlayback_private_method__mix>`\ (\ buffer\: ``AudioFrame*``, rate_scale\: :ref:`float<class_float>`, frames\: :ref:`int<class_int>`\ ) |virtual| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`_seek<class_AudioStreamPlayback_private_method__seek>`\ (\ position\: :ref:`float<class_float>`\ ) |virtual| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`_set_parameter<class_AudioStreamPlayback_private_method__set_parameter>`\ (\ name\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`\ ) |virtual| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`_start<class_AudioStreamPlayback_private_method__start>`\ (\ from_pos\: :ref:`float<class_float>`\ ) |virtual| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`_stop<class_AudioStreamPlayback_private_method__stop>`\ (\ ) |virtual| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`_tag_used_streams<class_AudioStreamPlayback_private_method__tag_used_streams>`\ (\ ) |virtual| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_loop_count<class_AudioStreamPlayback_method_get_loop_count>`\ (\ ) |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayback_method_get_playback_position>`\ (\ ) |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AudioSamplePlayback<class_AudioSamplePlayback>` | :ref:`get_sample_playback<class_AudioStreamPlayback_method_get_sample_playback>`\ (\ ) |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AudioStreamPlayback_method_is_playing>`\ (\ ) |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`mix_audio<class_AudioStreamPlayback_method_mix_audio>`\ (\ rate_scale\: :ref:`float<class_float>`, frames\: :ref:`int<class_int>`\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`seek<class_AudioStreamPlayback_method_seek>`\ (\ time\: :ref:`float<class_float>` = 0.0\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`set_sample_playback<class_AudioStreamPlayback_method_set_sample_playback>`\ (\ playback_sample\: :ref:`AudioSamplePlayback<class_AudioSamplePlayback>`\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`start<class_AudioStreamPlayback_method_start>`\ (\ from_pos\: :ref:`float<class_float>` = 0.0\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`stop<class_AudioStreamPlayback_method_stop>`\ (\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_get_loop_count<class_AudioStreamPlayback_private_method__get_loop_count>`\ (\ ) |virtual| |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Variant<class_Variant>` | :ref:`_get_parameter<class_AudioStreamPlayback_private_method__get_parameter>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |virtual| |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_get_playback_position<class_AudioStreamPlayback_private_method__get_playback_position>`\ (\ ) |virtual| |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_is_playing<class_AudioStreamPlayback_private_method__is_playing>`\ (\ ) |virtual| |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_mix<class_AudioStreamPlayback_private_method__mix>`\ (\ buffer\: ``AudioFrame*``, rate_scale\: :ref:`float<class_float>`, frames\: :ref:`int<class_int>`\ ) |virtual| |required| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`_seek<class_AudioStreamPlayback_private_method__seek>`\ (\ position\: :ref:`float<class_float>`\ ) |virtual| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`_set_parameter<class_AudioStreamPlayback_private_method__set_parameter>`\ (\ name\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`\ ) |virtual| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`_start<class_AudioStreamPlayback_private_method__start>`\ (\ from_pos\: :ref:`float<class_float>`\ ) |virtual| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`_stop<class_AudioStreamPlayback_private_method__stop>`\ (\ ) |virtual| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`_tag_used_streams<class_AudioStreamPlayback_private_method__tag_used_streams>`\ (\ ) |virtual| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_loop_count<class_AudioStreamPlayback_method_get_loop_count>`\ (\ ) |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayback_method_get_playback_position>`\ (\ ) |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AudioSamplePlayback<class_AudioSamplePlayback>` | :ref:`get_sample_playback<class_AudioStreamPlayback_method_get_sample_playback>`\ (\ ) |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AudioStreamPlayback_method_is_playing>`\ (\ ) |const| |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`mix_audio<class_AudioStreamPlayback_method_mix_audio>`\ (\ rate_scale\: :ref:`float<class_float>`, frames\: :ref:`int<class_int>`\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`seek<class_AudioStreamPlayback_method_seek>`\ (\ time\: :ref:`float<class_float>` = 0.0\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`set_sample_playback<class_AudioStreamPlayback_method_set_sample_playback>`\ (\ playback_sample\: :ref:`AudioSamplePlayback<class_AudioSamplePlayback>`\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`start<class_AudioStreamPlayback_method_start>`\ (\ from_pos\: :ref:`float<class_float>` = 0.0\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`stop<class_AudioStreamPlayback_method_stop>`\ (\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
@@ -139,7 +139,7 @@ AudioStreamPlayback
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`int<class_int>` **_mix**\ (\ buffer\: ``AudioFrame*``, rate_scale\: :ref:`float<class_float>`, frames\: :ref:`int<class_int>`\ ) |virtual| :ref:`🔗<class_AudioStreamPlayback_private_method__mix>`
|
||||
:ref:`int<class_int>` **_mix**\ (\ buffer\: ``AudioFrame*``, rate_scale\: :ref:`float<class_float>`, frames\: :ref:`int<class_int>`\ ) |virtual| |required| :ref:`🔗<class_AudioStreamPlayback_private_method__mix>`
|
||||
|
||||
覆盖该方法以自定义音频流的混合方式。即使播放未激活,也会调用该方法。
|
||||
|
||||
@@ -322,6 +322,7 @@ AudioStreamPlayback
|
||||
停止音频流。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/modules/interactive_music/doc_classes/AudioStreamPlaybackInteractive.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/modules/interactive_music/doc_classes/AudioStreamPlaybackInteractive.xml.
|
||||
|
||||
.. _class_AudioStreamPlaybackInteractive:
|
||||
|
||||
@@ -90,6 +90,7 @@ AudioStreamPlaybackInteractive
|
||||
切换到剪辑(根据名称)。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/modules/vorbis/doc_classes/AudioStreamPlaybackOggVorbis.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/modules/vorbis/doc_classes/AudioStreamPlaybackOggVorbis.xml.
|
||||
|
||||
.. _class_AudioStreamPlaybackOggVorbis:
|
||||
|
||||
@@ -17,6 +17,7 @@ AudioStreamPlaybackOggVorbis
|
||||
该类目前没有描述,请帮我们\ :ref:`贡献一个 <doc_updating_the_class_reference>`\ 吧!
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/modules/interactive_music/doc_classes/AudioStreamPlaybackPlaylist.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/modules/interactive_music/doc_classes/AudioStreamPlaybackPlaylist.xml.
|
||||
|
||||
.. _class_AudioStreamPlaybackPlaylist:
|
||||
|
||||
@@ -15,6 +15,7 @@ AudioStreamPlaybackPlaylist
|
||||
:ref:`AudioStreamPlaylist<class_AudioStreamPlaylist>` 使用的播放类。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioStreamPlaybackPolyphonic.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioStreamPlaybackPolyphonic.xml.
|
||||
|
||||
.. _class_AudioStreamPlaybackPolyphonic:
|
||||
|
||||
@@ -130,6 +130,7 @@ AudioStreamPlaybackPolyphonic
|
||||
停止某个流。\ ``stream`` 参数是由 :ref:`play_stream()<class_AudioStreamPlaybackPolyphonic_method_play_stream>` 返回的整数 ID,在调用这个函数后失效。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioStreamPlaybackResampled.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioStreamPlaybackResampled.xml.
|
||||
|
||||
.. _class_AudioStreamPlaybackResampled:
|
||||
|
||||
@@ -26,13 +26,13 @@ AudioStreamPlaybackResampled
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_get_stream_sampling_rate<class_AudioStreamPlaybackResampled_private_method__get_stream_sampling_rate>`\ (\ ) |virtual| |const| |
|
||||
+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_mix_resampled<class_AudioStreamPlaybackResampled_private_method__mix_resampled>`\ (\ dst_buffer\: ``AudioFrame*``, frame_count\: :ref:`int<class_int>`\ ) |virtual| |
|
||||
+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`begin_resample<class_AudioStreamPlaybackResampled_method_begin_resample>`\ (\ ) |
|
||||
+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_get_stream_sampling_rate<class_AudioStreamPlaybackResampled_private_method__get_stream_sampling_rate>`\ (\ ) |virtual| |required| |const| |
|
||||
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_mix_resampled<class_AudioStreamPlaybackResampled_private_method__mix_resampled>`\ (\ dst_buffer\: ``AudioFrame*``, frame_count\: :ref:`int<class_int>`\ ) |virtual| |required| |
|
||||
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`begin_resample<class_AudioStreamPlaybackResampled_method_begin_resample>`\ (\ ) |
|
||||
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
@@ -47,7 +47,7 @@ AudioStreamPlaybackResampled
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **_get_stream_sampling_rate**\ (\ ) |virtual| |const| :ref:`🔗<class_AudioStreamPlaybackResampled_private_method__get_stream_sampling_rate>`
|
||||
:ref:`float<class_float>` **_get_stream_sampling_rate**\ (\ ) |virtual| |required| |const| :ref:`🔗<class_AudioStreamPlaybackResampled_private_method__get_stream_sampling_rate>`
|
||||
|
||||
.. container:: contribute
|
||||
|
||||
@@ -61,7 +61,7 @@ AudioStreamPlaybackResampled
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`int<class_int>` **_mix_resampled**\ (\ dst_buffer\: ``AudioFrame*``, frame_count\: :ref:`int<class_int>`\ ) |virtual| :ref:`🔗<class_AudioStreamPlaybackResampled_private_method__mix_resampled>`
|
||||
:ref:`int<class_int>` **_mix_resampled**\ (\ dst_buffer\: ``AudioFrame*``, frame_count\: :ref:`int<class_int>`\ ) |virtual| |required| :ref:`🔗<class_AudioStreamPlaybackResampled_private_method__mix_resampled>`
|
||||
|
||||
.. container:: contribute
|
||||
|
||||
@@ -82,6 +82,7 @@ AudioStreamPlaybackResampled
|
||||
该方法目前没有描述,请帮我们\ :ref:`贡献一个 <doc_updating_the_class_reference>`\ 吧!
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/modules/interactive_music/doc_classes/AudioStreamPlaybackSynchronized.xml.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/master/modules/interactive_music/doc_classes/AudioStreamPlaybackSynchronized.xml.
|
||||
|
||||
.. _class_AudioStreamPlaybackSynchronized:
|
||||
|
||||
@@ -17,6 +17,7 @@ AudioStreamPlaybackSynchronized
|
||||
该类目前没有描述,请帮我们\ :ref:`贡献一个 <doc_updating_the_class_reference>`\ 吧!
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioStreamPlayer.xml.
|
||||
.. 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.
|
||||
|
||||
.. _class_AudioStreamPlayer:
|
||||
|
||||
@@ -228,7 +228,7 @@ enum **MixTarget**: :ref:`🔗<enum_AudioStreamPlayer_MixTarget>`
|
||||
- |void| **set_mix_target**\ (\ value\: :ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>`\ )
|
||||
- :ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>` **get_mix_target**\ (\ )
|
||||
|
||||
混合目标声道,使用 :ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>` 常量。检测到小于等于两个扬声器时无效(见 :ref:`SpeakerMode<enum_AudioServer_SpeakerMode>`\ )。
|
||||
混合目标声道。检测到小于等于两个扬声器时无效(见 :ref:`SpeakerMode<enum_AudioServer_SpeakerMode>`\ )。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -439,6 +439,7 @@ enum **MixTarget**: :ref:`🔗<enum_AudioStreamPlayer_MixTarget>`
|
||||
停止该节点发出的所有声音。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioStreamPlayer2D.xml.
|
||||
.. 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.
|
||||
|
||||
.. _class_AudioStreamPlayer2D:
|
||||
|
||||
@@ -441,6 +441,7 @@ AudioStreamPlayer2D
|
||||
停止音频。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
|
||||
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/AudioStreamPlayer3D.xml.
|
||||
.. 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.
|
||||
|
||||
.. _class_AudioStreamPlayer3D:
|
||||
|
||||
@@ -335,7 +335,9 @@ enum **DopplerTracking**: :ref:`🔗<enum_AudioStreamPlayer3D_DopplerTracking>`
|
||||
- |void| **set_doppler_tracking**\ (\ value\: :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>`\ )
|
||||
- :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **get_doppler_tracking**\ (\ )
|
||||
|
||||
决定应该在哪个步骤计算多普勒效应。
|
||||
决定在哪一步计算多普勒效应。
|
||||
|
||||
\ **注意:**\ 如果 :ref:`doppler_tracking<class_AudioStreamPlayer3D_property_doppler_tracking>` 的值不是 :ref:`DOPPLER_TRACKING_DISABLED<class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_DISABLED>`\ ,且当前 :ref:`Camera3D<class_Camera3D>`/:ref:`AudioListener3D<class_AudioListener3D>` 禁用了多普勒跟踪,则多普勒效应会被听到,但不会考虑当前监听器的移动。如果需要精确的多普勒效应,则应在 **AudioStreamPlayer3D** 和当前 :ref:`Camera3D<class_Camera3D>`/:ref:`AudioListener3D<class_AudioListener3D>` 上同时启用多普勒跟踪。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -454,7 +456,11 @@ enum **DopplerTracking**: :ref:`🔗<enum_AudioStreamPlayer3D_DopplerTracking>`
|
||||
- |void| **set_panning_strength**\ (\ value\: :ref:`float<class_float>`\ )
|
||||
- :ref:`float<class_float>` **get_panning_strength**\ (\ )
|
||||
|
||||
通过将基础 :ref:`ProjectSettings.audio/general/3d_panning_strength<class_ProjectSettings_property_audio/general/3d_panning_strength>` 乘以该因子,来缩放该节点的声像强度。与较低的值相比,较高的值将从左到右更显著地声像移动音频。
|
||||
该系数会与基础的 :ref:`ProjectSettings.audio/general/3d_panning_strength<class_ProjectSettings_property_audio/general/3d_panning_strength>` 相乘,缩放节点的声像强度。如果乘积为 ``0.0`` 则禁用立体声声像,所有声道的音量相同。如果乘积为 ``1.0`` 则当声音位于听者的正左(或正右)时,有一个通道将被静音。
|
||||
|
||||
两个扬声器的立体声配置实现了 `WebAudio 标准的 StereoPannerNode 声像 <https://webaudio.github.io/web-audio-api/#stereopanner-algorithm>`__\ ,音量为到耳朵的半方位角的余弦值。
|
||||
|
||||
5.1 和 7.1 等其他扬声器配置则实现了 SPCAP(扬声器放置校正幅度)算法。
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -674,6 +680,7 @@ enum **DopplerTracking**: :ref:`🔗<enum_AudioStreamPlayer3D_DopplerTracking>`
|
||||
停止音频。
|
||||
|
||||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user