From 35df92c6153425f64f6a6461a0b3027c148289b1 Mon Sep 17 00:00:00 2001 From: Godot Organization Date: Sat, 7 Sep 2024 03:20:35 +0000 Subject: [PATCH] classref: Sync with current master branch (5675c76) --- classes/class_@globalscope.rst | 18 +- classes/class_animationmixer.rst | 26 ++- classes/class_audiostreaminteractive.rst | 2 +- classes/class_canvasitem.rst | 4 + classes/class_cpuparticles3d.rst | 21 ++ classes/class_dictionary.rst | 204 +++++++++++++++- classes/class_editorcontextmenuplugin.rst | 104 +++++++++ classes/class_editorexportplatformmacos.rst | 22 +- classes/class_editorinterface.rst | 218 +++++++++--------- classes/class_editorplugin.rst | 72 ++++++ .../class_editorresourcepreviewgenerator.rst | 4 +- classes/class_editorsettings.rst | 32 ++- classes/class_gltfskeleton.rst | 4 + classes/class_gltfskin.rst | 8 + classes/class_javaclass.rst | 63 ++++- classes/class_javaclasswrapper.rst | 10 + classes/class_javaobject.rst | 64 +++++ classes/class_menubar.rst | 10 +- classes/class_meshinstance3d.rst | 16 ++ classes/class_multimesh.rst | 2 + classes/class_object.rst | 73 ++++++ classes/class_os.rst | 6 +- classes/class_particleprocessmaterial.rst | 21 ++ classes/class_pathfollow2d.rst | 2 + classes/class_pathfollow3d.rst | 2 + classes/class_polygonpathfinder.rst | 58 ++++- classes/class_projectsettings.rst | 6 +- classes/class_refcounted.rst | 2 +- classes/class_renderingserver.rst | 16 ++ classes/class_resourceimporterwav.rst | 8 +- classes/class_spinbox.rst | 2 +- classes/class_spriteframes.rst | 14 ++ classes/class_tiledata.rst | 192 +++++++++++---- classes/class_viewport.rst | 14 ++ classes/index.rst | 3 + 35 files changed, 1126 insertions(+), 197 deletions(-) create mode 100644 classes/class_editorcontextmenuplugin.rst create mode 100644 classes/class_javaobject.rst diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst index 808ebcb8f38..d2cd4eea02d 100644 --- a/classes/class_@globalscope.rst +++ b/classes/class_@globalscope.rst @@ -3804,6 +3804,14 @@ Hints that an :ref:`int` property is a pointer. Used by GDExtension. Hints that a property is an :ref:`Array` with the stored type specified in the hint string. +.. _class_@GlobalScope_constant_PROPERTY_HINT_DICTIONARY_TYPE: + +.. rst-class:: classref-enumeration-constant + +:ref:`PropertyHint` **PROPERTY_HINT_DICTIONARY_TYPE** = ``38`` + +Hints that a property is a :ref:`Dictionary` with the stored types specified in the hint string. + .. _class_@GlobalScope_constant_PROPERTY_HINT_LOCALE_ID: .. rst-class:: classref-enumeration-constant @@ -3848,7 +3856,7 @@ Hints that a string property is a password, and every character is replaced with .. rst-class:: classref-enumeration-constant -:ref:`PropertyHint` **PROPERTY_HINT_MAX** = ``38`` +:ref:`PropertyHint` **PROPERTY_HINT_MAX** = ``39`` Represents the size of the :ref:`PropertyHint` enum. @@ -5320,7 +5328,7 @@ Returns the hyperbolic arc (also called inverse) cosine of ``x``, returning a va :ref:`float` **angle_difference**\ (\ from\: :ref:`float`, to\: :ref:`float`\ ) :ref:`🔗` -Returns the difference between the two angles, in the range of ``[-PI, +PI]``. When ``from`` and ``to`` are opposite, returns ``-PI`` if ``from`` is smaller than ``to``, or ``PI`` otherwise. +Returns the difference between the two angles (in radians), in the range of ``[-PI, +PI]``. When ``from`` and ``to`` are opposite, returns ``-PI`` if ``from`` is smaller than ``to``, or ``PI`` otherwise. .. rst-class:: classref-item-separator @@ -6082,9 +6090,9 @@ This function is faster than using :ref:`is_equal_approx` **lerp**\ (\ from\: :ref:`Variant`, to\: :ref:`Variant`, weight\: :ref:`Variant`\ ) :ref:`🔗` -Linearly interpolates between two values by the factor defined in ``weight``. To perform interpolation, ``weight`` should be between ``0.0`` and ``1.0`` (inclusive). However, values outside this range are allowed and can be used to perform *extrapolation*. If this is not desired, use :ref:`clamp` on the result of this function. +Linearly interpolates between two values by the factor defined in ``weight``. To perform interpolation, ``weight`` should be between ``0.0`` and ``1.0`` (inclusive). However, values outside this range are allowed and can be used to perform *extrapolation*. If this is not desired, use :ref:`clampf` to limit ``weight``. -Both ``from`` and ``to`` must be the same type. Supported types: :ref:`int`, :ref:`float`, :ref:`Vector2`, :ref:`Vector3`, :ref:`Vector4`, :ref:`Color`, :ref:`Quaternion`, :ref:`Basis`. +Both ``from`` and ``to`` must be the same type. Supported types: :ref:`int`, :ref:`float`, :ref:`Vector2`, :ref:`Vector3`, :ref:`Vector4`, :ref:`Color`, :ref:`Quaternion`, :ref:`Basis`, :ref:`Transform2D`, :ref:`Transform3D`. :: @@ -6092,7 +6100,7 @@ Both ``from`` and ``to`` must be the same type. Supported types: :ref:`int` which performs the reverse of this operation. To perform eased interpolation with :ref:`lerp`, combine it with :ref:`ease` or :ref:`smoothstep`. See also :ref:`remap` to map a continuous series of values to another. -\ **Note:** For better type safety, use :ref:`lerpf`, :ref:`Vector2.lerp`, :ref:`Vector3.lerp`, :ref:`Vector4.lerp`, :ref:`Color.lerp`, :ref:`Quaternion.slerp` or :ref:`Basis.slerp`. +\ **Note:** For better type safety, use :ref:`lerpf`, :ref:`Vector2.lerp`, :ref:`Vector3.lerp`, :ref:`Vector4.lerp`, :ref:`Color.lerp`, :ref:`Quaternion.slerp`, :ref:`Basis.slerp`, :ref:`Transform2D.interpolate_with`, or :ref:`Transform3D.interpolate_with`. .. rst-class:: classref-item-separator diff --git a/classes/class_animationmixer.rst b/classes/class_animationmixer.rst index d970b77d9b7..918f870a69b 100644 --- a/classes/class_animationmixer.rst +++ b/classes/class_animationmixer.rst @@ -302,7 +302,31 @@ An :ref:`Animation.UPDATE_CONTINUOUS Always treat the :ref:`Animation.UPDATE_DISCRETE` track value as :ref:`Animation.UPDATE_CONTINUOUS` with :ref:`Animation.INTERPOLATION_NEAREST`. This is the default behavior for :ref:`AnimationTree`. -If a value track has non-numeric type key values, it is internally converted to use :ref:`ANIMATION_CALLBACK_MODE_DISCRETE_RECESSIVE` with :ref:`Animation.UPDATE_DISCRETE`. +If a value track has un-interpolatable type key values, it is internally converted to use :ref:`ANIMATION_CALLBACK_MODE_DISCRETE_RECESSIVE` with :ref:`Animation.UPDATE_DISCRETE`. + +Un-interpolatable type list: + +- :ref:`@GlobalScope.TYPE_NIL`\ + +- :ref:`@GlobalScope.TYPE_NODE_PATH`\ + +- :ref:`@GlobalScope.TYPE_RID`\ + +- :ref:`@GlobalScope.TYPE_OBJECT`\ + +- :ref:`@GlobalScope.TYPE_CALLABLE`\ + +- :ref:`@GlobalScope.TYPE_SIGNAL`\ + +- :ref:`@GlobalScope.TYPE_DICTIONARY`\ + +- :ref:`@GlobalScope.TYPE_PACKED_BYTE_ARRAY`\ + +\ :ref:`@GlobalScope.TYPE_BOOL` and :ref:`@GlobalScope.TYPE_INT` are treated as :ref:`@GlobalScope.TYPE_FLOAT` during blending and rounded when the result is retrieved. + +It is same for arrays and vectors with them such as :ref:`@GlobalScope.TYPE_PACKED_INT32_ARRAY` or :ref:`@GlobalScope.TYPE_VECTOR2I`, they are treated as :ref:`@GlobalScope.TYPE_PACKED_FLOAT32_ARRAY` or :ref:`@GlobalScope.TYPE_VECTOR2`. Also note that for arrays, the size is also interpolated. + +\ :ref:`@GlobalScope.TYPE_STRING` and :ref:`@GlobalScope.TYPE_STRING_NAME` are interpolated between character codes and lengths, but note that there is a difference in algorithm between interpolation between keys and interpolation by blending. .. rst-class:: classref-section-separator diff --git a/classes/class_audiostreaminteractive.rst b/classes/class_audiostreaminteractive.rst index 02e2635cee1..e5aa52ec1f2 100644 --- a/classes/class_audiostreaminteractive.rst +++ b/classes/class_audiostreaminteractive.rst @@ -19,7 +19,7 @@ Audio stream that can playback music interactively, combining clips and a transi Description ----------- -This is an audio stream that can playback music interactively, combining clips and a transition table. Clips must be added first, and the transition rules via the :ref:`add_transition`. Additionally, this stream export a property parameter to control the playback via :ref:`AudioStreamPlayer`, :ref:`AudioStreamPlayer2D`, or :ref:`AudioStreamPlayer3D`. +This is an audio stream that can playback music interactively, combining clips and a transition table. Clips must be added first, and then the transition rules via the :ref:`add_transition`. Additionally, this stream exports a property parameter to control the playback via :ref:`AudioStreamPlayer`, :ref:`AudioStreamPlayer2D`, or :ref:`AudioStreamPlayer3D`. The way this is used is by filling a number of clips, then configuring the transition table. From there, clips are selected for playback and the music will smoothly go from the current to the new one while using the corresponding transition rule defined in the transition table. diff --git a/classes/class_canvasitem.rst b/classes/class_canvasitem.rst index d5412e78e24..43b1bcdf41a 100644 --- a/classes/class_canvasitem.rst +++ b/classes/class_canvasitem.rst @@ -880,6 +880,8 @@ If ``antialiased`` is ``true``, half transparent "feathers" will be attached to Draws a colored polygon of any number of points, convex or concave. Unlike :ref:`draw_polygon`, a single color must be specified for the whole polygon. +\ **Note:** If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with :ref:`Geometry2D.triangulate_polygon` and using :ref:`draw_mesh`, :ref:`draw_multimesh`, or :ref:`RenderingServer.canvas_item_add_triangle_array`. + .. rst-class:: classref-item-separator ---- @@ -1053,6 +1055,8 @@ Draws a :ref:`MultiMesh` in 2D with the provided texture. See : Draws a solid polygon of any number of points, convex or concave. Unlike :ref:`draw_colored_polygon`, each point's color can be changed individually. See also :ref:`draw_polyline` and :ref:`draw_polyline_colors`. If you need more flexibility (such as being able to use bones), use :ref:`RenderingServer.canvas_item_add_triangle_array` instead. +\ **Note:** If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with :ref:`Geometry2D.triangulate_polygon` and using :ref:`draw_mesh`, :ref:`draw_multimesh`, or :ref:`RenderingServer.canvas_item_add_triangle_array`. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_cpuparticles3d.rst b/classes/class_cpuparticles3d.rst index ba08e373997..503f30806ec 100644 --- a/classes/class_cpuparticles3d.rst +++ b/classes/class_cpuparticles3d.rst @@ -91,6 +91,8 @@ Properties +---------------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------------+ | :ref:`Vector3` | :ref:`emission_ring_axis` | | +---------------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`float` | :ref:`emission_ring_cone_angle` | | + +---------------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------------+ | :ref:`float` | :ref:`emission_ring_height` | | +---------------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------------+ | :ref:`float` | :ref:`emission_ring_inner_radius` | | @@ -969,6 +971,25 @@ The axis of the ring when using the emitter :ref:`EMISSION_SHAPE_RING` **emission_ring_cone_angle** :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_emission_ring_cone_angle**\ (\ value\: :ref:`float`\ ) +- :ref:`float` **get_emission_ring_cone_angle**\ (\ ) + +The angle of the cone when using the emitter :ref:`EMISSION_SHAPE_RING`. The default angle of 90 degrees results in a ring, while an angle of 0 degrees results in a cone. Intermediate values will result in a ring where one end is larger than the other. + +\ **Note:** Depending on :ref:`emission_ring_height`, the angle may be clamped if the ring's end is reached to form a perfect cone. + +.. rst-class:: classref-item-separator + +---- + .. _class_CPUParticles3D_property_emission_ring_height: .. rst-class:: classref-property diff --git a/classes/class_dictionary.rst b/classes/class_dictionary.rst index 2b3e7ac3edc..cc1678e02e4 100644 --- a/classes/class_dictionary.rst +++ b/classes/class_dictionary.rst @@ -212,11 +212,13 @@ Constructors .. table:: :widths: auto - +-------------------------------------+--------------------------------------------------------------------------------------------------------------+ - | :ref:`Dictionary` | :ref:`Dictionary`\ (\ ) | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------+ - | :ref:`Dictionary` | :ref:`Dictionary`\ (\ from\: :ref:`Dictionary`\ ) | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------+ + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Dictionary` | :ref:`Dictionary`\ (\ ) | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Dictionary` | :ref:`Dictionary`\ (\ base\: :ref:`Dictionary`, key_type\: :ref:`int`, key_class_name\: :ref:`StringName`, key_script\: :ref:`Variant`, value_type\: :ref:`int`, value_class_name\: :ref:`StringName`, value_script\: :ref:`Variant`\ ) | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Dictionary` | :ref:`Dictionary`\ (\ from\: :ref:`Dictionary`\ ) | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group @@ -226,6 +228,8 @@ Methods .. table:: :widths: auto + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`assign`\ (\ dictionary\: :ref:`Dictionary`\ ) | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`clear`\ (\ ) | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -239,6 +243,18 @@ Methods +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_or_add`\ (\ key\: :ref:`Variant`, default\: :ref:`Variant` = null\ ) | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_typed_key_builtin`\ (\ ) |const| | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`StringName` | :ref:`get_typed_key_class_name`\ (\ ) |const| | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`get_typed_key_script`\ (\ ) |const| | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_typed_value_builtin`\ (\ ) |const| | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`StringName` | :ref:`get_typed_value_class_name`\ (\ ) |const| | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`get_typed_value_script`\ (\ ) |const| | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has`\ (\ key\: :ref:`Variant`\ ) |const| | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_all`\ (\ keys\: :ref:`Array`\ ) |const| | @@ -249,6 +265,18 @@ Methods +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_read_only`\ (\ ) |const| | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_same_typed`\ (\ dictionary\: :ref:`Dictionary`\ ) |const| | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_same_typed_key`\ (\ dictionary\: :ref:`Dictionary`\ ) |const| | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_same_typed_value`\ (\ dictionary\: :ref:`Dictionary`\ ) |const| | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_typed`\ (\ ) |const| | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_typed_key`\ (\ ) |const| | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_typed_value`\ (\ ) |const| | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`keys`\ (\ ) |const| | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`make_read_only`\ (\ ) | @@ -303,6 +331,16 @@ Constructs an empty **Dictionary**. .. rst-class:: classref-constructor +:ref:`Dictionary` **Dictionary**\ (\ base\: :ref:`Dictionary`, key_type\: :ref:`int`, key_class_name\: :ref:`StringName`, key_script\: :ref:`Variant`, value_type\: :ref:`int`, value_class_name\: :ref:`StringName`, value_script\: :ref:`Variant`\ ) + +Creates a typed dictionary from the ``base`` dictionary. A typed dictionary can only contain keys and values of the given types, or that inherit from the given classes, as described by this constructor's parameters. + +.. rst-class:: classref-item-separator + +---- + +.. rst-class:: classref-constructor + :ref:`Dictionary` **Dictionary**\ (\ from\: :ref:`Dictionary`\ ) Returns the same dictionary as ``from``. If you need a copy of the dictionary, use :ref:`duplicate`. @@ -316,6 +354,18 @@ Returns the same dictionary as ``from``. If you need a copy of the dictionary, u Method Descriptions ------------------- +.. _class_Dictionary_method_assign: + +.. rst-class:: classref-method + +|void| **assign**\ (\ dictionary\: :ref:`Dictionary`\ ) :ref:`🔗` + +Assigns elements of another ``dictionary`` into the dictionary. Resizes the dictionary to match ``dictionary``. Performs type conversions if the dictionary is typed. + +.. rst-class:: classref-item-separator + +---- + .. _class_Dictionary_method_clear: .. rst-class:: classref-method @@ -392,6 +442,78 @@ Gets a value and ensures the key is set. If the ``key`` exists in the dictionary ---- +.. _class_Dictionary_method_get_typed_key_builtin: + +.. rst-class:: classref-method + +:ref:`int` **get_typed_key_builtin**\ (\ ) |const| :ref:`🔗` + +Returns the built-in :ref:`Variant` type of the typed dictionary's keys as a :ref:`Variant.Type` constant. If the keys are not typed, returns :ref:`@GlobalScope.TYPE_NIL`. See also :ref:`is_typed_key`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Dictionary_method_get_typed_key_class_name: + +.. rst-class:: classref-method + +:ref:`StringName` **get_typed_key_class_name**\ (\ ) |const| :ref:`🔗` + +Returns the **built-in** class name of the typed dictionary's keys, if the built-in :ref:`Variant` type is :ref:`@GlobalScope.TYPE_OBJECT`. Otherwise, returns an empty :ref:`StringName`. See also :ref:`is_typed_key` and :ref:`Object.get_class`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Dictionary_method_get_typed_key_script: + +.. rst-class:: classref-method + +:ref:`Variant` **get_typed_key_script**\ (\ ) |const| :ref:`🔗` + +Returns the :ref:`Script` instance associated with this typed dictionary's keys, or ``null`` if it does not exist. See also :ref:`is_typed_key`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Dictionary_method_get_typed_value_builtin: + +.. rst-class:: classref-method + +:ref:`int` **get_typed_value_builtin**\ (\ ) |const| :ref:`🔗` + +Returns the built-in :ref:`Variant` type of the typed dictionary's values as a :ref:`Variant.Type` constant. If the values are not typed, returns :ref:`@GlobalScope.TYPE_NIL`. See also :ref:`is_typed_value`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Dictionary_method_get_typed_value_class_name: + +.. rst-class:: classref-method + +:ref:`StringName` **get_typed_value_class_name**\ (\ ) |const| :ref:`🔗` + +Returns the **built-in** class name of the typed dictionary's values, if the built-in :ref:`Variant` type is :ref:`@GlobalScope.TYPE_OBJECT`. Otherwise, returns an empty :ref:`StringName`. See also :ref:`is_typed_value` and :ref:`Object.get_class`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Dictionary_method_get_typed_value_script: + +.. rst-class:: classref-method + +:ref:`Variant` **get_typed_value_script**\ (\ ) |const| :ref:`🔗` + +Returns the :ref:`Script` instance associated with this typed dictionary's values, or ``null`` if it does not exist. See also :ref:`is_typed_value`. + +.. rst-class:: classref-item-separator + +---- + .. _class_Dictionary_method_has: .. rst-class:: classref-method @@ -518,6 +640,78 @@ Returns ``true`` if the dictionary is read-only. See :ref:`make_read_only` **is_same_typed**\ (\ dictionary\: :ref:`Dictionary`\ ) |const| :ref:`🔗` + +Returns ``true`` if the dictionary is typed the same as ``dictionary``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Dictionary_method_is_same_typed_key: + +.. rst-class:: classref-method + +:ref:`bool` **is_same_typed_key**\ (\ dictionary\: :ref:`Dictionary`\ ) |const| :ref:`🔗` + +Returns ``true`` if the dictionary's keys are typed the same as ``dictionary``'s keys. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Dictionary_method_is_same_typed_value: + +.. rst-class:: classref-method + +:ref:`bool` **is_same_typed_value**\ (\ dictionary\: :ref:`Dictionary`\ ) |const| :ref:`🔗` + +Returns ``true`` if the dictionary's values are typed the same as ``dictionary``'s values. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Dictionary_method_is_typed: + +.. rst-class:: classref-method + +:ref:`bool` **is_typed**\ (\ ) |const| :ref:`🔗` + +Returns ``true`` if the dictionary is typed. Typed dictionaries can only store keys/values of their associated type and provide type safety for the ``[]`` operator. Methods of typed dictionary still return :ref:`Variant`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Dictionary_method_is_typed_key: + +.. rst-class:: classref-method + +:ref:`bool` **is_typed_key**\ (\ ) |const| :ref:`🔗` + +Returns ``true`` if the dictionary's keys are typed. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Dictionary_method_is_typed_value: + +.. rst-class:: classref-method + +:ref:`bool` **is_typed_value**\ (\ ) |const| :ref:`🔗` + +Returns ``true`` if the dictionary's values are typed. + +.. rst-class:: classref-item-separator + +---- + .. _class_Dictionary_method_keys: .. rst-class:: classref-method diff --git a/classes/class_editorcontextmenuplugin.rst b/classes/class_editorcontextmenuplugin.rst new file mode 100644 index 00000000000..10f12b6e5c6 --- /dev/null +++ b/classes/class_editorcontextmenuplugin.rst @@ -0,0 +1,104 @@ +: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/EditorContextMenuPlugin.xml. + +.. _class_EditorContextMenuPlugin: + +EditorContextMenuPlugin +======================= + +**Inherits:** :ref:`RefCounted` **<** :ref:`Object` + +Plugin for adding custom context menus in the editor. + +.. rst-class:: classref-introduction-group + +Description +----------- + +**EditorContextMenuPlugin** allows for the addition of custom options in the editor's context menu. + +Currently, context menus are supported for three commonly used areas: the file system, scene tree, and editor script list panel. + +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`_popup_menu`\ (\ paths\: :ref:`PackedStringArray`\ ) |virtual| | + +--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`add_context_menu_item`\ (\ name\: :ref:`String`, callback\: :ref:`Callable`, icon\: :ref:`Texture2D` = null, shortcut\: :ref:`Shortcut` = null\ ) | + +--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`add_menu_shortcut`\ (\ shortcut\: :ref:`Shortcut`, callback\: :ref:`Callable`\ ) | + +--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- + +.. _class_EditorContextMenuPlugin_private_method__popup_menu: + +.. rst-class:: classref-method + +|void| **_popup_menu**\ (\ paths\: :ref:`PackedStringArray`\ ) |virtual| :ref:`🔗` + +Called when creating a context menu, custom options can be added by using the :ref:`add_context_menu_item` function. + +.. rst-class:: classref-item-separator + +---- + +.. _class_EditorContextMenuPlugin_method_add_context_menu_item: + +.. rst-class:: classref-method + +|void| **add_context_menu_item**\ (\ name\: :ref:`String`, callback\: :ref:`Callable`, icon\: :ref:`Texture2D` = null, shortcut\: :ref:`Shortcut` = null\ ) :ref:`🔗` + +Add custom options to the context menu of the currently specified slot. + +To trigger a ``shortcut`` before the context menu is created, please additionally call the :ref:`add_menu_shortcut` function. + +:: + + func _popup_menu(paths): + add_context_menu_item("File Custom options", handle, ICON) + +.. rst-class:: classref-item-separator + +---- + +.. _class_EditorContextMenuPlugin_method_add_menu_shortcut: + +.. rst-class:: classref-method + +|void| **add_menu_shortcut**\ (\ shortcut\: :ref:`Shortcut`, callback\: :ref:`Callable`\ ) :ref:`🔗` + +To register the shortcut for the context menu, call this function within the :ref:`Object._init` function, even if the context menu has not been created yet. + +Note that this method should only be invoked from :ref:`Object._init`; otherwise, the shortcut will not be registered correctly. + +:: + + func _init(): + add_menu_shortcut(SHORTCUT, handle); + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` +.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` +.. |void| replace:: :abbr:`void (No return value.)` diff --git a/classes/class_editorexportplatformmacos.rst b/classes/class_editorexportplatformmacos.rst index 3bea82b2380..911bc2c7c7d 100644 --- a/classes/class_editorexportplatformmacos.rst +++ b/classes/class_editorexportplatformmacos.rst @@ -48,7 +48,9 @@ Properties +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`application/icon_interpolation` | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`application/min_macos_version` | + | :ref:`String` | :ref:`application/min_macos_version_arm64` | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`application/min_macos_version_x86_64` | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`application/short_version` | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -609,13 +611,25 @@ Interpolation method used to resize application icon. ---- -.. _class_EditorExportPlatformMacOS_property_application/min_macos_version: +.. _class_EditorExportPlatformMacOS_property_application/min_macos_version_arm64: + +.. rst-class:: classref-property + +:ref:`String` **application/min_macos_version_arm64** :ref:`🔗` + +Minimum version of macOS required for this application to run on Apple Silicon Macs, in the ``major.minor.patch`` or ``major.minor`` format, can only contain numeric characters (``0-9``) and periods (``.``). + +.. rst-class:: classref-item-separator + +---- + +.. _class_EditorExportPlatformMacOS_property_application/min_macos_version_x86_64: .. rst-class:: classref-property -:ref:`String` **application/min_macos_version** :ref:`🔗` +:ref:`String` **application/min_macos_version_x86_64** :ref:`🔗` -Minimum version of macOS required for this application to run in the ``major.minor.patch`` or ``major.minor`` format, can only contain numeric characters (``0-9``) and periods (``.``). +Minimum version of macOS required for this application to run on Intel Macs, in the ``major.minor.patch`` or ``major.minor`` format, can only contain numeric characters (``0-9``) and periods (``.``). .. rst-class:: classref-item-separator diff --git a/classes/class_editorinterface.rst b/classes/class_editorinterface.rst index 460ae730e0c..4de5e6f98e6 100644 --- a/classes/class_editorinterface.rst +++ b/classes/class_editorinterface.rst @@ -59,111 +59,111 @@ Methods .. table:: :widths: auto - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`edit_node`\ (\ node\: :ref:`Node`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`edit_resource`\ (\ resource\: :ref:`Resource`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`edit_script`\ (\ script\: :ref:`Script`, line\: :ref:`int` = -1, column\: :ref:`int` = 0, grab_focus\: :ref:`bool` = true\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Control` | :ref:`get_base_control`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorCommandPalette` | :ref:`get_command_palette`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_current_directory`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_current_feature_profile`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_current_path`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Node` | :ref:`get_edited_scene_root`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`VBoxContainer` | :ref:`get_editor_main_screen`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorPaths` | :ref:`get_editor_paths`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_editor_scale`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorSettings` | :ref:`get_editor_settings`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Theme` | :ref:`get_editor_theme`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorUndoRedoManager` | :ref:`get_editor_undo_redo`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`SubViewport` | :ref:`get_editor_viewport_2d`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`SubViewport` | :ref:`get_editor_viewport_3d`\ (\ idx\: :ref:`int` = 0\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`FileSystemDock` | :ref:`get_file_system_dock`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorInspector` | :ref:`get_inspector`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedStringArray` | :ref:`get_open_scenes`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_playing_scene`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorFileSystem` | :ref:`get_resource_filesystem`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorResourcePreview` | :ref:`get_resource_previewer`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`ScriptEditor` | :ref:`get_script_editor`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedStringArray` | :ref:`get_selected_paths`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorSelection` | :ref:`get_selection`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`inspect_object`\ (\ object\: :ref:`Object`, for_property\: :ref:`String` = "", inspector_only\: :ref:`bool` = false\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_multi_window_enabled`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_playing_scene`\ (\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_plugin_enabled`\ (\ plugin\: :ref:`String`\ ) |const| | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Array`\[:ref:`Texture2D`\] | :ref:`make_mesh_previews`\ (\ meshes\: :ref:`Array`\[:ref:`Mesh`\], preview_size\: :ref:`int`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`mark_scene_as_unsaved`\ (\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`open_scene_from_path`\ (\ scene_filepath\: :ref:`String`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`play_current_scene`\ (\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`play_custom_scene`\ (\ scene_filepath\: :ref:`String`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`play_main_scene`\ (\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`popup_dialog`\ (\ dialog\: :ref:`Window`, rect\: :ref:`Rect2i` = Rect2i(0, 0, 0, 0)\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`popup_dialog_centered`\ (\ dialog\: :ref:`Window`, minsize\: :ref:`Vector2i` = Vector2i(0, 0)\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`popup_dialog_centered_clamped`\ (\ dialog\: :ref:`Window`, minsize\: :ref:`Vector2i` = Vector2i(0, 0), fallback_ratio\: :ref:`float` = 0.75\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`popup_dialog_centered_ratio`\ (\ dialog\: :ref:`Window`, ratio\: :ref:`float` = 0.8\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`popup_node_selector`\ (\ callback\: :ref:`Callable`, valid_types\: :ref:`Array`\[:ref:`StringName`\] = []\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`popup_property_selector`\ (\ object\: :ref:`Object`, callback\: :ref:`Callable`, type_filter\: :ref:`PackedInt32Array` = PackedInt32Array()\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`reload_scene_from_path`\ (\ scene_filepath\: :ref:`String`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`restart_editor`\ (\ save\: :ref:`bool` = true\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`save_all_scenes`\ (\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`save_scene`\ (\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`save_scene_as`\ (\ path\: :ref:`String`, with_preview\: :ref:`bool` = true\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`select_file`\ (\ file\: :ref:`String`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_current_feature_profile`\ (\ profile_name\: :ref:`String`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_main_screen_editor`\ (\ name\: :ref:`String`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_plugin_enabled`\ (\ plugin\: :ref:`String`, enabled\: :ref:`bool`\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`stop_playing_scene`\ (\ ) | - +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`edit_node`\ (\ node\: :ref:`Node`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`edit_resource`\ (\ resource\: :ref:`Resource`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`edit_script`\ (\ script\: :ref:`Script`, line\: :ref:`int` = -1, column\: :ref:`int` = 0, grab_focus\: :ref:`bool` = true\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Control` | :ref:`get_base_control`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorCommandPalette` | :ref:`get_command_palette`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_current_directory`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_current_feature_profile`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_current_path`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Node` | :ref:`get_edited_scene_root`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`VBoxContainer` | :ref:`get_editor_main_screen`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorPaths` | :ref:`get_editor_paths`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_editor_scale`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorSettings` | :ref:`get_editor_settings`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Theme` | :ref:`get_editor_theme`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorUndoRedoManager` | :ref:`get_editor_undo_redo`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`SubViewport` | :ref:`get_editor_viewport_2d`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`SubViewport` | :ref:`get_editor_viewport_3d`\ (\ idx\: :ref:`int` = 0\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`FileSystemDock` | :ref:`get_file_system_dock`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorInspector` | :ref:`get_inspector`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`get_open_scenes`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_playing_scene`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorFileSystem` | :ref:`get_resource_filesystem`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorResourcePreview` | :ref:`get_resource_previewer`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`ScriptEditor` | :ref:`get_script_editor`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`get_selected_paths`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorSelection` | :ref:`get_selection`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`inspect_object`\ (\ object\: :ref:`Object`, for_property\: :ref:`String` = "", inspector_only\: :ref:`bool` = false\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_multi_window_enabled`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_playing_scene`\ (\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_plugin_enabled`\ (\ plugin\: :ref:`String`\ ) |const| | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Array`\[:ref:`Texture2D`\] | :ref:`make_mesh_previews`\ (\ meshes\: :ref:`Array`\[:ref:`Mesh`\], preview_size\: :ref:`int`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`mark_scene_as_unsaved`\ (\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`open_scene_from_path`\ (\ scene_filepath\: :ref:`String`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`play_current_scene`\ (\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`play_custom_scene`\ (\ scene_filepath\: :ref:`String`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`play_main_scene`\ (\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`popup_dialog`\ (\ dialog\: :ref:`Window`, rect\: :ref:`Rect2i` = Rect2i(0, 0, 0, 0)\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`popup_dialog_centered`\ (\ dialog\: :ref:`Window`, minsize\: :ref:`Vector2i` = Vector2i(0, 0)\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`popup_dialog_centered_clamped`\ (\ dialog\: :ref:`Window`, minsize\: :ref:`Vector2i` = Vector2i(0, 0), fallback_ratio\: :ref:`float` = 0.75\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`popup_dialog_centered_ratio`\ (\ dialog\: :ref:`Window`, ratio\: :ref:`float` = 0.8\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`popup_node_selector`\ (\ callback\: :ref:`Callable`, valid_types\: :ref:`Array`\[:ref:`StringName`\] = [], current_value\: :ref:`Node` = null\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`popup_property_selector`\ (\ object\: :ref:`Object`, callback\: :ref:`Callable`, type_filter\: :ref:`PackedInt32Array` = PackedInt32Array(), current_value\: :ref:`String` = ""\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`reload_scene_from_path`\ (\ scene_filepath\: :ref:`String`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`restart_editor`\ (\ save\: :ref:`bool` = true\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`save_all_scenes`\ (\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`save_scene`\ (\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`save_scene_as`\ (\ path\: :ref:`String`, with_preview\: :ref:`bool` = true\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`select_file`\ (\ file\: :ref:`String`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_current_feature_profile`\ (\ profile_name\: :ref:`String`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_main_screen_editor`\ (\ name\: :ref:`String`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_plugin_enabled`\ (\ plugin\: :ref:`String`, enabled\: :ref:`bool`\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`stop_playing_scene`\ (\ ) | + +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -733,9 +733,9 @@ See also :ref:`Window.set_unparent_when_invisible`, valid_types\: :ref:`Array`\[:ref:`StringName`\] = []\ ) :ref:`🔗` +|void| **popup_node_selector**\ (\ callback\: :ref:`Callable`, valid_types\: :ref:`Array`\[:ref:`StringName`\] = [], current_value\: :ref:`Node` = null\ ) :ref:`🔗` -Pops up an editor dialog for selecting a :ref:`Node` from the edited scene. The ``callback`` must take a single argument of type :ref:`NodePath`. It is called on the selected :ref:`NodePath` or the empty path ``^""`` if the dialog is canceled. If ``valid_types`` is provided, the dialog will only show Nodes that match one of the listed Node types. +Pops up an editor dialog for selecting a :ref:`Node` from the edited scene. The ``callback`` must take a single argument of type :ref:`NodePath`. It is called on the selected :ref:`NodePath` or the empty path ``^""`` if the dialog is canceled. If ``valid_types`` is provided, the dialog will only show Nodes that match one of the listed Node types. If ``current_value`` is provided, the Node will be automatically selected in the tree, if it exists. \ **Example:** Display the node selection dialog as soon as this node is added to the tree for the first time: @@ -759,9 +759,9 @@ Pops up an editor dialog for selecting a :ref:`Node` from the edited .. rst-class:: classref-method -|void| **popup_property_selector**\ (\ object\: :ref:`Object`, callback\: :ref:`Callable`, type_filter\: :ref:`PackedInt32Array` = PackedInt32Array()\ ) :ref:`🔗` +|void| **popup_property_selector**\ (\ object\: :ref:`Object`, callback\: :ref:`Callable`, type_filter\: :ref:`PackedInt32Array` = PackedInt32Array(), current_value\: :ref:`String` = ""\ ) :ref:`🔗` -Pops up an editor dialog for selecting properties from ``object``. The ``callback`` must take a single argument of type :ref:`NodePath`. It is called on the selected property path (see :ref:`NodePath.get_as_property_path`) or the empty path ``^""`` if the dialog is canceled. If ``type_filter`` is provided, the dialog will only show properties that match one of the listed :ref:`Variant.Type` values. +Pops up an editor dialog for selecting properties from ``object``. The ``callback`` must take a single argument of type :ref:`NodePath`. It is called on the selected property path (see :ref:`NodePath.get_as_property_path`) or the empty path ``^""`` if the dialog is canceled. If ``type_filter`` is provided, the dialog will only show properties that match one of the listed :ref:`Variant.Type` values. If ``current_value`` is provided, the property will be selected automatically in the property list, if it exists. :: diff --git a/classes/class_editorplugin.rst b/classes/class_editorplugin.rst index 199d912c1a9..3ff2efec755 100644 --- a/classes/class_editorplugin.rst +++ b/classes/class_editorplugin.rst @@ -89,6 +89,8 @@ Methods +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`add_autoload_singleton`\ (\ name\: :ref:`String`, path\: :ref:`String`\ ) | +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`add_context_menu_plugin`\ (\ slot\: :ref:`ContextMenuSlot`, plugin\: :ref:`EditorContextMenuPlugin`\ ) | + +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Button` | :ref:`add_control_to_bottom_panel`\ (\ control\: :ref:`Control`, title\: :ref:`String`, shortcut\: :ref:`Shortcut` = null\ ) | +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`add_control_to_container`\ (\ container\: :ref:`CustomControlContainer`, control\: :ref:`Control`\ ) | @@ -141,6 +143,8 @@ Methods +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`remove_autoload_singleton`\ (\ name\: :ref:`String`\ ) | +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`remove_context_menu_plugin`\ (\ slot\: :ref:`ContextMenuSlot`, plugin\: :ref:`EditorContextMenuPlugin`\ ) | + +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`remove_control_from_bottom_panel`\ (\ control\: :ref:`Control`\ ) | +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`remove_control_from_container`\ (\ container\: :ref:`CustomControlContainer`, control\: :ref:`Control`\ ) | @@ -488,6 +492,48 @@ Prevents the :ref:`InputEvent` from reaching other Editor clas Pass the :ref:`InputEvent` to other editor plugins except the main :ref:`Node3D` one. This can be used to prevent node selection changes and work with sub-gizmos instead. +.. rst-class:: classref-item-separator + +---- + +.. _enum_EditorPlugin_ContextMenuSlot: + +.. rst-class:: classref-enumeration + +enum **ContextMenuSlot**: :ref:`🔗` + +.. _class_EditorPlugin_constant_CONTEXT_SLOT_SCENE_TREE: + +.. rst-class:: classref-enumeration-constant + +:ref:`ContextMenuSlot` **CONTEXT_SLOT_SCENE_TREE** = ``0`` + +Context menu slot for the SceneTree. + +.. _class_EditorPlugin_constant_CONTEXT_SLOT_FILESYSTEM: + +.. rst-class:: classref-enumeration-constant + +:ref:`ContextMenuSlot` **CONTEXT_SLOT_FILESYSTEM** = ``1`` + +Context menu slot for the FileSystem. + +.. _class_EditorPlugin_constant_CONTEXT_SLOT_SCRIPT_EDITOR: + +.. rst-class:: classref-enumeration-constant + +:ref:`ContextMenuSlot` **CONTEXT_SLOT_SCRIPT_EDITOR** = ``2`` + +Context menu slot for the ScriptEditor file list. + +.. _class_EditorPlugin_constant_CONTEXT_SUBMENU_SLOT_FILESYSTEM_CREATE: + +.. rst-class:: classref-enumeration-constant + +:ref:`ContextMenuSlot` **CONTEXT_SUBMENU_SLOT_FILESYSTEM_CREATE** = ``3`` + +Context menu slot for the FileSystem create submenu. + .. rst-class:: classref-section-separator ---- @@ -1085,6 +1131,20 @@ Adds a script at ``path`` to the Autoload list as ``name``. ---- +.. _class_EditorPlugin_method_add_context_menu_plugin: + +.. rst-class:: classref-method + +|void| **add_context_menu_plugin**\ (\ slot\: :ref:`ContextMenuSlot`, plugin\: :ref:`EditorContextMenuPlugin`\ ) :ref:`🔗` + +Adds a plugin to the context menu. ``slot`` is the position in the context menu where the plugin will be added. + +Context menus are supported for three commonly used areas: the file system, scene tree, and editor script list panel. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorPlugin_method_add_control_to_bottom_panel: .. rst-class:: classref-method @@ -1461,6 +1521,18 @@ Removes an Autoload ``name`` from the list. ---- +.. _class_EditorPlugin_method_remove_context_menu_plugin: + +.. rst-class:: classref-method + +|void| **remove_context_menu_plugin**\ (\ slot\: :ref:`ContextMenuSlot`, plugin\: :ref:`EditorContextMenuPlugin`\ ) :ref:`🔗` + +Removes a context menu plugin from the specified slot. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorPlugin_method_remove_control_from_bottom_panel: .. rst-class:: classref-method diff --git a/classes/class_editorresourcepreviewgenerator.rst b/classes/class_editorresourcepreviewgenerator.rst index 6229916f434..016c9d3a007 100644 --- a/classes/class_editorresourcepreviewgenerator.rst +++ b/classes/class_editorresourcepreviewgenerator.rst @@ -72,7 +72,7 @@ By default, it returns ``false``. Generate a preview from a given resource with the specified size. This must always be implemented. -Returning an empty texture is an OK way to fail and let another generator take care. +Returning ``null`` is an OK way to fail and let another generator take care. Care must be taken because this function is always called from a thread (not the main thread). @@ -90,7 +90,7 @@ Care must be taken because this function is always called from a thread (not the Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call :ref:`_generate`. -Returning an empty texture is an OK way to fail and let another generator take care. +Returning ``null`` is an OK way to fail and let another generator take care. Care must be taken because this function is always called from a thread (not the main thread). diff --git a/classes/class_editorsettings.rst b/classes/class_editorsettings.rst index eb992a93235..aaeae5118c6 100644 --- a/classes/class_editorsettings.rst +++ b/classes/class_editorsettings.rst @@ -67,12 +67,16 @@ Properties +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`debugger/profiler_frame_max_functions` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`debugger/profiler_target_fps` | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`debugger/remote_inspect_refresh_interval` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`debugger/remote_scene_tree_refresh_interval` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`docks/filesystem/always_show_folders` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`docks/filesystem/other_file_extensions` | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`docks/filesystem/textfile_extensions` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`docks/filesystem/thumbnail_size` | @@ -853,6 +857,18 @@ The maximum number of script functions that can be displayed per frame in the pr ---- +.. _class_EditorSettings_property_debugger/profiler_target_fps: + +.. rst-class:: classref-property + +:ref:`int` **debugger/profiler_target_fps** :ref:`🔗` + +The target frame rate shown in the visual profiler graph, in frames per second. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_debugger/remote_inspect_refresh_interval: .. rst-class:: classref-property @@ -891,13 +907,25 @@ If ``true``, displays folders in the FileSystem dock's bottom pane when split mo ---- +.. _class_EditorSettings_property_docks/filesystem/other_file_extensions: + +.. rst-class:: classref-property + +:ref:`String` **docks/filesystem/other_file_extensions** :ref:`🔗` + +A comma separated list of unsupported file extensions to show in the FileSystem dock, e.g. ``"ico,icns"``. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_docks/filesystem/textfile_extensions: .. rst-class:: classref-property :ref:`String` **docks/filesystem/textfile_extensions** :ref:`🔗` -List of file extensions to consider as editable text files in the FileSystem dock (by double-clicking on the files). +A comma separated list of file extensions to consider as editable text files in the FileSystem dock (by double-clicking on the files), e.g. ``"txt,md,cfg,ini,log,json,yml,yaml,toml,xml"``. .. rst-class:: classref-item-separator @@ -3743,6 +3771,8 @@ Specifies how the Play window is launched relative to the Android editor. - **Side-by-side with Editor** will launch the Play window side-by-side with the Editor window. +- **Launch in PiP mode** will launch the Play window directly in picture-in-picture (PiP) mode if PiP mode is supported and enabled. When maximized, the Play window will occupy the same window as the Editor. + \ **Note:** Only available in the Android editor. .. rst-class:: classref-item-separator diff --git a/classes/class_gltfskeleton.rst b/classes/class_gltfskeleton.rst index 2c18ecaea1d..988e380374f 100644 --- a/classes/class_gltfskeleton.rst +++ b/classes/class_gltfskeleton.rst @@ -85,6 +85,8 @@ Property Descriptions There is currently no description for this property. Please help us by :ref:`contributing one `! +**Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedInt32Array` for more details. + .. rst-class:: classref-item-separator ---- @@ -104,6 +106,8 @@ Property Descriptions There is currently no description for this property. Please help us by :ref:`contributing one `! +**Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedInt32Array` for more details. + .. rst-class:: classref-section-separator ---- diff --git a/classes/class_gltfskin.rst b/classes/class_gltfskin.rst index fabbff6adeb..1a1b7201ee8 100644 --- a/classes/class_gltfskin.rst +++ b/classes/class_gltfskin.rst @@ -112,6 +112,8 @@ Property Descriptions There is currently no description for this property. Please help us by :ref:`contributing one `! +**Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedInt32Array` for more details. + .. rst-class:: classref-item-separator ---- @@ -131,6 +133,8 @@ Property Descriptions There is currently no description for this property. Please help us by :ref:`contributing one `! +**Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedInt32Array` for more details. + .. rst-class:: classref-item-separator ---- @@ -150,6 +154,8 @@ Property Descriptions There is currently no description for this property. Please help us by :ref:`contributing one `! +**Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedInt32Array` for more details. + .. rst-class:: classref-item-separator ---- @@ -169,6 +175,8 @@ Property Descriptions There is currently no description for this property. Please help us by :ref:`contributing one `! +**Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedInt32Array` for more details. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_javaclass.rst b/classes/class_javaclass.rst index ec46c89bd14..5ca861d1a7c 100644 --- a/classes/class_javaclass.rst +++ b/classes/class_javaclass.rst @@ -12,19 +12,76 @@ JavaClass **Inherits:** :ref:`RefCounted` **<** :ref:`Object` -Represents an object from the Java Native Interface. +Represents a class from the Java Native Interface. .. rst-class:: classref-introduction-group Description ----------- -Represents an object from the Java Native Interface. It is returned from :ref:`JavaClassWrapper.wrap`. +Represents a class from the Java Native Interface. It is returned from :ref:`JavaClassWrapper.wrap`. -\ **Note:** This class only works on Android. For any other build, this class does nothing. +\ **Note:** This class only works on Android. On any other platform, this class does nothing. \ **Note:** This class is not to be confused with :ref:`JavaScriptObject`. +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +------------------------------------------------------------------+------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_java_class_name`\ (\ ) |const| | + +------------------------------------------------------------------+------------------------------------------------------------------------------------------+ + | :ref:`Array`\[:ref:`Dictionary`\] | :ref:`get_java_method_list`\ (\ ) |const| | + +------------------------------------------------------------------+------------------------------------------------------------------------------------------+ + | :ref:`JavaClass` | :ref:`get_java_parent_class`\ (\ ) |const| | + +------------------------------------------------------------------+------------------------------------------------------------------------------------------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- + +.. _class_JavaClass_method_get_java_class_name: + +.. rst-class:: classref-method + +:ref:`String` **get_java_class_name**\ (\ ) |const| :ref:`🔗` + +Returns the Java class name. + +.. rst-class:: classref-item-separator + +---- + +.. _class_JavaClass_method_get_java_method_list: + +.. rst-class:: classref-method + +:ref:`Array`\[:ref:`Dictionary`\] **get_java_method_list**\ (\ ) |const| :ref:`🔗` + +Returns the object's Java methods and their signatures as an :ref:`Array` of dictionaries, in the same format as :ref:`Object.get_method_list`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_JavaClass_method_get_java_parent_class: + +.. rst-class:: classref-method + +:ref:`JavaClass` **get_java_parent_class**\ (\ ) |const| :ref:`🔗` + +Returns a **JavaClass** representing the Java parent class of this class. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_javaclasswrapper.rst b/classes/class_javaclasswrapper.rst index de7c0c2146c..dd228632d4b 100644 --- a/classes/class_javaclasswrapper.rst +++ b/classes/class_javaclasswrapper.rst @@ -23,6 +23,16 @@ The JavaClassWrapper singleton provides a way for the Godot application to send \ **Note:** This singleton is only available in Android builds. +:: + + var LocalDateTime = JavaClassWrapper.wrap("java.time.LocalDateTime") + var DateTimeFormatter = JavaClassWrapper.wrap("java.time.format.DateTimeFormatter") + + var datetime = LocalDateTime.now() + var formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm:ss") + + print(datetime.format(formatter)) + .. rst-class:: classref-reftable-group Methods diff --git a/classes/class_javaobject.rst b/classes/class_javaobject.rst new file mode 100644 index 00000000000..5a03e96075c --- /dev/null +++ b/classes/class_javaobject.rst @@ -0,0 +1,64 @@ +: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/JavaObject.xml. + +.. _class_JavaObject: + +JavaObject +========== + +**Inherits:** :ref:`RefCounted` **<** :ref:`Object` + +Represents an object from the Java Native Interface. + +.. rst-class:: classref-introduction-group + +Description +----------- + +Represents an object from the Java Native Interface. It can be returned from Java methods called on :ref:`JavaClass` or other **JavaObject**\ s. See :ref:`JavaClassWrapper` for an example. + +\ **Note:** This class only works on Android. On any other platform, this class does nothing. + +\ **Note:** This class is not to be confused with :ref:`JavaScriptObject`. + +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +-----------------------------------+-----------------------------------------------------------------------------+ + | :ref:`JavaClass` | :ref:`get_java_class`\ (\ ) |const| | + +-----------------------------------+-----------------------------------------------------------------------------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- + +.. _class_JavaObject_method_get_java_class: + +.. rst-class:: classref-method + +:ref:`JavaClass` **get_java_class**\ (\ ) |const| :ref:`🔗` + +Returns the :ref:`JavaClass` that this object is an instance of. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` +.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` +.. |void| replace:: :abbr:`void (No return value.)` diff --git a/classes/class_menubar.rst b/classes/class_menubar.rst index 24c7825ed93..7d65e6fd3b8 100644 --- a/classes/class_menubar.rst +++ b/classes/class_menubar.rst @@ -12,14 +12,14 @@ MenuBar **Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` -A horizontal menu bar that creates a :ref:`MenuButton` for each :ref:`PopupMenu` child. +A horizontal menu bar that creates a menu for each :ref:`PopupMenu` child. .. rst-class:: classref-introduction-group Description ----------- -A horizontal menu bar that creates a :ref:`MenuButton` for each :ref:`PopupMenu` child. New items are created by adding :ref:`PopupMenu`\ s to this node. +A horizontal menu bar that creates a menu for each :ref:`PopupMenu` child. New items are created by adding :ref:`PopupMenu`\ s to this node. .. rst-class:: classref-reftable-group @@ -185,6 +185,10 @@ Language code used for line-breaking and text shaping algorithms, if left empty If ``true``, **MenuBar** will use system global menu when supported. +\ **Note:** If ``true`` and global menu is supported, this node is not displayed, has zero size, and all its child nodes except :ref:`PopupMenu`\ s are inaccessible. + +\ **Note:** This property overrides the value of the :ref:`PopupMenu.prefer_native_menu` property of the child nodes. + .. rst-class:: classref-item-separator ---- @@ -200,7 +204,7 @@ If ``true``, **MenuBar** will use system global menu when supported. - |void| **set_start_index**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_start_index**\ (\ ) -Position in the global menu to insert first **MenuBar** item at. +Position order in the global menu to insert **MenuBar** items at. All menu items in the **MenuBar** are always inserted as a continuous range. Menus with lower :ref:`start_index` are inserted first. Menus with :ref:`start_index` equal to ``-1`` are inserted last. .. rst-class:: classref-item-separator diff --git a/classes/class_meshinstance3d.rst b/classes/class_meshinstance3d.rst index 604d6978821..26ed979ba97 100644 --- a/classes/class_meshinstance3d.rst +++ b/classes/class_meshinstance3d.rst @@ -63,6 +63,8 @@ Methods +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ArrayMesh` | :ref:`bake_mesh_from_current_blend_shape_mix`\ (\ existing\: :ref:`ArrayMesh` = null\ ) | +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`ArrayMesh` | :ref:`bake_mesh_from_current_skeleton_pose`\ (\ existing\: :ref:`ArrayMesh` = null\ ) | + +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`create_convex_collision`\ (\ clean\: :ref:`bool` = true, simplify\: :ref:`bool` = false\ ) | +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`create_debug_tangents`\ (\ ) | @@ -169,6 +171,20 @@ Takes a snapshot from the current :ref:`ArrayMesh` with all ble ---- +.. _class_MeshInstance3D_method_bake_mesh_from_current_skeleton_pose: + +.. rst-class:: classref-method + +:ref:`ArrayMesh` **bake_mesh_from_current_skeleton_pose**\ (\ existing\: :ref:`ArrayMesh` = null\ ) :ref:`🔗` + +Takes a snapshot of the current animated skeleton pose of the skinned mesh and bakes it to the provided ``existing`` mesh. If no ``existing`` mesh is provided a new :ref:`ArrayMesh` is created, baked, and returned. Requires a skeleton with a registered skin to work. Blendshapes are ignored. Mesh surface materials are not copied. + +\ **Performance:** :ref:`Mesh` data needs to be retrieved from the GPU, stalling the :ref:`RenderingServer` in the process. + +.. rst-class:: classref-item-separator + +---- + .. _class_MeshInstance3D_method_create_convex_collision: .. rst-class:: classref-method diff --git a/classes/class_multimesh.rst b/classes/class_multimesh.rst index 4dcf5ef822a..8cdee6bb9b4 100644 --- a/classes/class_multimesh.rst +++ b/classes/class_multimesh.rst @@ -194,6 +194,8 @@ Property Descriptions There is currently no description for this property. Please help us by :ref:`contributing one `! +**Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedFloat32Array` for more details. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_object.rst b/classes/class_object.rst index 9d20aa9ff59..cb05668ae90 100644 --- a/classes/class_object.rst +++ b/classes/class_object.rst @@ -75,6 +75,12 @@ Methods +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_init`\ (\ ) |virtual| | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`_iter_get`\ (\ iter\: :ref:`Variant`\ ) |virtual| | + +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`_iter_init`\ (\ iter\: :ref:`Array`\ ) |virtual| | + +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`_iter_next`\ (\ iter\: :ref:`Array`\ ) |virtual| | + +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_notification`\ (\ what\: :ref:`int`\ ) |virtual| | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_property_can_revert`\ (\ property\: :ref:`StringName`\ ) |virtual| | @@ -499,6 +505,73 @@ Called when the object's script is instantiated, oftentimes after the object is ---- +.. _class_Object_private_method__iter_get: + +.. rst-class:: classref-method + +:ref:`Variant` **_iter_get**\ (\ iter\: :ref:`Variant`\ ) |virtual| :ref:`🔗` + +Returns the current iterable value. ``iter`` stores the iteration state, but unlike :ref:`_iter_init` and :ref:`_iter_next` the state is supposed to be read-only, so there is no :ref:`Array` wrapper. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Object_private_method__iter_init: + +.. rst-class:: classref-method + +:ref:`bool` **_iter_init**\ (\ iter\: :ref:`Array`\ ) |virtual| :ref:`🔗` + +Initializes the iterator. ``iter`` stores the iteration state. Since GDScript does not support passing arguments by reference, a single-element array is used as a wrapper. Returns ``true`` so long as the iterator has not reached the end. + +Example: + +:: + + class MyRange: + var _from + var _to + + func _init(from, to): + assert(from <= to) + _from = from + _to = to + + func _iter_init(iter): + iter[0] = _from + return iter[0] < _to + + func _iter_next(iter): + iter[0] += 1 + return iter[0] < _to + + func _iter_get(iter): + return iter + + func _ready(): + var my_range = MyRange.new(2, 5) + for x in my_range: + print(x) # Prints 2, 3, 4. + +\ **Note:** Alternatively, you can ignore ``iter`` and use the object's state instead, see `online docs <../tutorials/scripting/gdscript/gdscript_advanced.html#custom-iterators>`__ for an example. Note that in this case you will not be able to reuse the same iterator instance in nested loops. Also, make sure you reset the iterator state in this method if you want to reuse the same instance multiple times. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Object_private_method__iter_next: + +.. rst-class:: classref-method + +:ref:`bool` **_iter_next**\ (\ iter\: :ref:`Array`\ ) |virtual| :ref:`🔗` + +Moves the iterator to the next iteration. ``iter`` stores the iteration state. Since GDScript does not support passing arguments by reference, a single-element array is used as a wrapper. Returns ``true`` so long as the iterator has not reached the end. + +.. rst-class:: classref-item-separator + +---- + .. _class_Object_private_method__notification: .. rst-class:: classref-method diff --git a/classes/class_os.rst b/classes/class_os.rst index eb00f225a53..c3376160375 100644 --- a/classes/class_os.rst +++ b/classes/class_os.rst @@ -71,7 +71,7 @@ Methods +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`execute`\ (\ path\: :ref:`String`, arguments\: :ref:`PackedStringArray`, output\: :ref:`Array` = [], read_stderr\: :ref:`bool` = false, open_console\: :ref:`bool` = false\ ) | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Dictionary` | :ref:`execute_with_pipe`\ (\ path\: :ref:`String`, arguments\: :ref:`PackedStringArray`\ ) | + | :ref:`Dictionary` | :ref:`execute_with_pipe`\ (\ path\: :ref:`String`, arguments\: :ref:`PackedStringArray`, blocking\: :ref:`bool` = true\ ) | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Key` | :ref:`find_keycode_from_string`\ (\ string\: :ref:`String`\ ) |const| | +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -581,10 +581,12 @@ If you wish to access a shell built-in or execute a composite command, a platfor .. rst-class:: classref-method -:ref:`Dictionary` **execute_with_pipe**\ (\ path\: :ref:`String`, arguments\: :ref:`PackedStringArray`\ ) :ref:`🔗` +:ref:`Dictionary` **execute_with_pipe**\ (\ path\: :ref:`String`, arguments\: :ref:`PackedStringArray`, blocking\: :ref:`bool` = true\ ) :ref:`🔗` Creates a new process that runs independently of Godot with redirected IO. It will not terminate when Godot terminates. The path specified in ``path`` must exist and be an executable file or macOS ``.app`` bundle. The path is resolved based on the current platform. The ``arguments`` are used in the given order and separated by a space. +If ``blocking`` is ``false``, created pipes work in non-blocking mode, i.e. read and write operations will return immediately. Use :ref:`FileAccess.get_error` to check if the last read/write operation was successful. + If the process cannot be created, this method returns an empty :ref:`Dictionary`. Otherwise, this method returns a :ref:`Dictionary` with the following keys: - ``"stdio"`` - :ref:`FileAccess` to access the process stdin and stdout pipes (read/write). diff --git a/classes/class_particleprocessmaterial.rst b/classes/class_particleprocessmaterial.rst index 0ea83a1e990..e471fec0b67 100644 --- a/classes/class_particleprocessmaterial.rst +++ b/classes/class_particleprocessmaterial.rst @@ -100,6 +100,8 @@ Properties +--------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-------------------------+ | :ref:`Vector3` | :ref:`emission_ring_axis` | | +--------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-------------------------+ + | :ref:`float` | :ref:`emission_ring_cone_angle` | | + +--------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-------------------------+ | :ref:`float` | :ref:`emission_ring_height` | | +--------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-------------------------+ | :ref:`float` | :ref:`emission_ring_inner_radius` | | @@ -1284,6 +1286,25 @@ The axis of the ring when using the emitter :ref:`EMISSION_SHAPE_RING` **emission_ring_cone_angle** :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_emission_ring_cone_angle**\ (\ value\: :ref:`float`\ ) +- :ref:`float` **get_emission_ring_cone_angle**\ (\ ) + +The angle of the cone when using the emitter :ref:`EMISSION_SHAPE_RING`. The default angle of 90 degrees results in a ring, while an angle of 0 degrees results in a cone. Intermediate values will result in a ring where one end is larger than the other. + +\ **Note:** Depending on :ref:`emission_ring_height`, the angle may be clamped if the ring's end is reached to form a perfect cone. + +.. rst-class:: classref-item-separator + +---- + .. _class_ParticleProcessMaterial_property_emission_ring_height: .. rst-class:: classref-property diff --git a/classes/class_pathfollow2d.rst b/classes/class_pathfollow2d.rst index 16ecfbdfd0f..3f2e9391654 100644 --- a/classes/class_pathfollow2d.rst +++ b/classes/class_pathfollow2d.rst @@ -141,6 +141,8 @@ The distance along the path, in pixels. Changing this value sets this node's pos The distance along the path as a number in the range 0.0 (for the first vertex) to 1.0 (for the last). This is just another way of expressing the progress within the path, as the offset supplied is multiplied internally by the path's length. +It can be set or get only if the **PathFollow2D** is the child of a :ref:`Path2D` which is part of the scene tree, and that this :ref:`Path2D` has a :ref:`Curve2D` with a non-zero length. Otherwise, trying to set this field will print an error, and getting this field will return ``0.0``. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_pathfollow3d.rst b/classes/class_pathfollow3d.rst index 1323bd70faf..6aad313fb15 100644 --- a/classes/class_pathfollow3d.rst +++ b/classes/class_pathfollow3d.rst @@ -212,6 +212,8 @@ The distance from the first vertex, measured in 3D units along the path. Changin The distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. This is just another way of expressing the progress within the path, as the progress supplied is multiplied internally by the path's length. +It can be set or get only if the **PathFollow3D** is the child of a :ref:`Path3D` which is part of the scene tree, and that this :ref:`Path3D` has a :ref:`Curve3D` with a non-zero length. Otherwise, trying to set this field will print an error, and getting this field will return ``0.0``. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_polygonpathfinder.rst b/classes/class_polygonpathfinder.rst index cf7319af0f3..50a410cad1e 100644 --- a/classes/class_polygonpathfinder.rst +++ b/classes/class_polygonpathfinder.rst @@ -127,9 +127,35 @@ Method Descriptions :ref:`bool` **is_point_inside**\ (\ point\: :ref:`Vector2`\ ) |const| :ref:`🔗` -.. container:: contribute +Returns ``true`` if ``point`` falls inside the polygon area. + + +.. tabs:: + + .. code-tab:: gdscript + + var polygon_path_finder = PolygonPathFinder.new() + var points = [Vector2(0.0, 0.0), Vector2(1.0, 0.0), Vector2(0.0, 1.0)] + var connections = [0, 1, 1, 2, 2, 0] + polygon_path_finder.setup(points, connections) + print(polygon_path_finder.is_point_inside(Vector2(0.2, 0.2))) # Prints true + print(polygon_path_finder.is_point_inside(Vector2(1.0, 1.0))) # Prints false + + .. code-tab:: csharp + + var polygonPathFinder = new PolygonPathFinder(); + var points = new Vector2[] + { + new Vector2(0.0f, 0.0f), + new Vector2(1.0f, 0.0f), + new Vector2(0.0f, 1.0f) + }; + var connections = new int[] { 0, 1, 1, 2, 2, 0 }; + polygonPathFinder.Setup(points, connections); + GD.Print(polygonPathFinder.IsPointInside(new Vector2(0.2f, 0.2f))); // Prints true + GD.Print(polygonPathFinder.IsPointInside(new Vector2(1.0f, 1.0f))); // Prints false + - There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator @@ -155,9 +181,33 @@ Method Descriptions |void| **setup**\ (\ points\: :ref:`PackedVector2Array`, connections\: :ref:`PackedInt32Array`\ ) :ref:`🔗` -.. container:: contribute +Sets up **PolygonPathFinder** with an array of points that define the vertices of the polygon, and an array of indices that determine the edges of the polygon. + +The length of ``connections`` must be even, returns an error if odd. + + +.. tabs:: + + .. code-tab:: gdscript + + var polygon_path_finder = PolygonPathFinder.new() + var points = [Vector2(0.0, 0.0), Vector2(1.0, 0.0), Vector2(0.0, 1.0)] + var connections = [0, 1, 1, 2, 2, 0] + polygon_path_finder.setup(points, connections) + + .. code-tab:: csharp + + var polygonPathFinder = new PolygonPathFinder(); + var points = new Vector2[] + { + new Vector2(0.0f, 0.0f), + new Vector2(1.0f, 0.0f), + new Vector2(0.0f, 1.0f) + }; + var connections = new int[] { 0, 1, 1, 2, 2, 0 }; + polygonPathFinder.Setup(points, connections); + - There is currently no description for this method. Please help us by :ref:`contributing one `! .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_projectsettings.rst b/classes/class_projectsettings.rst index 5287f09577f..72101831437 100644 --- a/classes/class_projectsettings.rst +++ b/classes/class_projectsettings.rst @@ -11804,7 +11804,11 @@ The default compression factor for lossless WebP. Decompression speed is mostly :ref:`bool` **rendering/viewport/hdr_2d** = ``false`` :ref:`🔗` -If ``true``, enables :ref:`Viewport.use_hdr_2d` on the root viewport. This allows 2D rendering to take advantage of effects requiring high dynamic range (e.g. 2D glow). +If ``true``, enables :ref:`Viewport.use_hdr_2d` on the root viewport. 2D rendering will use an high dynamic range (HDR) format framebuffer matching the bit depth of the 3D framebuffer. When using the Forward+ renderer this will be an ``RGBA16`` framebuffer, while when using the Mobile renderer it will be an ``RGB10_A2`` framebuffer. Additionally, 2D rendering will take place in linear color space and will be converted to sRGB space immediately before blitting to the screen. Practically speaking, this means that the end result of the Viewport will not be clamped into the ``0-1`` range and can be used in 3D rendering without color space adjustments. This allows 2D rendering to take advantage of effects requiring high dynamic range (e.g. 2D glow) as well as substantially improves the appearance of effects requiring highly detailed gradients. + +\ **Note:** This setting will have no effect when using the GL Compatibility renderer as the GL Compatibility renderer always renders in low dynamic range for performance reasons. + +\ **Note:** This property is only read when the project starts. To toggle HDR 2D at runtime, set :ref:`Viewport.use_hdr_2d` on the root :ref:`Viewport`. .. rst-class:: classref-item-separator diff --git a/classes/class_refcounted.rst b/classes/class_refcounted.rst index 61010394d17..755e1e8faca 100644 --- a/classes/class_refcounted.rst +++ b/classes/class_refcounted.rst @@ -12,7 +12,7 @@ RefCounted **Inherits:** :ref:`Object` -**Inherited By:** :ref:`AESContext`, :ref:`AStar2D`, :ref:`AStar3D`, :ref:`AStarGrid2D`, :ref:`AudioEffectInstance`, :ref:`AudioSample`, :ref:`AudioSamplePlayback`, :ref:`AudioStreamPlayback`, :ref:`CameraFeed`, :ref:`CharFXTransform`, :ref:`ConfigFile`, :ref:`Crypto`, :ref:`DirAccess`, :ref:`DTLSServer`, :ref:`EditorDebuggerPlugin`, :ref:`EditorDebuggerSession`, :ref:`EditorExportPlatform`, :ref:`EditorExportPlugin`, :ref:`EditorExportPreset`, :ref:`EditorFeatureProfile`, :ref:`EditorFileSystemImportFormatSupportQuery`, :ref:`EditorInspectorPlugin`, :ref:`EditorResourceConversionPlugin`, :ref:`EditorResourcePreviewGenerator`, :ref:`EditorResourceTooltipPlugin`, :ref:`EditorSceneFormatImporter`, :ref:`EditorScenePostImport`, :ref:`EditorScenePostImportPlugin`, :ref:`EditorScript`, :ref:`EditorTranslationParserPlugin`, :ref:`EncodedObjectAsID`, :ref:`ENetConnection`, :ref:`EngineProfiler`, :ref:`Expression`, :ref:`FileAccess`, :ref:`HashingContext`, :ref:`HMACContext`, :ref:`HTTPClient`, :ref:`ImageFormatLoader`, :ref:`JavaClass`, :ref:`JavaScriptObject`, :ref:`KinematicCollision2D`, :ref:`KinematicCollision3D`, :ref:`Lightmapper`, :ref:`MeshConvexDecompositionSettings`, :ref:`MeshDataTool`, :ref:`MultiplayerAPI`, :ref:`Mutex`, :ref:`NavigationPathQueryParameters2D`, :ref:`NavigationPathQueryParameters3D`, :ref:`NavigationPathQueryResult2D`, :ref:`NavigationPathQueryResult3D`, :ref:`Node3DGizmo`, :ref:`OggPacketSequencePlayback`, :ref:`OpenXRAPIExtension`, :ref:`PackedDataContainerRef`, :ref:`PacketPeer`, :ref:`PCKPacker`, :ref:`PhysicsPointQueryParameters2D`, :ref:`PhysicsPointQueryParameters3D`, :ref:`PhysicsRayQueryParameters2D`, :ref:`PhysicsRayQueryParameters3D`, :ref:`PhysicsShapeQueryParameters2D`, :ref:`PhysicsShapeQueryParameters3D`, :ref:`PhysicsTestMotionParameters2D`, :ref:`PhysicsTestMotionParameters3D`, :ref:`PhysicsTestMotionResult2D`, :ref:`PhysicsTestMotionResult3D`, :ref:`RandomNumberGenerator`, :ref:`RDAttachmentFormat`, :ref:`RDFramebufferPass`, :ref:`RDPipelineColorBlendState`, :ref:`RDPipelineColorBlendStateAttachment`, :ref:`RDPipelineDepthStencilState`, :ref:`RDPipelineMultisampleState`, :ref:`RDPipelineRasterizationState`, :ref:`RDPipelineSpecializationConstant`, :ref:`RDSamplerState`, :ref:`RDShaderSource`, :ref:`RDTextureFormat`, :ref:`RDTextureView`, :ref:`RDUniform`, :ref:`RDVertexAttribute`, :ref:`RegEx`, :ref:`RegExMatch`, :ref:`RenderSceneBuffers`, :ref:`RenderSceneBuffersConfiguration`, :ref:`Resource`, :ref:`ResourceFormatLoader`, :ref:`ResourceFormatSaver`, :ref:`ResourceImporter`, :ref:`SceneState`, :ref:`SceneTreeTimer`, :ref:`Semaphore`, :ref:`SkinReference`, :ref:`StreamPeer`, :ref:`SurfaceTool`, :ref:`TCPServer`, :ref:`TextLine`, :ref:`TextParagraph`, :ref:`TextServer`, :ref:`Thread`, :ref:`TLSOptions`, :ref:`TriangleMesh`, :ref:`Tween`, :ref:`Tweener`, :ref:`UDPServer`, :ref:`UPNP`, :ref:`UPNPDevice`, :ref:`WeakRef`, :ref:`WebRTCPeerConnection`, :ref:`XMLParser`, :ref:`XRInterface`, :ref:`XRPose`, :ref:`XRTracker`, :ref:`ZIPPacker`, :ref:`ZIPReader` +**Inherited By:** :ref:`AESContext`, :ref:`AStar2D`, :ref:`AStar3D`, :ref:`AStarGrid2D`, :ref:`AudioEffectInstance`, :ref:`AudioSample`, :ref:`AudioSamplePlayback`, :ref:`AudioStreamPlayback`, :ref:`CameraFeed`, :ref:`CharFXTransform`, :ref:`ConfigFile`, :ref:`Crypto`, :ref:`DirAccess`, :ref:`DTLSServer`, :ref:`EditorContextMenuPlugin`, :ref:`EditorDebuggerPlugin`, :ref:`EditorDebuggerSession`, :ref:`EditorExportPlatform`, :ref:`EditorExportPlugin`, :ref:`EditorExportPreset`, :ref:`EditorFeatureProfile`, :ref:`EditorFileSystemImportFormatSupportQuery`, :ref:`EditorInspectorPlugin`, :ref:`EditorResourceConversionPlugin`, :ref:`EditorResourcePreviewGenerator`, :ref:`EditorResourceTooltipPlugin`, :ref:`EditorSceneFormatImporter`, :ref:`EditorScenePostImport`, :ref:`EditorScenePostImportPlugin`, :ref:`EditorScript`, :ref:`EditorTranslationParserPlugin`, :ref:`EncodedObjectAsID`, :ref:`ENetConnection`, :ref:`EngineProfiler`, :ref:`Expression`, :ref:`FileAccess`, :ref:`HashingContext`, :ref:`HMACContext`, :ref:`HTTPClient`, :ref:`ImageFormatLoader`, :ref:`JavaClass`, :ref:`JavaObject`, :ref:`JavaScriptObject`, :ref:`KinematicCollision2D`, :ref:`KinematicCollision3D`, :ref:`Lightmapper`, :ref:`MeshConvexDecompositionSettings`, :ref:`MeshDataTool`, :ref:`MultiplayerAPI`, :ref:`Mutex`, :ref:`NavigationPathQueryParameters2D`, :ref:`NavigationPathQueryParameters3D`, :ref:`NavigationPathQueryResult2D`, :ref:`NavigationPathQueryResult3D`, :ref:`Node3DGizmo`, :ref:`OggPacketSequencePlayback`, :ref:`OpenXRAPIExtension`, :ref:`PackedDataContainerRef`, :ref:`PacketPeer`, :ref:`PCKPacker`, :ref:`PhysicsPointQueryParameters2D`, :ref:`PhysicsPointQueryParameters3D`, :ref:`PhysicsRayQueryParameters2D`, :ref:`PhysicsRayQueryParameters3D`, :ref:`PhysicsShapeQueryParameters2D`, :ref:`PhysicsShapeQueryParameters3D`, :ref:`PhysicsTestMotionParameters2D`, :ref:`PhysicsTestMotionParameters3D`, :ref:`PhysicsTestMotionResult2D`, :ref:`PhysicsTestMotionResult3D`, :ref:`RandomNumberGenerator`, :ref:`RDAttachmentFormat`, :ref:`RDFramebufferPass`, :ref:`RDPipelineColorBlendState`, :ref:`RDPipelineColorBlendStateAttachment`, :ref:`RDPipelineDepthStencilState`, :ref:`RDPipelineMultisampleState`, :ref:`RDPipelineRasterizationState`, :ref:`RDPipelineSpecializationConstant`, :ref:`RDSamplerState`, :ref:`RDShaderSource`, :ref:`RDTextureFormat`, :ref:`RDTextureView`, :ref:`RDUniform`, :ref:`RDVertexAttribute`, :ref:`RegEx`, :ref:`RegExMatch`, :ref:`RenderSceneBuffers`, :ref:`RenderSceneBuffersConfiguration`, :ref:`Resource`, :ref:`ResourceFormatLoader`, :ref:`ResourceFormatSaver`, :ref:`ResourceImporter`, :ref:`SceneState`, :ref:`SceneTreeTimer`, :ref:`Semaphore`, :ref:`SkinReference`, :ref:`StreamPeer`, :ref:`SurfaceTool`, :ref:`TCPServer`, :ref:`TextLine`, :ref:`TextParagraph`, :ref:`TextServer`, :ref:`Thread`, :ref:`TLSOptions`, :ref:`TriangleMesh`, :ref:`Tween`, :ref:`Tweener`, :ref:`UDPServer`, :ref:`UPNP`, :ref:`UPNPDevice`, :ref:`WeakRef`, :ref:`WebRTCPeerConnection`, :ref:`XMLParser`, :ref:`XRInterface`, :ref:`XRPose`, :ref:`XRTracker`, :ref:`ZIPPacker`, :ref:`ZIPReader` Base class for reference-counted objects. diff --git a/classes/class_renderingserver.rst b/classes/class_renderingserver.rst index 85b1d47dbe3..7459a2980c3 100644 --- a/classes/class_renderingserver.rst +++ b/classes/class_renderingserver.rst @@ -141,6 +141,8 @@ Methods +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`canvas_item_add_triangle_array`\ (\ item\: :ref:`RID`, indices\: :ref:`PackedInt32Array`, points\: :ref:`PackedVector2Array`, colors\: :ref:`PackedColorArray`, uvs\: :ref:`PackedVector2Array` = PackedVector2Array(), bones\: :ref:`PackedInt32Array` = PackedInt32Array(), weights\: :ref:`PackedFloat32Array` = PackedFloat32Array(), texture\: :ref:`RID` = RID(), count\: :ref:`int` = -1\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`canvas_item_attach_skeleton`\ (\ item\: :ref:`RID`, skeleton\: :ref:`RID`\ ) | + +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`canvas_item_clear`\ (\ item\: :ref:`RID`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`canvas_item_create`\ (\ ) | @@ -6224,6 +6226,8 @@ Draws particles on the :ref:`CanvasItem` pointed to by the ``i Draws a 2D polygon on the :ref:`CanvasItem` pointed to by the ``item`` :ref:`RID`. If you need more flexibility (such as being able to use bones), use :ref:`canvas_item_add_triangle_array` instead. See also :ref:`CanvasItem.draw_polygon`. +\ **Note:** If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with :ref:`Geometry2D.triangulate_polygon` and using :ref:`CanvasItem.draw_mesh`, :ref:`CanvasItem.draw_multimesh`, or :ref:`canvas_item_add_triangle_array`. + .. rst-class:: classref-item-separator ---- @@ -6314,6 +6318,18 @@ Draws a triangle array on the :ref:`CanvasItem` pointed to by ---- +.. _class_RenderingServer_method_canvas_item_attach_skeleton: + +.. rst-class:: classref-method + +|void| **canvas_item_attach_skeleton**\ (\ item\: :ref:`RID`, skeleton\: :ref:`RID`\ ) :ref:`🔗` + +Attaches a skeleton to the :ref:`CanvasItem`. Removes the previous skeleton. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingServer_method_canvas_item_clear: .. rst-class:: classref-method diff --git a/classes/class_resourceimporterwav.rst b/classes/class_resourceimporterwav.rst index f63ea0f568a..cb205171af4 100644 --- a/classes/class_resourceimporterwav.rst +++ b/classes/class_resourceimporterwav.rst @@ -19,7 +19,9 @@ Imports a WAV audio file for playback. Description ----------- -WAV is an uncompressed format, which can provide higher quality compared to Ogg Vorbis and MP3. It also has the lowest CPU cost to decode. This means high numbers of WAV sounds can be played at the same time, even on low-end deviceS. +WAV is an uncompressed format, which can provide higher quality compared to Ogg Vorbis and MP3. It also has the lowest CPU cost to decode. This means high numbers of WAV sounds can be played at the same time, even on low-end devices. + +By default, Godot imports WAV files using the lossy Quite OK Audio compression. You may change this by setting the :ref:`compress/mode` property. .. rst-class:: classref-introduction-group @@ -37,7 +39,7 @@ Properties :widths: auto +---------------------------+--------------------------------------------------------------------------------+-----------+ - | :ref:`int` | :ref:`compress/mode` | ``0`` | + | :ref:`int` | :ref:`compress/mode` | ``2`` | +---------------------------+--------------------------------------------------------------------------------+-----------+ | :ref:`int` | :ref:`edit/loop_begin` | ``0`` | +---------------------------+--------------------------------------------------------------------------------+-----------+ @@ -71,7 +73,7 @@ Property Descriptions .. rst-class:: classref-property -:ref:`int` **compress/mode** = ``0`` :ref:`🔗` +:ref:`int` **compress/mode** = ``2`` :ref:`🔗` The compression mode to use on import. diff --git a/classes/class_spinbox.rst b/classes/class_spinbox.rst index b1d7f359978..e917bda31bb 100644 --- a/classes/class_spinbox.rst +++ b/classes/class_spinbox.rst @@ -447,7 +447,7 @@ Vertical separation between the up and down buttons. :ref:`int` **buttons_width** = ``16`` :ref:`🔗` -Width of the up and down buttons. If smaller than any icon set on the buttons, the respective icon may overlap neighboring elements, unless :ref:`set_min_buttons_width_from_icons` is different than ``0``. +Width of the up and down buttons. If smaller than any icon set on the buttons, the respective icon may overlap neighboring elements. If smaller than ``0``, the width is automatically adjusted from the icon size. .. rst-class:: classref-item-separator diff --git a/classes/class_spriteframes.rst b/classes/class_spriteframes.rst index 86e11ef0a13..ab02369819f 100644 --- a/classes/class_spriteframes.rst +++ b/classes/class_spriteframes.rst @@ -38,6 +38,8 @@ Methods +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`clear_all`\ (\ ) | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`duplicate_animation`\ (\ anim_from\: :ref:`StringName`, anim_to\: :ref:`StringName`\ ) | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_animation_loop`\ (\ anim\: :ref:`StringName`\ ) |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedStringArray` | :ref:`get_animation_names`\ (\ ) |const| | @@ -122,6 +124,18 @@ Removes all animations. An empty ``default`` animation will be created. ---- +.. _class_SpriteFrames_method_duplicate_animation: + +.. rst-class:: classref-method + +|void| **duplicate_animation**\ (\ anim_from\: :ref:`StringName`, anim_to\: :ref:`StringName`\ ) :ref:`🔗` + +Duplicates the animation ``anim_from`` to a new animation named ``anim_to``. Fails if ``anim_to`` already exists, or if ``anim_from`` does not exist. + +.. rst-class:: classref-item-separator + +---- + .. _class_SpriteFrames_method_get_animation_loop: .. rst-class:: classref-method diff --git a/classes/class_tiledata.rst b/classes/class_tiledata.rst index 968cdb334cf..27501f317cb 100644 --- a/classes/class_tiledata.rst +++ b/classes/class_tiledata.rst @@ -61,57 +61,69 @@ Methods .. table:: :widths: auto - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`add_collision_polygon`\ (\ layer_id\: :ref:`int`\ ) | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_collision_polygon_one_way_margin`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`\ ) |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedVector2Array` | :ref:`get_collision_polygon_points`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`\ ) |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_collision_polygons_count`\ (\ layer_id\: :ref:`int`\ ) |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_constant_angular_velocity`\ (\ layer_id\: :ref:`int`\ ) |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2` | :ref:`get_constant_linear_velocity`\ (\ layer_id\: :ref:`int`\ ) |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Variant` | :ref:`get_custom_data`\ (\ layer_name\: :ref:`String`\ ) |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Variant` | :ref:`get_custom_data_by_layer_id`\ (\ layer_id\: :ref:`int`\ ) |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`NavigationPolygon` | :ref:`get_navigation_polygon`\ (\ layer_id\: :ref:`int`, flip_h\: :ref:`bool` = false, flip_v\: :ref:`bool` = false, transpose\: :ref:`bool` = false\ ) |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`OccluderPolygon2D` | :ref:`get_occluder`\ (\ layer_id\: :ref:`int`, flip_h\: :ref:`bool` = false, flip_v\: :ref:`bool` = false, transpose\: :ref:`bool` = false\ ) |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_terrain_peering_bit`\ (\ peering_bit\: :ref:`CellNeighbor`\ ) |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_collision_polygon_one_way`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`\ ) |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_valid_terrain_peering_bit`\ (\ peering_bit\: :ref:`CellNeighbor`\ ) |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`remove_collision_polygon`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`\ ) | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_collision_polygon_one_way`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`, one_way\: :ref:`bool`\ ) | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_collision_polygon_one_way_margin`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`, one_way_margin\: :ref:`float`\ ) | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_collision_polygon_points`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`, polygon\: :ref:`PackedVector2Array`\ ) | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_collision_polygons_count`\ (\ layer_id\: :ref:`int`, polygons_count\: :ref:`int`\ ) | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_constant_angular_velocity`\ (\ layer_id\: :ref:`int`, velocity\: :ref:`float`\ ) | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_constant_linear_velocity`\ (\ layer_id\: :ref:`int`, velocity\: :ref:`Vector2`\ ) | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_custom_data`\ (\ layer_name\: :ref:`String`, value\: :ref:`Variant`\ ) | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_custom_data_by_layer_id`\ (\ layer_id\: :ref:`int`, value\: :ref:`Variant`\ ) | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_navigation_polygon`\ (\ layer_id\: :ref:`int`, navigation_polygon\: :ref:`NavigationPolygon`\ ) | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_occluder`\ (\ layer_id\: :ref:`int`, occluder_polygon\: :ref:`OccluderPolygon2D`\ ) | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_terrain_peering_bit`\ (\ peering_bit\: :ref:`CellNeighbor`, terrain\: :ref:`int`\ ) | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`add_collision_polygon`\ (\ layer_id\: :ref:`int`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`add_occluder_polygon`\ (\ layer_id\: :ref:`int`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_collision_polygon_one_way_margin`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`\ ) |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedVector2Array` | :ref:`get_collision_polygon_points`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`\ ) |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_collision_polygons_count`\ (\ layer_id\: :ref:`int`\ ) |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_constant_angular_velocity`\ (\ layer_id\: :ref:`int`\ ) |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`get_constant_linear_velocity`\ (\ layer_id\: :ref:`int`\ ) |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`get_custom_data`\ (\ layer_name\: :ref:`String`\ ) |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`get_custom_data_by_layer_id`\ (\ layer_id\: :ref:`int`\ ) |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`NavigationPolygon` | :ref:`get_navigation_polygon`\ (\ layer_id\: :ref:`int`, flip_h\: :ref:`bool` = false, flip_v\: :ref:`bool` = false, transpose\: :ref:`bool` = false\ ) |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`OccluderPolygon2D` | :ref:`get_occluder`\ (\ layer_id\: :ref:`int`, flip_h\: :ref:`bool` = false, flip_v\: :ref:`bool` = false, transpose\: :ref:`bool` = false\ ) |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`OccluderPolygon2D` | :ref:`get_occluder_polygon`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`, flip_h\: :ref:`bool` = false, flip_v\: :ref:`bool` = false, transpose\: :ref:`bool` = false\ ) |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_occluder_polygons_count`\ (\ layer_id\: :ref:`int`\ ) |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_terrain_peering_bit`\ (\ peering_bit\: :ref:`CellNeighbor`\ ) |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_collision_polygon_one_way`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`\ ) |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_valid_terrain_peering_bit`\ (\ peering_bit\: :ref:`CellNeighbor`\ ) |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`remove_collision_polygon`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`remove_occluder_polygon`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_collision_polygon_one_way`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`, one_way\: :ref:`bool`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_collision_polygon_one_way_margin`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`, one_way_margin\: :ref:`float`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_collision_polygon_points`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`, polygon\: :ref:`PackedVector2Array`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_collision_polygons_count`\ (\ layer_id\: :ref:`int`, polygons_count\: :ref:`int`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_constant_angular_velocity`\ (\ layer_id\: :ref:`int`, velocity\: :ref:`float`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_constant_linear_velocity`\ (\ layer_id\: :ref:`int`, velocity\: :ref:`Vector2`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_custom_data`\ (\ layer_name\: :ref:`String`, value\: :ref:`Variant`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_custom_data_by_layer_id`\ (\ layer_id\: :ref:`int`, value\: :ref:`Variant`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_navigation_polygon`\ (\ layer_id\: :ref:`int`, navigation_polygon\: :ref:`NavigationPolygon`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_occluder`\ (\ layer_id\: :ref:`int`, occluder_polygon\: :ref:`OccluderPolygon2D`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_occluder_polygon`\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`, polygon\: :ref:`OccluderPolygon2D`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_occluder_polygons_count`\ (\ layer_id\: :ref:`int`, polygons_count\: :ref:`int`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_terrain_peering_bit`\ (\ peering_bit\: :ref:`CellNeighbor`, terrain\: :ref:`int`\ ) | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -343,6 +355,18 @@ Adds a collision polygon to the tile on the given TileSet physics layer. ---- +.. _class_TileData_method_add_occluder_polygon: + +.. rst-class:: classref-method + +|void| **add_occluder_polygon**\ (\ layer_id\: :ref:`int`\ ) :ref:`🔗` + +Adds an occlusion polygon to the tile on the TileSet occlusion layer with index ``layer_id``. + +.. rst-class:: classref-item-separator + +---- + .. _class_TileData_method_get_collision_polygon_one_way_margin: .. rst-class:: classref-method @@ -447,6 +471,8 @@ Returns the navigation polygon of the tile for the TileSet navigation layer with :ref:`OccluderPolygon2D` **get_occluder**\ (\ layer_id\: :ref:`int`, flip_h\: :ref:`bool` = false, flip_v\: :ref:`bool` = false, transpose\: :ref:`bool` = false\ ) |const| :ref:`🔗` +**Deprecated:** Use :ref:`get_occluder_polygon` instead. + Returns the occluder polygon of the tile for the TileSet occlusion layer with index ``layer_id``. \ ``flip_h``, ``flip_v``, and ``transpose`` allow transforming the returned polygon. @@ -455,6 +481,32 @@ Returns the occluder polygon of the tile for the TileSet occlusion layer with in ---- +.. _class_TileData_method_get_occluder_polygon: + +.. rst-class:: classref-method + +:ref:`OccluderPolygon2D` **get_occluder_polygon**\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`, flip_h\: :ref:`bool` = false, flip_v\: :ref:`bool` = false, transpose\: :ref:`bool` = false\ ) |const| :ref:`🔗` + +Returns the occluder polygon at index ``polygon_index`` from the TileSet occlusion layer with index ``layer_id``. + +The ``flip_h``, ``flip_v``, and ``transpose`` parameters can be ``true`` to transform the returned polygon. + +.. rst-class:: classref-item-separator + +---- + +.. _class_TileData_method_get_occluder_polygons_count: + +.. rst-class:: classref-method + +:ref:`int` **get_occluder_polygons_count**\ (\ layer_id\: :ref:`int`\ ) |const| :ref:`🔗` + +Returns the number of occluder polygons of the tile in the TileSet occlusion layer with index ``layer_id``. + +.. rst-class:: classref-item-separator + +---- + .. _class_TileData_method_get_terrain_peering_bit: .. rst-class:: classref-method @@ -503,6 +555,18 @@ Removes the polygon at index ``polygon_index`` for TileSet physics layer with in ---- +.. _class_TileData_method_remove_occluder_polygon: + +.. rst-class:: classref-method + +|void| **remove_occluder_polygon**\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`\ ) :ref:`🔗` + +Removes the polygon at index ``polygon_index`` for TileSet occlusion layer with index ``layer_id``. + +.. rst-class:: classref-item-separator + +---- + .. _class_TileData_method_set_collision_polygon_one_way: .. rst-class:: classref-method @@ -617,12 +681,38 @@ Sets the navigation polygon for the TileSet navigation layer with index ``layer_ |void| **set_occluder**\ (\ layer_id\: :ref:`int`, occluder_polygon\: :ref:`OccluderPolygon2D`\ ) :ref:`🔗` +**Deprecated:** Use :ref:`set_occluder_polygon` instead. + Sets the occluder for the TileSet occlusion layer with index ``layer_id``. .. rst-class:: classref-item-separator ---- +.. _class_TileData_method_set_occluder_polygon: + +.. rst-class:: classref-method + +|void| **set_occluder_polygon**\ (\ layer_id\: :ref:`int`, polygon_index\: :ref:`int`, polygon\: :ref:`OccluderPolygon2D`\ ) :ref:`🔗` + +Sets the occluder for polygon with index ``polygon_index`` in the TileSet occlusion layer with index ``layer_id``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_TileData_method_set_occluder_polygons_count: + +.. rst-class:: classref-method + +|void| **set_occluder_polygons_count**\ (\ layer_id\: :ref:`int`, polygons_count\: :ref:`int`\ ) :ref:`🔗` + +Sets the occluder polygon count in the TileSet occlusion layer with index ``layer_id``. + +.. rst-class:: classref-item-separator + +---- + .. _class_TileData_method_set_terrain_peering_bit: .. rst-class:: classref-method diff --git a/classes/class_viewport.rst b/classes/class_viewport.rst index 94a5041bc30..4c51c893356 100644 --- a/classes/class_viewport.rst +++ b/classes/class_viewport.rst @@ -193,6 +193,8 @@ Methods +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2` | :ref:`get_visible_rect`\ (\ ) |const| | +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`gui_cancel_drag`\ (\ ) | + +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`gui_get_drag_data`\ (\ ) |const| | +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Control` | :ref:`gui_get_focus_owner`\ (\ ) |const| | @@ -2083,6 +2085,18 @@ Returns the visible rectangle in global screen coordinates. ---- +.. _class_Viewport_method_gui_cancel_drag: + +.. rst-class:: classref-method + +|void| **gui_cancel_drag**\ (\ ) :ref:`🔗` + +Cancels the drag operation that was previously started through :ref:`Control._get_drag_data` or forced with :ref:`Control.force_drag`. + +.. rst-class:: classref-item-separator + +---- + .. _class_Viewport_method_gui_get_drag_data: .. rst-class:: classref-method diff --git a/classes/index.rst b/classes/index.rst index ab55fbf9f47..7f95012a5be 100644 --- a/classes/index.rst +++ b/classes/index.rst @@ -724,6 +724,7 @@ Other objects class_diraccess class_displayserver class_dtlsserver + class_editorcontextmenuplugin class_editordebuggerplugin class_editordebuggersession class_editorexportplatform @@ -784,6 +785,7 @@ Other objects class_ip class_javaclass class_javaclasswrapper + class_javaobject class_javascriptbridge class_javascriptobject class_jnisingleton @@ -980,6 +982,7 @@ Editor-only :name: toc-class-ref-editors class_editorcommandpalette + class_editorcontextmenuplugin class_editordebuggerplugin class_editordebuggersession class_editorexportplatform