You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An abstract class is a class that cannot be instantiated directly. Instead, it is meant to be inherited by other classes. Attempting to instantiate an abstract class will result in an error.
136
+
137
+
An abstract method is a method that has no implementation. Therefore, a newline or a semicolon is expected after the function header. This defines a contract that inheriting classes must conform to, because the method signature must be compatible when overriding.
138
+
139
+
Inheriting classes must either provide implementations for all abstract methods, or the inheriting class must be marked as abstract. If a class has at least one abstract method (either its own or an unimplemented inherited one), then it must also be marked as abstract. However, the reverse is not true: an abstract class is allowed to have no abstract methods.
140
+
141
+
::
142
+
143
+
@abstract class Shape:
144
+
@abstract func draw()
145
+
146
+
class Circle extends Shape:
147
+
func draw():
148
+
print("Drawing a circle.")
149
+
150
+
class Square extends Shape:
151
+
func draw():
152
+
print("Drawing a square.")
153
+
154
+
.. rst-class:: classref-item-separator
155
+
156
+
----
157
+
127
158
.. _class_@GDScript_annotation_@export:
128
159
129
160
.. rst-class:: classref-annotation
@@ -856,6 +887,8 @@ The order of ``mode``, ``sync`` and ``transfer_mode`` does not matter, but value
856
887
@rpc("authority", "call_remote", "unreliable", 0) # Equivalent to @rpc
857
888
func fn_default(): pass
858
889
890
+
\ **Note:** Methods annotated with :ref:`@rpc<class_@GDScript_annotation_@rpc>` cannot receive objects which define required parameters in :ref:`Object._init()<class_Object_private_method__init>`. See :ref:`Object._init()<class_Object_private_method__init>` for more details.
891
+
859
892
.. rst-class:: classref-item-separator
860
893
861
894
----
@@ -1073,7 +1106,7 @@ Converts a ``dictionary`` (created with :ref:`inst_to_dict()<class_@GDScript_met
\ **Note:** This function only works if the running instance is connected to a debugging server (i.e. an editor instance).:ref:`get_stack()<class_@GDScript_method_get_stack>` will not work in projects exported in release mode, or in projects exported in debug mode if not connected to a debugging server.
1128
+
See also :ref:`print_debug()<class_@GDScript_method_print_debug>`,:ref:`print_stack()<class_@GDScript_method_print_stack>`, and :ref:`Engine.capture_script_backtraces()<class_Engine_method_capture_script_backtraces>`.
1096
1129
1097
-
\ **Note:** Calling this function from a :ref:`Thread<class_Thread>` is not supported. Doing so will return an empty array.
1130
+
\ **Note:** By default, backtraces are only available in editor builds and debug builds. To enable them for release builds as well, you need to enable :ref:`ProjectSettings.debug/settings/gdscript/always_track_call_stacks<class_ProjectSettings_property_debug/settings/gdscript/always_track_call_stacks>`.
1098
1131
1099
1132
.. rst-class:: classref-item-separator
1100
1133
@@ -1268,7 +1301,9 @@ The output in the console may look like the following:
1268
1301
Test print
1269
1302
At: res://test.gd:15:_process()
1270
1303
1271
-
\ **Note:** Calling this function from a :ref:`Thread<class_Thread>` is not supported. Doing so will instead print the thread ID.
1304
+
See also :ref:`print_stack()<class_@GDScript_method_print_stack>`, :ref:`get_stack()<class_@GDScript_method_get_stack>`, and :ref:`Engine.capture_script_backtraces()<class_Engine_method_capture_script_backtraces>`.
1305
+
1306
+
\ **Note:** By default, backtraces are only available in editor builds and debug builds. To enable them for release builds as well, you need to enable :ref:`ProjectSettings.debug/settings/gdscript/always_track_call_stacks<class_ProjectSettings_property_debug/settings/gdscript/always_track_call_stacks>`.
1272
1307
1273
1308
.. rst-class:: classref-item-separator
1274
1309
@@ -1280,17 +1315,17 @@ The output in the console may look like the following:
Prints a stack trace at the current code location. See also :ref:`get_stack()<class_@GDScript_method_get_stack>`.
1318
+
Prints a stack trace at the current code location.
1284
1319
1285
1320
The output in the console may look like the following:
1286
1321
1287
1322
.. code:: text
1288
1323
1289
1324
Frame 0 - res://test.gd:16 in function '_process'
1290
1325
1291
-
\ **Note:** This function only works if the running instance is connected to a debugging server (i.e. an editor instance).:ref:`print_stack()<class_@GDScript_method_print_stack>` will not work in projects exported in release mode, or in projects exported in debug mode if not connected to a debugging server.
1326
+
See also :ref:`print_debug()<class_@GDScript_method_print_debug>`,:ref:`get_stack()<class_@GDScript_method_get_stack>`, and :ref:`Engine.capture_script_backtraces()<class_Engine_method_capture_script_backtraces>`.
1292
1327
1293
-
\ **Note:** Calling this function from a :ref:`Thread<class_Thread>` is not supported. Doing so will instead print the thread ID.
1328
+
\ **Note:** By default, backtraces are only available in editor builds and debug builds. To enable them for release builds as well, you need to enable :ref:`ProjectSettings.debug/settings/gdscript/always_track_call_stacks<class_ProjectSettings_property_debug/settings/gdscript/always_track_call_stacks>`.
Hints that a boolean property will enable the feature associated with the group that it occurs in. Only works within a group or subgroup. Use the optional hint string ``"feature"`` when the group only has properties that are meaningful when the feature is enabled.
3890
+
Hints that a boolean property will enable the feature associated with the group that it occurs in. The property will be displayed as a checkbox on the group header. Only works within a group or subgroup.
3891
3891
3892
-
\ **Note:** The ``"feature"`` hint string does not modify or reset any values.
3892
+
By default, disabling the property hides all properties in the group. Use the optional hint string ``"checkbox_only"`` to disable this behavior.
Copy file name to clipboardExpand all lines: classes/class_aabb.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ It uses floating-point coordinates. The 2D counterpart to **AABB** is :ref:`Rect
23
23
24
24
\ **Note:** Negative values for :ref:`size<class_AABB_property_size>` are not supported. With negative size, most **AABB** methods do not work correctly. Use :ref:`abs()<class_AABB_method_abs>` to get an equivalent **AABB** with a non-negative size.
25
25
26
-
\ **Note:** In a boolean context, a **AABB** evaluates to ``false`` if both :ref:`position<class_AABB_property_position>` and :ref:`size<class_AABB_property_size>` are zero (equal to :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`). Otherwise, it always evaluates to ``true``.
26
+
\ **Note:** In a boolean context, an **AABB** evaluates to ``false`` if both :ref:`position<class_AABB_property_position>` and :ref:`size<class_AABB_property_size>` are zero (equal to :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`). Otherwise, it always evaluates to ``true``.
27
27
28
28
.. note::
29
29
@@ -366,7 +366,7 @@ Returns the center point of the bounding box. This is the same as ``position + (
Returns the position of one of the 8 vertices that compose this bounding box. With a ``idx`` of ``0`` this is the same as :ref:`position<class_AABB_property_position>`, and a ``idx`` of ``7`` is the same as :ref:`end<class_AABB_property_end>`.
369
+
Returns the position of one of the 8 vertices that compose this bounding box. With an ``idx`` of ``0`` this is the same as :ref:`position<class_AABB_property_position>`, and an ``idx`` of ``7`` is the same as :ref:`end<class_AABB_property_end>`.
Copy file name to clipboardExpand all lines: classes/class_array.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -679,7 +679,7 @@ If ``deep`` is ``true``, a **deep** copy is returned: all nested arrays and dict
679
679
680
680
Duplicates this array, deeply, like :ref:`duplicate()<class_Array_method_duplicate>`\ ``(true)``, with extra control over how subresources are handled.
681
681
682
-
\ ``deep_subresources_mode`` must be one of the values from :ref:`ResourceDeepDuplicateMode<enum_Resource_ResourceDeepDuplicateMode>`. By default, only internal resources will be duplicated (recursively).
682
+
\ ``deep_subresources_mode`` must be one of the values from :ref:`DeepDuplicateMode<enum_Resource_DeepDuplicateMode>`. By default, only internal resources will be duplicated (recursively).
Returns an image of the same size as the bitmap and with a:ref:`Format<enum_Image_Format>` of type :ref:`Image.FORMAT_L8<class_Image_constant_FORMAT_L8>`. ``true`` bits of the bitmap are being converted into white pixels, and ``false`` bits into black.
75
+
Returns an image of the same size as the bitmap and with an:ref:`Format<enum_Image_Format>` of type :ref:`Image.FORMAT_L8<class_Image_constant_FORMAT_L8>`. ``true`` bits of the bitmap are being converted into white pixels, and ``false`` bits into black.
Copy file name to clipboardExpand all lines: classes/class_capsulemesh.rst
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,8 @@ Property Descriptions
61
61
62
62
Total height of the capsule mesh (including the hemispherical ends).
63
63
64
+
\ **Note:** The :ref:`height<class_CapsuleMesh_property_height>` of a capsule must be at least twice its :ref:`radius<class_CapsuleMesh_property_radius>`. Otherwise, the capsule becomes a circle. If the :ref:`height<class_CapsuleMesh_property_height>` is less than twice the :ref:`radius<class_CapsuleMesh_property_radius>`, the properties adjust to a valid value.
65
+
64
66
.. rst-class:: classref-item-separator
65
67
66
68
----
@@ -95,6 +97,8 @@ Number of radial segments on the capsule mesh.
95
97
96
98
Radius of the capsule mesh.
97
99
100
+
\ **Note:** The :ref:`radius<class_CapsuleMesh_property_radius>` of a capsule cannot be greater than half of its :ref:`height<class_CapsuleMesh_property_height>`. Otherwise, the capsule becomes a circle. If the :ref:`radius<class_CapsuleMesh_property_radius>` is greater than half of the :ref:`height<class_CapsuleMesh_property_height>`, the properties adjust to a valid value.
Copy file name to clipboardExpand all lines: classes/class_capsuleshape2d.rst
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,8 @@ Property Descriptions
61
61
62
62
The capsule's full height, including the semicircles.
63
63
64
+
\ **Note:** The :ref:`height<class_CapsuleShape2D_property_height>` of a capsule must be at least twice its :ref:`radius<class_CapsuleShape2D_property_radius>`. Otherwise, the capsule becomes a circle. If the :ref:`height<class_CapsuleShape2D_property_height>` is less than twice the :ref:`radius<class_CapsuleShape2D_property_radius>`, the properties adjust to a valid value.
65
+
64
66
.. rst-class:: classref-item-separator
65
67
66
68
----
@@ -95,6 +97,8 @@ The capsule's height, excluding the semicircles. This is the height of the centr
95
97
96
98
The capsule's radius.
97
99
100
+
\ **Note:** The :ref:`radius<class_CapsuleShape2D_property_radius>` of a capsule cannot be greater than half of its :ref:`height<class_CapsuleShape2D_property_height>`. Otherwise, the capsule becomes a circle. If the :ref:`radius<class_CapsuleShape2D_property_radius>` is greater than half of the :ref:`height<class_CapsuleShape2D_property_height>`, the properties adjust to a valid value.
101
+
98
102
.. |virtual| replace:::abbr:`virtual(This method should typically be overridden by the user to have any effect.)`
99
103
.. |required| replace:::abbr:`required(This method is required to be overridden when extending its base class.)`
100
104
.. |const| replace:::abbr:`const(This method has no side effects. It doesn't modify any of the instance's member variables.)`
Copy file name to clipboardExpand all lines: classes/class_capsuleshape3d.rst
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,8 @@ Property Descriptions
68
68
69
69
The capsule's full height, including the hemispheres.
70
70
71
+
\ **Note:** The :ref:`height<class_CapsuleShape3D_property_height>` of a capsule must be at least twice its :ref:`radius<class_CapsuleShape3D_property_radius>`. Otherwise, the capsule becomes a sphere. If the :ref:`height<class_CapsuleShape3D_property_height>` is less than twice the :ref:`radius<class_CapsuleShape3D_property_radius>`, the properties adjust to a valid value.
72
+
71
73
.. rst-class:: classref-item-separator
72
74
73
75
----
@@ -102,6 +104,8 @@ The capsule's height, excluding the hemispheres. This is the height of the centr
102
104
103
105
The capsule's radius.
104
106
107
+
\ **Note:** The :ref:`radius<class_CapsuleShape3D_property_radius>` of a capsule cannot be greater than half of its :ref:`height<class_CapsuleShape3D_property_height>`. Otherwise, the capsule becomes a sphere. If the :ref:`radius<class_CapsuleShape3D_property_radius>` is greater than half of the :ref:`height<class_CapsuleShape3D_property_height>`, the properties adjust to a valid value.
108
+
105
109
.. |virtual| replace:::abbr:`virtual(This method should typically be overridden by the user to have any effect.)`
106
110
.. |required| replace:::abbr:`required(This method is required to be overridden when extending its base class.)`
107
111
.. |const| replace:::abbr:`const(This method has no side effects. It doesn't modify any of the instance's member variables.)`
Copy file name to clipboardExpand all lines: classes/class_codeedit.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -892,7 +892,7 @@ Override this method to define how the selected entry should be inserted. If ``r
892
892
893
893
Override this method to define what items in ``candidates`` should be displayed.
894
894
895
-
Both ``candidates`` and the return is a:ref:`Array<class_Array>` of :ref:`Dictionary<class_Dictionary>`, see :ref:`get_code_completion_option()<class_CodeEdit_method_get_code_completion_option>` for :ref:`Dictionary<class_Dictionary>` content.
895
+
Both ``candidates`` and the return is an:ref:`Array<class_Array>` of :ref:`Dictionary<class_Dictionary>`, see :ref:`get_code_completion_option()<class_CodeEdit_method_get_code_completion_option>` for :ref:`Dictionary<class_Dictionary>` content.
Multiple layers are stacked on top of each other when using the default vertical import option (with the first layer at the top). Alternatively, you can choose an horizontal layout in the import options (with the first layer at the left).
40
+
Multiple layers are stacked on top of each other when using the default vertical import option (with the first layer at the top). Alternatively, you can choose a horizontal layout in the import options (with the first layer at the left).
41
41
42
42
\ **Note:** **CubemapArray** is not supported in the Compatibility renderer due to graphics API limitations.
0 commit comments