diff options
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/AStar.xml | 3 | ||||
-rw-r--r-- | doc/classes/AStar2D.xml | 3 | ||||
-rw-r--r-- | doc/classes/Array.xml | 10 | ||||
-rw-r--r-- | doc/classes/AudioEffectRecord.xml | 1 | ||||
-rw-r--r-- | doc/classes/Dictionary.xml | 8 | ||||
-rw-r--r-- | doc/classes/DisplayServer.xml | 66 | ||||
-rw-r--r-- | doc/classes/File.xml | 35 | ||||
-rw-r--r-- | doc/classes/FileDialog.xml | 6 | ||||
-rw-r--r-- | doc/classes/Image.xml | 2 | ||||
-rw-r--r-- | doc/classes/KinematicBody2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/Label.xml | 2 | ||||
-rw-r--r-- | doc/classes/Light3D.xml | 18 | ||||
-rw-r--r-- | doc/classes/LineEdit.xml | 20 | ||||
-rw-r--r-- | doc/classes/Material.xml | 2 | ||||
-rw-r--r-- | doc/classes/Node.xml | 5 | ||||
-rw-r--r-- | doc/classes/Object.xml | 1 | ||||
-rw-r--r-- | doc/classes/OmniLight3D.xml | 2 | ||||
-rw-r--r-- | doc/classes/RigidBody2D.xml | 7 | ||||
-rw-r--r-- | doc/classes/RigidBody3D.xml | 7 | ||||
-rw-r--r-- | doc/classes/SpotLight3D.xml | 2 | ||||
-rw-r--r-- | doc/classes/String.xml | 14 | ||||
-rw-r--r-- | doc/classes/SubViewportContainer.xml | 1 | ||||
-rw-r--r-- | doc/classes/TileSet.xml | 2 |
23 files changed, 162 insertions, 57 deletions
diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml index e930abba87..2695e86f47 100644 --- a/doc/classes/AStar.xml +++ b/doc/classes/AStar.xml @@ -131,7 +131,8 @@ <argument index="1" name="include_disabled" type="bool" default="false"> </argument> <description> - Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns -1 if there are no points in the points pool. + Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns [code]-1[/code] if there are no points in the points pool. + [b]Note:[/b] If several points are the closest to [code]to_position[/code], the one with the smallest ID will be returned, ensuring a deterministic result. </description> </method> <method name="get_closest_position_in_segment" qualifiers="const"> diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml index 16fa05041e..622d336ef6 100644 --- a/doc/classes/AStar2D.xml +++ b/doc/classes/AStar2D.xml @@ -114,7 +114,8 @@ <argument index="1" name="include_disabled" type="bool" default="false"> </argument> <description> - Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns -1 if there are no points in the points pool. + Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns [code]-1[/code] if there are no points in the points pool. + [b]Note:[/b] If several points are the closest to [code]to_position[/code], the one with the smallest ID will be returned, ensuring a deterministic result. </description> </method> <method name="get_closest_position_in_segment" qualifiers="const"> diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 7593f7dff4..9a3eccd8dc 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -200,7 +200,7 @@ <argument index="1" name="from" type="int" default="0"> </argument> <description> - Searches the array for a value and returns its index or -1 if not found. Optionally, the initial search index can be passed. + Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. </description> </method> <method name="find_last"> @@ -209,7 +209,7 @@ <argument index="0" name="value" type="Variant"> </argument> <description> - Searches the array in reverse order for a value and returns its index or -1 if not found. + Searches the array in reverse order for a value and returns its index or [code]-1[/code] if not found. </description> </method> <method name="front"> @@ -232,6 +232,12 @@ ["inside", 7].has(7) == true ["inside", 7].has("7") == false [/codeblock] + [b]Note:[/b] This is equivalent to using the [code]in[/code] operator as follows: + [codeblock] + # Will evaluate to `true`. + if 2 in [2, 4, 6, 8]: + pass + [/codeblock] </description> </method> <method name="hash"> diff --git a/doc/classes/AudioEffectRecord.xml b/doc/classes/AudioEffectRecord.xml index 4dac81322f..a217342d98 100644 --- a/doc/classes/AudioEffectRecord.xml +++ b/doc/classes/AudioEffectRecord.xml @@ -4,6 +4,7 @@ Audio effect used for recording sound from a microphone. </brief_description> <description> + Allows the user to record sound from a microphone. It sets and gets the format in which the audio file will be recorded (8-bit, 16-bit, or compressed). It checks whether or not the recording is active, and if it is, records the sound. It then returns the recorded sample. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/audio/recording_with_microphone.html</link> diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 385f4b7e59..5413fa33c6 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -126,6 +126,13 @@ </argument> <description> Returns [code]true[/code] if the dictionary has a given key. + [b]Note:[/b] This is equivalent to using the [code]in[/code] operator as follows: + [codeblock] + # Will evaluate to `true`. + if "godot" in {"godot": "engine"}: + pass + [/codeblock] + This method (like the [code]in[/code] operator) will evaluate to [code]true[/code] as long as the key exists, even if the associated value is [code]null[/code]. </description> </method> <method name="has_all"> @@ -148,6 +155,7 @@ # The line below prints `true`, whereas it would have printed `false` if both variables were compared directly. print(dict1.hash() == dict2.hash()) [/codeblock] + [b]Note:[/b] Dictionaries with the same keys/values but in a different order will have a different hash. </description> </method> <method name="keys"> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 7fe712753c..f8306cbd72 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -127,12 +127,6 @@ <description> </description> </method> - <method name="get_latin_keyboard_variant" qualifiers="const"> - <return type="int" enum="DisplayServer.LatinKeyboardVariant"> - </return> - <description> - </description> - </method> <method name="get_name" qualifiers="const"> <return type="String"> </return> @@ -389,6 +383,52 @@ <description> </description> </method> + <method name="keyboard_get_current_layout" qualifiers="const"> + <return type="int"> + </return> + <description> + Returns active keyboard layout index. + [b]Note:[/b] This method is implemented on Linux, macOS and Windows. + </description> + </method> + <method name="keyboard_get_layout_count" qualifiers="const"> + <return type="int"> + </return> + <description> + Returns the number of keyboard layouts. + [b]Note:[/b] This method is implemented on Linux, macOS and Windows. + </description> + </method> + <method name="keyboard_get_layout_language" qualifiers="const"> + <return type="String"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + Returns the ISO-639/BCP-47 language code of the keyboard layout at position [code]index[/code]. + [b]Note:[/b] This method is implemented on Linux, macOS and Windows. + </description> + </method> + <method name="keyboard_get_layout_name" qualifiers="const"> + <return type="String"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + Returns the localized name of the keyboard layout at position [code]index[/code]. + [b]Note:[/b] This method is implemented on Linux, macOS and Windows. + </description> + </method> + <method name="keyboard_set_current_layout"> + <return type="void"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + Sets active keyboard layout. + [b]Note:[/b] This method is implemented on Linux, macOS and Windows. + </description> + </method> <method name="mouse_get_absolute_position" qualifiers="const"> <return type="Vector2i"> </return> @@ -1021,20 +1061,6 @@ </constant> <constant name="WINDOW_FLAG_MAX" value="5" enum="WindowFlags"> </constant> - <constant name="LATIN_KEYBOARD_QWERTY" value="0" enum="LatinKeyboardVariant"> - </constant> - <constant name="LATIN_KEYBOARD_QWERTZ" value="1" enum="LatinKeyboardVariant"> - </constant> - <constant name="LATIN_KEYBOARD_AZERTY" value="2" enum="LatinKeyboardVariant"> - </constant> - <constant name="LATIN_KEYBOARD_QZERTY" value="3" enum="LatinKeyboardVariant"> - </constant> - <constant name="LATIN_KEYBOARD_DVORAK" value="4" enum="LatinKeyboardVariant"> - </constant> - <constant name="LATIN_KEYBOARD_NEO" value="5" enum="LatinKeyboardVariant"> - </constant> - <constant name="LATIN_KEYBOARD_COLEMAK" value="6" enum="LatinKeyboardVariant"> - </constant> <constant name="WINDOW_EVENT_MOUSE_ENTER" value="0" enum="WindowEvent"> </constant> <constant name="WINDOW_EVENT_MOUSE_EXIT" value="1" enum="WindowEvent"> diff --git a/doc/classes/File.xml b/doc/classes/File.xml index 17c65731ff..b90039e496 100644 --- a/doc/classes/File.xml +++ b/doc/classes/File.xml @@ -54,28 +54,28 @@ <return type="int"> </return> <description> - Returns the next 16 bits from the file as an integer. + Returns the next 16 bits from the file as an integer. See [method store_16] for details on what values can be stored and retrieved this way. </description> </method> <method name="get_32" qualifiers="const"> <return type="int"> </return> <description> - Returns the next 32 bits from the file as an integer. + Returns the next 32 bits from the file as an integer. See [method store_32] for details on what values can be stored and retrieved this way. </description> </method> <method name="get_64" qualifiers="const"> <return type="int"> </return> <description> - Returns the next 64 bits from the file as an integer. + Returns the next 64 bits from the file as an integer. See [method store_64] for details on what values can be stored and retrieved this way. </description> </method> <method name="get_8" qualifiers="const"> <return type="int"> </return> <description> - Returns the next 8 bits from the file as an integer. + Returns the next 8 bits from the file as an integer. See [method store_8] for details on what values can be stored and retrieved this way. </description> </method> <method name="get_as_text" qualifiers="const"> @@ -297,7 +297,26 @@ </argument> <description> Stores an integer as 16 bits in the file. - [b]Note:[/b] The [code]value[/code] should lie in the interval [code][0, 2^16 - 1][/code]. + [b]Note:[/b] The [code]value[/code] should lie in the interval [code][0, 2^16 - 1][/code]. Any other value will overflow and wrap around. + To store a signed integer, use [method store_64] or store a signed integer from the interval [code][-2^15, 2^15 - 1][/code] (i.e. keeping one bit for the signedness) and compute its sign manually when reading. For example: + [codeblock] + const MAX_15B = 1 << 15 + const MAX_16B = 1 << 16 + + func unsigned16_to_signed(unsigned): + return (unsigned + MAX_15B) % MAX_16B - MAX_15B + + func _ready(): + var f = File.new() + f.open("user://file.dat", File.WRITE_READ) + f.store_16(-42) # This wraps around and stores 65494 (2^16 - 42). + f.store_16(121) # In bounds, will store 121. + f.seek(0) # Go back to start to read the stored value. + var read1 = f.get_16() # 65494 + var read2 = f.get_16() # 121 + var converted1 = unsigned16_to_signed(read1) # -42 + var converted2 = unsigned16_to_signed(read2) # 121 + [/codeblock] </description> </method> <method name="store_32"> @@ -307,7 +326,8 @@ </argument> <description> Stores an integer as 32 bits in the file. - [b]Note:[/b] The [code]value[/code] should lie in the interval [code][0, 2^32 - 1][/code]. + [b]Note:[/b] The [code]value[/code] should lie in the interval [code][0, 2^32 - 1][/code]. Any other value will overflow and wrap around. + To store a signed integer, use [method store_64], or convert it manually (see [method store_16] for an example). </description> </method> <method name="store_64"> @@ -327,7 +347,8 @@ </argument> <description> Stores an integer as 8 bits in the file. - [b]Note:[/b] The [code]value[/code] should lie in the interval [code][0, 255][/code]. + [b]Note:[/b] The [code]value[/code] should lie in the interval [code][0, 255][/code]. Any other value will overflow and wrap around. + To store a signed integer, use [method store_64], or convert it manually (see [method store_16] for an example). </description> </method> <method name="store_buffer"> diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml index cef93aec0c..eaaccbd0dd 100644 --- a/doc/classes/FileDialog.xml +++ b/doc/classes/FileDialog.xml @@ -132,6 +132,12 @@ </constant> </constants> <theme_items> + <theme_item name="file" type="Texture2D"> + Custom icon for files. + </theme_item> + <theme_item name="file_icon_modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + The color modulation applied to the file icon. + </theme_item> <theme_item name="files_disabled" type="Color" default="Color( 0, 0, 0, 0.7 )"> The color tint for disabled files (when the [FileDialog] is used in open folder mode). </theme_item> diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index aa8c8d2443..d29fcfd96f 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -154,7 +154,7 @@ <argument index="4" name="data" type="PackedByteArray"> </argument> <description> - Creates a new image of given size and format. See [enum Format] constants. Fills the image with the given raw data. If [code]use_mipmaps[/code] is [code]true[/code] then generate mipmaps for this image. See the [method generate_mipmaps]. + Creates a new image of given size and format. See [enum Format] constants. Fills the image with the given raw data. If [code]use_mipmaps[/code] is [code]true[/code] then loads mipmaps for this image from [code]data[/code]. See [method generate_mipmaps]. </description> </method> <method name="crop"> diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml index 6b2bbeb895..f0f4d83821 100644 --- a/doc/classes/KinematicBody2D.xml +++ b/doc/classes/KinematicBody2D.xml @@ -9,7 +9,7 @@ [b]Kinematic characters:[/b] KinematicBody2D also has an API for moving objects (the [method move_and_collide] and [method move_and_slide] methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html</link> + <link title="Kinematic character (2D)">https://docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html</link> <link>https://docs.godotengine.org/en/latest/tutorials/physics/using_kinematic_body_2d.html</link> </tutorials> <methods> diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index 263fb6c022..3318f2757d 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -57,7 +57,7 @@ </member> <member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" override="true" enum="Control.MouseFilter" default="2" /> <member name="percent_visible" type="float" setter="set_percent_visible" getter="get_percent_visible" default="1.0"> - Limits the count of visible characters. If you set [code]percent_visible[/code] to 50, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box. + Limits the amount of visible characters. If you set [code]percent_visible[/code] to 0.5, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box. </member> <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" override="true" default="4" /> <member name="text" type="String" setter="set_text" getter="get_text" default=""""> diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index cb21db2d00..930a68be7f 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -4,7 +4,7 @@ Provides a base class for different kinds of light nodes. </brief_description> <description> - Light3D is the abstract base class for light nodes, so it shouldn't be used directly (it can't be instanced). Other types of light nodes inherit from it. Light3D contains the common variables and parameters used for lighting. + Light3D is the [i]abstract[/i] base class for light nodes. As it can't be instanced, it shouldn't be used directly. Other types of light nodes inherit from it. Light3D contains the common variables and parameters used for lighting. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> @@ -36,19 +36,19 @@ If [code]true[/code], the light only appears in the editor and will not be visible at runtime. </member> <member name="light_angular_distance" type="float" setter="set_param" getter="get_param" default="0.0"> - Angular size of the light in degrees. Only available for [DirectionalLight3D]s. For reference, the sun from earth is approximately [code]0.5[/code]. + The light's angular size in degrees. Only available for [DirectionalLight3D]s. For reference, the Sun from the Earth is approximately [code]0.5[/code]. </member> <member name="light_bake_mode" type="int" setter="set_bake_mode" getter="get_bake_mode" enum="Light3D.BakeMode" default="1"> The light's bake mode. See [enum BakeMode]. </member> <member name="light_color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> - The light's color. + The light's color. An [i]overbright[/i] color can be used to achieve a result equivalent to increasing the light's [member light_energy]. </member> <member name="light_cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="4294967295"> The light will affect objects in the selected layers. </member> <member name="light_energy" type="float" setter="set_param" getter="get_param" default="1.0"> - The light's strength multiplier. + The light's strength multiplier (this is not a physical unit). For [OmniLight3D] and [SpotLight3D], changing this value will only change the light color's intensity, not the light's radius. </member> <member name="light_indirect_energy" type="float" setter="set_param" getter="get_param" default="1.0"> Secondary multiplier used with indirect light (light bounces). Used with [GIProbe]. @@ -60,16 +60,16 @@ [Texture2D] projected by light. [member shadow_enabled] must be on for the projector to work. Light projectors make the light appear as if it is shining through a colored but transparent object, almost like light shining through stained glass. </member> <member name="light_size" type="float" setter="set_param" getter="get_param" default="0.0"> - The size of the light in Godot units. Only available for [OmniLight3D]s and [SpotLight3D]s. + The size of the light in Godot units. Only available for [OmniLight3D]s and [SpotLight3D]s. Increasing this value will make the light fade out slower and shadows appear blurrier. This can be used to simulate area lights to an extent. </member> <member name="light_specular" type="float" setter="set_param" getter="get_param" default="0.5"> - The intensity of the specular blob in objects affected by the light. At [code]0[/code] the light becomes a pure diffuse light. + The intensity of the specular blob in objects affected by the light. At [code]0[/code], the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface. </member> <member name="shadow_bias" type="float" setter="set_param" getter="get_param" default="0.02"> - Used to adjust shadow appearance. Too small a value results in self-shadowing, while too large a value causes shadows to separate from casters. Adjust as needed. + Used to adjust shadow appearance. Too small a value results in self-shadowing ("shadow acne"), while too large a value causes shadows to separate from casters ("peter-panning"). Adjust as needed. </member> <member name="shadow_blur" type="float" setter="set_param" getter="get_param" default="1.0"> - Blurs the edges of the shadow. Can be used to hide pixel artifacts in low resolution shadow maps. A high value can make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible. + Blurs the edges of the shadow. Can be used to hide pixel artifacts in low-resolution shadow maps. A high value can impact performance, make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible. </member> <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color( 0, 0, 0, 1 )"> The color of shadows cast by this light. @@ -78,7 +78,7 @@ If [code]true[/code], the light will cast shadows. </member> <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" default="1.0"> - Offsets the lookup into the shadow map by the objects normal. This can be used reduce self-shadowing artifacts without using [member shadow_bias]. In practice, this value should be tweaked along with [member shadow_bias] to reduce artifacts as much as possible. + Offsets the lookup into the shadow map by the object's normal. This can be used to reduce self-shadowing artifacts without using [member shadow_bias]. In practice, this value should be tweaked along with [member shadow_bias] to reduce artifacts as much as possible. </member> <member name="shadow_reverse_cull_face" type="bool" setter="set_shadow_reverse_cull_face" getter="get_shadow_reverse_cull_face" default="false"> If [code]true[/code], reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double-sided shadows with [constant GeometryInstance3D.SHADOW_CASTING_SETTING_DOUBLE_SIDED]. diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 3eeb892719..c1c54dd11b 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -43,7 +43,25 @@ <return type="void"> </return> <description> - Erases the [LineEdit] text. + Erases the [LineEdit]'s [member text]. + </description> + </method> + <method name="delete_char_at_cursor"> + <return type="void"> + </return> + <description> + Deletes one character at the cursor's current position (equivalent to pressing [kbd]Delete[/kbd]). + </description> + </method> + <method name="delete_text"> + <return type="void"> + </return> + <argument index="0" name="from_column" type="int"> + </argument> + <argument index="1" name="to_column" type="int"> + </argument> + <description> + Deletes a section of the [member text] going from position [code]from_column[/code] to [code]to_column[/code]. Both parameters should be within the text's length. </description> </method> <method name="deselect"> diff --git a/doc/classes/Material.xml b/doc/classes/Material.xml index a37c8127f0..f3686876ca 100644 --- a/doc/classes/Material.xml +++ b/doc/classes/Material.xml @@ -17,7 +17,7 @@ </member> <member name="render_priority" type="int" setter="set_render_priority" getter="get_render_priority" default="0"> Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects. - [b]Note:[/b] this only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are sorted based on depth, while transparent objects are sorted from back to front (subject to priority). + [b]Note:[/b] this only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). </member> </members> <constants> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 04c8d2bf57..9617ee0437 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -55,6 +55,7 @@ It is only called if input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_input]. To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. For gameplay input, [method _unhandled_input] and [method _unhandled_key_input] are usually a better fit as they allow the GUI to intercept the events first. + [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan). </description> </method> <method name="_physics_process" qualifiers="virtual"> @@ -66,6 +67,7 @@ Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the [code]delta[/code] variable should be constant. It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_physics_process]. Corresponds to the [constant NOTIFICATION_PHYSICS_PROCESS] notification in [method Object._notification]. + [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan). </description> </method> <method name="_process" qualifiers="virtual"> @@ -77,6 +79,7 @@ Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the [code]delta[/code] time since the previous frame is not constant. It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process]. Corresponds to the [constant NOTIFICATION_PROCESS] notification in [method Object._notification]. + [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan). </description> </method> <method name="_ready" qualifiers="virtual"> @@ -99,6 +102,7 @@ It is only called if unhandled input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_input]. To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. For gameplay input, this and [method _unhandled_key_input] are usually a better fit than [method _input] as they allow the GUI to intercept the events first. + [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan). </description> </method> <method name="_unhandled_key_input" qualifiers="virtual"> @@ -111,6 +115,7 @@ It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_key_input]. To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. For gameplay input, this and [method _unhandled_input] are usually a better fit than [method _input] as they allow the GUI to intercept the events first. + [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan). </description> </method> <method name="add_child"> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index 87bcab25db..8d08688b41 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -15,6 +15,7 @@ print("position" in n) # Prints "True". print("other_property" in n) # Prints "False". [/codeblock] + The [code]in[/code] operator will evaluate to [code]true[/code] as long as the key exists, even if the value is [code]null[/code]. Objects also receive notifications. Notifications are a simple way to notify the object about different events, so they can all be handled together. See [method _notification]. </description> <tutorials> diff --git a/doc/classes/OmniLight3D.xml b/doc/classes/OmniLight3D.xml index 0bbc987156..000d67e691 100644 --- a/doc/classes/OmniLight3D.xml +++ b/doc/classes/OmniLight3D.xml @@ -16,7 +16,7 @@ The light's attenuation (drop-off) curve. A number of presets are available in the [b]Inspector[/b] by right-clicking the curve. </member> <member name="omni_range" type="float" setter="set_param" getter="get_param" default="5.0"> - The light's radius. + The light's radius. Note that the effectively lit area may appear to be smaller depending on the [member omni_attenuation] in use. No matter the [member omni_attenuation] in use, the light will never reach anything outside this radius. </member> <member name="omni_shadow_mode" type="int" setter="set_shadow_mode" getter="get_shadow_mode" enum="OmniLight3D.ShadowMode" default="1"> See [enum ShadowMode]. diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml index 8379fc5b58..a3fd2e81fd 100644 --- a/doc/classes/RigidBody2D.xml +++ b/doc/classes/RigidBody2D.xml @@ -127,7 +127,7 @@ The body's total applied torque. </member> <member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" default="true"> - If [code]true[/code], the body will not calculate forces and will act as a static body if there is no movement. The body will wake up when other forces are applied via collisions or by using [method apply_impulse] or [method add_force]. + If [code]true[/code], the body can enter sleep mode when there is no movement. See [member sleeping]. </member> <member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" default="false"> If [code]true[/code], the body will emit signals when it collides with another RigidBody2D. See also [member contacts_reported]. @@ -165,7 +165,7 @@ If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. </member> <member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" default="false"> - If [code]true[/code], the body is sleeping and will not calculate forces until woken up by a collision or by using [method apply_impulse] or [method add_force]. + If [code]true[/code], the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [method apply_impulse] or [method add_force] methods. </member> <member name="weight" type="float" setter="set_weight" getter="get_weight" default="9.8"> The body's weight based on its mass and the [b]Default Gravity[/b] value in [b]Project > Project Settings > Physics > 2d[/b]. @@ -214,7 +214,8 @@ </signal> <signal name="sleeping_state_changed"> <description> - Emitted when [member sleeping] changes. + Emitted when the physics engine changes the body's sleeping state. + [b]Note:[/b] Changing the value [member sleeping] will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or [code]emit_signal("sleeping_state_changed")[/code] is used. </description> </signal> </signals> diff --git a/doc/classes/RigidBody3D.xml b/doc/classes/RigidBody3D.xml index 1db818d6af..063cc3ca59 100644 --- a/doc/classes/RigidBody3D.xml +++ b/doc/classes/RigidBody3D.xml @@ -147,7 +147,7 @@ Lock the body's movement in the Z axis. </member> <member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" default="true"> - If [code]true[/code], the body is deactivated when there is no movement, so it will not take part in the simulation until it is awaken by an external force. + If [code]true[/code], the body can enter sleep mode when there is no movement. See [member sleeping]. </member> <member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" default="false"> If [code]true[/code], the RigidBody3D will emit signals when it collides with another RigidBody3D. @@ -182,7 +182,7 @@ If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. </member> <member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" default="false"> - If [code]true[/code], the body is sleeping and will not calculate forces until woken up by a collision or the [code]apply_impulse[/code] method. + If [code]true[/code], the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [method apply_impulse] or [method add_force] methods. </member> <member name="weight" type="float" setter="set_weight" getter="get_weight" default="9.8"> The body's weight based on its mass and the global 3D gravity. Global values are set in [b]Project > Project Settings > Physics > 3d[/b]. @@ -233,7 +233,8 @@ </signal> <signal name="sleeping_state_changed"> <description> - Emitted when the body changes its sleeping state. Either by sleeping or waking up. + Emitted when the physics engine changes the body's sleeping state. + [b]Note:[/b] Changing the value [member sleeping] will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or [code]emit_signal("sleeping_state_changed")[/code] is used. </description> </signal> </signals> diff --git a/doc/classes/SpotLight3D.xml b/doc/classes/SpotLight3D.xml index f094818c21..d8d82a6852 100644 --- a/doc/classes/SpotLight3D.xml +++ b/doc/classes/SpotLight3D.xml @@ -22,7 +22,7 @@ The spotlight's light energy attenuation curve. </member> <member name="spot_range" type="float" setter="set_param" getter="get_param" default="5.0"> - The maximal range that can be reached by the spotlight. + The maximal range that can be reached by the spotlight. Note that the effectively lit area may appear to be smaller depending on the [member spot_attenuation] in use. No matter the [member spot_attenuation] in use, the light will never reach anything outside this range. </member> </members> <constants> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 0dd6923129..24d92b822a 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -412,7 +412,13 @@ <argument index="1" name="from" type="int" default="0"> </argument> <description> - Finds the first occurrence of a substring. Returns the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed. + Finds the first occurrence of a substring. Returns the starting position of the substring or [code]-1[/code] if not found. Optionally, the initial search index can be passed. + [b]Note:[/b] If you just want to know whether a string contains a substring, use the [code]in[/code] operator as follows: + [codeblock] + # Will evaluate to `false`. + if "i" in "team": + pass + [/codeblock] </description> </method> <method name="find_last"> @@ -421,7 +427,7 @@ <argument index="0" name="what" type="String"> </argument> <description> - Finds the last occurrence of a substring. Returns the starting position of the substring or -1 if not found. + Finds the last occurrence of a substring. Returns the starting position of the substring or [code]-1[/code] if not found. </description> </method> <method name="findn"> @@ -432,7 +438,7 @@ <argument index="1" name="from" type="int" default="0"> </argument> <description> - Finds the first occurrence of a substring, ignoring case. Returns the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed. + Finds the first occurrence of a substring, ignoring case. Returns the starting position of the substring or [code]-1[/code] if not found. Optionally, the initial search index can be passed. </description> </method> <method name="format"> @@ -947,7 +953,7 @@ <argument index="1" name="len" type="int" default="-1"> </argument> <description> - Returns part of the string from the position [code]from[/code] with length [code]len[/code]. Argument [code]len[/code] is optional and using -1 will return remaining characters from given position. + Returns part of the string from the position [code]from[/code] with length [code]len[/code]. Argument [code]len[/code] is optional and using [code]-1[/code] will return remaining characters from given position. </description> </method> <method name="to_ascii"> diff --git a/doc/classes/SubViewportContainer.xml b/doc/classes/SubViewportContainer.xml index e6a0bd4866..16d483e7f8 100644 --- a/doc/classes/SubViewportContainer.xml +++ b/doc/classes/SubViewportContainer.xml @@ -5,6 +5,7 @@ </brief_description> <description> A [Container] node that holds a [SubViewport], automatically setting its size. + [b]Note:[/b] Changing a SubViewportContainer's [member Control.rect_scale] will cause its contents to appear distorted. To change its visual size without causing distortion, adjust the node's margins instead (if it's not already in a container). </description> <tutorials> </tutorials> diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index c647f83598..9a78e45d46 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -44,6 +44,8 @@ <argument index="1" name="neighbor_id" type="int"> </argument> <description> + Determines when the auto-tiler should consider two different auto-tile IDs to be bound together. + [b]Note:[/b] [code]neighbor_id[/code] will be [code]-1[/code] ([constant TileMap.INVALID_CELL]) when checking a tile against an empty neighbor tile. </description> </method> <method name="autotile_clear_bitmask_map"> |