mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
7579 lines
329 KiB
ReStructuredText
7579 lines
329 KiB
ReStructuredText
: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/@GlobalScope.xml.
|
||
|
||
.. _class_@GlobalScope:
|
||
|
||
@GlobalScope
|
||
============
|
||
|
||
全局范围的常量和函数。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
描述
|
||
----
|
||
|
||
全局范围的枚举常量和内置函数的列表。此处的内容都是全局的,包括用于错误码、键码、属性提示等的常量。
|
||
|
||
这里还记录了单例,因为任何地方都可以访问单例。
|
||
|
||
只能在 GDScript 编写的脚本中访问的条目见 :ref:`@GDScript<class_@GDScript>`\ 。
|
||
|
||
.. note::
|
||
|
||
通过 C# 使用该 API 时会有显著不同,详见 :ref:`doc_c_sharp_differences`\ 。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
教程
|
||
----
|
||
|
||
- :doc:`随机数生成 <../tutorials/math/random_number_generation>`
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
属性
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`AudioServer<class_AudioServer>` | :ref:`AudioServer<class_@GlobalScope_property_AudioServer>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`CameraServer<class_CameraServer>` | :ref:`CameraServer<class_@GlobalScope_property_CameraServer>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`ClassDB<class_ClassDB>` | :ref:`ClassDB<class_@GlobalScope_property_ClassDB>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`DisplayServer<class_DisplayServer>` | :ref:`DisplayServer<class_@GlobalScope_property_DisplayServer>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`EditorInterface<class_EditorInterface>` | :ref:`EditorInterface<class_@GlobalScope_property_EditorInterface>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`Engine<class_Engine>` | :ref:`Engine<class_@GlobalScope_property_Engine>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`EngineDebugger<class_EngineDebugger>` | :ref:`EngineDebugger<class_@GlobalScope_property_EngineDebugger>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`GDExtensionManager<class_GDExtensionManager>` | :ref:`GDExtensionManager<class_@GlobalScope_property_GDExtensionManager>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`Geometry2D<class_Geometry2D>` | :ref:`Geometry2D<class_@GlobalScope_property_Geometry2D>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`Geometry3D<class_Geometry3D>` | :ref:`Geometry3D<class_@GlobalScope_property_Geometry3D>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`IP<class_IP>` | :ref:`IP<class_@GlobalScope_property_IP>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`Input<class_Input>` | :ref:`Input<class_@GlobalScope_property_Input>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`InputMap<class_InputMap>` | :ref:`InputMap<class_@GlobalScope_property_InputMap>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`JavaClassWrapper<class_JavaClassWrapper>` | :ref:`JavaClassWrapper<class_@GlobalScope_property_JavaClassWrapper>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`JavaScriptBridge<class_JavaScriptBridge>` | :ref:`JavaScriptBridge<class_@GlobalScope_property_JavaScriptBridge>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`Marshalls<class_Marshalls>` | :ref:`Marshalls<class_@GlobalScope_property_Marshalls>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`NativeMenu<class_NativeMenu>` | :ref:`NativeMenu<class_@GlobalScope_property_NativeMenu>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`NavigationMeshGenerator<class_NavigationMeshGenerator>` | :ref:`NavigationMeshGenerator<class_@GlobalScope_property_NavigationMeshGenerator>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`NavigationServer2D<class_NavigationServer2D>` | :ref:`NavigationServer2D<class_@GlobalScope_property_NavigationServer2D>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`NavigationServer3D<class_NavigationServer3D>` | :ref:`NavigationServer3D<class_@GlobalScope_property_NavigationServer3D>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`OS<class_OS>` | :ref:`OS<class_@GlobalScope_property_OS>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`Performance<class_Performance>` | :ref:`Performance<class_@GlobalScope_property_Performance>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`PhysicsServer2D<class_PhysicsServer2D>` | :ref:`PhysicsServer2D<class_@GlobalScope_property_PhysicsServer2D>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`PhysicsServer2DManager<class_PhysicsServer2DManager>` | :ref:`PhysicsServer2DManager<class_@GlobalScope_property_PhysicsServer2DManager>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`PhysicsServer3D<class_PhysicsServer3D>` | :ref:`PhysicsServer3D<class_@GlobalScope_property_PhysicsServer3D>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`PhysicsServer3DManager<class_PhysicsServer3DManager>` | :ref:`PhysicsServer3DManager<class_@GlobalScope_property_PhysicsServer3DManager>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`ProjectSettings<class_ProjectSettings>` | :ref:`ProjectSettings<class_@GlobalScope_property_ProjectSettings>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`RenderingServer<class_RenderingServer>` | :ref:`RenderingServer<class_@GlobalScope_property_RenderingServer>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`ResourceLoader<class_ResourceLoader>` | :ref:`ResourceLoader<class_@GlobalScope_property_ResourceLoader>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`ResourceSaver<class_ResourceSaver>` | :ref:`ResourceSaver<class_@GlobalScope_property_ResourceSaver>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`ResourceUID<class_ResourceUID>` | :ref:`ResourceUID<class_@GlobalScope_property_ResourceUID>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`TextServerManager<class_TextServerManager>` | :ref:`TextServerManager<class_@GlobalScope_property_TextServerManager>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`ThemeDB<class_ThemeDB>` | :ref:`ThemeDB<class_@GlobalScope_property_ThemeDB>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`Time<class_Time>` | :ref:`Time<class_@GlobalScope_property_Time>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`TranslationServer<class_TranslationServer>` | :ref:`TranslationServer<class_@GlobalScope_property_TranslationServer>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`WorkerThreadPool<class_WorkerThreadPool>` | :ref:`WorkerThreadPool<class_@GlobalScope_property_WorkerThreadPool>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`XRServer<class_XRServer>` | :ref:`XRServer<class_@GlobalScope_property_XRServer>` |
|
||
+---------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
方法
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`abs<class_@GlobalScope_method_abs>`\ (\ x\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`absf<class_@GlobalScope_method_absf>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`absi<class_@GlobalScope_method_absi>`\ (\ x\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`acos<class_@GlobalScope_method_acos>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`acosh<class_@GlobalScope_method_acosh>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`angle_difference<class_@GlobalScope_method_angle_difference>`\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`asin<class_@GlobalScope_method_asin>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`asinh<class_@GlobalScope_method_asinh>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`atan<class_@GlobalScope_method_atan>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`atan2<class_@GlobalScope_method_atan2>`\ (\ y\: :ref:`float<class_float>`, x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`atanh<class_@GlobalScope_method_atanh>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`bezier_derivative<class_@GlobalScope_method_bezier_derivative>`\ (\ start\: :ref:`float<class_float>`, control_1\: :ref:`float<class_float>`, control_2\: :ref:`float<class_float>`, end\: :ref:`float<class_float>`, t\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`bezier_interpolate<class_@GlobalScope_method_bezier_interpolate>`\ (\ start\: :ref:`float<class_float>`, control_1\: :ref:`float<class_float>`, control_2\: :ref:`float<class_float>`, end\: :ref:`float<class_float>`, t\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`bytes_to_var<class_@GlobalScope_method_bytes_to_var>`\ (\ bytes\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`bytes_to_var_with_objects<class_@GlobalScope_method_bytes_to_var_with_objects>`\ (\ bytes\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`ceil<class_@GlobalScope_method_ceil>`\ (\ x\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`ceilf<class_@GlobalScope_method_ceilf>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`ceili<class_@GlobalScope_method_ceili>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`clamp<class_@GlobalScope_method_clamp>`\ (\ value\: :ref:`Variant<class_Variant>`, min\: :ref:`Variant<class_Variant>`, max\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`clampf<class_@GlobalScope_method_clampf>`\ (\ value\: :ref:`float<class_float>`, min\: :ref:`float<class_float>`, max\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`clampi<class_@GlobalScope_method_clampi>`\ (\ value\: :ref:`int<class_int>`, min\: :ref:`int<class_int>`, max\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`cos<class_@GlobalScope_method_cos>`\ (\ angle_rad\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`cosh<class_@GlobalScope_method_cosh>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`cubic_interpolate<class_@GlobalScope_method_cubic_interpolate>`\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, pre\: :ref:`float<class_float>`, post\: :ref:`float<class_float>`, weight\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`cubic_interpolate_angle<class_@GlobalScope_method_cubic_interpolate_angle>`\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, pre\: :ref:`float<class_float>`, post\: :ref:`float<class_float>`, weight\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`cubic_interpolate_angle_in_time<class_@GlobalScope_method_cubic_interpolate_angle_in_time>`\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, pre\: :ref:`float<class_float>`, post\: :ref:`float<class_float>`, weight\: :ref:`float<class_float>`, to_t\: :ref:`float<class_float>`, pre_t\: :ref:`float<class_float>`, post_t\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`cubic_interpolate_in_time<class_@GlobalScope_method_cubic_interpolate_in_time>`\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, pre\: :ref:`float<class_float>`, post\: :ref:`float<class_float>`, weight\: :ref:`float<class_float>`, to_t\: :ref:`float<class_float>`, pre_t\: :ref:`float<class_float>`, post_t\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`db_to_linear<class_@GlobalScope_method_db_to_linear>`\ (\ db\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`deg_to_rad<class_@GlobalScope_method_deg_to_rad>`\ (\ deg\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`ease<class_@GlobalScope_method_ease>`\ (\ x\: :ref:`float<class_float>`, curve\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`error_string<class_@GlobalScope_method_error_string>`\ (\ error\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`exp<class_@GlobalScope_method_exp>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`floor<class_@GlobalScope_method_floor>`\ (\ x\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`floorf<class_@GlobalScope_method_floorf>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`floori<class_@GlobalScope_method_floori>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`fmod<class_@GlobalScope_method_fmod>`\ (\ x\: :ref:`float<class_float>`, y\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`fposmod<class_@GlobalScope_method_fposmod>`\ (\ x\: :ref:`float<class_float>`, y\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`hash<class_@GlobalScope_method_hash>`\ (\ variable\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Object<class_Object>` | :ref:`instance_from_id<class_@GlobalScope_method_instance_from_id>`\ (\ instance_id\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`inverse_lerp<class_@GlobalScope_method_inverse_lerp>`\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, weight\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_equal_approx<class_@GlobalScope_method_is_equal_approx>`\ (\ a\: :ref:`float<class_float>`, b\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_finite<class_@GlobalScope_method_is_finite>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_inf<class_@GlobalScope_method_is_inf>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_instance_id_valid<class_@GlobalScope_method_is_instance_id_valid>`\ (\ id\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_instance_valid<class_@GlobalScope_method_is_instance_valid>`\ (\ instance\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_nan<class_@GlobalScope_method_is_nan>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_same<class_@GlobalScope_method_is_same>`\ (\ a\: :ref:`Variant<class_Variant>`, b\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_zero_approx<class_@GlobalScope_method_is_zero_approx>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`lerp<class_@GlobalScope_method_lerp>`\ (\ from\: :ref:`Variant<class_Variant>`, to\: :ref:`Variant<class_Variant>`, weight\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`lerp_angle<class_@GlobalScope_method_lerp_angle>`\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, weight\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`lerpf<class_@GlobalScope_method_lerpf>`\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, weight\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`linear_to_db<class_@GlobalScope_method_linear_to_db>`\ (\ lin\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`log<class_@GlobalScope_method_log>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`max<class_@GlobalScope_method_max>`\ (\ ...\ ) |vararg| |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`maxf<class_@GlobalScope_method_maxf>`\ (\ a\: :ref:`float<class_float>`, b\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`maxi<class_@GlobalScope_method_maxi>`\ (\ a\: :ref:`int<class_int>`, b\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`min<class_@GlobalScope_method_min>`\ (\ ...\ ) |vararg| |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`minf<class_@GlobalScope_method_minf>`\ (\ a\: :ref:`float<class_float>`, b\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`mini<class_@GlobalScope_method_mini>`\ (\ a\: :ref:`int<class_int>`, b\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`move_toward<class_@GlobalScope_method_move_toward>`\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, delta\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`nearest_po2<class_@GlobalScope_method_nearest_po2>`\ (\ value\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`pingpong<class_@GlobalScope_method_pingpong>`\ (\ value\: :ref:`float<class_float>`, length\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`posmod<class_@GlobalScope_method_posmod>`\ (\ x\: :ref:`int<class_int>`, y\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`pow<class_@GlobalScope_method_pow>`\ (\ base\: :ref:`float<class_float>`, exp\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`print<class_@GlobalScope_method_print>`\ (\ ...\ ) |vararg| |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`print_rich<class_@GlobalScope_method_print_rich>`\ (\ ...\ ) |vararg| |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`print_verbose<class_@GlobalScope_method_print_verbose>`\ (\ ...\ ) |vararg| |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`printerr<class_@GlobalScope_method_printerr>`\ (\ ...\ ) |vararg| |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`printraw<class_@GlobalScope_method_printraw>`\ (\ ...\ ) |vararg| |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`prints<class_@GlobalScope_method_prints>`\ (\ ...\ ) |vararg| |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`printt<class_@GlobalScope_method_printt>`\ (\ ...\ ) |vararg| |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_error<class_@GlobalScope_method_push_error>`\ (\ ...\ ) |vararg| |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_warning<class_@GlobalScope_method_push_warning>`\ (\ ...\ ) |vararg| |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`rad_to_deg<class_@GlobalScope_method_rad_to_deg>`\ (\ rad\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedInt64Array<class_PackedInt64Array>` | :ref:`rand_from_seed<class_@GlobalScope_method_rand_from_seed>`\ (\ seed\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`randf<class_@GlobalScope_method_randf>`\ (\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`randf_range<class_@GlobalScope_method_randf_range>`\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`randfn<class_@GlobalScope_method_randfn>`\ (\ mean\: :ref:`float<class_float>`, deviation\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`randi<class_@GlobalScope_method_randi>`\ (\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`randi_range<class_@GlobalScope_method_randi_range>`\ (\ from\: :ref:`int<class_int>`, to\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`randomize<class_@GlobalScope_method_randomize>`\ (\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`remap<class_@GlobalScope_method_remap>`\ (\ value\: :ref:`float<class_float>`, istart\: :ref:`float<class_float>`, istop\: :ref:`float<class_float>`, ostart\: :ref:`float<class_float>`, ostop\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`rid_allocate_id<class_@GlobalScope_method_rid_allocate_id>`\ (\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`RID<class_RID>` | :ref:`rid_from_int64<class_@GlobalScope_method_rid_from_int64>`\ (\ base\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`rotate_toward<class_@GlobalScope_method_rotate_toward>`\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, delta\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`round<class_@GlobalScope_method_round>`\ (\ x\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`roundf<class_@GlobalScope_method_roundf>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`roundi<class_@GlobalScope_method_roundi>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`seed<class_@GlobalScope_method_seed>`\ (\ base\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`sign<class_@GlobalScope_method_sign>`\ (\ x\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`signf<class_@GlobalScope_method_signf>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`signi<class_@GlobalScope_method_signi>`\ (\ x\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`sin<class_@GlobalScope_method_sin>`\ (\ angle_rad\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`sinh<class_@GlobalScope_method_sinh>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`smoothstep<class_@GlobalScope_method_smoothstep>`\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`snapped<class_@GlobalScope_method_snapped>`\ (\ x\: :ref:`Variant<class_Variant>`, step\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`snappedf<class_@GlobalScope_method_snappedf>`\ (\ x\: :ref:`float<class_float>`, step\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`snappedi<class_@GlobalScope_method_snappedi>`\ (\ x\: :ref:`float<class_float>`, step\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`sqrt<class_@GlobalScope_method_sqrt>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`step_decimals<class_@GlobalScope_method_step_decimals>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`str<class_@GlobalScope_method_str>`\ (\ ...\ ) |vararg| |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`str_to_var<class_@GlobalScope_method_str_to_var>`\ (\ string\: :ref:`String<class_String>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`tan<class_@GlobalScope_method_tan>`\ (\ angle_rad\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`tanh<class_@GlobalScope_method_tanh>`\ (\ x\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`type_convert<class_@GlobalScope_method_type_convert>`\ (\ variant\: :ref:`Variant<class_Variant>`, type\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`type_string<class_@GlobalScope_method_type_string>`\ (\ type\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`typeof<class_@GlobalScope_method_typeof>`\ (\ variable\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`var_to_bytes<class_@GlobalScope_method_var_to_bytes>`\ (\ variable\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`var_to_bytes_with_objects<class_@GlobalScope_method_var_to_bytes_with_objects>`\ (\ variable\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`var_to_str<class_@GlobalScope_method_var_to_str>`\ (\ variable\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`weakref<class_@GlobalScope_method_weakref>`\ (\ obj\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`wrap<class_@GlobalScope_method_wrap>`\ (\ value\: :ref:`Variant<class_Variant>`, min\: :ref:`Variant<class_Variant>`, max\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`wrapf<class_@GlobalScope_method_wrapf>`\ (\ value\: :ref:`float<class_float>`, min\: :ref:`float<class_float>`, max\: :ref:`float<class_float>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`wrapi<class_@GlobalScope_method_wrapi>`\ (\ value\: :ref:`int<class_int>`, min\: :ref:`int<class_int>`, max\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
枚举
|
||
----
|
||
|
||
.. _enum_@GlobalScope_Side:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **Side**: :ref:`🔗<enum_@GlobalScope_Side>`
|
||
|
||
.. _class_@GlobalScope_constant_SIDE_LEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Side<enum_@GlobalScope_Side>` **SIDE_LEFT** = ``0``
|
||
|
||
左边,常用于 :ref:`Control<class_Control>` 或 :ref:`StyleBox<class_StyleBox>` 的派生类。
|
||
|
||
.. _class_@GlobalScope_constant_SIDE_TOP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Side<enum_@GlobalScope_Side>` **SIDE_TOP** = ``1``
|
||
|
||
顶边,常用于 :ref:`Control<class_Control>` 或 :ref:`StyleBox<class_StyleBox>` 的派生类。
|
||
|
||
.. _class_@GlobalScope_constant_SIDE_RIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Side<enum_@GlobalScope_Side>` **SIDE_RIGHT** = ``2``
|
||
|
||
右边,常用于 :ref:`Control<class_Control>` 或 :ref:`StyleBox<class_StyleBox>` 的派生类。
|
||
|
||
.. _class_@GlobalScope_constant_SIDE_BOTTOM:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Side<enum_@GlobalScope_Side>` **SIDE_BOTTOM** = ``3``
|
||
|
||
底边,常用于 :ref:`Control<class_Control>` 或 :ref:`StyleBox<class_StyleBox>` 的派生类。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_Corner:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **Corner**: :ref:`🔗<enum_@GlobalScope_Corner>`
|
||
|
||
.. _class_@GlobalScope_constant_CORNER_TOP_LEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Corner<enum_@GlobalScope_Corner>` **CORNER_TOP_LEFT** = ``0``
|
||
|
||
左上角。
|
||
|
||
.. _class_@GlobalScope_constant_CORNER_TOP_RIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Corner<enum_@GlobalScope_Corner>` **CORNER_TOP_RIGHT** = ``1``
|
||
|
||
右上角。
|
||
|
||
.. _class_@GlobalScope_constant_CORNER_BOTTOM_RIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Corner<enum_@GlobalScope_Corner>` **CORNER_BOTTOM_RIGHT** = ``2``
|
||
|
||
右下角。
|
||
|
||
.. _class_@GlobalScope_constant_CORNER_BOTTOM_LEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Corner<enum_@GlobalScope_Corner>` **CORNER_BOTTOM_LEFT** = ``3``
|
||
|
||
左下角。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_Orientation:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **Orientation**: :ref:`🔗<enum_@GlobalScope_Orientation>`
|
||
|
||
.. _class_@GlobalScope_constant_VERTICAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Orientation<enum_@GlobalScope_Orientation>` **VERTICAL** = ``1``
|
||
|
||
通用垂直对齐,常用于 :ref:`Separator<class_Separator>`\ 、\ :ref:`ScrollBar<class_ScrollBar>`\ 、\ :ref:`Slider<class_Slider>` 等。
|
||
|
||
.. _class_@GlobalScope_constant_HORIZONTAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Orientation<enum_@GlobalScope_Orientation>` **HORIZONTAL** = ``0``
|
||
|
||
通用水平对齐,常用于 :ref:`Separator<class_Separator>`\ 、\ :ref:`ScrollBar<class_ScrollBar>`\ 、\ :ref:`Slider<class_Slider>` 等。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_ClockDirection:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **ClockDirection**: :ref:`🔗<enum_@GlobalScope_ClockDirection>`
|
||
|
||
.. _class_@GlobalScope_constant_CLOCKWISE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ClockDirection<enum_@GlobalScope_ClockDirection>` **CLOCKWISE** = ``0``
|
||
|
||
顺时针旋转。被一些方法使用(例如 :ref:`Image.rotate_90()<class_Image_method_rotate_90>`\ )。
|
||
|
||
.. _class_@GlobalScope_constant_COUNTERCLOCKWISE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ClockDirection<enum_@GlobalScope_ClockDirection>` **COUNTERCLOCKWISE** = ``1``
|
||
|
||
逆时针旋转。被一些方法使用(例如 :ref:`Image.rotate_90()<class_Image_method_rotate_90>`\ )。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_HorizontalAlignment:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **HorizontalAlignment**: :ref:`🔗<enum_@GlobalScope_HorizontalAlignment>`
|
||
|
||
.. _class_@GlobalScope_constant_HORIZONTAL_ALIGNMENT_LEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **HORIZONTAL_ALIGNMENT_LEFT** = ``0``
|
||
|
||
水平左对齐,常用于文本派生类。
|
||
|
||
.. _class_@GlobalScope_constant_HORIZONTAL_ALIGNMENT_CENTER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **HORIZONTAL_ALIGNMENT_CENTER** = ``1``
|
||
|
||
水平居中对齐,常用于文本派生类。
|
||
|
||
.. _class_@GlobalScope_constant_HORIZONTAL_ALIGNMENT_RIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **HORIZONTAL_ALIGNMENT_RIGHT** = ``2``
|
||
|
||
水平右对齐,常用于文本派生类。
|
||
|
||
.. _class_@GlobalScope_constant_HORIZONTAL_ALIGNMENT_FILL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **HORIZONTAL_ALIGNMENT_FILL** = ``3``
|
||
|
||
扩展行以适应宽度,常用于文本派生类。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_VerticalAlignment:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **VerticalAlignment**: :ref:`🔗<enum_@GlobalScope_VerticalAlignment>`
|
||
|
||
.. _class_@GlobalScope_constant_VERTICAL_ALIGNMENT_TOP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`VerticalAlignment<enum_@GlobalScope_VerticalAlignment>` **VERTICAL_ALIGNMENT_TOP** = ``0``
|
||
|
||
垂直上对齐,常用于文本派生类。
|
||
|
||
.. _class_@GlobalScope_constant_VERTICAL_ALIGNMENT_CENTER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`VerticalAlignment<enum_@GlobalScope_VerticalAlignment>` **VERTICAL_ALIGNMENT_CENTER** = ``1``
|
||
|
||
垂直居中对齐,常用于文本派生类。
|
||
|
||
.. _class_@GlobalScope_constant_VERTICAL_ALIGNMENT_BOTTOM:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`VerticalAlignment<enum_@GlobalScope_VerticalAlignment>` **VERTICAL_ALIGNMENT_BOTTOM** = ``2``
|
||
|
||
垂直下对齐,常用于文本派生类。
|
||
|
||
.. _class_@GlobalScope_constant_VERTICAL_ALIGNMENT_FILL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`VerticalAlignment<enum_@GlobalScope_VerticalAlignment>` **VERTICAL_ALIGNMENT_FILL** = ``3``
|
||
|
||
扩展行以适应高度,通常用于文本派生类。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_InlineAlignment:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **InlineAlignment**: :ref:`🔗<enum_@GlobalScope_InlineAlignment>`
|
||
|
||
.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_TOP_TO:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` **INLINE_ALIGNMENT_TOP_TO** = ``0``
|
||
|
||
将内联对象(例如图像、表格)的顶部与 ``INLINE_ALIGNMENT_TO_*`` 常量指定的文本位置对齐。
|
||
|
||
.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_CENTER_TO:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` **INLINE_ALIGNMENT_CENTER_TO** = ``1``
|
||
|
||
将内联对象(例如图像、表格)的中心与 ``INLINE_ALIGNMENT_TO_*`` 常量指定的文本位置对齐。
|
||
|
||
.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_BASELINE_TO:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` **INLINE_ALIGNMENT_BASELINE_TO** = ``3``
|
||
|
||
将内联对象(如图像、表格)的基线(用户定义)与\ ``INLINE_ALIGNMENT_TO_*`` 常数指定的文本位置对齐。
|
||
|
||
.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_BOTTOM_TO:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` **INLINE_ALIGNMENT_BOTTOM_TO** = ``2``
|
||
|
||
将内联对象(例如图像、表格)的底部与 ``INLINE_ALIGNMENT_TO_*`` 常量指定的文本位置对齐。
|
||
|
||
.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_TO_TOP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` **INLINE_ALIGNMENT_TO_TOP** = ``0``
|
||
|
||
将由 ``INLINE_ALIGNMENT_*_TO`` 常量指定的内联对象(例如图像、表格)的位置与文本顶部对齐。
|
||
|
||
.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_TO_CENTER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` **INLINE_ALIGNMENT_TO_CENTER** = ``4``
|
||
|
||
将由 ``INLINE_ALIGNMENT_*_TO`` 常量指定的内联对象(例如图像、表格)的位置与文本中心对齐。
|
||
|
||
.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_TO_BASELINE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` **INLINE_ALIGNMENT_TO_BASELINE** = ``8``
|
||
|
||
将由 ``INLINE_ALIGNMENT_*_TO`` 常量指定的内联对象(例如图像、表格)的位置与文本基线对齐。
|
||
|
||
.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_TO_BOTTOM:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` **INLINE_ALIGNMENT_TO_BOTTOM** = ``12``
|
||
|
||
将内联对象(例如图像、表格)与文本底部对齐。
|
||
|
||
.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_TOP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` **INLINE_ALIGNMENT_TOP** = ``0``
|
||
|
||
将内联对象(例如图像、表格)的顶部与文本的顶部对齐。等效于 ``INLINE_ALIGNMENT_TOP_TO | INLINE_ALIGNMENT_TO_TOP``\ 。
|
||
|
||
.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_CENTER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` **INLINE_ALIGNMENT_CENTER** = ``5``
|
||
|
||
将内联对象(例如图像、表格)的中心与文本的中心对齐。相当于 ``INLINE_ALIGNMENT_CENTER_TO | INLINE_ALIGNMENT_TO_CENTER``\ 。
|
||
|
||
.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_BOTTOM:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` **INLINE_ALIGNMENT_BOTTOM** = ``14``
|
||
|
||
将内联对象(例如图像、表格)的底部与文本底部对齐。等效于 ``INLINE_ALIGNMENT_BOTTOM_TO | INLINE_ALIGNMENT_TO_BOTTOM``\ 。
|
||
|
||
.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_IMAGE_MASK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` **INLINE_ALIGNMENT_IMAGE_MASK** = ``3``
|
||
|
||
用于 ``INLINE_ALIGNMENT_*_TO`` 对齐常量的位掩码。
|
||
|
||
.. _class_@GlobalScope_constant_INLINE_ALIGNMENT_TEXT_MASK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` **INLINE_ALIGNMENT_TEXT_MASK** = ``12``
|
||
|
||
用于 ``INLINE_ALIGNMENT_TO_*`` 对齐常量的位掩码。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_EulerOrder:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **EulerOrder**: :ref:`🔗<enum_@GlobalScope_EulerOrder>`
|
||
|
||
.. _class_@GlobalScope_constant_EULER_ORDER_XYZ:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`EulerOrder<enum_@GlobalScope_EulerOrder>` **EULER_ORDER_XYZ** = ``0``
|
||
|
||
指定欧拉角应按 XYZ 顺序排列。组合时顺序为 X、Y、Z。分解时顺序相反,先 Z、再 Y、最后 X。
|
||
|
||
.. _class_@GlobalScope_constant_EULER_ORDER_XZY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`EulerOrder<enum_@GlobalScope_EulerOrder>` **EULER_ORDER_XZY** = ``1``
|
||
|
||
指定欧拉角应按 XZY 顺序排列。组合时顺序为 X、Z、Y。分解时顺序相反,先 Y、再 Z、最后 X。
|
||
|
||
.. _class_@GlobalScope_constant_EULER_ORDER_YXZ:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`EulerOrder<enum_@GlobalScope_EulerOrder>` **EULER_ORDER_YXZ** = ``2``
|
||
|
||
指定欧拉角应按 YXZ 顺序排列。组合时顺序为 Y、X、Z。分解时顺序相反,先 Z、再 X、最后 Y。
|
||
|
||
.. _class_@GlobalScope_constant_EULER_ORDER_YZX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`EulerOrder<enum_@GlobalScope_EulerOrder>` **EULER_ORDER_YZX** = ``3``
|
||
|
||
指定欧拉角应按 YZX 顺序排列。组合时顺序为 Y、Z、X。分解时顺序相反,先 X、再 Z、最后 Y。
|
||
|
||
.. _class_@GlobalScope_constant_EULER_ORDER_ZXY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`EulerOrder<enum_@GlobalScope_EulerOrder>` **EULER_ORDER_ZXY** = ``4``
|
||
|
||
指定欧拉角应按 ZXY 顺序排列。组合时顺序为 Z、X、Y。分解时顺序相反,先 Y、再 X、最后 Z。
|
||
|
||
.. _class_@GlobalScope_constant_EULER_ORDER_ZYX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`EulerOrder<enum_@GlobalScope_EulerOrder>` **EULER_ORDER_ZYX** = ``5``
|
||
|
||
指定欧拉角应按 ZYX 顺序排列。组合时顺序为 Z、Y、X。分解时顺序相反,先 X、再 Y、最后 Z。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_Key:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **Key**: :ref:`🔗<enum_@GlobalScope_Key>`
|
||
|
||
.. _class_@GlobalScope_constant_KEY_NONE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_NONE** = ``0``
|
||
|
||
与任何键都不对应的枚举值。这用于初始化具有通用状态的 :ref:`Key<enum_@GlobalScope_Key>` 属性。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_SPECIAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_SPECIAL** = ``4194304``
|
||
|
||
应用此位的键码不可打印。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_ESCAPE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_ESCAPE** = ``4194305``
|
||
|
||
ESC 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_TAB:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_TAB** = ``4194306``
|
||
|
||
Tab 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_BACKTAB:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_BACKTAB** = ``4194307``
|
||
|
||
Shift + Tab 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_BACKSPACE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_BACKSPACE** = ``4194308``
|
||
|
||
退格键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_ENTER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_ENTER** = ``4194309``
|
||
|
||
回车键(位于主键盘)。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_ENTER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_ENTER** = ``4194310``
|
||
|
||
小键盘区的回车键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_INSERT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_INSERT** = ``4194311``
|
||
|
||
Insert 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_DELETE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_DELETE** = ``4194312``
|
||
|
||
Delete 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_PAUSE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_PAUSE** = ``4194313``
|
||
|
||
Pause 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_PRINT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_PRINT** = ``4194314``
|
||
|
||
Print Screen 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_SYSREQ:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_SYSREQ** = ``4194315``
|
||
|
||
System Request 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_CLEAR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_CLEAR** = ``4194316``
|
||
|
||
Clear 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_HOME:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_HOME** = ``4194317``
|
||
|
||
Home 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_END:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_END** = ``4194318``
|
||
|
||
End 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LEFT** = ``4194319``
|
||
|
||
左方向键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_UP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_UP** = ``4194320``
|
||
|
||
上方向键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_RIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_RIGHT** = ``4194321``
|
||
|
||
右方向键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_DOWN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_DOWN** = ``4194322``
|
||
|
||
下方向键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_PAGEUP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_PAGEUP** = ``4194323``
|
||
|
||
Page Up 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_PAGEDOWN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_PAGEDOWN** = ``4194324``
|
||
|
||
Page Down 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_SHIFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_SHIFT** = ``4194325``
|
||
|
||
Shift 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_CTRL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_CTRL** = ``4194326``
|
||
|
||
Control 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_META:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_META** = ``4194327``
|
||
|
||
Meta 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_ALT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_ALT** = ``4194328``
|
||
|
||
Alt 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_CAPSLOCK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_CAPSLOCK** = ``4194329``
|
||
|
||
Caps Lock 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_NUMLOCK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_NUMLOCK** = ``4194330``
|
||
|
||
Num Lock 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_SCROLLLOCK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_SCROLLLOCK** = ``4194331``
|
||
|
||
Scroll Lock 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F1:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F1** = ``4194332``
|
||
|
||
F1 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F2:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F2** = ``4194333``
|
||
|
||
F2 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F3:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F3** = ``4194334``
|
||
|
||
F3 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F4:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F4** = ``4194335``
|
||
|
||
F4 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F5:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F5** = ``4194336``
|
||
|
||
F5 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F6:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F6** = ``4194337``
|
||
|
||
F6 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F7:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F7** = ``4194338``
|
||
|
||
F7 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F8** = ``4194339``
|
||
|
||
F8 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F9:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F9** = ``4194340``
|
||
|
||
F9 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F10:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F10** = ``4194341``
|
||
|
||
F10 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F11:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F11** = ``4194342``
|
||
|
||
F11 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F12:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F12** = ``4194343``
|
||
|
||
F12 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F13:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F13** = ``4194344``
|
||
|
||
F13 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F14:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F14** = ``4194345``
|
||
|
||
F14 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F15:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F15** = ``4194346``
|
||
|
||
F15 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F16:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F16** = ``4194347``
|
||
|
||
F16 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F17:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F17** = ``4194348``
|
||
|
||
F17 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F18:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F18** = ``4194349``
|
||
|
||
F18 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F19:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F19** = ``4194350``
|
||
|
||
F19 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F20:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F20** = ``4194351``
|
||
|
||
F20 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F21:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F21** = ``4194352``
|
||
|
||
F21 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F22:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F22** = ``4194353``
|
||
|
||
F22 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F23:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F23** = ``4194354``
|
||
|
||
F23 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F24:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F24** = ``4194355``
|
||
|
||
F24 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F25:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F25** = ``4194356``
|
||
|
||
F25 键。由于 Windows 限制,仅支持 macOS 和 Linux。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F26:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F26** = ``4194357``
|
||
|
||
F26 键。由于 Windows 限制,仅支持 macOS 和 Linux。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F27:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F27** = ``4194358``
|
||
|
||
F27 键。由于 Windows 限制,仅支持 macOS 和 Linux。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F28:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F28** = ``4194359``
|
||
|
||
F28 键。由于 Windows 限制,仅支持 macOS 和 Linux。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F29:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F29** = ``4194360``
|
||
|
||
F29 键。由于 Windows 限制,仅支持 macOS 和 Linux。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F30:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F30** = ``4194361``
|
||
|
||
F30 键。由于 Windows 限制,仅支持 macOS 和 Linux。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F31:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F31** = ``4194362``
|
||
|
||
F31 键。由于 Windows 限制,仅支持 macOS 和 Linux。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F32:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F32** = ``4194363``
|
||
|
||
F32 键。由于 Windows 限制,仅支持 macOS 和 Linux。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F33:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F33** = ``4194364``
|
||
|
||
F33 键。由于 Windows 限制,仅支持 macOS 和 Linux。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F34:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F34** = ``4194365``
|
||
|
||
F34 键。由于 Windows 限制,仅支持 macOS 和 Linux。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F35:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F35** = ``4194366``
|
||
|
||
F35 键。由于 Windows 限制,仅支持 macOS 和 Linux。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_MULTIPLY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_MULTIPLY** = ``4194433``
|
||
|
||
小键盘的星键/乘以键(\*)。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_DIVIDE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_DIVIDE** = ``4194434``
|
||
|
||
小键盘的除以键(/)。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_SUBTRACT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_SUBTRACT** = ``4194435``
|
||
|
||
小键盘的减号键(-)。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_PERIOD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_PERIOD** = ``4194436``
|
||
|
||
小键盘的点键(.)。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_ADD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_ADD** = ``4194437``
|
||
|
||
小键盘的加号键(+)。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_0:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_0** = ``4194438``
|
||
|
||
小键盘的数字 0。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_1:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_1** = ``4194439``
|
||
|
||
小键盘的数字 1。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_2:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_2** = ``4194440``
|
||
|
||
小键盘的数字 2。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_3:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_3** = ``4194441``
|
||
|
||
小键盘的数字 3。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_4:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_4** = ``4194442``
|
||
|
||
小键盘的数字 4。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_5:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_5** = ``4194443``
|
||
|
||
小键盘的数字 5。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_6:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_6** = ``4194444``
|
||
|
||
小键盘的数字 6。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_7:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_7** = ``4194445``
|
||
|
||
小键盘的数字 7。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_8** = ``4194446``
|
||
|
||
小键盘的数字 8。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KP_9:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KP_9** = ``4194447``
|
||
|
||
小键盘的数字 9。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_MENU:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_MENU** = ``4194370``
|
||
|
||
上下文菜单键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_HYPER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_HYPER** = ``4194371``
|
||
|
||
超级键。(仅在 Linux/X11 上)。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_HELP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_HELP** = ``4194373``
|
||
|
||
Help 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_BACK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_BACK** = ``4194376``
|
||
|
||
向后键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_FORWARD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_FORWARD** = ``4194377``
|
||
|
||
向前键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_STOP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_STOP** = ``4194378``
|
||
|
||
媒体停止播放键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_REFRESH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_REFRESH** = ``4194379``
|
||
|
||
刷新键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_VOLUMEDOWN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_VOLUMEDOWN** = ``4194380``
|
||
|
||
音量降低键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_VOLUMEMUTE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_VOLUMEMUTE** = ``4194381``
|
||
|
||
静音键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_VOLUMEUP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_VOLUMEUP** = ``4194382``
|
||
|
||
音量升高键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_MEDIAPLAY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_MEDIAPLAY** = ``4194388``
|
||
|
||
媒体播放键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_MEDIASTOP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_MEDIASTOP** = ``4194389``
|
||
|
||
媒体停止播放键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_MEDIAPREVIOUS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_MEDIAPREVIOUS** = ``4194390``
|
||
|
||
上一首歌键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_MEDIANEXT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_MEDIANEXT** = ``4194391``
|
||
|
||
下一首歌键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_MEDIARECORD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_MEDIARECORD** = ``4194392``
|
||
|
||
媒体录制键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_HOMEPAGE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_HOMEPAGE** = ``4194393``
|
||
|
||
主页键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_FAVORITES:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_FAVORITES** = ``4194394``
|
||
|
||
收藏键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_SEARCH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_SEARCH** = ``4194395``
|
||
|
||
搜索键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_STANDBY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_STANDBY** = ``4194396``
|
||
|
||
Standby 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_OPENURL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_OPENURL** = ``4194397``
|
||
|
||
打开 URL / 启动浏览器键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCHMAIL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCHMAIL** = ``4194398``
|
||
|
||
启动邮箱键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCHMEDIA:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCHMEDIA** = ``4194399``
|
||
|
||
启动多媒体键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCH0:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCH0** = ``4194400``
|
||
|
||
快捷启动键 0。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCH1:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCH1** = ``4194401``
|
||
|
||
快捷启动键 1。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCH2:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCH2** = ``4194402``
|
||
|
||
快捷启动键 2。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCH3:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCH3** = ``4194403``
|
||
|
||
快捷启动键 3。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCH4:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCH4** = ``4194404``
|
||
|
||
快捷启动键 4。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCH5:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCH5** = ``4194405``
|
||
|
||
快捷启动键 5。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCH6:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCH6** = ``4194406``
|
||
|
||
快捷启动键 6。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCH7:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCH7** = ``4194407``
|
||
|
||
快捷启动键 7。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCH8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCH8** = ``4194408``
|
||
|
||
快捷启动键 8。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCH9:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCH9** = ``4194409``
|
||
|
||
快捷启动键 9。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCHA:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCHA** = ``4194410``
|
||
|
||
快捷启动键 A。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCHB:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCHB** = ``4194411``
|
||
|
||
快捷启动键 B。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCHC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCHC** = ``4194412``
|
||
|
||
快捷启动键 C。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCHD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCHD** = ``4194413``
|
||
|
||
快捷启动键 D。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCHE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCHE** = ``4194414``
|
||
|
||
快捷启动键 E。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LAUNCHF:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LAUNCHF** = ``4194415``
|
||
|
||
快捷启动键 F。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_GLOBE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_GLOBE** = ``4194416``
|
||
|
||
Mac / iPad 键盘上的“地球”键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_KEYBOARD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_KEYBOARD** = ``4194417``
|
||
|
||
iPad 键盘上的“屏幕键盘”键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_JIS_EISU:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_JIS_EISU** = ``4194418``
|
||
|
||
Mac 键盘上的“英数”键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_JIS_KANA:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_JIS_KANA** = ``4194419``
|
||
|
||
Mac 键盘上的“かな”键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_UNKNOWN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_UNKNOWN** = ``8388607``
|
||
|
||
未知键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_SPACE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_SPACE** = ``32``
|
||
|
||
空格键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_EXCLAM:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_EXCLAM** = ``33``
|
||
|
||
感叹号(\ ``!``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_QUOTEDBL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_QUOTEDBL** = ``34``
|
||
|
||
双引号(\ ``"``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_NUMBERSIGN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_NUMBERSIGN** = ``35``
|
||
|
||
数字符号即\ *井号*\ (\ ``#``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_DOLLAR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_DOLLAR** = ``36``
|
||
|
||
美元符号(\ ``$``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_PERCENT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_PERCENT** = ``37``
|
||
|
||
百分号(\ ``%``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_AMPERSAND:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_AMPERSAND** = ``38``
|
||
|
||
与号(\ ``&``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_APOSTROPHE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_APOSTROPHE** = ``39``
|
||
|
||
撇号(\ ``'``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_PARENLEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_PARENLEFT** = ``40``
|
||
|
||
左括号(\ ``(``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_PARENRIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_PARENRIGHT** = ``41``
|
||
|
||
右括号(\ ``)``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_ASTERISK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_ASTERISK** = ``42``
|
||
|
||
星号(\ ``*``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_PLUS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_PLUS** = ``43``
|
||
|
||
加号(\ ``+``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_COMMA:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_COMMA** = ``44``
|
||
|
||
逗号(\ ``,``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_MINUS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_MINUS** = ``45``
|
||
|
||
减号(\ ``-``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_PERIOD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_PERIOD** = ``46``
|
||
|
||
句号(\ ``.``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_SLASH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_SLASH** = ``47``
|
||
|
||
正斜杠(\ ``/``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_0:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_0** = ``48``
|
||
|
||
数字 0 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_1:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_1** = ``49``
|
||
|
||
数字 1 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_2:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_2** = ``50``
|
||
|
||
数字 2 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_3:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_3** = ``51``
|
||
|
||
数字 3 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_4:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_4** = ``52``
|
||
|
||
数字 4 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_5:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_5** = ``53``
|
||
|
||
数字 5 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_6:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_6** = ``54``
|
||
|
||
数字 6 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_7:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_7** = ``55``
|
||
|
||
数字 7 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_8** = ``56``
|
||
|
||
数字 8 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_9:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_9** = ``57``
|
||
|
||
数字 9 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_COLON:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_COLON** = ``58``
|
||
|
||
冒号(\ ``:``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_SEMICOLON:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_SEMICOLON** = ``59``
|
||
|
||
分号(\ ``;``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LESS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_LESS** = ``60``
|
||
|
||
小于号(\ ``<``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_EQUAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_EQUAL** = ``61``
|
||
|
||
等于号(\ ``=``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_GREATER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_GREATER** = ``62``
|
||
|
||
大于号(\ ``>``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_QUESTION:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_QUESTION** = ``63``
|
||
|
||
问号(\ ``?``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_AT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_AT** = ``64``
|
||
|
||
艾特号(\ ``@``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_A:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_A** = ``65``
|
||
|
||
A 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_B:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_B** = ``66``
|
||
|
||
B 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_C:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_C** = ``67``
|
||
|
||
C 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_D:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_D** = ``68``
|
||
|
||
D 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_E:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_E** = ``69``
|
||
|
||
E 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_F:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_F** = ``70``
|
||
|
||
F 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_G:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_G** = ``71``
|
||
|
||
G 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_H:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_H** = ``72``
|
||
|
||
H 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_I:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_I** = ``73``
|
||
|
||
I 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_J:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_J** = ``74``
|
||
|
||
J 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_K:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_K** = ``75``
|
||
|
||
K 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_L:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_L** = ``76``
|
||
|
||
L 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_M:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_M** = ``77``
|
||
|
||
M 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_N:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_N** = ``78``
|
||
|
||
N 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_O:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_O** = ``79``
|
||
|
||
O 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_P:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_P** = ``80``
|
||
|
||
P 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_Q:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_Q** = ``81``
|
||
|
||
Q 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_R:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_R** = ``82``
|
||
|
||
R 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_S:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_S** = ``83``
|
||
|
||
S 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_T:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_T** = ``84``
|
||
|
||
T 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_U:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_U** = ``85``
|
||
|
||
U 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_V:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_V** = ``86``
|
||
|
||
V 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_W:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_W** = ``87``
|
||
|
||
W 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_X:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_X** = ``88``
|
||
|
||
X 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_Y:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_Y** = ``89``
|
||
|
||
Y 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_Z:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_Z** = ``90``
|
||
|
||
Z 键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_BRACKETLEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_BRACKETLEFT** = ``91``
|
||
|
||
左中括号(\ ``[lb]``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_BACKSLASH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_BACKSLASH** = ``92``
|
||
|
||
反斜杠(\ ``\``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_BRACKETRIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_BRACKETRIGHT** = ``93``
|
||
|
||
右中括号(\ ``[rb]``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_ASCIICIRCUM:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_ASCIICIRCUM** = ``94``
|
||
|
||
脱字符(\ ``^``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_UNDERSCORE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_UNDERSCORE** = ``95``
|
||
|
||
下划线(\ ``_``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_QUOTELEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_QUOTELEFT** = ``96``
|
||
|
||
重音符(\ `````\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_BRACELEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_BRACELEFT** = ``123``
|
||
|
||
左大括号(\ ``{``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_BAR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_BAR** = ``124``
|
||
|
||
垂直的条或\ *竖线*\ (\ ``|``\ 键)。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_BRACERIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_BRACERIGHT** = ``125``
|
||
|
||
右大括号(\ ``}``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_ASCIITILDE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_ASCIITILDE** = ``126``
|
||
|
||
波浪线(\ ``~``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_YEN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_YEN** = ``165``
|
||
|
||
日元符号(\ ``¥``\ )键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_SECTION:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Key<enum_@GlobalScope_Key>` **KEY_SECTION** = ``167``
|
||
|
||
章节号(\ ``§``\ )键。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_KeyModifierMask:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
flags **KeyModifierMask**: :ref:`🔗<enum_@GlobalScope_KeyModifierMask>`
|
||
|
||
.. _class_@GlobalScope_constant_KEY_CODE_MASK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>` **KEY_CODE_MASK** = ``8388607``
|
||
|
||
键码掩码。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_MODIFIER_MASK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>` **KEY_MODIFIER_MASK** = ``2130706432``
|
||
|
||
修饰键掩码。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_MASK_CMD_OR_CTRL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>` **KEY_MASK_CMD_OR_CTRL** = ``16777216``
|
||
|
||
自动重映射为 macOS 上的 :ref:`KEY_META<class_@GlobalScope_constant_KEY_META>` 和其他平台上的 :ref:`KEY_CTRL<class_@GlobalScope_constant_KEY_CTRL>`\ ,此掩码在实际事件中从不设置,应仅用于键映射。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_MASK_SHIFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>` **KEY_MASK_SHIFT** = ``33554432``
|
||
|
||
Shift 键掩码。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_MASK_ALT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>` **KEY_MASK_ALT** = ``67108864``
|
||
|
||
Alt 或 Option(在 macOS 上)键掩码。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_MASK_META:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>` **KEY_MASK_META** = ``134217728``
|
||
|
||
命令(在 macOS 上)或 Meta/Windows 键掩码。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_MASK_CTRL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>` **KEY_MASK_CTRL** = ``268435456``
|
||
|
||
Ctrl 键掩码。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_MASK_KPAD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>` **KEY_MASK_KPAD** = ``536870912``
|
||
|
||
Keypad 键掩码。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_MASK_GROUP_SWITCH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>` **KEY_MASK_GROUP_SWITCH** = ``1073741824``
|
||
|
||
Group Switch 键掩码。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_KeyLocation:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **KeyLocation**: :ref:`🔗<enum_@GlobalScope_KeyLocation>`
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LOCATION_UNSPECIFIED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`KeyLocation<enum_@GlobalScope_KeyLocation>` **KEY_LOCATION_UNSPECIFIED** = ``0``
|
||
|
||
用于仅出现一次的键,或者当比较不需要区分 ``LEFT`` 和 ``RIGHT`` 版本时。
|
||
|
||
例如,当使用 :ref:`InputEvent.is_match()<class_InputEvent_method_is_match>` 时,具有 :ref:`KEY_LOCATION_UNSPECIFIED<class_@GlobalScope_constant_KEY_LOCATION_UNSPECIFIED>` 的事件将与传递的事件上的任意 :ref:`KeyLocation<enum_@GlobalScope_KeyLocation>` 匹配。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LOCATION_LEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`KeyLocation<enum_@GlobalScope_KeyLocation>` **KEY_LOCATION_LEFT** = ``1``
|
||
|
||
对键中位于左侧的键。
|
||
|
||
.. _class_@GlobalScope_constant_KEY_LOCATION_RIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`KeyLocation<enum_@GlobalScope_KeyLocation>` **KEY_LOCATION_RIGHT** = ``2``
|
||
|
||
对键中位于右侧的键。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_MouseButton:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **MouseButton**: :ref:`🔗<enum_@GlobalScope_MouseButton>`
|
||
|
||
.. _class_@GlobalScope_constant_MOUSE_BUTTON_NONE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MouseButton<enum_@GlobalScope_MouseButton>` **MOUSE_BUTTON_NONE** = ``0``
|
||
|
||
与任何鼠标按钮都不对应的枚举值。这用于初始化具有通用状态的 :ref:`MouseButton<enum_@GlobalScope_MouseButton>` 属性。
|
||
|
||
.. _class_@GlobalScope_constant_MOUSE_BUTTON_LEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MouseButton<enum_@GlobalScope_MouseButton>` **MOUSE_BUTTON_LEFT** = ``1``
|
||
|
||
鼠标主键,通常分配给左键。
|
||
|
||
.. _class_@GlobalScope_constant_MOUSE_BUTTON_RIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MouseButton<enum_@GlobalScope_MouseButton>` **MOUSE_BUTTON_RIGHT** = ``2``
|
||
|
||
鼠标次键,通常分配给右键。
|
||
|
||
.. _class_@GlobalScope_constant_MOUSE_BUTTON_MIDDLE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MouseButton<enum_@GlobalScope_MouseButton>` **MOUSE_BUTTON_MIDDLE** = ``3``
|
||
|
||
鼠标中键。
|
||
|
||
.. _class_@GlobalScope_constant_MOUSE_BUTTON_WHEEL_UP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MouseButton<enum_@GlobalScope_MouseButton>` **MOUSE_BUTTON_WHEEL_UP** = ``4``
|
||
|
||
鼠标滚轮向上滚动。
|
||
|
||
.. _class_@GlobalScope_constant_MOUSE_BUTTON_WHEEL_DOWN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MouseButton<enum_@GlobalScope_MouseButton>` **MOUSE_BUTTON_WHEEL_DOWN** = ``5``
|
||
|
||
鼠标滚轮向下滚动。
|
||
|
||
.. _class_@GlobalScope_constant_MOUSE_BUTTON_WHEEL_LEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MouseButton<enum_@GlobalScope_MouseButton>` **MOUSE_BUTTON_WHEEL_LEFT** = ``6``
|
||
|
||
鼠标滚轮左键(仅在某些鼠标上有实现)。
|
||
|
||
.. _class_@GlobalScope_constant_MOUSE_BUTTON_WHEEL_RIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MouseButton<enum_@GlobalScope_MouseButton>` **MOUSE_BUTTON_WHEEL_RIGHT** = ``7``
|
||
|
||
鼠标滚轮右键(仅在某些鼠标上有实现)。
|
||
|
||
.. _class_@GlobalScope_constant_MOUSE_BUTTON_XBUTTON1:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MouseButton<enum_@GlobalScope_MouseButton>` **MOUSE_BUTTON_XBUTTON1** = ``8``
|
||
|
||
鼠标额外键 1。有时会出现,通常位于鼠标的两侧。
|
||
|
||
.. _class_@GlobalScope_constant_MOUSE_BUTTON_XBUTTON2:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MouseButton<enum_@GlobalScope_MouseButton>` **MOUSE_BUTTON_XBUTTON2** = ``9``
|
||
|
||
鼠标额外键 2。有时会出现,通常位于鼠标的两侧。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_MouseButtonMask:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
flags **MouseButtonMask**: :ref:`🔗<enum_@GlobalScope_MouseButtonMask>`
|
||
|
||
.. _class_@GlobalScope_constant_MOUSE_BUTTON_MASK_LEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MouseButtonMask<enum_@GlobalScope_MouseButtonMask>` **MOUSE_BUTTON_MASK_LEFT** = ``1``
|
||
|
||
鼠标主键掩码,通常用于左键。
|
||
|
||
.. _class_@GlobalScope_constant_MOUSE_BUTTON_MASK_RIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MouseButtonMask<enum_@GlobalScope_MouseButtonMask>` **MOUSE_BUTTON_MASK_RIGHT** = ``2``
|
||
|
||
鼠标次键掩码,通常用于右键。
|
||
|
||
.. _class_@GlobalScope_constant_MOUSE_BUTTON_MASK_MIDDLE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MouseButtonMask<enum_@GlobalScope_MouseButtonMask>` **MOUSE_BUTTON_MASK_MIDDLE** = ``4``
|
||
|
||
鼠标中键掩码。
|
||
|
||
.. _class_@GlobalScope_constant_MOUSE_BUTTON_MASK_MB_XBUTTON1:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MouseButtonMask<enum_@GlobalScope_MouseButtonMask>` **MOUSE_BUTTON_MASK_MB_XBUTTON1** = ``128``
|
||
|
||
鼠标额外键 1 掩码。
|
||
|
||
.. _class_@GlobalScope_constant_MOUSE_BUTTON_MASK_MB_XBUTTON2:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MouseButtonMask<enum_@GlobalScope_MouseButtonMask>` **MOUSE_BUTTON_MASK_MB_XBUTTON2** = ``256``
|
||
|
||
鼠标额外键 2 掩码。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_JoyButton:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **JoyButton**: :ref:`🔗<enum_@GlobalScope_JoyButton>`
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_INVALID:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_INVALID** = ``-1``
|
||
|
||
无效的游戏控制器按钮。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_A:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_A** = ``0``
|
||
|
||
游戏控制器 SDL 按键 A。对应底部动作按钮:Sony Cross、Xbox A、Nintendo B。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_B:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_B** = ``1``
|
||
|
||
游戏控制器 SDL 按钮 B。对应右侧动作按钮:Sony Circle、Xbox B、Nintendo A。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_X:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_X** = ``2``
|
||
|
||
游戏控制器 SDL 按钮 X。对应左侧动作按钮:Sony Square、Xbox X、Nintendo Y。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_Y:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_Y** = ``3``
|
||
|
||
游戏控制器 SDL 按钮 Y。对应顶部动作按钮:Sony Triangle、Xbox Y、Nintendo X。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_BACK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_BACK** = ``4``
|
||
|
||
游戏控制器 SDL back 按钮。对应于 Sony Select、Xbox Back、Nintendo - 按钮。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_GUIDE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_GUIDE** = ``5``
|
||
|
||
游戏控制器 SDL guide 按钮。对应于索尼 PS、Xbox 的 Home 键。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_START:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_START** = ``6``
|
||
|
||
游戏控制器 SDL start 按钮。对应于 Sony Options、Xbox Menu、Nintendo + 按钮。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_LEFT_STICK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_LEFT_STICK** = ``7``
|
||
|
||
游戏控制器 SDL 左摇杆按钮。对应于 Sony L3、Xbox L/LS 按钮。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_RIGHT_STICK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_RIGHT_STICK** = ``8``
|
||
|
||
游戏控制器 SDL 右摇杆按钮。对应于 Sony R3、Xbox R/RS 按钮。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_LEFT_SHOULDER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_LEFT_SHOULDER** = ``9``
|
||
|
||
游戏控制器 SDL 左肩按钮。对应于 Sony L1、Xbox LB 按钮。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_RIGHT_SHOULDER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_RIGHT_SHOULDER** = ``10``
|
||
|
||
游戏控制器 SDL 右肩按钮。对应于 Sony R1、Xbox RB 按钮。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_DPAD_UP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_DPAD_UP** = ``11``
|
||
|
||
游戏控制器方向键向上按钮。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_DPAD_DOWN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_DPAD_DOWN** = ``12``
|
||
|
||
游戏控制器方向键向下按钮。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_DPAD_LEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_DPAD_LEFT** = ``13``
|
||
|
||
游戏控制器方向键向左键。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_DPAD_RIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_DPAD_RIGHT** = ``14``
|
||
|
||
游戏控制器方向键向右键。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_MISC1:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_MISC1** = ``15``
|
||
|
||
游戏控制器 SDL 杂项按钮。对应 Xbox 分享键、PS5 麦克风键、Nintendo Switch 捕捉键。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_PADDLE1:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_PADDLE1** = ``16``
|
||
|
||
游戏控制器 SDL 拨片 1 按钮。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_PADDLE2:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_PADDLE2** = ``17``
|
||
|
||
游戏控制器 SDL 拨片 2 按钮。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_PADDLE3:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_PADDLE3** = ``18``
|
||
|
||
游戏控制器 SDL 拨片 3 按钮。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_PADDLE4:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_PADDLE4** = ``19``
|
||
|
||
游戏控制器 SDL 拨片 4 按钮。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_TOUCHPAD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_TOUCHPAD** = ``20``
|
||
|
||
游戏控制器 SDL 触摸板按钮。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_SDL_MAX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_SDL_MAX** = ``21``
|
||
|
||
SDL 游戏控制器按钮的数量。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_BUTTON_MAX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` **JOY_BUTTON_MAX** = ``128``
|
||
|
||
引擎所支持的最大游戏控制器按钮数。特定平台上的实际界限可能更低:
|
||
|
||
- **Android:**\ 最多 36 个按钮。
|
||
|
||
- **Linux:**\ 最多 80 个按钮。
|
||
|
||
- **Windows** 和 **macOS:**\ 最多 128 个按钮。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_JoyAxis:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **JoyAxis**: :ref:`🔗<enum_@GlobalScope_JoyAxis>`
|
||
|
||
.. _class_@GlobalScope_constant_JOY_AXIS_INVALID:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyAxis<enum_@GlobalScope_JoyAxis>` **JOY_AXIS_INVALID** = ``-1``
|
||
|
||
无效的游戏控制器轴。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_AXIS_LEFT_X:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyAxis<enum_@GlobalScope_JoyAxis>` **JOY_AXIS_LEFT_X** = ``0``
|
||
|
||
游戏控制器左操纵杆 x 轴。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_AXIS_LEFT_Y:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyAxis<enum_@GlobalScope_JoyAxis>` **JOY_AXIS_LEFT_Y** = ``1``
|
||
|
||
游戏控制器左操纵杆 y 轴。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_AXIS_RIGHT_X:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyAxis<enum_@GlobalScope_JoyAxis>` **JOY_AXIS_RIGHT_X** = ``2``
|
||
|
||
游戏控制器右操纵杆 x 轴。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_AXIS_RIGHT_Y:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyAxis<enum_@GlobalScope_JoyAxis>` **JOY_AXIS_RIGHT_Y** = ``3``
|
||
|
||
游戏控制器右操纵杆 y 轴。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_AXIS_TRIGGER_LEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyAxis<enum_@GlobalScope_JoyAxis>` **JOY_AXIS_TRIGGER_LEFT** = ``4``
|
||
|
||
游戏控制器左扳机轴。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_AXIS_TRIGGER_RIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyAxis<enum_@GlobalScope_JoyAxis>` **JOY_AXIS_TRIGGER_RIGHT** = ``5``
|
||
|
||
游戏控制器右扳机轴。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_AXIS_SDL_MAX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyAxis<enum_@GlobalScope_JoyAxis>` **JOY_AXIS_SDL_MAX** = ``6``
|
||
|
||
SDL 游戏控制器轴的数量。
|
||
|
||
.. _class_@GlobalScope_constant_JOY_AXIS_MAX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`JoyAxis<enum_@GlobalScope_JoyAxis>` **JOY_AXIS_MAX** = ``10``
|
||
|
||
最大游戏控制器轴数:OpenVR 最多支持 5 个操纵杆,总共 10 个轴。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_MIDIMessage:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **MIDIMessage**: :ref:`🔗<enum_@GlobalScope_MIDIMessage>`
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_NONE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_NONE** = ``0``
|
||
|
||
不对应任何 MIDI 消息。这是 :ref:`InputEventMIDI.message<class_InputEventMIDI_property_message>` 的默认值。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_NOTE_OFF:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_NOTE_OFF** = ``8``
|
||
|
||
音符被释放时发送的 MIDI 消息。
|
||
|
||
\ **注意:**\ 并非所有 MIDI 设备都会发送该消息;有些可能会发送 :ref:`MIDI_MESSAGE_NOTE_ON<class_@GlobalScope_constant_MIDI_MESSAGE_NOTE_ON>`\ ,并将 :ref:`InputEventMIDI.velocity<class_InputEventMIDI_property_velocity>` 设置为 ``0``\ 。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_NOTE_ON:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_NOTE_ON** = ``9``
|
||
|
||
音符被按下时发送的 MIDI 消息。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_AFTERTOUCH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_AFTERTOUCH** = ``10``
|
||
|
||
发送 MIDI 消息以指示音符被按下时的压力的变化,也称为触后。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_CONTROL_CHANGE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_CONTROL_CHANGE** = ``11``
|
||
|
||
控制器值发生变化时发送的 MIDI 消息。MIDI 设备中不演奏音符的输入都属于控制器。包括音量滑块、平衡滑块、声像滑块,以及各种开关和踏板等。简要清单见 `General MIDI 规范 <https://zh.wikipedia.org/zh-cn/General_MIDI#%E6%8E%A7%E5%88%B6%E5%99%A8%E4%BA%8B%E4%BB%B6%EF%BC%88Controller_events%EF%BC%89>`__\ 。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_PROGRAM_CHANGE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_PROGRAM_CHANGE** = ``12``
|
||
|
||
MIDI 设备更改乐器(也叫\ *音色*\ 或\ *预设*\ )时发送的 MIDI 消息。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_CHANNEL_PRESSURE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_CHANNEL_PRESSURE** = ``13``
|
||
|
||
表示整个通道的压力发生改变时发送的 MIDI 消息。部分 MIDI 设备可能用这个消息来代替 :ref:`MIDI_MESSAGE_AFTERTOUCH<class_@GlobalScope_constant_MIDI_MESSAGE_AFTERTOUCH>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_PITCH_BEND:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_PITCH_BEND** = ``14``
|
||
|
||
音高弯曲器的值发生改变时发送的 MIDI 消息,音高弯曲器通常是 MIDI 设备上的滚轮。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_SYSTEM_EXCLUSIVE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_SYSTEM_EXCLUSIVE** = ``240``
|
||
|
||
MIDI 系统独占消息(SysEx)。这类消息并未标准化,取决于发送的 MIDI 设备。
|
||
|
||
\ **注意:**\ 尚未实现从 :ref:`InputEventMIDI<class_InputEventMIDI>` 获取该消息。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_QUARTER_FRAME:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_QUARTER_FRAME** = ``241``
|
||
|
||
每四分之一帧发送的 MIDI 消息,用于让连接的 MIDI 设备保持同步。与 :ref:`MIDI_MESSAGE_TIMING_CLOCK<class_@GlobalScope_constant_MIDI_MESSAGE_TIMING_CLOCK>` 相关。
|
||
|
||
\ **注意:**\ 尚未实现从 :ref:`InputEventMIDI<class_InputEventMIDI>` 获取该消息。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_SONG_POSITION_POINTER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_SONG_POSITION_POINTER** = ``242``
|
||
|
||
跳转至当前序列或乐曲中的某个位置时发送的 MIDI 消息。
|
||
|
||
\ **注意:**\ 尚未实现从 :ref:`InputEventMIDI<class_InputEventMIDI>` 获取该消息。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_SONG_SELECT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_SONG_SELECT** = ``243``
|
||
|
||
发送以选择要播放的序列或歌曲的 MIDI 消息。
|
||
|
||
\ **注意:**\ 从 :ref:`InputEventMIDI<class_InputEventMIDI>` 获取该消息的数据尚未实现。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_TUNE_REQUEST:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_TUNE_REQUEST** = ``246``
|
||
|
||
请求调校时发送的 MIDI 消息。适用于模拟合成器。大多数现代 MIDI 设备不需要这个消息。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_TIMING_CLOCK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_TIMING_CLOCK** = ``248``
|
||
|
||
在 :ref:`MIDI_MESSAGE_QUARTER_FRAME<class_@GlobalScope_constant_MIDI_MESSAGE_QUARTER_FRAME>` 之后发送 24 次的 MIDI 消息,用于让连接的 MIDI 设备保持同步。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_START:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_START** = ``250``
|
||
|
||
发送以从头开始当前序列或歌曲的 MIDI 消息。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_CONTINUE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_CONTINUE** = ``251``
|
||
|
||
发送以从当前序列或歌曲的暂停点恢复的 MIDI 消息。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_STOP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_STOP** = ``252``
|
||
|
||
发送以暂停当前序列或歌曲的 MIDI 消息。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_ACTIVE_SENSING:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_ACTIVE_SENSING** = ``254``
|
||
|
||
MIDI 设备空闲时不断发送的 MIDI 消息,用于告知接收方连接仍然有效。大多数 MIDI 设备不会发送这个消息。
|
||
|
||
.. _class_@GlobalScope_constant_MIDI_MESSAGE_SYSTEM_RESET:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MIDIMessage<enum_@GlobalScope_MIDIMessage>` **MIDI_MESSAGE_SYSTEM_RESET** = ``255``
|
||
|
||
用于将 MIDI 设备恢复至开机时的默认状态而发送的 MIDI 消息。MIDI 设备正在启动时不应该发送。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_Error:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **Error**: :ref:`🔗<enum_@GlobalScope_Error>`
|
||
|
||
.. _class_@GlobalScope_constant_OK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **OK** = ``0``
|
||
|
||
返回 :ref:`Error<enum_@GlobalScope_Error>` 的方法会在没有错误发生时返回 :ref:`OK<class_@GlobalScope_constant_OK>`\ 。
|
||
|
||
由于 :ref:`OK<class_@GlobalScope_constant_OK>` 的值为 ``0``\ ,并且所有其他错误常数都是正整数,因此返回值也可以用于布尔检查。
|
||
|
||
::
|
||
|
||
var error = method_that_returns_error()
|
||
if error != OK:
|
||
printerr("失败!")
|
||
|
||
# 或者也可以:
|
||
if error:
|
||
printerr("还是失败!")
|
||
|
||
\ **注意:**\ 许多函数不返回错误代码,但会将错误信息打印到标准输出。
|
||
|
||
.. _class_@GlobalScope_constant_FAILED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **FAILED** = ``1``
|
||
|
||
一般性错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_UNAVAILABLE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_UNAVAILABLE** = ``2``
|
||
|
||
不可用的错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_UNCONFIGURED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_UNCONFIGURED** = ``3``
|
||
|
||
未配置的错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_UNAUTHORIZED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_UNAUTHORIZED** = ``4``
|
||
|
||
未经授权的错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_PARAMETER_RANGE_ERROR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_PARAMETER_RANGE_ERROR** = ``5``
|
||
|
||
参数范围错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_OUT_OF_MEMORY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_OUT_OF_MEMORY** = ``6``
|
||
|
||
内存不足(OOM)错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_FILE_NOT_FOUND:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_FILE_NOT_FOUND** = ``7``
|
||
|
||
文件:未找到错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_FILE_BAD_DRIVE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_FILE_BAD_DRIVE** = ``8``
|
||
|
||
文件:坏驱动器错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_FILE_BAD_PATH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_FILE_BAD_PATH** = ``9``
|
||
|
||
文件:错误的路径错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_FILE_NO_PERMISSION:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_FILE_NO_PERMISSION** = ``10``
|
||
|
||
文件:无权限错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_FILE_ALREADY_IN_USE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_FILE_ALREADY_IN_USE** = ``11``
|
||
|
||
文件:已在使用错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_FILE_CANT_OPEN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_FILE_CANT_OPEN** = ``12``
|
||
|
||
文件:无法打开错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_FILE_CANT_WRITE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_FILE_CANT_WRITE** = ``13``
|
||
|
||
文件:无法写入错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_FILE_CANT_READ:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_FILE_CANT_READ** = ``14``
|
||
|
||
文件:无法读取错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_FILE_UNRECOGNIZED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_FILE_UNRECOGNIZED** = ``15``
|
||
|
||
文件:未识别的错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_FILE_CORRUPT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_FILE_CORRUPT** = ``16``
|
||
|
||
文件:损坏错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_FILE_MISSING_DEPENDENCIES:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_FILE_MISSING_DEPENDENCIES** = ``17``
|
||
|
||
文件:缺少依赖项错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_FILE_EOF:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_FILE_EOF** = ``18``
|
||
|
||
文件:文件结束(EOF)错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_CANT_OPEN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_CANT_OPEN** = ``19``
|
||
|
||
无法打开错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_CANT_CREATE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_CANT_CREATE** = ``20``
|
||
|
||
无法创建错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_QUERY_FAILED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_QUERY_FAILED** = ``21``
|
||
|
||
查询失败错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_ALREADY_IN_USE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_ALREADY_IN_USE** = ``22``
|
||
|
||
已在使用中错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_LOCKED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_LOCKED** = ``23``
|
||
|
||
锁定错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_TIMEOUT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_TIMEOUT** = ``24``
|
||
|
||
超时错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_CANT_CONNECT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_CANT_CONNECT** = ``25``
|
||
|
||
无法连接错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_CANT_RESOLVE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_CANT_RESOLVE** = ``26``
|
||
|
||
无法解决错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_CONNECTION_ERROR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_CONNECTION_ERROR** = ``27``
|
||
|
||
连接错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_CANT_ACQUIRE_RESOURCE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_CANT_ACQUIRE_RESOURCE** = ``28``
|
||
|
||
无法获取资源错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_CANT_FORK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_CANT_FORK** = ``29``
|
||
|
||
无法分叉进程错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_INVALID_DATA:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_INVALID_DATA** = ``30``
|
||
|
||
无效数据错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_INVALID_PARAMETER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_INVALID_PARAMETER** = ``31``
|
||
|
||
无效参数错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_ALREADY_EXISTS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_ALREADY_EXISTS** = ``32``
|
||
|
||
已存在的错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_DOES_NOT_EXIST:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_DOES_NOT_EXIST** = ``33``
|
||
|
||
不存在的错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_DATABASE_CANT_READ:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_DATABASE_CANT_READ** = ``34``
|
||
|
||
数据库:读取错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_DATABASE_CANT_WRITE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_DATABASE_CANT_WRITE** = ``35``
|
||
|
||
数据库:写入错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_COMPILATION_FAILED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_COMPILATION_FAILED** = ``36``
|
||
|
||
编译失败错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_METHOD_NOT_FOUND:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_METHOD_NOT_FOUND** = ``37``
|
||
|
||
方法未找到错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_LINK_FAILED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_LINK_FAILED** = ``38``
|
||
|
||
链接失败错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_SCRIPT_FAILED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_SCRIPT_FAILED** = ``39``
|
||
|
||
脚本失败错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_CYCLIC_LINK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_CYCLIC_LINK** = ``40``
|
||
|
||
循环链接(导入循环)错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_INVALID_DECLARATION:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_INVALID_DECLARATION** = ``41``
|
||
|
||
无效声明错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_DUPLICATE_SYMBOL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_DUPLICATE_SYMBOL** = ``42``
|
||
|
||
符号重复错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_PARSE_ERROR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_PARSE_ERROR** = ``43``
|
||
|
||
解析错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_BUSY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_BUSY** = ``44``
|
||
|
||
忙碌错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_SKIP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_SKIP** = ``45``
|
||
|
||
跳过错误。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_HELP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_HELP** = ``46``
|
||
|
||
帮助错误。内部使用,用于将 ``--version`` 或 ``--help`` 作为选项传递给可执行文件的情况。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_BUG:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_BUG** = ``47``
|
||
|
||
Bug 错误,由方法中的实现问题引起。
|
||
|
||
\ **注意:**\ 如果内置方法返回此代码,请在 `GitHub 问题追踪器 <https://github.com/godotengine/godot/issues>`__ 上开一个问题。
|
||
|
||
.. _class_@GlobalScope_constant_ERR_PRINTER_ON_FIRE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **ERR_PRINTER_ON_FIRE** = ``48``
|
||
|
||
打印机起火错误(这是个彩蛋,引擎中没有内置方法会返回此错误码)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_PropertyHint:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **PropertyHint**: :ref:`🔗<enum_@GlobalScope_PropertyHint>`
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_NONE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_NONE** = ``0``
|
||
|
||
该属性没有编辑器提示。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_RANGE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_RANGE** = ``1``
|
||
|
||
提示 :ref:`int<class_int>` 或 :ref:`float<class_float>` 属性应在提示字符串 ``"最小值,最大值"`` 或 ``"最小值,最大值,步长"`` 指定的范围内。提示字符串可以选择包含 ``"or_greater"`` 和/或 ``"or_less"``\ ,从而允许手动输入高于最大值或低于最小值的值。
|
||
|
||
\ **示例:**\ ``"-360,360,1,or_greater,or_less"``\ 。
|
||
|
||
此外,还可以包含其他关键字:\ ``"exp"`` 用于指数范围编辑,\ ``"radians_as_degrees"`` 用于以度数编辑弧度角(范围的取值也使用度数),\ ``"degrees"`` 提示角度,\ ``"hide_slider"`` 则会隐藏滑块。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_ENUM:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_ENUM** = ``2``
|
||
|
||
提示 :ref:`int<class_int>` 或 :ref:`String<class_String>` 属性是枚举值,可通过提示字符串在指定的列表中选取。
|
||
|
||
该提示字符串是逗号分隔的名称列表,例如 ``"Hello,Something,Else"``\ 。 **不会**\ 从名称的任何一端删除空格。对于整数属性,列表中的第一个名称的值为 0,下一个名称的值为 1,依此类推。也可以通过将 ``:integer`` 附加到名称来显式指定值,例如 ``"Zero,One,Three:3,Four,Six:6"``\ 。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_ENUM_SUGGESTION:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_ENUM_SUGGESTION** = ``3``
|
||
|
||
提示 :ref:`String<class_String>` 属性为枚举值,可以通过提示字符串在指定的列表中选取,例如 ``"Hello,Something,Else"``\ 。
|
||
|
||
与 :ref:`PROPERTY_HINT_ENUM<class_@GlobalScope_constant_PROPERTY_HINT_ENUM>` 不同,具有该提示的属性仍然接受任意值并且可以为空。值列表用于建议可能的值。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_EXP_EASING:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_EXP_EASING** = ``4``
|
||
|
||
提示应通过指数缓动函数编辑 :ref:`float<class_float>` 属性。提示字符串可以包括 ``"attenuation"`` 以水平翻转曲线,和/或 ``"positive_only"`` 以排除 in/out 缓动并限制值大于或等于零。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_LINK:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_LINK** = ``5``
|
||
|
||
提示向量属性应该允许分量链接。例如,这能够让 :ref:`Vector2.x<class_Vector2_property_x>` 和 :ref:`Vector2.y<class_Vector2_property_y>` 被一起编辑。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_FLAGS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_FLAGS** = ``6``
|
||
|
||
提示 :ref:`int<class_int>` 属性为位掩码,位标志拥有名称。
|
||
|
||
提示字符串为逗号分隔的名称列表,例如 ``"Bit0,Bit1,Bit2,Bit3"``\ 。名称两端的空白字符\ **不会**\ 被移除。列表中的第一个名称的值为 1、然后是 2、接下来就是 4、8、16 等值。也可以通过在名称后加上 ``:整数`` 来指定显式的值,例如 ``"A:4,B:8,C:16"``\ 。你还可以对标志进行组合(\ ``"A:4,B:8,AB:12,C:16"``\ )。
|
||
|
||
\ **注意:**\ 标志值最多为 ``1``\ ,最多为 ``2 ** 32 - 1``\ 。
|
||
|
||
\ **注意:**\ 与 :ref:`PROPERTY_HINT_ENUM<class_@GlobalScope_constant_PROPERTY_HINT_ENUM>` 不同,不会考虑前一个显式值。如果提示为 ``"A:16,B,C"``\ ,则 A 为 16、B 为 2、C 为 4。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_2D_RENDER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_LAYERS_2D_RENDER** = ``7``
|
||
|
||
提示 :ref:`int<class_int>` 属性为位掩码,表示可命名的 2D 渲染层。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_2D_PHYSICS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_LAYERS_2D_PHYSICS** = ``8``
|
||
|
||
提示 :ref:`int<class_int>` 属性为位掩码,表示可命名的 2D 物理层。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_2D_NAVIGATION:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_LAYERS_2D_NAVIGATION** = ``9``
|
||
|
||
提示 :ref:`int<class_int>` 属性为位掩码,表示可命名的 2D 导航层。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_3D_RENDER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_LAYERS_3D_RENDER** = ``10``
|
||
|
||
提示 :ref:`int<class_int>` 属性为位掩码,表示可命名的 3D 渲染层。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_3D_PHYSICS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_LAYERS_3D_PHYSICS** = ``11``
|
||
|
||
提示 :ref:`int<class_int>` 属性为位掩码,表示可命名的 3D 物理层。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_3D_NAVIGATION:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_LAYERS_3D_NAVIGATION** = ``12``
|
||
|
||
提示 :ref:`int<class_int>` 属性为位掩码,表示可命名的 3D 导航层。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_AVOIDANCE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_LAYERS_AVOIDANCE** = ``37``
|
||
|
||
提示整数属性为位掩码,表示可命名的避障层。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_FILE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_FILE** = ``13``
|
||
|
||
提示 :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:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_DIR** = ``14``
|
||
|
||
提示 :ref:`String<class_String>` 属性为目录的路径。编辑时会弹出选取路径的文件对话框。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_GLOBAL_FILE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_GLOBAL_FILE** = ``15``
|
||
|
||
提示 :ref:`String<class_String>` 属性为文件的绝对路径,位于项目文件夹之外。编辑时会弹出选取路径的文件对话框。提示字符串可以设为一组带有通配符的筛选器,例如 ``"*.png,*.jpg"``\ 。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_GLOBAL_DIR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_GLOBAL_DIR** = ``16``
|
||
|
||
提示 :ref:`String<class_String>` 属性为目录的绝对路径,位于项目文件夹之外。编辑时会弹出选取路径的文件对话框。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_RESOURCE_TYPE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_RESOURCE_TYPE** = ``17``
|
||
|
||
提示属性是 :ref:`Resource<class_Resource>` 派生类型的实例,可通过提示字符串指定(例如 ``"Texture2D"``\ )。 编辑该属性会显示一个有效资源类型的弹出菜单用以实例化。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_MULTILINE_TEXT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_MULTILINE_TEXT** = ``18``
|
||
|
||
提示 :ref:`String<class_String>` 属性为包含换行的文本。编辑是会显示文本输入字段,可以进行换行。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_EXPRESSION:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_EXPRESSION** = ``19``
|
||
|
||
提示 :ref:`String<class_String>` 属性为 :ref:`Expression<class_Expression>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_PLACEHOLDER_TEXT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_PLACEHOLDER_TEXT** = ``20``
|
||
|
||
提示 :ref:`String<class_String>` 属性在为空时应当显示占位文本。提示字符串为所使用的占位文本。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_COLOR_NO_ALPHA:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_COLOR_NO_ALPHA** = ``21``
|
||
|
||
提示一个 :ref:`Color<class_Color>` 属性在编辑时不能影响其透明度(\ :ref:`Color.a<class_Color_property_a>` 不可编辑)。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_OBJECT_ID:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_OBJECT_ID** = ``22``
|
||
|
||
提示该属性的值是一个被编码为对象 ID 的对象,其类型在提示字符串中指定。被用于调试器。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_TYPE_STRING:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_TYPE_STRING** = ``23``
|
||
|
||
如果属性为 :ref:`String<class_String>`\ ,则提示该属性代表特定的类型(类)。这样就能使用创建对话框选择类型。该属性中存放的是所选类型,是一个字符串。
|
||
|
||
如果属性为 :ref:`Array<class_Array>`\ ,则提示编辑器如何显示其中的元素。\ ``hint_string`` 必须使用 ``":"`` 和 ``"/"`` 对内嵌的类型进行编码。
|
||
|
||
如果属性为 :ref:`Dictionary<class_Dictionary>`\ ,则提示编辑器如何显示其中的元素。\ ``hint_string`` 与 :ref:`Array<class_Array>` 相同,使用 ``";"`` 分隔键和值。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
# elem_type 数组。
|
||
hint_string = "%d:" % [elem_type]
|
||
hint_string = "%d/%d:%s" % [elem_type, elem_hint, elem_hint_string]
|
||
# elem_type 二维数组(elem_type 数组的数组)。
|
||
hint_string = "%d:%d:" % [TYPE_ARRAY, elem_type]
|
||
hint_string = "%d:%d/%d:%s" % [TYPE_ARRAY, elem_type, elem_hint, elem_hint_string]
|
||
# elem_type 三维数组(elem_type 数组的数组的数组)。
|
||
hint_string = "%d:%d:%d:" % [TYPE_ARRAY, TYPE_ARRAY, elem_type]
|
||
hint_string = "%d:%d:%d/%d:%s" % [TYPE_ARRAY, TYPE_ARRAY, elem_type, elem_hint, elem_hint_string]
|
||
|
||
.. code-tab:: csharp
|
||
|
||
// elem_type 数组。
|
||
hintString = $"{elemType:D}:";
|
||
hintString = $"{elemType:}/{elemHint:D}:{elemHintString}";
|
||
// elem_type 二维数组(elem_type 数组的数组)。
|
||
hintString = $"{Variant.Type.Array:D}:{elemType:D}:";
|
||
hintString = $"{Variant.Type.Array:D}:{elemType:D}/{elemHint:D}:{elemHintString}";
|
||
// elem_type 三维数组(elem_type 数组的数组的数组)。
|
||
hintString = $"{Variant.Type.Array:D}:{Variant.Type.Array:D}:{elemType:D}:";
|
||
hintString = $"{Variant.Type.Array:D}:{Variant.Type.Array:D}:{elemType:D}/{elemHint:D}:{elemHintString}";
|
||
|
||
|
||
|
||
\ **示例:**\
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
hint_string = "%d:" % [TYPE_INT] # 整数数组。
|
||
hint_string = "%d/%d:1,10,1" % [TYPE_INT, PROPERTY_HINT_RANGE] # 整数数组(范围为 1 到 10)。
|
||
hint_string = "%d/%d:Zero,One,Two" % [TYPE_INT, PROPERTY_HINT_ENUM] # 整数数组(枚举)。
|
||
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)。
|
||
hint_string = "%d:%d/%d:Texture2D" % [TYPE_ARRAY, TYPE_OBJECT, PROPERTY_HINT_RESOURCE_TYPE] # 纹理二维数组。
|
||
|
||
.. code-tab:: csharp
|
||
|
||
hintString = $"{Variant.Type.Int:D}/{PropertyHint.Range:D}:1,10,1"; // 整数数组(范围为 1 到 10)。
|
||
hintString = $"{Variant.Type.Int:D}/{PropertyHint.Enum:D}:Zero,One,Two"; // 整数数组(枚举)。
|
||
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)。
|
||
hintString = $"{Variant.Type.Array:D}:{Variant.Type.Object:D}/{PropertyHint.ResourceType:D}:Texture2D"; // 纹理二维数组。
|
||
|
||
|
||
|
||
\ **注意:**\ 后缀冒号是必须的,否则无法正确识别内置类型。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE** = ``24``
|
||
|
||
**已弃用:** This hint is not used by the engine.
|
||
|
||
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_OBJECT_TOO_BIG:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_OBJECT_TOO_BIG** = ``25``
|
||
|
||
提示对象太大而无法通过调试器发送。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_NODE_PATH_VALID_TYPES:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_NODE_PATH_VALID_TYPES** = ``26``
|
||
|
||
提示该提示字符串为类型 :ref:`NodePath<class_NodePath>` 的属性指定有效的节点类型。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_SAVE_FILE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_SAVE_FILE** = ``27``
|
||
|
||
提示 :ref:`String<class_String>` 属性是文件的路径。编辑它将显示一个文件对话框,用于选择文件要保存的路径。该对话框可以访问项目的目录。该提示字符串可以是一组带有通配符的筛选器,例如 ``"*.png,*.jpg"``\ 。另见 :ref:`FileDialog.filters<class_FileDialog_property_filters>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_GLOBAL_SAVE_FILE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_GLOBAL_SAVE_FILE** = ``28``
|
||
|
||
提示 :ref:`String<class_String>` 属性是文件的路径。编辑它将显示一个文件对话框,用于选择文件要保存的路径。该对话框可以访问整个文件系统。该提示字符串可以是一组带有通配符的筛选器,例如 ``"*.png,*.jpg"``\ 。另见 :ref:`FileDialog.filters<class_FileDialog_property_filters>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_INT_IS_OBJECTID:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_INT_IS_OBJECTID** = ``29``
|
||
|
||
**已弃用:** This hint is not used by the engine.
|
||
|
||
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_INT_IS_POINTER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_INT_IS_POINTER** = ``30``
|
||
|
||
提示 :ref:`int<class_int>` 属性是一个指针。用于 GDExtension。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_ARRAY_TYPE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_ARRAY_TYPE** = ``31``
|
||
|
||
提示属性为 :ref:`Array<class_Array>`\ ,其中所存储的类型在提示字符串中指定。提示字符串中包含的是数组的类型(例如 ``"String"``\ )。
|
||
|
||
对存储的类型进行更精细的控制请使用 :ref:`PROPERTY_HINT_TYPE_STRING<class_@GlobalScope_constant_PROPERTY_HINT_TYPE_STRING>` 中的提示字符串。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_DICTIONARY_TYPE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_DICTIONARY_TYPE** = ``38``
|
||
|
||
提示属性为 :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:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_LOCALE_ID** = ``32``
|
||
|
||
提示一个字符串属性是一个区域设置代码。编辑它将显示一个用于选择语言和地区的区域设置对话框。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_LOCALIZABLE_STRING:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_LOCALIZABLE_STRING** = ``33``
|
||
|
||
提示一个字典属性是字符串翻译映射。字典的键是区域设置代码,值是翻译后的字符串。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_NODE_TYPE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_NODE_TYPE** = ``34``
|
||
|
||
提示属性是 :ref:`Node<class_Node>` 派生类型的实例,可以选择通过提示字符串指定(例如 ``"Node2D"``\ )。编辑它将显示一个用于从场景中选取节点的对话框。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_HIDE_QUATERNION_EDIT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_HIDE_QUATERNION_EDIT** = ``35``
|
||
|
||
提示四元数属性应当禁用临时欧拉值编辑器。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_PASSWORD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_PASSWORD** = ``36``
|
||
|
||
提示字符串属性为密码,每一个字符都会被替换为秘密字符。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_TOOL_BUTTON:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_TOOL_BUTTON** = ``39``
|
||
|
||
一个\ :ref:`Callable<class_Callable>`\ 属性应当被显示为一个可点击的按钮。当按钮被按下,该属性被调用。提示字符串指定了按钮的文本并可以通过\ ``"EditorIcons"``\ 主题类型指定一个图标。
|
||
|
||
.. code:: text
|
||
|
||
"Click me!" - 一个按钮,文本为“Click me!”,图标是默认的“Callable”图标。
|
||
"Click me!,ColorRect" - 一个按钮,文本为“Click me!”,图标是“ColorRect”图标。
|
||
|
||
\ **注意:**\ 一个可调用对象\ :ref:`Callable<class_Callable>`\ 无法被妥善序列化和保存到文件,所以建议使用\ :ref:`PROPERTY_USAGE_EDITOR<class_@GlobalScope_constant_PROPERTY_USAGE_EDITOR>`\ 而不是\ :ref:`PROPERTY_USAGE_DEFAULT<class_@GlobalScope_constant_PROPERTY_USAGE_DEFAULT>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_HINT_ONESHOT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_ONESHOT** = ``40``
|
||
|
||
提示一个属性在设置后仍会自动被改变,例如\ :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** = ``45``
|
||
|
||
代表 :ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` 枚举的大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_PropertyUsageFlags:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
flags **PropertyUsageFlags**: :ref:`🔗<enum_@GlobalScope_PropertyUsageFlags>`
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_NONE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_NONE** = ``0``
|
||
|
||
该属性不被存储,也不会显示在编辑器中。这是非导出属性的默认值。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_STORAGE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_STORAGE** = ``2``
|
||
|
||
将属性序列化并保存到场景文件中(用于导出属性的默认值)。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_EDITOR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_EDITOR** = ``4``
|
||
|
||
该属性将被显示在 :ref:`EditorInspector<class_EditorInspector>` 中(用于导出属性的默认值)。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_INTERNAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_INTERNAL** = ``8``
|
||
|
||
该属性排除在类参考手册之外。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_CHECKABLE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_CHECKABLE** = ``16``
|
||
|
||
该属性可以在 :ref:`EditorInspector<class_EditorInspector>` 中被勾选。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_CHECKED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_CHECKED** = ``32``
|
||
|
||
该属性在 :ref:`EditorInspector<class_EditorInspector>` 中已被勾选。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_GROUP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_GROUP** = ``64``
|
||
|
||
用于在编辑器中将属性编组在一起。请参阅 :ref:`EditorInspector<class_EditorInspector>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_CATEGORY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_CATEGORY** = ``128``
|
||
|
||
在编辑器中用于为属性分类。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_SUBGROUP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_SUBGROUP** = ``256``
|
||
|
||
用于在子组(一个组下)中将编辑器中的属性编组在一起。请参阅 :ref:`EditorInspector<class_EditorInspector>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_CLASS_IS_BITFIELD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_CLASS_IS_BITFIELD** = ``512``
|
||
|
||
该属性是一个位字段,即它包含多个被表示为位的标志。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_NO_INSTANCE_STATE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_NO_INSTANCE_STATE** = ``1024``
|
||
|
||
该属性不在 :ref:`PackedScene<class_PackedScene>` 中保存其状态。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_RESTART_IF_CHANGED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_RESTART_IF_CHANGED** = ``2048``
|
||
|
||
编辑属性会提示用户重新启动编辑器。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_SCRIPT_VARIABLE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_SCRIPT_VARIABLE** = ``4096``
|
||
|
||
本属性是一个脚本变量。\ :ref:`PROPERTY_USAGE_SCRIPT_VARIABLE<class_@GlobalScope_constant_PROPERTY_USAGE_SCRIPT_VARIABLE>`\ 可以用来把导出的脚本变量与内建变量(没有这一项使用标识)区分开来。默认情况下,\ :ref:`PROPERTY_USAGE_SCRIPT_VARIABLE<class_@GlobalScope_constant_PROPERTY_USAGE_SCRIPT_VARIABLE>`\ 对脚本中通过重载\ :ref:`Object._get_property_list()<class_Object_private_method__get_property_list>`\ 创建的变量\ **不生效**\ 。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_STORE_IF_NULL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_STORE_IF_NULL** = ``8192``
|
||
|
||
即使 :ref:`Object<class_Object>` 类型的属性值为 ``null``\ ,也会被存储。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED** = ``16384``
|
||
|
||
如果该属性被修改,则所有检查器字段都将被刷新。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE** = ``32768``
|
||
|
||
**已弃用:** This flag is not used by the engine.
|
||
|
||
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_CLASS_IS_ENUM:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_CLASS_IS_ENUM** = ``65536``
|
||
|
||
该属性是一个枚举类型的变量,即它仅从其关联的枚举中获取被命名的整数常量。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_NIL_IS_VARIANT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_NIL_IS_VARIANT** = ``131072``
|
||
|
||
如果属性将 ``nil`` 作为默认值,则其类型将为 :ref:`Variant<class_Variant>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_ARRAY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_ARRAY** = ``262144``
|
||
|
||
该属性为数组。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_ALWAYS_DUPLICATE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_ALWAYS_DUPLICATE** = ``524288``
|
||
|
||
当创建一个带有 :ref:`Resource.duplicate()<class_Resource_method_duplicate>` 的 Resource,并且它的标志是在一个 Resource 的属性上设置的副本时候,无论 ``subresources`` 为多少,该属性永远都会被创建为副本。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_NEVER_DUPLICATE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_NEVER_DUPLICATE** = ``1048576``
|
||
|
||
使用 :ref:`Resource.duplicate()<class_Resource_method_duplicate>` 复制资源时,如果该资源的某个属性上设有这个标志,则不会对该属性进行复制,无视 ``subresources`` 布尔型参数。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_HIGH_END_GFX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_HIGH_END_GFX** = ``2097152``
|
||
|
||
仅当支持现代渲染器(不包括 Compatibility 渲染方式)时,该属性才会显示在编辑器中。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT** = ``4194304``
|
||
|
||
:ref:`NodePath<class_NodePath>` 属性将始终相对于场景根。对于本地资源来说最有用。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT** = ``8388608``
|
||
|
||
在动态创建资源时使用,即 Getter 将始终返回一个不同的实例。\ :ref:`ResourceSaver<class_ResourceSaver>` 需要该信息来正确保存这种资源。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_KEYING_INCREMENTS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_KEYING_INCREMENTS** = ``16777216``
|
||
|
||
插入该属性的动画关键帧将自动增加该值,从而可以轻松地为一行中的多个值设置关键帧。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_DEFERRED_SET_RESOURCE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_DEFERRED_SET_RESOURCE** = ``33554432``
|
||
|
||
**已弃用:** This flag is not used by the engine.
|
||
|
||
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT** = ``67108864``
|
||
|
||
当该属性为 :ref:`Resource<class_Resource>` 且基础对象为 :ref:`Node<class_Node>` 时,则每当该节点是在编辑器中创建的,都会自动创建一个资源实例。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_EDITOR_BASIC_SETTING:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_EDITOR_BASIC_SETTING** = ``134217728``
|
||
|
||
该属性被视为基本设置,即使禁用高级模式时也会显现。用于项目设置。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_READ_ONLY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_READ_ONLY** = ``268435456``
|
||
|
||
该属性在 :ref:`EditorInspector<class_EditorInspector>` 中只读。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_SECRET:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_SECRET** = ``536870912``
|
||
|
||
具有该标志的导出预设属性包含机密信息,并与导出预设配置的其余部分分开存储。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_DEFAULT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_DEFAULT** = ``6``
|
||
|
||
默认用法(存储和编辑器)。
|
||
|
||
.. _class_@GlobalScope_constant_PROPERTY_USAGE_NO_EDITOR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PropertyUsageFlags<enum_@GlobalScope_PropertyUsageFlags>` **PROPERTY_USAGE_NO_EDITOR** = ``2``
|
||
|
||
默认用法,但不在编辑器中显示属性(存储)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_MethodFlags:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
flags **MethodFlags**: :ref:`🔗<enum_@GlobalScope_MethodFlags>`
|
||
|
||
.. _class_@GlobalScope_constant_METHOD_FLAG_NORMAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MethodFlags<enum_@GlobalScope_MethodFlags>` **METHOD_FLAG_NORMAL** = ``1``
|
||
|
||
普通方法的标志。
|
||
|
||
.. _class_@GlobalScope_constant_METHOD_FLAG_EDITOR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MethodFlags<enum_@GlobalScope_MethodFlags>` **METHOD_FLAG_EDITOR** = ``2``
|
||
|
||
编辑器方法的标志。
|
||
|
||
.. _class_@GlobalScope_constant_METHOD_FLAG_CONST:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MethodFlags<enum_@GlobalScope_MethodFlags>` **METHOD_FLAG_CONST** = ``4``
|
||
|
||
常量方法的标志。
|
||
|
||
.. _class_@GlobalScope_constant_METHOD_FLAG_VIRTUAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MethodFlags<enum_@GlobalScope_MethodFlags>` **METHOD_FLAG_VIRTUAL** = ``8``
|
||
|
||
虚方法的标志。
|
||
|
||
.. _class_@GlobalScope_constant_METHOD_FLAG_VARARG:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MethodFlags<enum_@GlobalScope_MethodFlags>` **METHOD_FLAG_VARARG** = ``16``
|
||
|
||
具有可变数量参数的方法的标志。
|
||
|
||
.. _class_@GlobalScope_constant_METHOD_FLAG_STATIC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MethodFlags<enum_@GlobalScope_MethodFlags>` **METHOD_FLAG_STATIC** = ``32``
|
||
|
||
静态方法的标志。
|
||
|
||
.. _class_@GlobalScope_constant_METHOD_FLAG_OBJECT_CORE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MethodFlags<enum_@GlobalScope_MethodFlags>` **METHOD_FLAG_OBJECT_CORE** = ``64``
|
||
|
||
内部使用。允许不将核心虚拟方法(例如 :ref:`Object._notification()<class_Object_private_method__notification>`\ )转储到 JSON API。
|
||
|
||
.. _class_@GlobalScope_constant_METHOD_FLAG_VIRTUAL_REQUIRED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MethodFlags<enum_@GlobalScope_MethodFlags>` **METHOD_FLAG_VIRTUAL_REQUIRED** = ``128``
|
||
|
||
必选虚方法的标志。GDScript 会为抽象函数设置该标志。
|
||
|
||
.. _class_@GlobalScope_constant_METHOD_FLAGS_DEFAULT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MethodFlags<enum_@GlobalScope_MethodFlags>` **METHOD_FLAGS_DEFAULT** = ``1``
|
||
|
||
默认方法标志(正常)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_Variant.Type:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **Variant.Type**: :ref:`🔗<enum_@GlobalScope_Variant.Type>`
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_NIL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_NIL** = ``0``
|
||
|
||
变量为 ``null``\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_BOOL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_BOOL** = ``1``
|
||
|
||
变量类型为 :ref:`bool<class_bool>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_INT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_INT** = ``2``
|
||
|
||
变量类型为 :ref:`int<class_int>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_FLOAT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_FLOAT** = ``3``
|
||
|
||
变量的类型为 :ref:`float<class_float>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_STRING:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_STRING** = ``4``
|
||
|
||
变量类型为 :ref:`String<class_String>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_VECTOR2:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_VECTOR2** = ``5``
|
||
|
||
变量类型为 :ref:`Vector2<class_Vector2>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_VECTOR2I:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_VECTOR2I** = ``6``
|
||
|
||
变量类型为 :ref:`Vector2i<class_Vector2i>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_RECT2:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_RECT2** = ``7``
|
||
|
||
变量类型为 :ref:`Rect2<class_Rect2>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_RECT2I:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_RECT2I** = ``8``
|
||
|
||
变量类型为 :ref:`Rect2i<class_Rect2i>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_VECTOR3:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_VECTOR3** = ``9``
|
||
|
||
变量类型为 :ref:`Vector3<class_Vector3>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_VECTOR3I:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_VECTOR3I** = ``10``
|
||
|
||
变量类型为 :ref:`Vector3i<class_Vector3i>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_TRANSFORM2D:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_TRANSFORM2D** = ``11``
|
||
|
||
变量类型为 :ref:`Transform2D<class_Transform2D>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_VECTOR4:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_VECTOR4** = ``12``
|
||
|
||
变量类型为 :ref:`Vector4<class_Vector4>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_VECTOR4I:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_VECTOR4I** = ``13``
|
||
|
||
变量类型为 :ref:`Vector4i<class_Vector4i>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_PLANE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_PLANE** = ``14``
|
||
|
||
变量类型为 :ref:`Plane<class_Plane>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_QUATERNION:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_QUATERNION** = ``15``
|
||
|
||
变量类型为 :ref:`Quaternion<class_Quaternion>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_AABB:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_AABB** = ``16``
|
||
|
||
变量类型为 :ref:`AABB<class_AABB>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_BASIS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_BASIS** = ``17``
|
||
|
||
变量类型为 :ref:`Basis<class_Basis>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_TRANSFORM3D:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_TRANSFORM3D** = ``18``
|
||
|
||
变量类型为 :ref:`Transform3D<class_Transform3D>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_PROJECTION:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_PROJECTION** = ``19``
|
||
|
||
变量类型为 :ref:`Projection<class_Projection>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_COLOR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_COLOR** = ``20``
|
||
|
||
变量类型为 :ref:`Color<class_Color>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_STRING_NAME:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_STRING_NAME** = ``21``
|
||
|
||
变量类型为 :ref:`StringName<class_StringName>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_NODE_PATH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_NODE_PATH** = ``22``
|
||
|
||
变量类型为 :ref:`NodePath<class_NodePath>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_RID:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_RID** = ``23``
|
||
|
||
变量类型为 :ref:`RID<class_RID>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_OBJECT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_OBJECT** = ``24``
|
||
|
||
变量类型为 :ref:`Object<class_Object>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_CALLABLE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_CALLABLE** = ``25``
|
||
|
||
变量类型为 :ref:`Callable<class_Callable>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_SIGNAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_SIGNAL** = ``26``
|
||
|
||
变量类型为 :ref:`Signal<class_Signal>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_DICTIONARY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_DICTIONARY** = ``27``
|
||
|
||
变量类型为 :ref:`Dictionary<class_Dictionary>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_ARRAY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_ARRAY** = ``28``
|
||
|
||
变量类型为 :ref:`Array<class_Array>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_PACKED_BYTE_ARRAY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_PACKED_BYTE_ARRAY** = ``29``
|
||
|
||
变量类型为 :ref:`PackedByteArray<class_PackedByteArray>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_PACKED_INT32_ARRAY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_PACKED_INT32_ARRAY** = ``30``
|
||
|
||
变量类型为 :ref:`PackedInt32Array<class_PackedInt32Array>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_PACKED_INT64_ARRAY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_PACKED_INT64_ARRAY** = ``31``
|
||
|
||
变量类型为 :ref:`PackedInt64Array<class_PackedInt64Array>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_PACKED_FLOAT32_ARRAY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_PACKED_FLOAT32_ARRAY** = ``32``
|
||
|
||
变量类型为 :ref:`PackedFloat32Array<class_PackedFloat32Array>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_PACKED_FLOAT64_ARRAY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_PACKED_FLOAT64_ARRAY** = ``33``
|
||
|
||
变量类型为 :ref:`PackedFloat64Array<class_PackedFloat64Array>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_PACKED_STRING_ARRAY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_PACKED_STRING_ARRAY** = ``34``
|
||
|
||
变量类型为 :ref:`PackedStringArray<class_PackedStringArray>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_PACKED_VECTOR2_ARRAY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_PACKED_VECTOR2_ARRAY** = ``35``
|
||
|
||
变量类型为 :ref:`PackedVector2Array<class_PackedVector2Array>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_PACKED_VECTOR3_ARRAY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_PACKED_VECTOR3_ARRAY** = ``36``
|
||
|
||
变量类型为 :ref:`PackedVector3Array<class_PackedVector3Array>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_PACKED_COLOR_ARRAY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_PACKED_COLOR_ARRAY** = ``37``
|
||
|
||
变量类型为 :ref:`PackedColorArray<class_PackedColorArray>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_PACKED_VECTOR4_ARRAY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_PACKED_VECTOR4_ARRAY** = ``38``
|
||
|
||
变量类型为 :ref:`PackedVector4Array<class_PackedVector4Array>`\ 。
|
||
|
||
.. _class_@GlobalScope_constant_TYPE_MAX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **TYPE_MAX** = ``39``
|
||
|
||
代表 :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` 枚举的大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_@GlobalScope_Variant.Operator:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **Variant.Operator**: :ref:`🔗<enum_@GlobalScope_Variant.Operator>`
|
||
|
||
.. _class_@GlobalScope_constant_OP_EQUAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_EQUAL** = ``0``
|
||
|
||
相等运算符(\ ``==``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_NOT_EQUAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_NOT_EQUAL** = ``1``
|
||
|
||
不等运算符(\ ``!=``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_LESS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_LESS** = ``2``
|
||
|
||
小于运算符(\ ``<``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_LESS_EQUAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_LESS_EQUAL** = ``3``
|
||
|
||
小于等于运算符(\ ``<=``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_GREATER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_GREATER** = ``4``
|
||
|
||
大于运算符(\ ``>``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_GREATER_EQUAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_GREATER_EQUAL** = ``5``
|
||
|
||
大于等于运算符(\ ``>=``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_ADD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_ADD** = ``6``
|
||
|
||
加法运算符(\ ``+``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_SUBTRACT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_SUBTRACT** = ``7``
|
||
|
||
减法运算符(\ ``-``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_MULTIPLY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_MULTIPLY** = ``8``
|
||
|
||
乘法运算符(\ ``*``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_DIVIDE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_DIVIDE** = ``9``
|
||
|
||
除法运算符(\ ``/``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_NEGATE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_NEGATE** = ``10``
|
||
|
||
一元减号运算符(\ ``-``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_POSITIVE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_POSITIVE** = ``11``
|
||
|
||
一元加号运算符(\ ``+``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_MODULE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_MODULE** = ``12``
|
||
|
||
余数/取模运算符(\ ``%``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_POWER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_POWER** = ``13``
|
||
|
||
幂运算符(\ ``**``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_SHIFT_LEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_SHIFT_LEFT** = ``14``
|
||
|
||
左移运算符(\ ``<<``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_SHIFT_RIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_SHIFT_RIGHT** = ``15``
|
||
|
||
右移运算符(\ ``>>``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_BIT_AND:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_BIT_AND** = ``16``
|
||
|
||
按位与运算符(\ ``&``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_BIT_OR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_BIT_OR** = ``17``
|
||
|
||
按位或运算符(\ ``|``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_BIT_XOR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_BIT_XOR** = ``18``
|
||
|
||
按位异或运算符(\ ``^``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_BIT_NEGATE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_BIT_NEGATE** = ``19``
|
||
|
||
按位非运算符(\ ``~``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_AND:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_AND** = ``20``
|
||
|
||
逻辑与运算符(\ ``and`` 或 ``&&``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_OR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_OR** = ``21``
|
||
|
||
逻辑或运算符(\ ``or`` 或 ``||``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_XOR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_XOR** = ``22``
|
||
|
||
逻辑异或运算符(未在 GDScript 中实现)。
|
||
|
||
.. _class_@GlobalScope_constant_OP_NOT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_NOT** = ``23``
|
||
|
||
逻辑非运算符(\ ``not`` 或 ``!``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_IN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_IN** = ``24``
|
||
|
||
逻辑 IN 运算符(\ ``in``\ )。
|
||
|
||
.. _class_@GlobalScope_constant_OP_MAX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` **OP_MAX** = ``25``
|
||
|
||
代表 :ref:`Variant.Operator<enum_@GlobalScope_Variant.Operator>` 枚举的大小。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
属性说明
|
||
--------
|
||
|
||
.. _class_@GlobalScope_property_AudioServer:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`AudioServer<class_AudioServer>` **AudioServer** :ref:`🔗<class_@GlobalScope_property_AudioServer>`
|
||
|
||
:ref:`AudioServer<class_AudioServer>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_CameraServer:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`CameraServer<class_CameraServer>` **CameraServer** :ref:`🔗<class_@GlobalScope_property_CameraServer>`
|
||
|
||
:ref:`CameraServer<class_CameraServer>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_ClassDB:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`ClassDB<class_ClassDB>` **ClassDB** :ref:`🔗<class_@GlobalScope_property_ClassDB>`
|
||
|
||
:ref:`ClassDB<class_ClassDB>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_DisplayServer:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`DisplayServer<class_DisplayServer>` **DisplayServer** :ref:`🔗<class_@GlobalScope_property_DisplayServer>`
|
||
|
||
:ref:`DisplayServer<class_DisplayServer>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_EditorInterface:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`EditorInterface<class_EditorInterface>` **EditorInterface** :ref:`🔗<class_@GlobalScope_property_EditorInterface>`
|
||
|
||
:ref:`EditorInterface<class_EditorInterface>` 单例。
|
||
|
||
\ **注意:**\ 仅在编辑器构建中可用。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_Engine:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Engine<class_Engine>` **Engine** :ref:`🔗<class_@GlobalScope_property_Engine>`
|
||
|
||
:ref:`Engine<class_Engine>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_EngineDebugger:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`EngineDebugger<class_EngineDebugger>` **EngineDebugger** :ref:`🔗<class_@GlobalScope_property_EngineDebugger>`
|
||
|
||
:ref:`EngineDebugger<class_EngineDebugger>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_GDExtensionManager:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`GDExtensionManager<class_GDExtensionManager>` **GDExtensionManager** :ref:`🔗<class_@GlobalScope_property_GDExtensionManager>`
|
||
|
||
:ref:`GDExtensionManager<class_GDExtensionManager>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_Geometry2D:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Geometry2D<class_Geometry2D>` **Geometry2D** :ref:`🔗<class_@GlobalScope_property_Geometry2D>`
|
||
|
||
:ref:`Geometry2D<class_Geometry2D>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_Geometry3D:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Geometry3D<class_Geometry3D>` **Geometry3D** :ref:`🔗<class_@GlobalScope_property_Geometry3D>`
|
||
|
||
:ref:`Geometry3D<class_Geometry3D>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_IP:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`IP<class_IP>` **IP** :ref:`🔗<class_@GlobalScope_property_IP>`
|
||
|
||
:ref:`IP<class_IP>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_Input:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Input<class_Input>` **Input** :ref:`🔗<class_@GlobalScope_property_Input>`
|
||
|
||
:ref:`Input<class_Input>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_InputMap:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`InputMap<class_InputMap>` **InputMap** :ref:`🔗<class_@GlobalScope_property_InputMap>`
|
||
|
||
:ref:`InputMap<class_InputMap>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_JavaClassWrapper:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`JavaClassWrapper<class_JavaClassWrapper>` **JavaClassWrapper** :ref:`🔗<class_@GlobalScope_property_JavaClassWrapper>`
|
||
|
||
:ref:`JavaClassWrapper<class_JavaClassWrapper>` 单例。
|
||
|
||
\ **注意:**\ 仅在 Android 上实现。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_JavaScriptBridge:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`JavaScriptBridge<class_JavaScriptBridge>` **JavaScriptBridge** :ref:`🔗<class_@GlobalScope_property_JavaScriptBridge>`
|
||
|
||
:ref:`JavaScriptBridge<class_JavaScriptBridge>` 单例。
|
||
|
||
\ **注意:**\ 仅在 Web 平台上实现。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_Marshalls:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Marshalls<class_Marshalls>` **Marshalls** :ref:`🔗<class_@GlobalScope_property_Marshalls>`
|
||
|
||
:ref:`Marshalls<class_Marshalls>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_NativeMenu:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`NativeMenu<class_NativeMenu>` **NativeMenu** :ref:`🔗<class_@GlobalScope_property_NativeMenu>`
|
||
|
||
:ref:`NativeMenu<class_NativeMenu>` 单例。
|
||
|
||
\ **注意:**\ 仅在 macOS 上实现。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_NavigationMeshGenerator:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`NavigationMeshGenerator<class_NavigationMeshGenerator>` **NavigationMeshGenerator** :ref:`🔗<class_@GlobalScope_property_NavigationMeshGenerator>`
|
||
|
||
:ref:`NavigationMeshGenerator<class_NavigationMeshGenerator>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_NavigationServer2D:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`NavigationServer2D<class_NavigationServer2D>` **NavigationServer2D** :ref:`🔗<class_@GlobalScope_property_NavigationServer2D>`
|
||
|
||
:ref:`NavigationServer2D<class_NavigationServer2D>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_NavigationServer3D:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`NavigationServer3D<class_NavigationServer3D>` **NavigationServer3D** :ref:`🔗<class_@GlobalScope_property_NavigationServer3D>`
|
||
|
||
:ref:`NavigationServer3D<class_NavigationServer3D>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_OS:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`OS<class_OS>` **OS** :ref:`🔗<class_@GlobalScope_property_OS>`
|
||
|
||
:ref:`OS<class_OS>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_Performance:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Performance<class_Performance>` **Performance** :ref:`🔗<class_@GlobalScope_property_Performance>`
|
||
|
||
:ref:`Performance<class_Performance>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_PhysicsServer2D:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`PhysicsServer2D<class_PhysicsServer2D>` **PhysicsServer2D** :ref:`🔗<class_@GlobalScope_property_PhysicsServer2D>`
|
||
|
||
:ref:`PhysicsServer2D<class_PhysicsServer2D>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_PhysicsServer2DManager:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`PhysicsServer2DManager<class_PhysicsServer2DManager>` **PhysicsServer2DManager** :ref:`🔗<class_@GlobalScope_property_PhysicsServer2DManager>`
|
||
|
||
:ref:`PhysicsServer2DManager<class_PhysicsServer2DManager>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_PhysicsServer3D:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`PhysicsServer3D<class_PhysicsServer3D>` **PhysicsServer3D** :ref:`🔗<class_@GlobalScope_property_PhysicsServer3D>`
|
||
|
||
:ref:`PhysicsServer3D<class_PhysicsServer3D>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_PhysicsServer3DManager:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`PhysicsServer3DManager<class_PhysicsServer3DManager>` **PhysicsServer3DManager** :ref:`🔗<class_@GlobalScope_property_PhysicsServer3DManager>`
|
||
|
||
:ref:`PhysicsServer3DManager<class_PhysicsServer3DManager>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_ProjectSettings:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`ProjectSettings<class_ProjectSettings>` **ProjectSettings** :ref:`🔗<class_@GlobalScope_property_ProjectSettings>`
|
||
|
||
:ref:`ProjectSettings<class_ProjectSettings>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_RenderingServer:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`RenderingServer<class_RenderingServer>` **RenderingServer** :ref:`🔗<class_@GlobalScope_property_RenderingServer>`
|
||
|
||
:ref:`RenderingServer<class_RenderingServer>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_ResourceLoader:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`ResourceLoader<class_ResourceLoader>` **ResourceLoader** :ref:`🔗<class_@GlobalScope_property_ResourceLoader>`
|
||
|
||
:ref:`ResourceLoader<class_ResourceLoader>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_ResourceSaver:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`ResourceSaver<class_ResourceSaver>` **ResourceSaver** :ref:`🔗<class_@GlobalScope_property_ResourceSaver>`
|
||
|
||
:ref:`ResourceSaver<class_ResourceSaver>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_ResourceUID:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`ResourceUID<class_ResourceUID>` **ResourceUID** :ref:`🔗<class_@GlobalScope_property_ResourceUID>`
|
||
|
||
:ref:`ResourceUID<class_ResourceUID>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_TextServerManager:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`TextServerManager<class_TextServerManager>` **TextServerManager** :ref:`🔗<class_@GlobalScope_property_TextServerManager>`
|
||
|
||
:ref:`TextServerManager<class_TextServerManager>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_ThemeDB:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`ThemeDB<class_ThemeDB>` **ThemeDB** :ref:`🔗<class_@GlobalScope_property_ThemeDB>`
|
||
|
||
:ref:`ThemeDB<class_ThemeDB>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_Time:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Time<class_Time>` **Time** :ref:`🔗<class_@GlobalScope_property_Time>`
|
||
|
||
:ref:`Time<class_Time>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_TranslationServer:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`TranslationServer<class_TranslationServer>` **TranslationServer** :ref:`🔗<class_@GlobalScope_property_TranslationServer>`
|
||
|
||
:ref:`TranslationServer<class_TranslationServer>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_WorkerThreadPool:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`WorkerThreadPool<class_WorkerThreadPool>` **WorkerThreadPool** :ref:`🔗<class_@GlobalScope_property_WorkerThreadPool>`
|
||
|
||
:ref:`WorkerThreadPool<class_WorkerThreadPool>` 单例。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_property_XRServer:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`XRServer<class_XRServer>` **XRServer** :ref:`🔗<class_@GlobalScope_property_XRServer>`
|
||
|
||
:ref:`XRServer<class_XRServer>` 单例。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
方法说明
|
||
--------
|
||
|
||
.. _class_@GlobalScope_method_abs:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **abs**\ (\ x\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_abs>`
|
||
|
||
返回一个 :ref:`Variant<class_Variant>` 类型参数 ``x`` 的绝对值(即非负值)。支持的类型:\ :ref:`int<class_int>`\ 、\ :ref:`float<class_float>`\ 、\ :ref:`Vector2<class_Vector2>`\ 、\ :ref:`Vector2i<class_Vector2i>`\ 、\ :ref:`Vector3<class_Vector3>`\ 、\ :ref:`Vector3i<class_Vector3i>`\ 、\ :ref:`Vector4<class_Vector4>`\ 、\ :ref:`Vector4i<class_Vector4i>` 。
|
||
|
||
::
|
||
|
||
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)
|
||
|
||
\ **注意:**\ 为了更好的类型安全,请使用 :ref:`absf()<class_@GlobalScope_method_absf>`\ 、\ :ref:`absi()<class_@GlobalScope_method_absi>`\ 、\ :ref:`Vector2.abs()<class_Vector2_method_abs>`\ 、\ :ref:`Vector2i.abs()<class_Vector2i_method_abs>`\ 、\ :ref:`Vector3.abs()<class_Vector3_method_abs>`\ 、\ :ref:`Vector3i.abs()<class_Vector3i_method_abs>`\ 、\ :ref:`Vector4.abs()<class_Vector4_method_abs>` 或 :ref:`Vector4i.abs()<class_Vector4i_method_abs>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_absf:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **absf**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_absf>`
|
||
|
||
返回浮点参数 ``x`` 的绝对值(即正值)。
|
||
|
||
::
|
||
|
||
# a=1.2
|
||
var a = absf(-1.2)
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_absi:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **absi**\ (\ x\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_absi>`
|
||
|
||
返回整数参数 ``x`` 的绝对值(即正值)。
|
||
|
||
::
|
||
|
||
# a=1
|
||
var a = absi(-1)
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_acos:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **acos**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_acos>`
|
||
|
||
返回 ``x`` 的反余弦,单位为弧度。用来获取余弦 ``x`` 的角度。\ ``x`` 会被钳制在 ``-1.0`` 和 ``1.0``\ (包括)之间,因此 :ref:`acos()<class_@GlobalScope_method_acos>` 不会返回 :ref:`@GDScript.NAN<class_@GDScript_constant_NAN>`\ 。
|
||
|
||
::
|
||
|
||
# 如果用 rad_to_deg(c) 转换,c为0.523599或30度
|
||
var c = acos(0.866025)
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_acosh:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **acosh**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_acosh>`
|
||
|
||
返回 ``x`` 的反双曲余弦值,返回值为弧度。使用它来获取在双曲空间中,如果 ``x`` 大于或等于 1,角的余弦的角度。对于 ``x`` 小于 1 的值,将返回 0,以防止 :ref:`acosh()<class_@GlobalScope_method_acosh>` 返回 :ref:`@GDScript.NAN<class_@GDScript_constant_NAN>`\ 。
|
||
|
||
::
|
||
|
||
var a = acosh(2) # 返回 1.31695789692482
|
||
cosh(a) # 返回 2
|
||
|
||
var b = acosh(-1) # 返回 0
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_angle_difference:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **angle_difference**\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_angle_difference>`
|
||
|
||
返回两个角度之间的差(单位为弧度),范围为 ``[-PI, +PI]`` 。当 ``from`` 和 ``to`` 相反时,如果 ``from`` 小于 ``to``\ ,则返回 ``-PI`` ,否则返回 ``PI`` 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_asin:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **asin**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_asin>`
|
||
|
||
返回 ``x`` 的反正弦值,单位为弧度。用来获取正弦 ``x`` 的角度。\ ``x`` 会被钳制在 ``-1.0`` 和 ``1.0``\ (包括)之间,因此 :ref:`asin()<class_@GlobalScope_method_asin>` 不会返回 :ref:`@GDScript.NAN<class_@GDScript_constant_NAN>`\ 。
|
||
|
||
::
|
||
|
||
# 如果用 rad_to_deg(s) 转换,s为0.523599或30度
|
||
var s = asin(0.5)
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_asinh:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **asinh**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_asinh>`
|
||
|
||
返回 ``x`` 的反双曲正弦值,返回值为弧度。使用它来获取在双曲空间中,角的正弦角度。
|
||
|
||
::
|
||
|
||
var a = asinh(0.9) # 返回 0.8088669356527824
|
||
sinh(a) # 返回 0.9
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_atan:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **atan**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_atan>`
|
||
|
||
返回 ``x`` 的反正切值,单位为弧度。在三角函数中用它来得到一个角上切线的角度。
|
||
|
||
该方法无法确定角度应该落在哪个象限。如果你同时拥有 ``y`` 和 ``x``\ ,请参见 :ref:`atan2()<class_@GlobalScope_method_atan2>`\ 。
|
||
|
||
::
|
||
|
||
var a = atan(0.5) # a=0.463648
|
||
|
||
如果 ``x`` 在 ``-PI/2`` 和 ``PI/2``\ (包括)之间,\ ``atan(tan(x))`` 等于 ``x``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_atan2:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **atan2**\ (\ y\: :ref:`float<class_float>`, x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_atan2>`
|
||
|
||
返回 ``y/x`` 的反正切值,单位为弧度。用来获得正切值为 ``y/x`` 的角度。为了计算该值,该方法考虑了两个参数的符号,以确定象限。
|
||
|
||
重要提示:按照惯例,Y 坐标在前。
|
||
|
||
::
|
||
|
||
var a = atan2(0, -1) # a = 3.141593
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_atanh:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **atanh**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_atanh>`
|
||
|
||
返回 ``x`` 的反双曲正切值,返回值为弧度。如果 ``x`` 在 -1 和 1 之间(不包括 -1 和 1),则使用它从双曲空间中的角度的正切值获取角度。
|
||
|
||
在数学中,只有在实数集中,-1 < ``x`` < 1 的情况下,双曲反正切才有意义。因此,为了预防 :ref:`atanh()<class_@GlobalScope_method_atanh>` 返回 :ref:`@GDScript.NAN<class_@GDScript_constant_NAN>`\ ,对于 ``x`` 等于或小于 -1 的值,返回负的 :ref:`@GDScript.NAN<class_@GDScript_constant_NAN>`\ ;对于 ``x``\ 等于或大于 1 的值,返回正的 :ref:`@GDScript.INF<class_@GDScript_constant_INF>`\ 。
|
||
|
||
::
|
||
|
||
var a = atanh(0.9) # 返回 1.47221948958322
|
||
tanh(a) # 返回 0.9
|
||
|
||
var b = atanh(-2) # 返回 -inf
|
||
tanh(b) # 返回 -1
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_bezier_derivative:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **bezier_derivative**\ (\ start\: :ref:`float<class_float>`, control_1\: :ref:`float<class_float>`, control_2\: :ref:`float<class_float>`, end\: :ref:`float<class_float>`, t\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_bezier_derivative>`
|
||
|
||
返回由给定的 ``control_1``\ 、\ ``control_2`` 和 ``end`` 点定义的一维\ `贝塞尔曲线 <https://en.wikipedia.org/wiki/B%C3%A9zier_curve>`__\ 上 ``t`` 处的导数。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_bezier_interpolate:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **bezier_interpolate**\ (\ start\: :ref:`float<class_float>`, control_1\: :ref:`float<class_float>`, control_2\: :ref:`float<class_float>`, end\: :ref:`float<class_float>`, t\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_bezier_interpolate>`
|
||
|
||
返回由给定的 ``control_1``\ 、\ ``control_2`` 和 ``end`` 点定义的一维\ `贝塞尔曲线 <https://en.wikipedia.org/wiki/B%C3%A9zier_curve>`__\ 上位于给定 ``t`` 的点。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_bytes_to_var:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **bytes_to_var**\ (\ bytes\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_@GlobalScope_method_bytes_to_var>`
|
||
|
||
将字节数组解码回 :ref:`Variant<class_Variant>` 值,无法解码对象。
|
||
|
||
\ **注意:**\ 如果需要对象反序列化,请参见 :ref:`bytes_to_var_with_objects()<class_@GlobalScope_method_bytes_to_var_with_objects>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_bytes_to_var_with_objects:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **bytes_to_var_with_objects**\ (\ bytes\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_@GlobalScope_method_bytes_to_var_with_objects>`
|
||
|
||
将字节数组解码回 :ref:`Variant<class_Variant>` 值。允许解码对象。
|
||
|
||
\ **警告:**\ 反序列化的对象可能包含执行的代码。如果序列化对象的来源不受信任,则不要使用此选项,以避免潜在的安全威胁(远程执行代码)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_ceil:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **ceil**\ (\ x\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_ceil>`
|
||
|
||
向上舍入 ``x``\ (朝正无穷大方向),返回不小于 ``x`` 的最小整数。支持的类型:\ :ref:`int<class_int>`\ 、\ :ref:`float<class_float>`\ 、\ :ref:`Vector2<class_Vector2>`\ 、\ :ref:`Vector2i<class_Vector2i>`\ 、\ :ref:`Vector3<class_Vector3>`\ 、\ :ref:`Vector3i<class_Vector3i>`\ 、\ :ref:`Vector4<class_Vector4>`\ 、\ :ref:`Vector4i<class_Vector4i>`\ 。
|
||
|
||
::
|
||
|
||
var i = ceil(1.45) # i 为 2.0
|
||
i = ceil(1.001) # i 为 2.0
|
||
|
||
另见 :ref:`floor()<class_@GlobalScope_method_floor>`\ 、\ :ref:`round()<class_@GlobalScope_method_round>`\ 、\ :ref:`snapped()<class_@GlobalScope_method_snapped>`\ 。
|
||
|
||
\ **注意:**\ 为了更好的类型安全,使用 :ref:`ceilf()<class_@GlobalScope_method_ceilf>`\ 、\ :ref:`ceili()<class_@GlobalScope_method_ceili>`\ 、\ :ref:`Vector2.ceil()<class_Vector2_method_ceil>`\ 、\ :ref:`Vector3.ceil()<class_Vector3_method_ceil>` 或 :ref:`Vector4.ceil()<class_Vector4_method_ceil>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_ceilf:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **ceilf**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_ceilf>`
|
||
|
||
向上舍入 ``x``\ (朝正无穷大),返回不小于 ``x`` 的最小整数。
|
||
|
||
\ :ref:`ceil()<class_@GlobalScope_method_ceil>` 的类型安全版本,返回一个 :ref:`float<class_float>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_ceili:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **ceili**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_ceili>`
|
||
|
||
向上舍入 ``x``\ (朝正无穷大),返回不小于 ``x`` 的最小整数。
|
||
|
||
\ :ref:`ceil()<class_@GlobalScope_method_ceil>` 的类型安全版本,返回一个 :ref:`int<class_int>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_clamp:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **clamp**\ (\ value\: :ref:`Variant<class_Variant>`, min\: :ref:`Variant<class_Variant>`, max\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_clamp>`
|
||
|
||
钳制 ``value``\ ,返回不小于 ``min`` 且不大于 ``max`` 的 :ref:`Variant<class_Variant>`\ 。任何能够用小于和大于运算符进行比较的值都能工作。
|
||
|
||
::
|
||
|
||
var a = clamp(-10, -1, 5)
|
||
# a 是 -1
|
||
|
||
var b = clamp(8.1, 0.9, 5.5)
|
||
# b 是 5.5
|
||
|
||
\ **注意:**\ 为了更好的类型安全,请使用 :ref:`clampf()<class_@GlobalScope_method_clampf>`\ 、\ :ref:`clampi()<class_@GlobalScope_method_clampi>`\ 、\ :ref:`Vector2.clamp()<class_Vector2_method_clamp>`\ 、\ :ref:`Vector2i.clamp()<class_Vector2i_method_clamp>`\ 、\ :ref:`Vector3.clamp()<class_Vector3_method_clamp>`\ 、\ :ref:`Vector3i.clamp()<class_Vector3i_method_clamp>`\ 、\ :ref:`Vector4.clamp()<class_Vector4_method_clamp>`\ 、\ :ref:`Vector4i.clamp()<class_Vector4i_method_clamp>` 或 :ref:`Color.clamp()<class_Color_method_clamp>`\ (该方法当前不受支持)。
|
||
|
||
\ **注意:**\ 当在向量上使用该函数时,它\ *不*\ 会执行逐分量钳制,并且如果 ``value < min`` 则结果为 ``min``\ ,如果 ``value > max`` 则为 ``max``\ 。要执行逐分量钳制,请使用上面列出的方法。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_clampf:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **clampf**\ (\ value\: :ref:`float<class_float>`, min\: :ref:`float<class_float>`, max\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_clampf>`
|
||
|
||
钳制 ``value``\ ,返回不小于 ``min`` 且不大于 ``max`` 的 :ref:`float<class_float>`\ 。
|
||
|
||
::
|
||
|
||
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
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_clampi:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **clampi**\ (\ value\: :ref:`int<class_int>`, min\: :ref:`int<class_int>`, max\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_clampi>`
|
||
|
||
钳制 ``value``\ ,返回不小于 ``min`` 且不大于 ``max`` 的 :ref:`int<class_int>`\ 。
|
||
|
||
::
|
||
|
||
var speed = 42
|
||
var a = clampi(speed, 1, 20) # a 是 20
|
||
|
||
speed = -10
|
||
var b = clampi(speed, -1, 1) # b 是 -1
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_cos:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **cos**\ (\ angle_rad\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_cos>`
|
||
|
||
返回弧度角为 ``angle_rad`` 的余弦值。
|
||
|
||
::
|
||
|
||
cos(PI * 2) # 返回 1.0
|
||
cos(PI) # 返回 -1.0
|
||
cos(deg_to_rad(90)) # 返回 0.0
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_cosh:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **cosh**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_cosh>`
|
||
|
||
返回弧度角 ``x`` 的双曲余弦值。
|
||
|
||
::
|
||
|
||
print(cosh(1)) # 打印 1.543081
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_cubic_interpolate:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **cubic_interpolate**\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, pre\: :ref:`float<class_float>`, post\: :ref:`float<class_float>`, weight\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_cubic_interpolate>`
|
||
|
||
根据 ``weight`` 定义的系数,以及 ``pre`` 和 ``post`` 值,在两个值之间进行三次插值。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_cubic_interpolate_angle:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **cubic_interpolate_angle**\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, pre\: :ref:`float<class_float>`, post\: :ref:`float<class_float>`, weight\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_cubic_interpolate_angle>`
|
||
|
||
根据 ``weight`` 定义的系数,以及 ``pre`` 和 ``post`` 值,在两个旋转值之间的最短路径进行三次插值 。另见 :ref:`lerp_angle()<class_@GlobalScope_method_lerp_angle>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_cubic_interpolate_angle_in_time:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **cubic_interpolate_angle_in_time**\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, pre\: :ref:`float<class_float>`, post\: :ref:`float<class_float>`, weight\: :ref:`float<class_float>`, to_t\: :ref:`float<class_float>`, pre_t\: :ref:`float<class_float>`, post_t\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_cubic_interpolate_angle_in_time>`
|
||
|
||
根据 ``weight`` 定义的系数,以及 ``pre`` 和 ``post`` 值,在两个旋转值之间的最短路径进行三次插值。另见 :ref:`lerp_angle()<class_@GlobalScope_method_lerp_angle>`\ 。
|
||
|
||
它可以根据时间值执行比 :ref:`cubic_interpolate()<class_@GlobalScope_method_cubic_interpolate>` 更平滑的插值。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_cubic_interpolate_in_time:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **cubic_interpolate_in_time**\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, pre\: :ref:`float<class_float>`, post\: :ref:`float<class_float>`, weight\: :ref:`float<class_float>`, to_t\: :ref:`float<class_float>`, pre_t\: :ref:`float<class_float>`, post_t\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_cubic_interpolate_in_time>`
|
||
|
||
根据 ``weight`` 定义的系数,以及 ``pre`` 和 ``post`` 值,在两个值之间进行三次插值。
|
||
|
||
它可以根据时间值执行比 :ref:`cubic_interpolate()<class_@GlobalScope_method_cubic_interpolate>` 更平滑的插值。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_db_to_linear:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **db_to_linear**\ (\ db\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_db_to_linear>`
|
||
|
||
将分贝值转换为线性能量(音频)值。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_deg_to_rad:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **deg_to_rad**\ (\ deg\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_deg_to_rad>`
|
||
|
||
将角度值转换为弧度值。
|
||
|
||
::
|
||
|
||
var r = deg_to_rad(180) # r 是 3.141593
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_ease:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **ease**\ (\ x\: :ref:`float<class_float>`, curve\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_ease>`
|
||
|
||
基于用 ``curve`` 定义的缓动函数返回 ``x`` “缓动后”的值,该缓动函数是基于指数的缓动。\ ``curve`` 可以是任意浮点数,具体数值会导致以下行为:
|
||
|
||
.. code:: text
|
||
|
||
- 低于 -1.0(开区间):缓入缓出
|
||
- -1.0:线性
|
||
- 在 -1.0 和 0.0 之间(开区间):缓出缓入
|
||
- 0.0:恒定
|
||
- 在 0.0 到 1.0 之间(开区间):缓出
|
||
- 1.0:线性
|
||
- 大于 1.0(开区间):缓入
|
||
|
||
\ `ease() 曲线值速查表 <https://raw.githubusercontent.com/godotengine/godot-docs/master/img/ease_cheatsheet.png>`__\
|
||
|
||
另见 :ref:`smoothstep()<class_@GlobalScope_method_smoothstep>`\ 。如果你需要执行更高级的过渡,请使用 :ref:`Tween.interpolate_value()<class_Tween_method_interpolate_value>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_error_string:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **error_string**\ (\ error\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_error_string>`
|
||
|
||
为给定的 :ref:`Error<enum_@GlobalScope_Error>` 代码返回一个人类可读的名称。
|
||
|
||
::
|
||
|
||
print(OK) # 输出 0
|
||
print(error_string(OK)) # 输出“OK”
|
||
print(error_string(ERR_BUSY)) # 输出“Busy”
|
||
print(error_string(ERR_OUT_OF_MEMORY)) # 输出“Out of memory”
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_exp:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **exp**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_exp>`
|
||
|
||
自然指数函数。计算数学常数 *e* 的 ``x`` 次方并返回它。
|
||
|
||
\ *e* 的近似值为 2.71828,可以使用 ``exp(1)`` 获得。
|
||
|
||
求其他底数的指数应使用 :ref:`pow()<class_@GlobalScope_method_pow>` 方法。
|
||
|
||
::
|
||
|
||
var a = exp(2) # 大约是 7.39
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_floor:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **floor**\ (\ x\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_floor>`
|
||
|
||
向下舍入 ``x``\ (朝负无穷大),返回不大于 ``x`` 的最大整数。支持的类型:\ :ref:`int<class_int>`\ 、\ :ref:`float<class_float>`\ 、\ :ref:`Vector2<class_Vector2>`\ 、\ :ref:`Vector2i<class_Vector2i>`\ 、\ :ref:`Vector3<class_Vector3>`\ 、\ :ref:`Vector3i<class_Vector3i>`\ 、\ :ref:`Vector4<class_Vector4>`\ 、\ :ref:`Vector4i<class_Vector4i>`\ 。
|
||
|
||
::
|
||
|
||
var a = floor(2.99) # a 为 2.0
|
||
a = floor(-2.99) # a 为 -3.0
|
||
|
||
另见 :ref:`ceil()<class_@GlobalScope_method_ceil>`\ 、\ :ref:`round()<class_@GlobalScope_method_round>`\ 、\ :ref:`snapped()<class_@GlobalScope_method_snapped>`\ 。
|
||
|
||
\ **注意:**\ 为了更好的类型安全,请使用 :ref:`floorf()<class_@GlobalScope_method_floorf>`\ 、\ :ref:`floori()<class_@GlobalScope_method_floori>`\ 、\ :ref:`Vector2.floor()<class_Vector2_method_floor>`\ 、\ :ref:`Vector3.floor()<class_Vector3_method_floor>` 或 :ref:`Vector4.floor()<class_Vector4_method_floor>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_floorf:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **floorf**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_floorf>`
|
||
|
||
将 ``x`` 向下舍入(向负无穷大),返回不超过 ``x`` 的最大整数。
|
||
|
||
一个类型安全的 :ref:`floor()<class_@GlobalScope_method_floor>` 版本,返回一个 :ref:`float<class_float>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_floori:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **floori**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_floori>`
|
||
|
||
将 ``x`` 向下舍入(向负无穷大),返回不超过 ``x`` 的最大整数。
|
||
|
||
是 :ref:`floor()<class_@GlobalScope_method_floor>` 的类型安全版本,返回一个 :ref:`int<class_int>`\ 。
|
||
|
||
\ **注意:**\ 这个函数与 ``int(x)`` *不* 一样,后者是向 0 取整。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_fmod:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **fmod**\ (\ x\: :ref:`float<class_float>`, y\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_fmod>`
|
||
|
||
返回 ``x`` 除以 ``y`` 的浮点型余数,符号与 ``x``\ 一致。
|
||
|
||
::
|
||
|
||
var remainder = fmod(7, 5.5) # remainder 是 1.5
|
||
|
||
对于整数取余运算,请使用 ``%`` 运算符。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_fposmod:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **fposmod**\ (\ x\: :ref:`float<class_float>`, y\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_fposmod>`
|
||
|
||
返回 ``x`` 除以 ``y`` 的浮点模数,对正负数进行一致的循环。
|
||
|
||
::
|
||
|
||
print(" (x) (fmod(x, 1.5)) (fposmod(x, 1.5))")
|
||
for i in 7:
|
||
var x = i * 0.5 - 1.5
|
||
print("%4.1f %4.1f | %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)])
|
||
|
||
输出:
|
||
|
||
.. code:: text
|
||
|
||
(x) (fmod(x, 1.5)) (fposmod(x, 1.5))
|
||
-1.5 -0.0 | 0.0
|
||
-1.0 -1.0 | 0.5
|
||
-0.5 -0.5 | 1.0
|
||
0.0 0.0 | 0.0
|
||
0.5 0.5 | 0.5
|
||
1.0 1.0 | 1.0
|
||
1.5 0.0 | 0.0
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_hash:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **hash**\ (\ variable\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_hash>`
|
||
|
||
返回传入的 ``variable`` 的整数哈希值。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
print(hash("a")) # 输出 177670
|
||
|
||
.. code-tab:: csharp
|
||
|
||
GD.Print(GD.Hash("a")); // 输出 177670
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_instance_from_id:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Object<class_Object>` **instance_from_id**\ (\ instance_id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_instance_from_id>`
|
||
|
||
返回实例 ID ``instance_id`` 所对应的 :ref:`Object<class_Object>`\ 。所有对象都有唯一实例 ID。另见 :ref:`Object.get_instance_id()<class_Object_method_get_instance_id>`\ 。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
var drink = "water"
|
||
|
||
func _ready():
|
||
var id = get_instance_id()
|
||
var instance = instance_from_id(id)
|
||
print(instance.foo) # 输出“water”
|
||
|
||
.. code-tab:: csharp
|
||
|
||
public partial class MyNode : Node
|
||
{
|
||
public string Drink { get; set; } = "water";
|
||
|
||
public override void _Ready()
|
||
{
|
||
ulong id = GetInstanceId();
|
||
var instance = (MyNode)InstanceFromId(Id);
|
||
GD.Print(instance.Drink); // 输出“water”
|
||
}
|
||
}
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_inverse_lerp:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **inverse_lerp**\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, weight\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_inverse_lerp>`
|
||
|
||
返回插值或外推的因子。范围用 ``from`` 和 ``to``\ 指定,插值后的值由 ``weight`` 指定。如果 ``weight`` 在 ``from`` 和 ``to`` 之间(包含),那么返回的值在 ``0.0`` 和 ``1.0`` 之间。如果 ``weight`` 在该范围之外,则返回的是外推因子(返回值小于 ``0.0`` 或大于 ``1.0``\ )。如果不希望这样,请对 :ref:`inverse_lerp()<class_@GlobalScope_method_inverse_lerp>` 的结果使用 :ref:`clamp()<class_@GlobalScope_method_clamp>`\ 。
|
||
|
||
::
|
||
|
||
# 下面的 `lerp()` 调用时的插值比例是 0.75。
|
||
var middle = lerp(20, 30, 0.75)
|
||
# middle 现在是 27.5。
|
||
|
||
# 现在,我们假装忘记了原来的比例,想要找到是多少。
|
||
var ratio = inverse_lerp(20, 30, 27.5)
|
||
# ratio 现在是 0.75。
|
||
|
||
另见 :ref:`lerp()<class_@GlobalScope_method_lerp>`\ ,它执行本操作的逆操作;以及 :ref:`remap()<class_@GlobalScope_method_remap>`\ ,将一系列连续的值映射到另一个值。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_is_equal_approx:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_equal_approx**\ (\ a\: :ref:`float<class_float>`, b\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_is_equal_approx>`
|
||
|
||
如果 ``a`` 和 ``b`` 彼此近似相等,则返回 ``true``\ 。
|
||
|
||
这里,“近似相等”意味着 ``a`` 和 ``b`` 在彼此的一个小的内部 epsilon 内,该 epsilon 与数字的大小成比例。
|
||
|
||
相同符号的无穷大值被认为是相等的。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_is_finite:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
: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>`\ 、正无穷大或负无穷大。另见 :ref:`is_inf()<class_@GlobalScope_method_is_inf>` 和 :ref:`is_nan()<class_@GlobalScope_method_is_nan>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_is_inf:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_inf**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_is_inf>`
|
||
|
||
如果 ``x`` 是正无穷大或负无穷大,则返回 ``true`` 。另见 :ref:`is_finite()<class_@GlobalScope_method_is_finite>` 和 :ref:`is_nan()<class_@GlobalScope_method_is_nan>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_is_instance_id_valid:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_instance_id_valid**\ (\ id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_is_instance_id_valid>`
|
||
|
||
如果与 ``id`` 对应的 Object 是有效的对象(例如没有从内存中删除),则返回 ``true`` 。所有对象都有唯一的实例 ID。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_is_instance_valid:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_instance_valid**\ (\ instance\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_is_instance_valid>`
|
||
|
||
如果 ``instance`` 是有效的 Object(例如,没有从内存中删除),则返回 ``true`` 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_is_nan:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_nan**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_is_nan>`
|
||
|
||
如果 ``x`` 为 NaN 值(“Not a Number”,不是数字,即无效值),则返回 ``true``\ 。存在的该方法必要性在于 :ref:`@GDScript.NAN<class_@GDScript_constant_NAN>` 与自身不相等,即无法使用 ``x == NAN`` 来判断是否为 NaN。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_is_same:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_same**\ (\ a\: :ref:`Variant<class_Variant>`, b\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_is_same>`
|
||
|
||
当 ``a`` 和 ``b`` 为值类型时,如果他们相同,那么返回 ``true``\ 。当 ``a`` 和 ``b`` 为引用类型时,如果它们的引用对象相同,那么返回 ``true``\ 。
|
||
|
||
::
|
||
|
||
# Vector2 是值类型
|
||
var vec2_a = Vector2(0, 0)
|
||
var vec2_b = Vector2(0, 0)
|
||
var vec2_c = Vector2(1, 1)
|
||
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 = []
|
||
is_same(arr_a, arr_a) # true
|
||
is_same(arr_a, arr_b) # false
|
||
|
||
值类型的 :ref:`Variant<class_Variant>` 有:\ ``null``\ 、\ :ref:`bool<class_bool>`\ 、\ :ref:`int<class_int>`\ 、\ :ref:`float<class_float>`\ 、\ :ref:`String<class_String>`\ 、\ :ref:`StringName<class_StringName>`\ 、\ :ref:`Vector2<class_Vector2>`\ 、\ :ref:`Vector2i<class_Vector2i>`\ 、\ :ref:`Vector3<class_Vector3>`\ 、\ :ref:`Vector3i<class_Vector3i>`\ 、\ :ref:`Vector4<class_Vector4>`\ 、\ :ref:`Vector4i<class_Vector4i>`\ 、\ :ref:`Rect2<class_Rect2>`\ 、\ :ref:`Rect2i<class_Rect2i>`\ 、\ :ref:`Transform2D<class_Transform2D>`\ 、\ :ref:`Transform3D<class_Transform3D>`\ 、\ :ref:`Plane<class_Plane>`\ 、\ :ref:`Quaternion<class_Quaternion>`\ 、\ :ref:`AABB<class_AABB>`\ 、\ :ref:`Basis<class_Basis>`\ 、\ :ref:`Projection<class_Projection>`\ 、\ :ref:`Color<class_Color>`\ 、\ :ref:`NodePath<class_NodePath>`\ 、\ :ref:`RID<class_RID>`\ 、\ :ref:`Callable<class_Callable>` 和 :ref:`Signal<class_Signal>`\ 。
|
||
|
||
引用类型的 :ref:`Variant<class_Variant>` 有:\ :ref:`Object<class_Object>`\ 、\ :ref:`Dictionary<class_Dictionary>`\ 、\ :ref:`Array<class_Array>`\ 、\ :ref:`PackedByteArray<class_PackedByteArray>`\ 、\ :ref:`PackedInt32Array<class_PackedInt32Array>`\ 、\ :ref:`PackedInt64Array<class_PackedInt64Array>`\ 、\ :ref:`PackedFloat32Array<class_PackedFloat32Array>`\ 、\ :ref:`PackedFloat64Array<class_PackedFloat64Array>`\ 、\ :ref:`PackedStringArray<class_PackedStringArray>`\ 、\ :ref:`PackedVector2Array<class_PackedVector2Array>`\ 、\ :ref:`PackedVector3Array<class_PackedVector3Array>`\ 、\ :ref:`PackedVector4Array<class_PackedVector4Array>` 和 :ref:`PackedColorArray<class_PackedColorArray>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_is_zero_approx:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_zero_approx**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_is_zero_approx>`
|
||
|
||
如果 ``x`` 为零或几乎为零,则返回 ``true``\ 。比较是使用具有小内部 epsilon 的公差计算的。
|
||
|
||
该函数比使用一个值为零的 :ref:`is_equal_approx()<class_@GlobalScope_method_is_equal_approx>` 更快。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_lerp:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **lerp**\ (\ from\: :ref:`Variant<class_Variant>`, to\: :ref:`Variant<class_Variant>`, weight\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_lerp>`
|
||
|
||
通过 ``weight`` 中定义的因子在两个值之间进行线性插值。要执行插值,\ ``weight`` 应介于 ``0.0`` 和 ``1.0`` 之间(包含)。但是,超出此范围的值也是允许的,并可用于执行\ *外推*\ 。如果不需要,请在使用 :ref:`clampf()<class_@GlobalScope_method_clampf>` 限制 ``weight``\ 。
|
||
|
||
\ ``from`` 和 ``to`` 必须是同一类型。支持的类型:\ :ref:`int<class_int>`\ 、\ :ref:`float<class_float>`\ 、\ :ref:`Vector2<class_Vector2>`\ 、\ :ref:`Vector3<class_Vector3>`\ 、\ :ref:`Vector4<class_Vector4>`\ 、\ :ref:`Color<class_Color>`\ 、\ :ref:`Quaternion<class_Quaternion>`\ 、\ :ref:`Basis<class_Basis>`\ 、\ :ref:`Transform2D<class_Transform2D>`\ 、\ :ref:`Transform3D<class_Transform3D>`\ 。
|
||
|
||
::
|
||
|
||
lerp(0, 4, 0.75) # 返回 3.0
|
||
|
||
另见执行本操作的逆操作的 :ref:`inverse_lerp()<class_@GlobalScope_method_inverse_lerp>`\ 。要使用 :ref:`lerp()<class_@GlobalScope_method_lerp>` 执行缓动插值,请将其与 :ref:`ease()<class_@GlobalScope_method_ease>` 或 :ref:`smoothstep()<class_@GlobalScope_method_smoothstep>` 结合使用。另见 :ref:`remap()<class_@GlobalScope_method_remap>`\ ,可将一系列连续的值映射到另一个值。
|
||
|
||
\ **注意:**\ 为了更好的类型安全,请使用 :ref:`lerpf()<class_@GlobalScope_method_lerpf>`\ 、\ :ref:`Vector2.lerp()<class_Vector2_method_lerp>`\ 、\ :ref:`Vector3.lerp()<class_Vector3_method_lerp>`\ 、\ :ref:`Vector4.lerp()<class_Vector4_method_lerp>`\ 、\ :ref:`Color.lerp()<class_Color_method_lerp>`\ 、\ :ref:`Quaternion.slerp()<class_Quaternion_method_slerp>`\ 、\ :ref:`Basis.slerp()<class_Basis_method_slerp>`\ 、\ :ref:`Transform2D.interpolate_with()<class_Transform2D_method_interpolate_with>` 或 :ref:`Transform3D.interpolate_with()<class_Transform3D_method_interpolate_with>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_lerp_angle:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **lerp_angle**\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, weight\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_lerp_angle>`
|
||
|
||
通过 0.0 和 1.0 之间的 ``weight`` 值,在两个角度(以弧度为单位)之间进行线性插值。
|
||
|
||
类似于 :ref:`lerp()<class_@GlobalScope_method_lerp>`\ ,但当角度环绕 :ref:`@GDScript.TAU<class_@GDScript_constant_TAU>` 时会正确插值。要使用 :ref:`lerp_angle()<class_@GlobalScope_method_lerp_angle>` 执行缓动插值,请将其与 :ref:`ease()<class_@GlobalScope_method_ease>` 或 :ref:`smoothstep()<class_@GlobalScope_method_smoothstep>` 结合使用。
|
||
|
||
::
|
||
|
||
extends Sprite
|
||
var elapsed = 0.0
|
||
func _process(delta):
|
||
var min_angle = deg_to_rad(0.0)
|
||
var max_angle = deg_to_rad(90.0)
|
||
rotation = lerp_angle(min_angle, max_angle, elapsed)
|
||
elapsed += delta
|
||
|
||
\ **注意:**\ 该函数通过 ``from`` 和 ``to`` 之间的最短路径进行插值。然而,当这两个角度相距大致 ``PI + k * TAU`` 其中 ``k`` 为任意整数时,由于浮点数精度误差的缘故,要对插值的方向进行判断是很难的。例如,\ ``lerp_angle(0, PI, weight)`` 会逆时针插值,而 ``lerp_angle(0, PI + 5 * TAU, weight)`` 则会顺时针插值。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_lerpf:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **lerpf**\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, weight\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_lerpf>`
|
||
|
||
通过 ``weight`` 中定义的因子在两个值之间进行线性插值。要执行插值,\ ``weight`` 应介于 ``0.0`` 和 ``1.0`` 之间(包含)。但是,超出此范围的值是允许的,并可用于执行 *外推*\ 。如果不需要,请对此函数的结果使用 :ref:`clampf()<class_@GlobalScope_method_clampf>`\ 。
|
||
|
||
::
|
||
|
||
lerpf(0, 4, 0.75) # 返回 3.0
|
||
|
||
另见执行本操作的逆运算的 :ref:`inverse_lerp()<class_@GlobalScope_method_inverse_lerp>`\ 。要使用 :ref:`lerp()<class_@GlobalScope_method_lerp>` 执行缓动插值,请将其与 :ref:`ease()<class_@GlobalScope_method_ease>` 或 :ref:`smoothstep()<class_@GlobalScope_method_smoothstep>` 结合使用。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_linear_to_db:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **linear_to_db**\ (\ lin\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_linear_to_db>`
|
||
|
||
从线性能量转换为分贝(音频)。由于音量通常不是线性的,可以用于实现符合预期的音量滑块。
|
||
|
||
\ **示例:**\ 通过 :ref:`Slider<class_Slider>` 节点在 ``0.0`` 到 ``1.0`` 的范围内修改 Master 总线的音量:
|
||
|
||
::
|
||
|
||
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), linear_to_db($Slider.value))
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_log:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **log**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_log>`
|
||
|
||
返回 ``x`` 的\ `自然对数 <https://zh.wikipedia.org/zh-cn/%E8%87%AA%E7%84%B6%E5%B0%8D%E6%95%B8>`__\ (底数为 `[i]e[/i] <https://zh.wikipedia.org/zh-cn/E_(%E6%95%B0%E5%AD%A6%E5%B8%B8%E6%95%B0)>`__\ ,\ *e* 约为 2.71828)。这是持续增长到一定程度所需的时间。
|
||
|
||
\ **注意:**\ 这个函数与大多数计算器上的对数“log”函数不同,他们适用的底数是 10。要使用底数为 10 的对数,请使用 ``log(x) / log(10)``\ 。
|
||
|
||
::
|
||
|
||
log(10) # 返回 2.302585
|
||
|
||
\ **注意:**\ ``0`` 的对数返回 ``-inf``\ ,负值返回 ``-nan``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_max:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **max**\ (\ ...\ ) |vararg| :ref:`🔗<class_@GlobalScope_method_max>`
|
||
|
||
返回给定数值中的最大值。该函数可以接受任意数量的参数。
|
||
|
||
::
|
||
|
||
max(1, 7, 3, -6, 5) # 返回 7
|
||
|
||
\ **注意:**\ 对向量使用时\ *不会*\ 针对分量求最大值,选取最大值时只会使用 ``x < y`` 进行比较。要求分量中的最大值,请使用 :ref:`Vector2.min()<class_Vector2_method_min>`\ 、\ :ref:`Vector2i.min()<class_Vector2i_method_min>`\ 、\ :ref:`Vector3.min()<class_Vector3_method_min>`\ 、\ :ref:`Vector3i.min()<class_Vector3i_method_min>`\ 、\ :ref:`Vector4.min()<class_Vector4_method_min>`\ 、\ :ref:`Vector4i.min()<class_Vector4i_method_min>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_maxf:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **maxf**\ (\ a\: :ref:`float<class_float>`, b\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_maxf>`
|
||
|
||
返回两个 :ref:`float<class_float>` 值中的最大值。
|
||
|
||
::
|
||
|
||
maxf(3.6, 24) # 返回 24.0
|
||
maxf(-3.99, -4) # 返回 -3.99
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_maxi:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **maxi**\ (\ a\: :ref:`int<class_int>`, b\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_maxi>`
|
||
|
||
返回两个 :ref:`int<class_int>` 值中的最大值。
|
||
|
||
::
|
||
|
||
maxi(1, 2) # 返回 2
|
||
maxi(-3, -4) # 返回 -3
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_min:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **min**\ (\ ...\ ) |vararg| :ref:`🔗<class_@GlobalScope_method_min>`
|
||
|
||
返回给定数值中的最小值。该函数可以接受任意数量的参数。
|
||
|
||
::
|
||
|
||
min(1, 7, 3, -6, 5) # 返回 -6
|
||
|
||
\ **注意:**\ 对向量使用时\ *不会*\ 针对分量求最小值,选取最小值时只会使用 ``x < y`` 进行比较。要求分量中的最小值,请使用 :ref:`Vector2.min()<class_Vector2_method_min>`\ 、\ :ref:`Vector2i.min()<class_Vector2i_method_min>`\ 、\ :ref:`Vector3.min()<class_Vector3_method_min>`\ 、\ :ref:`Vector3i.min()<class_Vector3i_method_min>`\ 、\ :ref:`Vector4.min()<class_Vector4_method_min>`\ 、\ :ref:`Vector4i.min()<class_Vector4i_method_min>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_minf:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **minf**\ (\ a\: :ref:`float<class_float>`, b\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_minf>`
|
||
|
||
返回两个 :ref:`float<class_float>` 值中的最小值。
|
||
|
||
::
|
||
|
||
minf(3.6, 24) # 返回 3.6
|
||
minf(-3.99, -4) # 返回 -4.0
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_mini:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **mini**\ (\ a\: :ref:`int<class_int>`, b\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_mini>`
|
||
|
||
返回两个 :ref:`int<class_int>` 值中的最小值。
|
||
|
||
::
|
||
|
||
mini(1, 2) # 返回 1
|
||
mini(-3, -4) # 返回 -4
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_move_toward:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **move_toward**\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, delta\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_move_toward>`
|
||
|
||
将 ``from`` 向 ``to`` 移动,移动的长度是 ``delta``\ 。不会超过 ``to``\ 。
|
||
|
||
使用负的 ``delta`` 值则向远离的方向移动。
|
||
|
||
::
|
||
|
||
move_toward(5, 10, 4) # Returns 9
|
||
move_toward(10, 5, 4) # Returns 6
|
||
move_toward(5, 10, 9) # Returns 10
|
||
move_toward(10, 5, -1.5) # Returns 11.5
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_nearest_po2:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **nearest_po2**\ (\ value\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_nearest_po2>`
|
||
|
||
返回大于等于 ``value`` 的最小的 2 的幂。
|
||
|
||
::
|
||
|
||
nearest_po2(3) # 返回 4
|
||
nearest_po2(4) # 返回 4
|
||
nearest_po2(5) # 返回 8
|
||
|
||
nearest_po2(0) # 返回 0(可能出乎意料)
|
||
nearest_po2(-1) # 返回 0(可能出乎意料)
|
||
|
||
\ **警告:**\ 由于其实现方式,该函数会对小于等于 ``0`` 的值返回 ``0`` 而不是 ``1``\ ,例外是 ``value`` 为最小的负 64 位整数(\ ``-9223372036854775808``\ )时,会将 ``value`` 原样返回。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_pingpong:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **pingpong**\ (\ value\: :ref:`float<class_float>`, length\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_pingpong>`
|
||
|
||
将 ``value`` 包裹在 ``0`` 和 ``length`` 之间。如果达到限制,函数返回的下一个值将减少到 ``0`` 侧或增加到 ``length`` 侧(像三角波)。如果 ``length`` 小于零,则变为正数。
|
||
|
||
::
|
||
|
||
pingpong(-3.0, 3.0) # 返回 3.0
|
||
pingpong(-2.0, 3.0) # 返回 2.0
|
||
pingpong(-1.0, 3.0) # 返回 1.0
|
||
pingpong(0.0, 3.0) # 返回 0.0
|
||
pingpong(1.0, 3.0) # 返回 1.0
|
||
pingpong(2.0, 3.0) # 返回 2.0
|
||
pingpong(3.0, 3.0) # 返回 3.0
|
||
pingpong(4.0, 3.0) # 返回 2.0
|
||
pingpong(5.0, 3.0) # 返回 1.0
|
||
pingpong(6.0, 3.0) # 返回 0.0
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_posmod:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **posmod**\ (\ x\: :ref:`int<class_int>`, y\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_posmod>`
|
||
|
||
返回 ``x`` 除以 ``y`` 的整数模数,对正负数进行一致的循环。
|
||
|
||
::
|
||
|
||
print("#(i) (i % 3) (posmod(i, 3))")
|
||
for i in range(-3, 4):
|
||
print("%2d %2d | %2d" % [i, i % 3, posmod(i, 3)])
|
||
|
||
结果:
|
||
|
||
.. code:: text
|
||
|
||
(i) (i % 3) (posmod(i, 3))
|
||
-3 0 | 0
|
||
-2 -2 | 1
|
||
-1 -1 | 2
|
||
0 0 | 0
|
||
1 1 | 1
|
||
2 2 | 2
|
||
3 0 | 0
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_pow:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **pow**\ (\ base\: :ref:`float<class_float>`, exp\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_pow>`
|
||
|
||
返回 ``base`` 的 ``exp`` 次幂的结果。
|
||
|
||
在 GDScript 中,这相当于 ``**`` 运算符。
|
||
|
||
::
|
||
|
||
pow(2, 5) # 返回 32.0
|
||
pow(4, 1.5) # 返回 8.0
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_print:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **print**\ (\ ...\ ) |vararg| :ref:`🔗<class_@GlobalScope_method_print>`
|
||
|
||
以尽可能最佳的方式将一个或多个任意类型的参数转换为字符串,并将其打印到控制台。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
var a = [1, 2, 3]
|
||
print("a", "b", a) # 输出“ab[1, 2, 3]”
|
||
|
||
.. code-tab:: csharp
|
||
|
||
Godot.Collections.Array a = [1, 2, 3];
|
||
GD.Print("a", "b", a); // 输出“ab[1, 2, 3]”
|
||
|
||
|
||
|
||
\ **注意:**\ 请考虑使用 :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>`\ 。这将它们与用于调试目的的打印消息区分开来,同时还会在打印错误或警告时显示堆栈跟踪。另见 :ref:`Engine.print_to_stdout<class_Engine_property_print_to_stdout>` 和 :ref:`ProjectSettings.application/run/disable_stdout<class_ProjectSettings_property_application/run/disable_stdout>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_print_rich:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **print_rich**\ (\ ...\ ) |vararg| :ref:`🔗<class_@GlobalScope_method_print_rich>`
|
||
|
||
以尽可能最佳的方式将一个或多个任意类型的参数转换为字符串,并将其打印到控制台。
|
||
|
||
支持以下 BBCode 标签: ``b``\ 、\ ``i``\ 、\ ``u``\ 、\ ``s``\ 、\ ``indent``\ 、\ ``code``\ 、\ ``url``\ 、\ ``center``\ 、\ ``right``\ 、\ ``color``\ 、\ ``bgcolor``\ 、\ ``fgcolor``\ 。
|
||
|
||
URL 标签仅支持在 URL 标签中包含 URL,不支持使用不同标题的 URL。
|
||
|
||
当打印到标准输出时,支持的 BBCode 子集被转换为 ANSI 转义码以供终端仿真器显示。对 ANSI 转义码的支持可能因终端仿真器而异,尤其是斜体和删除线。在标准输出中,\ ``code`` 会使用较弱的文本表示,但字体不变。不支持的标签在标准输出中会原样保留。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
print_rich("[color=green][b]Hello world![/b][/color]") # 输出“Hello world!”,使用绿色的粗体。
|
||
|
||
.. code-tab:: csharp
|
||
|
||
GD.PrintRich("[color=green][b]Hello world![/b][/color]"); // 输出“Hello world!”,使用绿色的粗体。
|
||
|
||
|
||
|
||
\ **注意:**\ 请考虑使用 :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>`\ 。这将它们与用于调试目的的打印消息区分开来,同时还会在打印错误或警告时显示堆栈跟踪。
|
||
|
||
\ **注意:**\ 在编辑器中显示的输出支持可点击的 ``[url=address]文本[/url]`` 标签。点击时, ``[url]`` 标签的 ``address`` 值由 :ref:`OS.shell_open()<class_OS_method_shell_open>` 处理。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_print_verbose:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **print_verbose**\ (\ ...\ ) |vararg| :ref:`🔗<class_@GlobalScope_method_print_verbose>`
|
||
|
||
如果启用了详细模式(\ :ref:`OS.is_stdout_verbose()<class_OS_method_is_stdout_verbose>` 返回 ``true``\ ),则尽可能以最佳方式将一个或多个任意类型的参数转换为字符串,并将它们打印到控制台。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_printerr:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **printerr**\ (\ ...\ ) |vararg| :ref:`🔗<class_@GlobalScope_method_printerr>`
|
||
|
||
以尽可能最佳的方式将一个或多个参数作为字符串输出到标准错误行。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
printerr("prints to stderr")
|
||
|
||
.. code-tab:: csharp
|
||
|
||
GD.PrintErr("prints to stderr");
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_printraw:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **printraw**\ (\ ...\ ) |vararg| :ref:`🔗<class_@GlobalScope_method_printraw>`
|
||
|
||
以尽可能最佳的方式将一个或多个参数作为字符串输出到操作系统终端。与 :ref:`print()<class_@GlobalScope_method_print>` 不同的是,最后不会自动添加换行符。
|
||
|
||
\ **注意:**\ 操作系统终端与编辑器的“输出”面板\ *不同*\ 。从终端运行 Godot 时可以看到发送至操作系统终端的输出。在 Windows 上,需要用到 ``console.exe`` 可执行文件。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
# 输出“ABC”到终端
|
||
printraw("A")
|
||
printraw("B")
|
||
printraw("C")
|
||
|
||
.. code-tab:: csharp
|
||
|
||
// 输出“ABC”到终端
|
||
GD.PrintRaw("A");
|
||
GD.PrintRaw("B");
|
||
GD.PrintRaw("C");
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_prints:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **prints**\ (\ ...\ ) |vararg| :ref:`🔗<class_@GlobalScope_method_prints>`
|
||
|
||
将一个或多个参数打印到控制台,每个参数之间有一个空格。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
prints("A", "B", "C") # 输出“A B C”
|
||
|
||
.. code-tab:: csharp
|
||
|
||
GD.PrintS("A", "B", "C"); // 输出“A B C”
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_printt:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **printt**\ (\ ...\ ) |vararg| :ref:`🔗<class_@GlobalScope_method_printt>`
|
||
|
||
将一个或多个参数打印到控制台,每个参数之间有一个制表符。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
printt("A", "B", "C") # 输出“A B C”
|
||
|
||
.. code-tab:: csharp
|
||
|
||
GD.PrintT("A", "B", "C"); // 输出“A B C”
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_push_error:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_error**\ (\ ...\ ) |vararg| :ref:`🔗<class_@GlobalScope_method_push_error>`
|
||
|
||
将错误消息推送到 Godot 的内置调试器和操作系统终端。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
push_error("test error") # 向调试器和终端打印“test error”作为错误。
|
||
|
||
.. code-tab:: csharp
|
||
|
||
GD.PushError("test error"); // 向调试器和终端打印“test error”作为错误。
|
||
|
||
|
||
|
||
\ **注意:**\ 该函数不会暂停项目执行。要在调试版本中打印错误消息并暂停项目执行,请改用 ``assert(false, "test error")``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_push_warning:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_warning**\ (\ ...\ ) |vararg| :ref:`🔗<class_@GlobalScope_method_push_warning>`
|
||
|
||
将警告消息推送到 Godot 的内置调试器和操作系统终端。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
push_warning("test warning") # 以警告的形式向调试器和终端输出“test warning”。
|
||
|
||
.. code-tab:: csharp
|
||
|
||
GD.PushWarning("test warning"); // 以警告的形式向调试器和终端输出“test warning”。
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_rad_to_deg:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **rad_to_deg**\ (\ rad\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_rad_to_deg>`
|
||
|
||
将以弧度表示的角度转换为度。
|
||
|
||
::
|
||
|
||
rad_to_deg(0.523599) # 返回 30
|
||
rad_to_deg(PI) # 返回 180
|
||
rad_to_deg(PI * 2) # 返回 360
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_rand_from_seed:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedInt64Array<class_PackedInt64Array>` **rand_from_seed**\ (\ seed\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_rand_from_seed>`
|
||
|
||
给定一个 ``seed``\ ,返回一个大小为 ``2`` 的 :ref:`PackedInt64Array<class_PackedInt64Array>`\ ,其中第一个元素是随机化的 :ref:`int<class_int>` 值,第二个元素与 ``seed`` 相同。传入相同的 ``seed`` 会一致地返回相同的数组。
|
||
|
||
\ **注意:**\ 这里的“种子”是指伪随机数发生器的内部状态,目前实现为一个 64 位整数。
|
||
|
||
::
|
||
|
||
var a = rand_from_seed(4)
|
||
|
||
print(a[0]) # 输出 2879024997
|
||
print(a[1]) # 输出 4
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_randf:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **randf**\ (\ ) :ref:`🔗<class_@GlobalScope_method_randf>`
|
||
|
||
返回 ``0.0`` 和 ``1.0``\ (包含)之间的随机浮点值。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
randf() # 返回示例 0.375671
|
||
|
||
.. code-tab:: csharp
|
||
|
||
GD.Randf(); // 返回示例 0.375671
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_randf_range:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **randf_range**\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_randf_range>`
|
||
|
||
返回 ``from`` 和 ``to``\ (包含)之间的随机浮点值。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
randf_range(0, 20.5) # 返回示例 7.45315
|
||
randf_range(-10, 10) # 返回示例 -3.844535
|
||
|
||
.. code-tab:: csharp
|
||
|
||
GD.RandRange(0.0, 20.5); // 返回示例 7.45315
|
||
GD.RandRange(-10.0, 10.0); // 返回示例 -3.844535
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_randfn:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **randfn**\ (\ mean\: :ref:`float<class_float>`, deviation\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_randfn>`
|
||
|
||
返回一个\ `正态分布 <https://en.wikipedia.org/wiki/Normal_distribution>`__\ 的伪随机数,该正态分布具有指定 ``mean`` 和标准 ``deviation``\ 。这也被称为高斯分布。
|
||
|
||
\ **注意:**\ 该方法使用 `Box-Muller 变换 <https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform>`__\ 算法。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_randi:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **randi**\ (\ ) :ref:`🔗<class_@GlobalScope_method_randi>`
|
||
|
||
返回一个随机的无符号 32 位整数。使用余数获得区间 ``[0, N - 1]`` (其中 N 小于 2^32)的随机值。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
randi() # 返回介于 0 到 2^32 - 1 之间的随机整数
|
||
randi() % 20 # 返回介于 0 到 19之间的随机整数
|
||
randi() % 100 # 返回介于 0 到 99 之间的随机整数
|
||
randi() % 100 + 1 # 返回介于 1 到 100 之间的随机整数
|
||
|
||
.. code-tab:: csharp
|
||
|
||
GD.Randi(); // 返回介于 0 到 2^32 - 1 之间的随机整数
|
||
GD.Randi() % 20; // 返回介于 0 到 19之间的随机整数
|
||
GD.Randi() % 100; // 返回介于 0 到 99 之间的随机整数
|
||
GD.Randi() % 100 + 1; // 返回介于 1 到 100 之间的随机整数
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_randi_range:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **randi_range**\ (\ from\: :ref:`int<class_int>`, to\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_randi_range>`
|
||
|
||
返回介于 ``from`` 和 ``to``\ (包含)之间的一个随机有符号 32 位整数。如果 ``to`` 小于 ``from``\ ,则它们将被交换。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
randi_range(0, 1) # 返回 0 或 1
|
||
randi_range(-10, 1000) # 返回介于 -10 和 1000 之间的随机整数
|
||
|
||
.. code-tab:: csharp
|
||
|
||
GD.RandRange(0, 1); // 返回 0 或 1
|
||
GD.RandRange(-10, 1000); // 返回介于 -10 和 1000 之间的随机整数
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_randomize:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **randomize**\ (\ ) :ref:`🔗<class_@GlobalScope_method_randomize>`
|
||
|
||
随机化随机数发生器的种子(或内部状态)。目前的实现使用一个基于设备时间的数字。
|
||
|
||
\ **注意:**\ 该函数在项目运行时自动被调用。如果需要修复种子以获得一致、可重现的结果,请使用 :ref:`seed()<class_@GlobalScope_method_seed>` 来初始化随机数生成器。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_remap:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **remap**\ (\ value\: :ref:`float<class_float>`, istart\: :ref:`float<class_float>`, istop\: :ref:`float<class_float>`, ostart\: :ref:`float<class_float>`, ostop\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_remap>`
|
||
|
||
将 ``value`` 从范围 ``[istart, istop]`` 映射到 ``[ostart, ostop]``\ 。另见 :ref:`lerp()<class_@GlobalScope_method_lerp>` 和 :ref:`inverse_lerp()<class_@GlobalScope_method_inverse_lerp>`\ 。如果 ``value`` 在 ``[istart, istop]`` 之外,那么结果值也将在 ``[ostart, ostop]`` 之外。如果不希望这样,请对该函数的结果使用 :ref:`clamp()<class_@GlobalScope_method_clamp>`\ 。
|
||
|
||
::
|
||
|
||
remap(75, 0, 100, -1, 1) # 返回 0.5
|
||
|
||
对于需要多个范围的复杂用例,请考虑改用 :ref:`Curve<class_Curve>` 或 :ref:`Gradient<class_Gradient>`\ 。
|
||
|
||
\ **注意:**\ 如果 ``istart == istop``\ ,则返回值未定义(很可能是 NaN、INF 或 -INF)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_rid_allocate_id:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **rid_allocate_id**\ (\ ) :ref:`🔗<class_@GlobalScope_method_rid_allocate_id>`
|
||
|
||
分配一个唯一 ID,实现方可以用它来构造 RID。主要由原生扩展使用,用于实现服务器。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_rid_from_int64:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`RID<class_RID>` **rid_from_int64**\ (\ base\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_rid_from_int64>`
|
||
|
||
从 ``base`` 创建一个 RID。主要由原生扩展使用,用于构建服务器。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_rotate_toward:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **rotate_toward**\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, delta\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_rotate_toward>`
|
||
|
||
将 ``from`` 朝 ``to`` 旋转,旋转的量为 ``delta``\ 。不会越过 ``to``\ 。
|
||
|
||
与 :ref:`move_toward()<class_@GlobalScope_method_move_toward>` 类似,但是能够让夹角正确绕过 :ref:`@GDScript.TAU<class_@GDScript_constant_TAU>`\ 。
|
||
|
||
如果 ``delta`` 为负,则该函数会进行远离 ``to`` 的旋转,朝向相反的角度,但不会越过该角度。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_round:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **round**\ (\ x\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_round>`
|
||
|
||
将 ``x`` 舍入到最接近的整数,中间情况远离 0 舍入。支持的类型:\ :ref:`int<class_int>`\ 、\ :ref:`float<class_float>`\ 、\ :ref:`Vector2<class_Vector2>`\ 、\ :ref:`Vector2i<class_Vector2i>`\ 、\ :ref:`Vector3<class_Vector3>`\ 、\ :ref:`Vector3i<class_Vector3i>`\ 、\ :ref:`Vector4<class_Vector4>`\ 、\ :ref:`Vector4i<class_Vector4i>`\ 。
|
||
|
||
::
|
||
|
||
round(2.4) # 返回 2
|
||
round(2.5) # 返回 3
|
||
round(2.6) # 返回 3
|
||
|
||
另见 :ref:`floor()<class_@GlobalScope_method_floor>`\ 、\ :ref:`ceil()<class_@GlobalScope_method_ceil>`\ 、\ :ref:`snapped()<class_@GlobalScope_method_snapped>`\ 。
|
||
|
||
\ **注意:**\ 为了更好的类型安全,使用 :ref:`roundf()<class_@GlobalScope_method_roundf>`\ 、\ :ref:`roundi()<class_@GlobalScope_method_roundi>`\ 、\ :ref:`Vector2.round()<class_Vector2_method_round>`\ 、\ :ref:`Vector3.round()<class_Vector3_method_round>` 或 :ref:`Vector4.round()<class_Vector4_method_round>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_roundf:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **roundf**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_roundf>`
|
||
|
||
将 ``x`` 舍入到最接近的整数,中间情况远离 0 舍入。
|
||
|
||
\ :ref:`round()<class_@GlobalScope_method_round>` 的类型安全版本,返回一个 :ref:`float<class_float>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_roundi:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **roundi**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_roundi>`
|
||
|
||
将 ``x`` 舍入到最接近的整数,中间情况远离 0 舍入。
|
||
|
||
\ :ref:`round()<class_@GlobalScope_method_round>` 的类型安全版本,返回一个 :ref:`int<class_int>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_seed:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **seed**\ (\ base\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_seed>`
|
||
|
||
将随机数生成器的种子设置为 ``base``\ 。手动设置种子可以确保大多数随机函数的结果一致、可重复。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
var my_seed = "Godot Rocks".hash()
|
||
seed(my_seed)
|
||
var a = randf() + randi()
|
||
seed(my_seed)
|
||
var b = randf() + randi()
|
||
# a 和 b 现在是一样的
|
||
|
||
.. code-tab:: csharp
|
||
|
||
ulong mySeed = (ulong)GD.Hash("Godot Rocks");
|
||
GD.Seed(mySeed);
|
||
var a = GD.Randf() + GD.Randi();
|
||
GD.Seed(mySeed);
|
||
var b = GD.Randf() + GD.Randi();
|
||
// a 和 b 现在是一样的
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_sign:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **sign**\ (\ x\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_sign>`
|
||
|
||
返回与 ``x`` 相同类型的 :ref:`Variant<class_Variant>`\ ,负值返回 ``-1``\ 、正值返回 ``1``\ ,零则返回 ``0``\ 。如果是 ``nan`` 则返回 0。
|
||
|
||
支持的类型有:\ :ref:`int<class_int>`\ 、\ :ref:`float<class_float>`\ 、\ :ref:`Vector2<class_Vector2>`\ 、\ :ref:`Vector2i<class_Vector2i>`\ 、\ :ref:`Vector3<class_Vector3>`\ 、\ :ref:`Vector3i<class_Vector3i>`\ 、\ :ref:`Vector4<class_Vector4>`\ 、\ :ref:`Vector4i<class_Vector4i>`\ 。
|
||
|
||
::
|
||
|
||
sign(-6.0) # 返回 -1
|
||
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>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_signf:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **signf**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_signf>`
|
||
|
||
如果 ``x`` 为负,则返回 ``-1.0``\ ;如果 ``x`` 为正,则返回 ``1.0``\ ;如果 ``x`` 为零,则返回 ``0.0``\ 。如果 ``x`` 为 ``nan`` 则返回 0.0。
|
||
|
||
::
|
||
|
||
signf(-6.5) # 返回 -1.0
|
||
signf(0.0) # 返回 0.0
|
||
signf(6.5) # 返回 1.0
|
||
signf(NAN) # 返回 0.0
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_signi:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **signi**\ (\ x\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_signi>`
|
||
|
||
如果 ``x`` 为负,则返回 ``-1``\ ;如果 ``x`` 为正,则返回 ``1``\ ;如果 ``x`` 为零,则返回 ``0``\ 。
|
||
|
||
::
|
||
|
||
signi(-6) # 返回 -1
|
||
signi(0) # 返回 0
|
||
signi(6) # 返回 1
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_sin:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **sin**\ (\ angle_rad\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_sin>`
|
||
|
||
返回弧度角 ``angle_rad`` 的正弦值。
|
||
|
||
::
|
||
|
||
sin(0.523599) # 返回 0.5
|
||
sin(deg_to_rad(90)) # 返回 1.0
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_sinh:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **sinh**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_sinh>`
|
||
|
||
返回 ``x`` 的双曲正弦值。
|
||
|
||
::
|
||
|
||
var a = log(2.0) # 返回 0.693147
|
||
sinh(a) # 返回 0.75
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_smoothstep:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **smoothstep**\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_smoothstep>`
|
||
|
||
返回在 ``0`` 和 ``1`` 之间的平滑三次 Hermite 插值结果。
|
||
|
||
对于正范围(当 ``from <= to`` 时),当 ``x <= from`` 时返回值为 ``0``\ ,当 ``x >= to`` 时返回值为 ``1``\ 。如果 ``x`` 位于 ``from`` 和 ``to`` 之间,返回值遵循一条 S 形曲线,平滑地从 ``0`` 过渡到 ``1``\ 。
|
||
|
||
对于负范围(当 ``from > to`` 时),函数镜像翻转,当 ``x <= to`` 时返回值为 ``1``\ ,当 ``x >= from`` 时返回值为 ``0``\ 。
|
||
|
||
这条 S 形曲线是三次 Hermite 插值器,由 ``f(y) = 3y^2 - 2y^3`` 给出,其中 ``y = (x-from) / (to-from)``\ 。
|
||
|
||
::
|
||
|
||
smoothstep(0, 2, -5.0) # 返回 0.0
|
||
smoothstep(0, 2, 0.5) # 返回 0.15625
|
||
smoothstep(0, 2, 1.0) # 返回 0.5
|
||
smoothstep(0, 2, 2.0) # 返回 1.0
|
||
|
||
与曲线值为 ``-1.6521`` 的 :ref:`ease()<class_@GlobalScope_method_ease>` 方法相比,\ :ref:`smoothstep()<class_@GlobalScope_method_smoothstep>` 返回的曲线是最平滑的,导数没有突变。如果你需要执行更高级的过渡效果,请使用 :ref:`Tween<class_Tween>` 或 :ref:`AnimationPlayer<class_AnimationPlayer>`\ 。
|
||
|
||
\ `smoothstep() 和 ease(x, -1.6521) 返回值的比较 <https://raw.githubusercontent.com/godotengine/godot-docs/master/img/smoothstep_ease_comparison.png>`__\
|
||
|
||
\ `Smoothstep() 在正范围、零范围和负范围的返回值 <https://raw.githubusercontent.com/godotengine/godot-docs/master/img/smoothstep_range.webp>`__
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_snapped:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **snapped**\ (\ x\: :ref:`Variant<class_Variant>`, step\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_snapped>`
|
||
|
||
返回最接近 ``x`` 的 ``step`` 的倍数。这也可用于将一个浮点数四舍五入为任意小数位数。
|
||
|
||
返回值是与 ``step`` 相同类型的 :ref:`Variant<class_Variant>`\ 。支持的类型:\ :ref:`int<class_int>`\ 、\ :ref:`float<class_float>`\ 、\ :ref:`Vector2<class_Vector2>`\ 、\ :ref:`Vector2i<class_Vector2i>`\ 、\ :ref:`Vector3<class_Vector3>`\ 、\ :ref:`Vector3i<class_Vector3i>`\ 、\ :ref:`Vector4<class_Vector4>`\ 、\ :ref:`Vector4i<class_Vector4i>`\ 。
|
||
|
||
::
|
||
|
||
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>`\ 。
|
||
|
||
\ **注意:**\ 为了更好的类型安全,请使用 :ref:`snappedf()<class_@GlobalScope_method_snappedf>`\ 、\ :ref:`snappedi()<class_@GlobalScope_method_snappedi>`\ 、\ :ref:`Vector2.snapped()<class_Vector2_method_snapped>`\ 、\ :ref:`Vector2i.snapped()<class_Vector2i_method_snapped>`\ 、\ :ref:`Vector3.snapped()<class_Vector3_method_snapped>`\ 、\ :ref:`Vector3i.snapped()<class_Vector3i_method_snapped>`\ 、\ :ref:`Vector4.snapped()<class_Vector4_method_snapped>`\ 、\ :ref:`Vector4i.snapped()<class_Vector4i_method_snapped>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_snappedf:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **snappedf**\ (\ x\: :ref:`float<class_float>`, step\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_snappedf>`
|
||
|
||
返回最接近 ``x`` 的 ``step`` 的倍数。也可用于将浮点数四舍五入为任意的小数位数。
|
||
|
||
\ :ref:`snapped()<class_@GlobalScope_method_snapped>` 的类型安全版本,返回一个 :ref:`float<class_float>`\ 。
|
||
|
||
::
|
||
|
||
snappedf(32.0, 2.5) # 返回 32.5
|
||
snappedf(3.14159, 0.01) # 返回 3.14
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_snappedi:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **snappedi**\ (\ x\: :ref:`float<class_float>`, step\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_snappedi>`
|
||
|
||
返回最接近 ``x`` 的 ``step`` 的倍数。
|
||
|
||
\ :ref:`snapped()<class_@GlobalScope_method_snapped>` 的类型安全版本,返回一个 :ref:`int<class_int>`\ 。
|
||
|
||
::
|
||
|
||
snappedi(53, 16) # 返回 48
|
||
snappedi(4096, 100) # 返回 4100
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_sqrt:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **sqrt**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_sqrt>`
|
||
|
||
返回 ``x`` 的平方根,\ ``x`` 为非负数。
|
||
|
||
::
|
||
|
||
sqrt(9) # 返回 3
|
||
sqrt(10.24) # 返回 3.2
|
||
sqrt(-1) # 返回 NaN
|
||
|
||
\ **注意:**\ 负数的 ``x`` 会返回 NaN(“不是数字”)。在 C# 中,如果需要负输入,请使用 ``System.Numerics.Complex``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_step_decimals:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **step_decimals**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_step_decimals>`
|
||
|
||
返回小数点后第一个非零数字的位置。注意最大返回值是 10,这是实现中的设计决定。
|
||
|
||
::
|
||
|
||
var n = step_decimals(5) # n 为 0
|
||
n = step_decimals(1.0005) # n 为 4
|
||
n = step_decimals(0.000000005) # n 为 9
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_str:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **str**\ (\ ...\ ) |vararg| :ref:`🔗<class_@GlobalScope_method_str>`
|
||
|
||
尽可能以最佳方式将一个或多个任何 :ref:`Variant<class_Variant>` 类型的参数转换为一个 :ref:`String<class_String>`\ 。
|
||
|
||
::
|
||
|
||
var a = [10, 20, 30]
|
||
var b = str(a)
|
||
print(len(a)) # 输出 3(数组中元素的数量)。
|
||
print(len(b)) # 输出 12(字符串“[10, 20, 30]”的长度)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_str_to_var:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **str_to_var**\ (\ string\: :ref:`String<class_String>`\ ) :ref:`🔗<class_@GlobalScope_method_str_to_var>`
|
||
|
||
将 :ref:`var_to_str()<class_@GlobalScope_method_var_to_str>` 返回的已格式化的 ``string`` 转换为原始 :ref:`Variant<class_Variant>`\ 。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
var data = '{ "a": 1, "b": 2 }' # data 是一个 String
|
||
var dict = str_to_var(data) # dict 是一个 Dictionary
|
||
print(dict["a"]) # 输出 1
|
||
|
||
.. code-tab:: csharp
|
||
|
||
string data = "{ \"a\": 1, \"b\": 2 }"; // data 是一个 string
|
||
var dict = GD.StrToVar(data).AsGodotDictionary(); // dict 是一个 Dictionary
|
||
GD.Print(dict["a"]); // 输出 1
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_tan:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **tan**\ (\ angle_rad\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_tan>`
|
||
|
||
返回弧度角 ``angle_rad`` 的正切值。
|
||
|
||
::
|
||
|
||
tan(deg_to_rad(45)) # 返回 1
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_tanh:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **tanh**\ (\ x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_tanh>`
|
||
|
||
返回 ``x`` 的双曲正切值。
|
||
|
||
::
|
||
|
||
var a = log(2.0) # 返回 0.693147
|
||
tanh(a) # 返回 0.6
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_type_convert:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **type_convert**\ (\ variant\: :ref:`Variant<class_Variant>`, type\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_type_convert>`
|
||
|
||
使用 :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` 值将给定的 ``variant`` 转换为给定的 ``type``\ 。此方法对类型的处理十分宽松,可以在数组类型之间自动转换,将数值的 :ref:`String<class_String>` 转换为 :ref:`int<class_int>`\ ,也可以将大多数内容转换为 :ref:`String<class_String>`\ 。
|
||
|
||
如果无法完成类型转换,此方法将返回该类型的默认值,例如 :ref:`Rect2<class_Rect2>` 转换为 :ref:`Vector2<class_Vector2>` 时将总是返回 :ref:`Vector2.ZERO<class_Vector2_constant_ZERO>`\ 。只要 ``type`` 是一个有效的 Variant 类型,此方法就永远不会显示错误消息。
|
||
|
||
返回的值是一个 :ref:`Variant<class_Variant>`\ ,但是其中的数据以及其类型将会与请求的类型相同。
|
||
|
||
::
|
||
|
||
type_convert("Hi!", TYPE_INT) # 返回 0
|
||
type_convert("123", TYPE_INT) # 返回 123
|
||
type_convert(123.4, TYPE_INT) # 返回 123
|
||
type_convert(5, TYPE_VECTOR2) # 返回 (0, 0)
|
||
type_convert("Hi!", TYPE_NIL) # 返回 null
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_type_string:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **type_string**\ (\ type\: :ref:`int<class_int>`\ ) :ref:`🔗<class_@GlobalScope_method_type_string>`
|
||
|
||
返回类型 ``type`` 的人类可读名称,参数使用 :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` 的值。
|
||
|
||
::
|
||
|
||
print(TYPE_INT) # 输出 2
|
||
print(type_string(TYPE_INT)) # 输出“int”
|
||
print(type_string(TYPE_STRING)) # 输出“String”
|
||
|
||
另见 :ref:`typeof()<class_@GlobalScope_method_typeof>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_typeof:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **typeof**\ (\ variable\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_typeof>`
|
||
|
||
返回变量 ``variable`` 的内部类型,使用的是 :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` 中的值。
|
||
|
||
::
|
||
|
||
var json = JSON.new()
|
||
json.parse('["a", "b", "c"]')
|
||
var result = json.get_data()
|
||
if typeof(result) == TYPE_ARRAY:
|
||
print(result[0]) # 输出“a”
|
||
else:
|
||
print("预料之外的结果!")
|
||
|
||
另见 :ref:`type_string()<class_@GlobalScope_method_type_string>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_var_to_bytes:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedByteArray<class_PackedByteArray>` **var_to_bytes**\ (\ variable\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_var_to_bytes>`
|
||
|
||
将 :ref:`Variant<class_Variant>` 值编码为字节数组,不编码对象。反序列化可以使用 :ref:`bytes_to_var()<class_@GlobalScope_method_bytes_to_var>` 来完成。
|
||
|
||
\ **注意:**\ 如果需要对象序列化,参见 :ref:`var_to_bytes_with_objects()<class_@GlobalScope_method_var_to_bytes_with_objects>`\ 。
|
||
|
||
\ **注意:**\ 编码 :ref:`Callable<class_Callable>` 不受支持,无论数据如何,都会导致空值。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_var_to_bytes_with_objects:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedByteArray<class_PackedByteArray>` **var_to_bytes_with_objects**\ (\ variable\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_var_to_bytes_with_objects>`
|
||
|
||
将 :ref:`Variant<class_Variant>` 值编码为字节数组。允许对对象进行编码(并且可能包括可执行代码)。反序列化可以使用 :ref:`bytes_to_var_with_objects()<class_@GlobalScope_method_bytes_to_var_with_objects>` 来完成。
|
||
|
||
\ **注意:**\ 编码 :ref:`Callable<class_Callable>` 不受支持,无论数据如何,都会导致空值。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_var_to_str:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **var_to_str**\ (\ variable\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_var_to_str>`
|
||
|
||
将 :ref:`Variant<class_Variant>` ``variable`` 转换为格式化的 :ref:`String<class_String>`\ ,后续可以使用 :ref:`str_to_var()<class_@GlobalScope_method_str_to_var>` 对其进行解析。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
var a = { "a": 1, "b": 2 }
|
||
print(var_to_str(a))
|
||
|
||
.. code-tab:: csharp
|
||
|
||
var a = new Godot.Collections.Dictionary { ["a"] = 1, ["b"] = 2 };
|
||
GD.Print(GD.VarToStr(a));
|
||
|
||
|
||
|
||
输出:
|
||
|
||
.. code:: text
|
||
|
||
{
|
||
"a": 1,
|
||
"b": 2
|
||
}
|
||
|
||
\ **注意:**\ 不支持转换 :ref:`Signal<class_Signal>` 和 :ref:`Callable<class_Callable>`\ ,这些类型无论有什么数据,转换后都是空值。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_weakref:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **weakref**\ (\ obj\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_@GlobalScope_method_weakref>`
|
||
|
||
返回一个 :ref:`WeakRef<class_WeakRef>` 实例,其中包含对 ``obj`` 的弱引用。如果 ``obj`` 为 ``null``\ ,则返回空的 :ref:`WeakRef<class_WeakRef>` 实例。如果 ``obj`` 既不是 :ref:`Object<class_Object>` 派生实例,也不是 ``null``\ ,则打印错误并返回 ``null``\ 。
|
||
|
||
对对象的弱引用不足以使对象保持存活:当对引用对象的剩余引用都是弱引用时,垃圾回收可以自由销毁该引用对象并将其内存重新用于其他用途。但是,在对象实际被销毁之前,弱引用可能会返回该对象,即使不存在对它的强引用也是如此。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_wrap:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
: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:`int<class_int>` 和 :ref:`float<class_float>`\ 。如果任一参数是 :ref:`float<class_float>`\ ,则该函数返回 :ref:`float<class_float>`\ ,否则返回 :ref:`int<class_int>`\ 。
|
||
|
||
::
|
||
|
||
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 (浮点类型)
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_wrapf:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
: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`` 则\ *不包含*\ 。可用于创建类似循环的行为或无限表面。
|
||
|
||
::
|
||
|
||
# 在 5.0 和 9.9 之间无限循环
|
||
value = wrapf(value + 0.1, 5.0, 10.0)
|
||
|
||
::
|
||
|
||
# 无限旋转(弧度)
|
||
angle = wrapf(angle + 0.1, 0.0, TAU)
|
||
|
||
::
|
||
|
||
# 无限旋转(弧度)
|
||
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>` 方法更灵活。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_@GlobalScope_method_wrapi:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
: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`` 则\ *不包含*\ 。可用于创建类似循环的行为或无限曲面。
|
||
|
||
::
|
||
|
||
# 在 5 和 9 之间无限循环
|
||
frame = wrapi(frame + 1, 5, 10)
|
||
|
||
::
|
||
|
||
# result 是 -2
|
||
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 (本方法用于构造某个类型。)`
|
||
.. |static| replace:: :abbr:`static (调用本方法无需实例,可直接使用类名进行调用。)`
|
||
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效运算符。)`
|
||
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列位标志构成位掩码的整数。)`
|
||
.. |void| replace:: :abbr:`void (无返回值。)`
|