diff options
Diffstat (limited to 'doc/classes')
60 files changed, 1076 insertions, 421 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 03eb733e54..9a28a0d085 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -27,8 +27,14 @@ <member name="Engine" type="Engine" setter="" getter=""> The [Engine] singleton. </member> - <member name="Geometry" type="Geometry" setter="" getter=""> - The [Geometry] singleton. + <member name="Geometry2D" type="Geometry2D" setter="" getter=""> + The [Geometry2D] singleton. + </member> + <member name="Geometry3D" type="Geometry3D" setter="" getter=""> + The [Geometry3D] singleton. + </member> + <member name="GodotSharp" type="GodotSharp" setter="" getter=""> + The [GodotSharp] singleton. </member> <member name="IP" type="IP" setter="" getter=""> The [IP] singleton. diff --git a/doc/classes/AESContext.xml b/doc/classes/AESContext.xml new file mode 100644 index 0000000000..ab4d0e0bc3 --- /dev/null +++ b/doc/classes/AESContext.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="AESContext" inherits="Reference" version="4.0"> + <brief_description> + Interface to low level AES encryption features. + </brief_description> + <description> + This class provides access to AES encryption/decryption of raw data. Both AES-ECB and AES-CBC mode are supported. + [codeblock] + extends Node + + var aes = AESContext.new() + + func _ready(): + var key = "My secret key!!!" # Key must be either 16 or 32 bytes. + var data = "My secret text!!" # Data size must be multiple of 16 bytes, apply padding if needed. + # Encrypt ECB + aes.start(AESContext.MODE_ECB_ENCRYPT, key.to_utf8()) + var encrypted = aes.update(data.to_utf8()) + aes.finish() + # Decrypt ECB + aes.start(AESContext.MODE_ECB_DECRYPT, key.to_utf8()) + var decrypted = aes.update(encrypted) + aes.finish() + # Check ECB + assert(decrypted == data.to_utf8()) + + var iv = "My secret iv!!!!" # IV must be of exactly 16 bytes. + # Encrypt CBC + aes.start(AESContext.MODE_CBC_ENCRYPT, key.to_utf8(), iv.to_utf8()) + encrypted = aes.update(data.to_utf8()) + aes.finish() + # Decrypt CBC + aes.start(AESContext.MODE_CBC_DECRYPT, key.to_utf8(), iv.to_utf8()) + decrypted = aes.update(encrypted) + aes.finish() + # Check CBC + assert(decrypted == data.to_utf8()) + [/codeblock] + </description> + <tutorials> + </tutorials> + <methods> + <method name="finish"> + <return type="void"> + </return> + <description> + Close this AES context so it can be started again. See [method start]. + </description> + </method> + <method name="get_iv_state"> + <return type="PackedByteArray"> + </return> + <description> + Get the current IV state for this context (IV gets updated when calling [method update]). You normally don't need this funciton. + Note: This function only makes sense when the context is started with [constant MODE_CBC_ENCRYPT] or [constant MODE_CBC_DECRYPT]. + </description> + </method> + <method name="start"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="mode" type="int" enum="AESContext.Mode"> + </argument> + <argument index="1" name="key" type="PackedByteArray"> + </argument> + <argument index="2" name="iv" type="PackedByteArray" default="PackedByteArray( )"> + </argument> + <description> + Start the AES context in the given [code]mode[/code]. A [code]key[/code] of either 16 or 32 bytes must always be provided, while an [code]iv[/code] (initialization vector) of exactly 16 bytes, is only needed when [code]mode[/code] is either [constant MODE_CBC_ENCRYPT] or [constant MODE_CBC_DECRYPT]. + </description> + </method> + <method name="update"> + <return type="PackedByteArray"> + </return> + <argument index="0" name="src" type="PackedByteArray"> + </argument> + <description> + Run the desired operation for this AES context. Will return a [PackedByteArray] containing the result of encrypting (or decrypting) the given [code]src[/code]. See [method start] for mode of operation. + Note: The size of [code]src[/code] must be a multiple of 16. Apply some padding if needed. + </description> + </method> + </methods> + <constants> + <constant name="MODE_ECB_ENCRYPT" value="0" enum="Mode"> + AES electronic codebook encryption mode. + </constant> + <constant name="MODE_ECB_DECRYPT" value="1" enum="Mode"> + AES electronic codebook decryption mode. + </constant> + <constant name="MODE_CBC_ENCRYPT" value="2" enum="Mode"> + AES cipher blocker chaining encryption mode. + </constant> + <constant name="MODE_CBC_DECRYPT" value="3" enum="Mode"> + AES cipher blocker chaining decryption mode. + </constant> + <constant name="MODE_MAX" value="4" enum="Mode"> + Maximum value for the mode enum. + </constant> + </constants> +</class> 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/AnimationTree.xml b/doc/classes/AnimationTree.xml index 9642dd1c70..dd04f4ce3f 100644 --- a/doc/classes/AnimationTree.xml +++ b/doc/classes/AnimationTree.xml @@ -4,6 +4,7 @@ A node to be used for advanced animation transitions in an [AnimationPlayer]. </brief_description> <description> + Note: When linked with an [AnimationPlayer], several properties and methods of the corresponding [AnimationPlayer] will not function as expected. Playback and transitions should be handled using only the [AnimationTree] and its constituent [AnimationNode](s). The [AnimationPlayer] node should be used solely for adding, deleting, and editing animations. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> @@ -23,6 +24,7 @@ <return type="Transform"> </return> <description> + Retrieve the motion of the [member root_motion_track] as a [Transform] that can be used elsewhere. If [member root_motion_track] is not a path to a track of type [constant Animation.TYPE_TRANSFORM], returns an identity transformation. </description> </method> <method name="rename_parameter"> @@ -47,6 +49,8 @@ The process mode of this [AnimationTree]. See [enum AnimationProcessMode] for available modes. </member> <member name="root_motion_track" type="NodePath" setter="set_root_motion_track" getter="get_root_motion_track" default="NodePath("")"> + The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by [code]":"[/code]. For example, [code]"character/skeleton:ankle"[/code] or [code]"character/mesh:transform/local"[/code]. + If the track has type [constant Animation.TYPE_TRANSFORM], the transformation will be cancelled visually, and the animation will appear to stay in place. </member> <member name="tree_root" type="AnimationNode" setter="set_tree_root" getter="get_tree_root"> The root animation node of this [AnimationTree]. See [AnimationNode]. 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/Color.xml b/doc/classes/Color.xml index b35d4fb36a..17b474531e 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -5,8 +5,9 @@ </brief_description> <description> A color is represented by red, green, and blue [code](r, g, b)[/code] components. Additionally, [code]a[/code] represents the alpha component, often used for transparency. Values are in floating-point and usually range from 0 to 1. Some properties (such as [member CanvasItem.modulate]) may accept values greater than 1. - You can also create a color from standardized color names by using [method @GDScript.ColorN] or directly using the color constants defined here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url]. + You can also create a color from standardized color names by using [method @GDScript.ColorN] or directly using the color constants defined here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url]. If you want to supply values in a range of 0 to 255, you should use [method @GDScript.Color8]. + [b]Note:[/b] In a boolean context, a Color will evaluate to [code]false[/code] if it's equal to [code]Color(0, 0, 0, 1)[/code] (opaque black). Otherwise, a Color will always evaluate to [code]true[/code]. </description> <tutorials> </tutorials> diff --git a/doc/classes/ConvexPolygonShape2D.xml b/doc/classes/ConvexPolygonShape2D.xml index cba446fff8..42951e2158 100644 --- a/doc/classes/ConvexPolygonShape2D.xml +++ b/doc/classes/ConvexPolygonShape2D.xml @@ -16,7 +16,7 @@ <argument index="0" name="point_cloud" type="PackedVector2Array"> </argument> <description> - Based on the set of points provided, this creates and assigns the [member points] property using the convex hull algorithm. Removing all unneeded points. See [method Geometry.convex_hull_2d] for details. + Based on the set of points provided, this creates and assigns the [member points] property using the convex hull algorithm. Removing all unneeded points. See [method Geometry2D.convex_hull] for details. </description> </method> </methods> diff --git a/doc/classes/Crypto.xml b/doc/classes/Crypto.xml index 10f1f18f0d..4edb3eda0a 100644 --- a/doc/classes/Crypto.xml +++ b/doc/classes/Crypto.xml @@ -5,7 +5,7 @@ </brief_description> <description> The Crypto class allows you to access some more advanced cryptographic functionalities in Godot. - For now, this includes generating cryptographically secure random bytes, and RSA keys and self-signed X509 certificates generation. More functionalities are planned for future releases. + For now, this includes generating cryptographically secure random bytes, RSA keys and self-signed X509 certificates generation, asymmetric key encryption/decryption, and signing/verification. [codeblock] extends Node @@ -21,12 +21,48 @@ # Save key and certificate in the user folder. key.save("user://generated.key") cert.save("user://generated.crt") + # Encryption + var data = "Some data" + var encrypted = crypto.encrypt(key, data.to_utf8()) + # Decryption + var decrypted = crypto.decrypt(key, encrypted) + # Signing + var signature = crypto.sign(HashingContext.HASH_SHA256, data.sha256_buffer(), key) + # Verifying + var verified = crypto.verify(HashingContext.HASH_SHA256, data.sha256_buffer(), signature, key) + # Checks + assert(verified) + assert(data.to_utf8() == decrypted) [/codeblock] [b]Note:[/b] Not available in HTML5 exports. </description> <tutorials> </tutorials> <methods> + <method name="decrypt"> + <return type="PackedByteArray"> + </return> + <argument index="0" name="key" type="CryptoKey"> + </argument> + <argument index="1" name="ciphertext" type="PackedByteArray"> + </argument> + <description> + Decrypt the given [code]ciphertext[/code] with the provided private [code]key[/code]. + [b]Note[/b]: The maximum size of accepted ciphertext is limited by the key size. + </description> + </method> + <method name="encrypt"> + <return type="PackedByteArray"> + </return> + <argument index="0" name="key" type="CryptoKey"> + </argument> + <argument index="1" name="plaintext" type="PackedByteArray"> + </argument> + <description> + Encrypt the given [code]plaintext[/code] with the provided public [code]key[/code]. + [b]Note[/b]: The maximum size of accepted plaintext is limited by the key size. + </description> + </method> <method name="generate_random_bytes"> <return type="PackedByteArray"> </return> @@ -68,6 +104,34 @@ [/codeblock] </description> </method> + <method name="sign"> + <return type="PackedByteArray"> + </return> + <argument index="0" name="hash_type" type="int" enum="HashingContext.HashType"> + </argument> + <argument index="1" name="hash" type="PackedByteArray"> + </argument> + <argument index="2" name="key" type="CryptoKey"> + </argument> + <description> + Sign a given [code]hash[/code] of type [code]hash_type[/code] with the provided private [code]key[/code]. + </description> + </method> + <method name="verify"> + <return type="bool"> + </return> + <argument index="0" name="hash_type" type="int" enum="HashingContext.HashType"> + </argument> + <argument index="1" name="hash" type="PackedByteArray"> + </argument> + <argument index="2" name="signature" type="PackedByteArray"> + </argument> + <argument index="3" name="key" type="CryptoKey"> + </argument> + <description> + Verify that a given [code]signature[/code] for [code]hash[/code] of type [code]hash_type[/code] against the provided public [code]key[/code]. + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/CryptoKey.xml b/doc/classes/CryptoKey.xml index fe7f4b63f0..410c2262f9 100644 --- a/doc/classes/CryptoKey.xml +++ b/doc/classes/CryptoKey.xml @@ -11,13 +11,34 @@ <tutorials> </tutorials> <methods> + <method name="is_public_only" qualifiers="const"> + <return type="bool"> + </return> + <description> + Return [code]true[/code] if this CryptoKey only has the public part, and not the private one. + </description> + </method> <method name="load"> <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> + <argument index="1" name="public_only" type="bool" default="false"> + </argument> + <description> + Loads a key from [code]path[/code]. If [code]public_only[/code] is [code]true[/code], only the public key will be loaded. + [b]Note[/b]: [code]path[/code] should should be a "*.pub" file if [code]public_only[/code] is [code]true[/code], a "*.key" file otherwise. + </description> + </method> + <method name="load_from_string"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="string_key" type="String"> + </argument> + <argument index="1" name="public_only" type="bool" default="false"> + </argument> <description> - Loads a key from [code]path[/code] ("*.key" file). + Loads a key from the given [code]string[/code]. If [code]public_only[/code] is [code]true[/code], only the public key will be loaded. </description> </method> <method name="save"> @@ -25,8 +46,20 @@ </return> <argument index="0" name="path" type="String"> </argument> + <argument index="1" name="public_only" type="bool" default="false"> + </argument> + <description> + Saves a key to the given [code]path[/code]. If [code]public_only[/code] is [code]true[/code], only the public key will be saved. + [b]Note[/b]: [code]path[/code] should should be a "*.pub" file if [code]public_only[/code] is [code]true[/code], a "*.key" file otherwise. + </description> + </method> + <method name="save_to_string"> + <return type="String"> + </return> + <argument index="0" name="public_only" type="bool" default="false"> + </argument> <description> - Saves a key to the given [code]path[/code] (should be a "*.key" file). + Returns a string containing the key in PEM format. If [code]public_only[/code] is [code]true[/code], only the public key will be included. </description> </method> </methods> 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/DirectionalLight3D.xml b/doc/classes/DirectionalLight3D.xml index 6c88dcf42e..fc7ce94a2b 100644 --- a/doc/classes/DirectionalLight3D.xml +++ b/doc/classes/DirectionalLight3D.xml @@ -39,22 +39,24 @@ <member name="directional_shadow_split_3" type="float" setter="set_param" getter="get_param" default="0.5"> The distance from shadow split 2 to split 3. Relative to [member directional_shadow_max_distance]. Only used when [member directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]. </member> + <member name="shadow_bias" type="float" setter="set_param" getter="get_param" override="true" default="0.05" /> + <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" override="true" default="1.0" /> </members> <constants> <constant name="SHADOW_ORTHOGONAL" value="0" enum="ShadowMode"> - Renders the entire scene's shadow map from an orthogonal point of view. May result in blockier shadows on close objects. + Renders the entire scene's shadow map from an orthogonal point of view. This is the fastest directional shadow mode. May result in blurrier shadows on close objects. </constant> <constant name="SHADOW_PARALLEL_2_SPLITS" value="1" enum="ShadowMode"> - Splits the view frustum in 2 areas, each with its own shadow map. + Splits the view frustum in 2 areas, each with its own shadow map. This shadow mode is a compromise between [constant SHADOW_ORTHOGONAL] and [constant SHADOW_PARALLEL_4_SPLITS] in terms of performance. </constant> <constant name="SHADOW_PARALLEL_4_SPLITS" value="2" enum="ShadowMode"> - Splits the view frustum in 4 areas, each with its own shadow map. + Splits the view frustum in 4 areas, each with its own shadow map. This is the slowest directional shadow mode. </constant> <constant name="SHADOW_DEPTH_RANGE_STABLE" value="0" enum="ShadowDepthRange"> Keeps the shadow stable when the camera moves, at the cost of lower effective shadow resolution. </constant> <constant name="SHADOW_DEPTH_RANGE_OPTIMIZED" value="1" enum="ShadowDepthRange"> - Tries to achieve maximum shadow resolution. May result in saw effect on shadow edges. + Tries to achieve maximum shadow resolution. May result in saw effect on shadow edges. This mode typically works best in games where the camera will often move at high speeds, such as most racing games. </constant> </constants> </class> 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/DynamicFontData.xml b/doc/classes/DynamicFontData.xml index 2b4ec17bf1..483da96f3f 100644 --- a/doc/classes/DynamicFontData.xml +++ b/doc/classes/DynamicFontData.xml @@ -12,7 +12,7 @@ </methods> <members> <member name="antialiased" type="bool" setter="set_antialiased" getter="is_antialiased" default="true"> - If [code]true[/code], the font is rendered with anti-aliasing. + If [code]true[/code], the font is rendered with anti-aliasing. This property applies both to the main font and its outline (if it has one). </member> <member name="font_path" type="String" setter="set_font_path" getter="get_font_path" default=""""> The path to the vector font file. diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml index 499c3b8271..c2c73a8b83 100644 --- a/doc/classes/EditorInterface.xml +++ b/doc/classes/EditorInterface.xml @@ -182,14 +182,6 @@ Selects the file, with the path provided by [code]file[/code], in the FileSystem dock. </description> </method> - <method name="set_distraction_free_mode"> - <return type="void"> - </return> - <argument index="0" name="enter" type="bool"> - </argument> - <description> - </description> - </method> <method name="set_main_screen_editor"> <return type="void"> </return> @@ -210,6 +202,11 @@ </description> </method> </methods> + <members> + <member name="distraction_free_mode" type="bool" setter="set_distraction_free_mode" getter="is_distraction_free_mode_enabled"> + If [code]true[/code], enables distraction-free mode which hides side docks to increase the space available for the main view. + </member> + </members> <constants> </constants> </class> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 19583fca28..2fa791a9df 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -22,7 +22,7 @@ </description> </method> <method name="add_control_to_bottom_panel"> - <return type="ToolButton"> + <return type="Button"> </return> <argument index="0" name="control" type="Control"> </argument> 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 99563ee367..eaaccbd0dd 100644 --- a/doc/classes/FileDialog.xml +++ b/doc/classes/FileDialog.xml @@ -4,7 +4,7 @@ Dialog for selecting files or directories in the filesystem. </brief_description> <description> - FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks. + FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks. The FileDialog automatically sets its window title according to the [member file_mode]. If you want to use a custom title, disable this by setting [member mode_overrides_title] to [code]false[/code]. </description> <tutorials> </tutorials> @@ -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/Geometry.xml b/doc/classes/Geometry2D.xml index 4d6f7b60a3..ffd4bd108d 100644 --- a/doc/classes/Geometry.xml +++ b/doc/classes/Geometry2D.xml @@ -1,67 +1,15 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Geometry" inherits="Object" version="4.0"> +<class name="Geometry2D" inherits="Object" version="4.0"> <brief_description> - Helper node to calculate generic geometry operations. + Helper node to calculate generic geometry operations in 2D space. </brief_description> <description> - Geometry provides users with a set of helper functions to create geometric shapes, compute intersections between shapes, and process various other geometric operations. + Geometry2D provides users with a set of helper functions to create geometric shapes, compute intersections between shapes, and process various other geometric operations. </description> <tutorials> </tutorials> <methods> - <method name="build_box_planes"> - <return type="Array"> - </return> - <argument index="0" name="extents" type="Vector3"> - </argument> - <description> - Returns an array with 6 [Plane]s that describe the sides of a box centered at the origin. The box size is defined by [code]extents[/code], which represents one (positive) corner of the box (i.e. half its actual size). - </description> - </method> - <method name="build_capsule_planes"> - <return type="Array"> - </return> - <argument index="0" name="radius" type="float"> - </argument> - <argument index="1" name="height" type="float"> - </argument> - <argument index="2" name="sides" type="int"> - </argument> - <argument index="3" name="lats" type="int"> - </argument> - <argument index="4" name="axis" type="int" enum="Vector3.Axis" default="2"> - </argument> - <description> - Returns an array of [Plane]s closely bounding a faceted capsule centered at the origin with radius [code]radius[/code] and height [code]height[/code]. The parameter [code]sides[/code] defines how many planes will be generated for the side part of the capsule, whereas [code]lats[/code] gives the number of latitudinal steps at the bottom and top of the capsule. The parameter [code]axis[/code] describes the axis along which the capsule is oriented (0 for X, 1 for Y, 2 for Z). - </description> - </method> - <method name="build_cylinder_planes"> - <return type="Array"> - </return> - <argument index="0" name="radius" type="float"> - </argument> - <argument index="1" name="height" type="float"> - </argument> - <argument index="2" name="sides" type="int"> - </argument> - <argument index="3" name="axis" type="int" enum="Vector3.Axis" default="2"> - </argument> - <description> - Returns an array of [Plane]s closely bounding a faceted cylinder centered at the origin with radius [code]radius[/code] and height [code]height[/code]. The parameter [code]sides[/code] defines how many planes will be generated for the round part of the cylinder. The parameter [code]axis[/code] describes the axis along which the cylinder is oriented (0 for X, 1 for Y, 2 for Z). - </description> - </method> - <method name="clip_polygon"> - <return type="PackedVector3Array"> - </return> - <argument index="0" name="points" type="PackedVector3Array"> - </argument> - <argument index="1" name="plane" type="Plane"> - </argument> - <description> - Clips the polygon defined by the points in [code]points[/code] against the [code]plane[/code] and returns the points of the clipped polygon. - </description> - </method> - <method name="clip_polygons_2d"> + <method name="clip_polygons"> <return type="Array"> </return> <argument index="0" name="polygon_a" type="PackedVector2Array"> @@ -73,7 +21,7 @@ If [code]polygon_b[/code] is enclosed by [code]polygon_a[/code], returns an outer polygon (boundary) and inner polygon (hole) which could be distinguished by calling [method is_polygon_clockwise]. </description> </method> - <method name="clip_polyline_with_polygon_2d"> + <method name="clip_polyline_with_polygon"> <return type="Array"> </return> <argument index="0" name="polyline" type="PackedVector2Array"> @@ -84,7 +32,7 @@ Clips [code]polyline[/code] against [code]polygon[/code] and returns an array of clipped polylines. This performs [constant OPERATION_DIFFERENCE] between the polyline and the polygon. This operation can be thought of as cutting a line with a closed shape. </description> </method> - <method name="convex_hull_2d"> + <method name="convex_hull"> <return type="PackedVector2Array"> </return> <argument index="0" name="points" type="PackedVector2Array"> @@ -93,7 +41,7 @@ Given an array of [Vector2]s, returns the convex hull as a list of points in counterclockwise order. The last point is the same as the first one. </description> </method> - <method name="exclude_polygons_2d"> + <method name="exclude_polygons"> <return type="Array"> </return> <argument index="0" name="polygon_a" type="PackedVector2Array"> @@ -101,24 +49,11 @@ <argument index="1" name="polygon_b" type="PackedVector2Array"> </argument> <description> - Mutually excludes common area defined by intersection of [code]polygon_a[/code] and [code]polygon_b[/code] (see [method intersect_polygons_2d]) and returns an array of excluded polygons. This performs [constant OPERATION_XOR] between polygons. In other words, returns all but common area between polygons. + Mutually excludes common area defined by intersection of [code]polygon_a[/code] and [code]polygon_b[/code] (see [method intersect_polygons]) and returns an array of excluded polygons. This performs [constant OPERATION_XOR] between polygons. In other words, returns all but common area between polygons. The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise]. </description> </method> <method name="get_closest_point_to_segment"> - <return type="Vector3"> - </return> - <argument index="0" name="point" type="Vector3"> - </argument> - <argument index="1" name="s1" type="Vector3"> - </argument> - <argument index="2" name="s2" type="Vector3"> - </argument> - <description> - Returns the 3D point on the 3D segment ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point will always be inside the specified segment. - </description> - </method> - <method name="get_closest_point_to_segment_2d"> <return type="Vector2"> </return> <argument index="0" name="point" type="Vector2"> @@ -132,19 +67,6 @@ </description> </method> <method name="get_closest_point_to_segment_uncapped"> - <return type="Vector3"> - </return> - <argument index="0" name="point" type="Vector3"> - </argument> - <argument index="1" name="s1" type="Vector3"> - </argument> - <argument index="2" name="s2" type="Vector3"> - </argument> - <description> - Returns the 3D point on the 3D line defined by ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point can be inside the segment ([code]s1[/code], [code]s2[/code]) or outside of it, i.e. somewhere on the line extending from the segment. - </description> - </method> - <method name="get_closest_point_to_segment_uncapped_2d"> <return type="Vector2"> </return> <argument index="0" name="point" type="Vector2"> @@ -158,21 +80,6 @@ </description> </method> <method name="get_closest_points_between_segments"> - <return type="PackedVector3Array"> - </return> - <argument index="0" name="p1" type="Vector3"> - </argument> - <argument index="1" name="p2" type="Vector3"> - </argument> - <argument index="2" name="q1" type="Vector3"> - </argument> - <argument index="3" name="q2" type="Vector3"> - </argument> - <description> - Given the two 3D segments ([code]p1[/code], [code]p2[/code]) and ([code]q1[/code], [code]q2[/code]), finds those two points on the two segments that are closest to each other. Returns a [PackedVector3Array] that contains this point on ([code]p1[/code], [code]p2[/code]) as well the accompanying point on ([code]q1[/code], [code]q2[/code]). - </description> - </method> - <method name="get_closest_points_between_segments_2d"> <return type="PackedVector2Array"> </return> <argument index="0" name="p1" type="Vector2"> @@ -187,16 +94,7 @@ Given the two 2D segments ([code]p1[/code], [code]p2[/code]) and ([code]q1[/code], [code]q2[/code]), finds those two points on the two segments that are closest to each other. Returns a [PackedVector2Array] that contains this point on ([code]p1[/code], [code]p2[/code]) as well the accompanying point on ([code]q1[/code], [code]q2[/code]). </description> </method> - <method name="get_uv84_normal_bit"> - <return type="int"> - </return> - <argument index="0" name="normal" type="Vector3"> - </argument> - <description> - Used internally by the engine. - </description> - </method> - <method name="intersect_polygons_2d"> + <method name="intersect_polygons"> <return type="Array"> </return> <argument index="0" name="polygon_a" type="PackedVector2Array"> @@ -208,7 +106,7 @@ The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise]. </description> </method> - <method name="intersect_polyline_with_polygon_2d"> + <method name="intersect_polyline_with_polygon"> <return type="Array"> </return> <argument index="0" name="polyline" type="PackedVector2Array"> @@ -252,7 +150,7 @@ Returns [code]true[/code] if [code]polygon[/code]'s vertices are ordered in clockwise order, otherwise returns [code]false[/code]. </description> </method> - <method name="line_intersects_line_2d"> + <method name="line_intersects_line"> <return type="Variant"> </return> <argument index="0" name="from_a" type="Vector2"> @@ -277,7 +175,7 @@ Given an array of [Vector2]s representing tiles, builds an atlas. The returned dictionary has two keys: [code]points[/code] is a vector of [Vector2] that specifies the positions of each tile, [code]size[/code] contains the overall size of the whole atlas as [Vector2]. </description> </method> - <method name="merge_polygons_2d"> + <method name="merge_polygons"> <return type="Array"> </return> <argument index="0" name="polygon_a" type="PackedVector2Array"> @@ -289,14 +187,14 @@ The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise]. </description> </method> - <method name="offset_polygon_2d"> + <method name="offset_polygon"> <return type="Array"> </return> <argument index="0" name="polygon" type="PackedVector2Array"> </argument> <argument index="1" name="delta" type="float"> </argument> - <argument index="2" name="join_type" type="int" enum="Geometry.PolyJoinType" default="0"> + <argument index="2" name="join_type" type="int" enum="Geometry2D.PolyJoinType" default="0"> </argument> <description> Inflates or deflates [code]polygon[/code] by [code]delta[/code] units (pixels). If [code]delta[/code] is positive, makes the polygon grow outward. If [code]delta[/code] is negative, shrinks the polygon inward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. Returns an empty array if [code]delta[/code] is negative and the absolute value of it approximately exceeds the minimum bounding rectangle dimensions of the polygon. @@ -304,16 +202,16 @@ The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise]. </description> </method> - <method name="offset_polyline_2d"> + <method name="offset_polyline"> <return type="Array"> </return> <argument index="0" name="polyline" type="PackedVector2Array"> </argument> <argument index="1" name="delta" type="float"> </argument> - <argument index="2" name="join_type" type="int" enum="Geometry.PolyJoinType" default="0"> + <argument index="2" name="join_type" type="int" enum="Geometry2D.PolyJoinType" default="0"> </argument> - <argument index="3" name="end_type" type="int" enum="Geometry.PolyEndType" default="3"> + <argument index="3" name="end_type" type="int" enum="Geometry2D.PolyEndType" default="3"> </argument> <description> Inflates or deflates [code]polyline[/code] by [code]delta[/code] units (pixels), producing polygons. If [code]delta[/code] is positive, makes the polyline grow outward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. If [code]delta[/code] is negative, returns an empty array. @@ -337,67 +235,7 @@ Returns if [code]point[/code] is inside the triangle specified by [code]a[/code], [code]b[/code] and [code]c[/code]. </description> </method> - <method name="ray_intersects_triangle"> - <return type="Variant"> - </return> - <argument index="0" name="from" type="Vector3"> - </argument> - <argument index="1" name="dir" type="Vector3"> - </argument> - <argument index="2" name="a" type="Vector3"> - </argument> - <argument index="3" name="b" type="Vector3"> - </argument> - <argument index="4" name="c" type="Vector3"> - </argument> - <description> - Tests if the 3D ray starting at [code]from[/code] with the direction of [code]dir[/code] intersects the triangle specified by [code]a[/code], [code]b[/code] and [code]c[/code]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, an empty [Variant] is returned. - </description> - </method> - <method name="segment_intersects_circle"> - <return type="float"> - </return> - <argument index="0" name="segment_from" type="Vector2"> - </argument> - <argument index="1" name="segment_to" type="Vector2"> - </argument> - <argument index="2" name="circle_position" type="Vector2"> - </argument> - <argument index="3" name="circle_radius" type="float"> - </argument> - <description> - Given the 2D segment ([code]segment_from[/code], [code]segment_to[/code]), returns the position on the segment (as a number between 0 and 1) at which the segment hits the circle that is located at position [code]circle_position[/code] and has radius [code]circle_radius[/code]. If the segment does not intersect the circle, -1 is returned (this is also the case if the line extending the segment would intersect the circle, but the segment does not). - </description> - </method> - <method name="segment_intersects_convex"> - <return type="PackedVector3Array"> - </return> - <argument index="0" name="from" type="Vector3"> - </argument> - <argument index="1" name="to" type="Vector3"> - </argument> - <argument index="2" name="planes" type="Array"> - </argument> - <description> - Given a convex hull defined though the [Plane]s in the array [code]planes[/code], tests if the segment ([code]from[/code], [code]to[/code]) intersects with that hull. If an intersection is found, returns a [PackedVector3Array] containing the point the intersection and the hull's normal. If no intersecion is found, an the returned array is empty. - </description> - </method> - <method name="segment_intersects_cylinder"> - <return type="PackedVector3Array"> - </return> - <argument index="0" name="from" type="Vector3"> - </argument> - <argument index="1" name="to" type="Vector3"> - </argument> - <argument index="2" name="height" type="float"> - </argument> - <argument index="3" name="radius" type="float"> - </argument> - <description> - Checks if the segment ([code]from[/code], [code]to[/code]) intersects the cylinder with height [code]height[/code] that is centered at the origin and has radius [code]radius[/code]. If no, returns an empty [PackedVector3Array]. If an intersection takes place, the returned array contains the point of intersection and the cylinder's normal at the point of intersection. - </description> - </method> - <method name="segment_intersects_segment_2d"> + <method name="segment_intersects_segment"> <return type="Variant"> </return> <argument index="0" name="from_a" type="Vector2"> @@ -412,39 +250,7 @@ Checks if the two segments ([code]from_a[/code], [code]to_a[/code]) and ([code]from_b[/code], [code]to_b[/code]) intersect. If yes, return the point of intersection as [Vector2]. If no intersection takes place, returns an empty [Variant]. </description> </method> - <method name="segment_intersects_sphere"> - <return type="PackedVector3Array"> - </return> - <argument index="0" name="from" type="Vector3"> - </argument> - <argument index="1" name="to" type="Vector3"> - </argument> - <argument index="2" name="sphere_position" type="Vector3"> - </argument> - <argument index="3" name="sphere_radius" type="float"> - </argument> - <description> - Checks if the segment ([code]from[/code], [code]to[/code]) intersects the sphere that is located at [code]sphere_position[/code] and has radius [code]sphere_radius[/code]. If no, returns an empty [PackedVector3Array]. If yes, returns a [PackedVector3Array] containing the point of intersection and the sphere's normal at the point of intersection. - </description> - </method> - <method name="segment_intersects_triangle"> - <return type="Variant"> - </return> - <argument index="0" name="from" type="Vector3"> - </argument> - <argument index="1" name="to" type="Vector3"> - </argument> - <argument index="2" name="a" type="Vector3"> - </argument> - <argument index="3" name="b" type="Vector3"> - </argument> - <argument index="4" name="c" type="Vector3"> - </argument> - <description> - Tests if the segment ([code]from[/code], [code]to[/code]) intersects the triangle [code]a[/code], [code]b[/code], [code]c[/code]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, an empty [Variant] is returned. - </description> - </method> - <method name="triangulate_delaunay_2d"> + <method name="triangulate_delaunay"> <return type="PackedInt32Array"> </return> <argument index="0" name="points" type="PackedVector2Array"> diff --git a/doc/classes/Geometry3D.xml b/doc/classes/Geometry3D.xml new file mode 100644 index 0000000000..ec685a5ce7 --- /dev/null +++ b/doc/classes/Geometry3D.xml @@ -0,0 +1,194 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="Geometry3D" inherits="Object" version="4.0"> + <brief_description> + Helper node to calculate generic geometry operations in 3D space. + </brief_description> + <description> + Geometry3D provides users with a set of helper functions to create geometric shapes, compute intersections between shapes, and process various other geometric operations. + </description> + <tutorials> + </tutorials> + <methods> + <method name="build_box_planes"> + <return type="Array"> + </return> + <argument index="0" name="extents" type="Vector3"> + </argument> + <description> + Returns an array with 6 [Plane]s that describe the sides of a box centered at the origin. The box size is defined by [code]extents[/code], which represents one (positive) corner of the box (i.e. half its actual size). + </description> + </method> + <method name="build_capsule_planes"> + <return type="Array"> + </return> + <argument index="0" name="radius" type="float"> + </argument> + <argument index="1" name="height" type="float"> + </argument> + <argument index="2" name="sides" type="int"> + </argument> + <argument index="3" name="lats" type="int"> + </argument> + <argument index="4" name="axis" type="int" enum="Vector3.Axis" default="2"> + </argument> + <description> + Returns an array of [Plane]s closely bounding a faceted capsule centered at the origin with radius [code]radius[/code] and height [code]height[/code]. The parameter [code]sides[/code] defines how many planes will be generated for the side part of the capsule, whereas [code]lats[/code] gives the number of latitudinal steps at the bottom and top of the capsule. The parameter [code]axis[/code] describes the axis along which the capsule is oriented (0 for X, 1 for Y, 2 for Z). + </description> + </method> + <method name="build_cylinder_planes"> + <return type="Array"> + </return> + <argument index="0" name="radius" type="float"> + </argument> + <argument index="1" name="height" type="float"> + </argument> + <argument index="2" name="sides" type="int"> + </argument> + <argument index="3" name="axis" type="int" enum="Vector3.Axis" default="2"> + </argument> + <description> + Returns an array of [Plane]s closely bounding a faceted cylinder centered at the origin with radius [code]radius[/code] and height [code]height[/code]. The parameter [code]sides[/code] defines how many planes will be generated for the round part of the cylinder. The parameter [code]axis[/code] describes the axis along which the cylinder is oriented (0 for X, 1 for Y, 2 for Z). + </description> + </method> + <method name="clip_polygon"> + <return type="PackedVector3Array"> + </return> + <argument index="0" name="points" type="PackedVector3Array"> + </argument> + <argument index="1" name="plane" type="Plane"> + </argument> + <description> + Clips the polygon defined by the points in [code]points[/code] against the [code]plane[/code] and returns the points of the clipped polygon. + </description> + </method> + <method name="get_closest_point_to_segment"> + <return type="Vector3"> + </return> + <argument index="0" name="point" type="Vector3"> + </argument> + <argument index="1" name="s1" type="Vector3"> + </argument> + <argument index="2" name="s2" type="Vector3"> + </argument> + <description> + Returns the 3D point on the 3D segment ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point will always be inside the specified segment. + </description> + </method> + <method name="get_closest_point_to_segment_uncapped"> + <return type="Vector3"> + </return> + <argument index="0" name="point" type="Vector3"> + </argument> + <argument index="1" name="s1" type="Vector3"> + </argument> + <argument index="2" name="s2" type="Vector3"> + </argument> + <description> + Returns the 3D point on the 3D line defined by ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point can be inside the segment ([code]s1[/code], [code]s2[/code]) or outside of it, i.e. somewhere on the line extending from the segment. + </description> + </method> + <method name="get_closest_points_between_segments"> + <return type="PackedVector3Array"> + </return> + <argument index="0" name="p1" type="Vector3"> + </argument> + <argument index="1" name="p2" type="Vector3"> + </argument> + <argument index="2" name="q1" type="Vector3"> + </argument> + <argument index="3" name="q2" type="Vector3"> + </argument> + <description> + Given the two 3D segments ([code]p1[/code], [code]p2[/code]) and ([code]q1[/code], [code]q2[/code]), finds those two points on the two segments that are closest to each other. Returns a [PackedVector3Array] that contains this point on ([code]p1[/code], [code]p2[/code]) as well the accompanying point on ([code]q1[/code], [code]q2[/code]). + </description> + </method> + <method name="get_uv84_normal_bit"> + <return type="int"> + </return> + <argument index="0" name="normal" type="Vector3"> + </argument> + <description> + Used internally by the engine. + </description> + </method> + <method name="ray_intersects_triangle"> + <return type="Variant"> + </return> + <argument index="0" name="from" type="Vector3"> + </argument> + <argument index="1" name="dir" type="Vector3"> + </argument> + <argument index="2" name="a" type="Vector3"> + </argument> + <argument index="3" name="b" type="Vector3"> + </argument> + <argument index="4" name="c" type="Vector3"> + </argument> + <description> + Tests if the 3D ray starting at [code]from[/code] with the direction of [code]dir[/code] intersects the triangle specified by [code]a[/code], [code]b[/code] and [code]c[/code]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, an empty [Variant] is returned. + </description> + </method> + <method name="segment_intersects_convex"> + <return type="PackedVector3Array"> + </return> + <argument index="0" name="from" type="Vector3"> + </argument> + <argument index="1" name="to" type="Vector3"> + </argument> + <argument index="2" name="planes" type="Array"> + </argument> + <description> + Given a convex hull defined though the [Plane]s in the array [code]planes[/code], tests if the segment ([code]from[/code], [code]to[/code]) intersects with that hull. If an intersection is found, returns a [PackedVector3Array] containing the point the intersection and the hull's normal. If no intersecion is found, an the returned array is empty. + </description> + </method> + <method name="segment_intersects_cylinder"> + <return type="PackedVector3Array"> + </return> + <argument index="0" name="from" type="Vector3"> + </argument> + <argument index="1" name="to" type="Vector3"> + </argument> + <argument index="2" name="height" type="float"> + </argument> + <argument index="3" name="radius" type="float"> + </argument> + <description> + Checks if the segment ([code]from[/code], [code]to[/code]) intersects the cylinder with height [code]height[/code] that is centered at the origin and has radius [code]radius[/code]. If no, returns an empty [PackedVector3Array]. If an intersection takes place, the returned array contains the point of intersection and the cylinder's normal at the point of intersection. + </description> + </method> + <method name="segment_intersects_sphere"> + <return type="PackedVector3Array"> + </return> + <argument index="0" name="from" type="Vector3"> + </argument> + <argument index="1" name="to" type="Vector3"> + </argument> + <argument index="2" name="sphere_position" type="Vector3"> + </argument> + <argument index="3" name="sphere_radius" type="float"> + </argument> + <description> + Checks if the segment ([code]from[/code], [code]to[/code]) intersects the sphere that is located at [code]sphere_position[/code] and has radius [code]sphere_radius[/code]. If no, returns an empty [PackedVector3Array]. If yes, returns a [PackedVector3Array] containing the point of intersection and the sphere's normal at the point of intersection. + </description> + </method> + <method name="segment_intersects_triangle"> + <return type="Variant"> + </return> + <argument index="0" name="from" type="Vector3"> + </argument> + <argument index="1" name="to" type="Vector3"> + </argument> + <argument index="2" name="a" type="Vector3"> + </argument> + <argument index="3" name="b" type="Vector3"> + </argument> + <argument index="4" name="c" type="Vector3"> + </argument> + <description> + Tests if the segment ([code]from[/code], [code]to[/code]) intersects the triangle [code]a[/code], [code]b[/code], [code]c[/code]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, an empty [Variant] is returned. + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 55d2275194..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"> @@ -436,6 +436,12 @@ Saves the image as a PNG file to [code]path[/code]. </description> </method> + <method name="save_png_to_buffer" qualifiers="const"> + <return type="PackedByteArray"> + </return> + <description> + </description> + </method> <method name="set_pixel"> <return type="void"> </return> diff --git a/doc/classes/InputMap.xml b/doc/classes/InputMap.xml index da93d7fb53..03212538c9 100644 --- a/doc/classes/InputMap.xml +++ b/doc/classes/InputMap.xml @@ -41,6 +41,15 @@ Removes all events from an action. </description> </method> + <method name="action_get_events"> + <return type="Array"> + </return> + <argument index="0" name="action" type="StringName"> + </argument> + <description> + Returns an array of [InputEvent]s associated with a given action. + </description> + </method> <method name="action_has_event"> <return type="bool"> </return> @@ -95,15 +104,6 @@ Returns [code]true[/code] if the given event is part of an existing action. This method ignores keyboard modifiers if the given [InputEvent] is not pressed (for proper release detection). See [method action_has_event] if you don't want this behavior. </description> </method> - <method name="get_action_list"> - <return type="Array"> - </return> - <argument index="0" name="action" type="StringName"> - </argument> - <description> - Returns an array of [InputEvent]s associated with a given action. - </description> - </method> <method name="get_actions"> <return type="Array"> </return> diff --git a/doc/classes/Joint2D.xml b/doc/classes/Joint2D.xml index fb0e184c26..b055293b9d 100644 --- a/doc/classes/Joint2D.xml +++ b/doc/classes/Joint2D.xml @@ -15,7 +15,7 @@ When [member node_a] and [member node_b] move in different directions the [code]bias[/code] controls how fast the joint pulls them back to their original position. The lower the [code]bias[/code] the more the two bodies can pull on the joint. </member> <member name="disable_collision" type="bool" setter="set_exclude_nodes_from_collision" getter="get_exclude_nodes_from_collision" default="true"> - If [code]true[/code], [member node_a] and [member node_b] can collide. + If [code]true[/code], [member node_a] and [member node_b] can not collide. </member> <member name="node_a" type="NodePath" setter="set_node_a" getter="get_node_a" default="NodePath("")"> The first body attached to the joint. Must derive from [PhysicsBody2D]. 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..dda6faa80a 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. + <member name="shadow_bias" type="float" setter="set_param" getter="get_param" default="0.1"> + 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. @@ -77,8 +77,8 @@ <member name="shadow_enabled" type="bool" setter="set_shadow" getter="has_shadow" default="false"> 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. + <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" default="2.0"> + 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/OS.xml b/doc/classes/OS.xml index 03203e2ebb..105def21ca 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -205,7 +205,7 @@ <return type="String"> </return> <description> - Returns the name of the host OS. Possible values are: [code]"Android"[/code], [code]"Haiku"[/code], [code]"iOS"[/code], [code]"HTML5"[/code], [code]"OSX"[/code], [code]"Server"[/code], [code]"Windows"[/code], [code]"UWP"[/code], [code]"X11"[/code]. + Returns the name of the host OS. Possible values are: [code]"Android"[/code], [code]"iOS"[/code], [code]"HTML5"[/code], [code]"OSX"[/code], [code]"Server"[/code], [code]"Windows"[/code], [code]"UWP"[/code], [code]"X11"[/code]. </description> </method> <method name="get_process_id" qualifiers="const"> @@ -254,20 +254,6 @@ [b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. </description> </method> - <method name="get_system_time_msecs" qualifiers="const"> - <return type="int"> - </return> - <description> - Returns the epoch time of the operating system in milliseconds. - </description> - </method> - <method name="get_system_time_secs" qualifiers="const"> - <return type="int"> - </return> - <description> - Returns the epoch time of the operating system in seconds. - </description> - </method> <method name="get_tablet_driver_count" qualifiers="const"> <return type="int"> </return> @@ -325,7 +311,7 @@ </description> </method> <method name="get_unix_time" qualifiers="const"> - <return type="int"> + <return type="float"> </return> <description> Returns the current UNIX epoch timestamp. 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/Performance.xml b/doc/classes/Performance.xml index 2a0c153267..0a9079ce71 100644 --- a/doc/classes/Performance.xml +++ b/doc/classes/Performance.xml @@ -5,12 +5,55 @@ </brief_description> <description> This class provides access to a number of different monitors related to performance, such as memory usage, draw calls, and FPS. These are the same as the values displayed in the [b]Monitor[/b] tab in the editor's [b]Debugger[/b] panel. By using the [method get_monitor] method of this class, you can access this data from your code. + You can add custom monitors using the [method add_custom_monitor] method. Custom monitors are available in [b]Monitor[/b] tab in the editor's [b]Debugger[/b] panel together with built-in monitors. [b]Note:[/b] A few of these monitors are only available in debug mode and will always return 0 when used in a release build. [b]Note:[/b] Many of these monitors are not updated in real-time, so there may be a short delay between changes. + [b]Note:[/b] Custom monitors do not support negative values. Negative values are clamped to 0. </description> <tutorials> </tutorials> <methods> + <method name="add_custom_monitor"> + <return type="void"> + </return> + <argument index="0" name="id" type="StringName"> + </argument> + <argument index="1" name="callable" type="Callable"> + </argument> + <argument index="2" name="arguments" type="Array" default="[ ]"> + </argument> + <description> + Adds a custom monitor with name same as id. You can specify the category of monitor using '/' in id. If there are more than one '/' then default category is used. Default category is "Custom". + [codeblock] + Performance.add_custom_monitor("MyCategory/MyMonitor", some_callable) # Adds monitor with name "MyName" to category "MyCategory" + Performance.add_custom_monitor("MyMonitor", some_callable) # Adds monitor with name "MyName" to category "Custom" + # Note: "MyCategory/MyMonitor" and "MyMonitor" have same name but different ids so above code is valid + Performance.add_custom_monitor("Custom/MyMonitor", some_callable) # Adds monitor with name "MyName" to category "Custom" + # Note: "MyMonitor" and "Custom/MyMonitor" have same name and same category but different ids so above code is valid + Performance.add_custom_monitor("MyCategoryOne/MyCategoryTwo/MyMonitor", some_callable) # Adds monitor with name "MyCategoryOne/MyCategoryTwo/MyMonitor" to category "Custom" + [/codeblock] + The debugger calls the callable to get the value of custom monitor. The callable must return a number. + Callables are called with arguments supplied in argument array. + [b]Note:[/b] It throws an error if given id is already present. + </description> + </method> + <method name="get_custom_monitor"> + <return type="Variant"> + </return> + <argument index="0" name="id" type="StringName"> + </argument> + <description> + Returns the value of custom monitor with given id. The callable is called to get the value of custom monitor. + [b]Note:[/b] It throws an error if the given id is absent. + </description> + </method> + <method name="get_custom_monitor_names"> + <return type="Array"> + </return> + <description> + Returns the names of active custom monitors in an array. + </description> + </method> <method name="get_monitor" qualifiers="const"> <return type="float"> </return> @@ -23,6 +66,32 @@ [/codeblock] </description> </method> + <method name="get_monitor_modification_time"> + <return type="int"> + </return> + <description> + Returns the last tick in which custom monitor was added/removed. + </description> + </method> + <method name="has_custom_monitor"> + <return type="bool"> + </return> + <argument index="0" name="id" type="StringName"> + </argument> + <description> + Returns true if custom monitor with the given id is present otherwise returns false. + </description> + </method> + <method name="remove_custom_monitor"> + <return type="void"> + </return> + <argument index="0" name="id" type="StringName"> + </argument> + <description> + Removes the custom monitor with given id. + [b]Note:[/b] It throws an error if the given id is already absent. + </description> + </method> </methods> <constants> <constant name="TIME_FPS" value="0" enum="Monitor"> diff --git a/doc/classes/PhysicsMaterial.xml b/doc/classes/PhysicsMaterial.xml index 6410626496..0889c238dc 100644 --- a/doc/classes/PhysicsMaterial.xml +++ b/doc/classes/PhysicsMaterial.xml @@ -12,6 +12,7 @@ </methods> <members> <member name="absorbent" type="bool" setter="set_absorbent" getter="is_absorbent" default="false"> + If [code]true[/code], subtracts the bounciness from the colliding object's bounciness instead of adding it. </member> <member name="bounce" type="float" setter="set_bounce" getter="get_bounce" default="0.0"> The body's bounciness. Values range from [code]0[/code] (no bounce) to [code]1[/code] (full bounciness). @@ -20,6 +21,7 @@ The body's friction. Values range from [code]0[/code] (frictionless) to [code]1[/code] (maximum friction). </member> <member name="rough" type="bool" setter="set_rough" getter="is_rough" default="false"> + If [code]true[/code], the physics engine will use the friction of the object marked as "rough" when two objects collide. If [code]false[/code], the physics engine will use the lowest friction of all colliding objects instead. If [code]true[/code] for both colliding objects, the physics engine will use the highest friction. </member> </members> <constants> diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml index 9da739e57a..d7821b1045 100644 --- a/doc/classes/PhysicsServer2D.xml +++ b/doc/classes/PhysicsServer2D.xml @@ -864,28 +864,28 @@ Creates a damped spring joint between two bodies. If not specified, the second body is assumed to be the joint itself. </description> </method> - <method name="damped_string_joint_get_param" qualifiers="const"> + <method name="damped_spring_joint_get_param" qualifiers="const"> <return type="float"> </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="param" type="int" enum="PhysicsServer2D.DampedStringParam"> + <argument index="1" name="param" type="int" enum="PhysicsServer2D.DampedSpringParam"> </argument> <description> - Returns the value of a damped spring joint parameter. + Returns the value of a damped spring joint parameter. See [enum DampedSpringParam] for a list of available parameters. </description> </method> - <method name="damped_string_joint_set_param"> + <method name="damped_spring_joint_set_param"> <return type="void"> </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="param" type="int" enum="PhysicsServer2D.DampedStringParam"> + <argument index="1" name="param" type="int" enum="PhysicsServer2D.DampedSpringParam"> </argument> <argument index="2" name="value" type="float"> </argument> <description> - Sets a damped spring joint parameter. See [enum DampedStringParam] for a list of available parameters. + Sets a damped spring joint parameter. See [enum DampedSpringParam] for a list of available parameters. </description> </method> <method name="free_rid"> @@ -1247,13 +1247,13 @@ </constant> <constant name="JOINT_PARAM_MAX_FORCE" value="2" enum="JointParam"> </constant> - <constant name="DAMPED_STRING_REST_LENGTH" value="0" enum="DampedStringParam"> + <constant name="DAMPED_SPRING_REST_LENGTH" value="0" enum="DampedSpringParam"> Sets the resting length of the spring joint. The joint will always try to go to back this length when pulled apart. </constant> - <constant name="DAMPED_STRING_STIFFNESS" value="1" enum="DampedStringParam"> + <constant name="DAMPED_SPRING_STIFFNESS" value="1" enum="DampedSpringParam"> Sets the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length. </constant> - <constant name="DAMPED_STRING_DAMPING" value="2" enum="DampedStringParam"> + <constant name="DAMPED_SPRING_DAMPING" value="2" enum="DampedSpringParam"> Sets the damping ratio of the spring joint. A value of 0 indicates an undamped spring, while 1 causes the system to reach equilibrium as fast as possible (critical damping). </constant> <constant name="CCD_MODE_DISABLED" value="0" enum="CCDMode"> diff --git a/doc/classes/PhysicsShapeQueryParameters2D.xml b/doc/classes/PhysicsShapeQueryParameters2D.xml index 9a162dabbb..63e13954ab 100644 --- a/doc/classes/PhysicsShapeQueryParameters2D.xml +++ b/doc/classes/PhysicsShapeQueryParameters2D.xml @@ -9,15 +9,6 @@ <tutorials> </tutorials> <methods> - <method name="set_shape"> - <return type="void"> - </return> - <argument index="0" name="shape" type="Resource"> - </argument> - <description> - Sets the [Shape2D] that will be used for collision/intersection queries. - </description> - </method> </methods> <members> <member name="collide_with_areas" type="bool" setter="set_collide_with_areas" getter="is_collide_with_areas_enabled" default="false"> @@ -38,8 +29,24 @@ <member name="motion" type="Vector2" setter="set_motion" getter="get_motion" default="Vector2( 0, 0 )"> The motion of the shape being queried for. </member> + <member name="shape" type="Resource" setter="set_shape" getter="get_shape"> + The [Shape2D] that will be used for collision/intersection queries. This stores the actual reference which avoids the shape to be released while being used for queries, so always prefer using this over [member shape_rid]. + </member> <member name="shape_rid" type="RID" setter="set_shape_rid" getter="get_shape_rid"> - The queried shape's [RID]. See also [method set_shape]. + The queried shape's [RID] that will be used for collision/intersection queries. Use this over [member shape] if you want to optimize for performance using the Servers API: + [codeblock] + var shape_rid = PhysicsServer2D.circle_shape_create() + var radius = 64 + PhysicsServer2D.shape_set_data(shape_rid, radius) + + var params = PhysicsShapeQueryParameters2D.new() + params.shape_rid = shape_rid + + # Execute physics queries here... + + # Release the shape when done with physics queries. + PhysicsServer2D.free_rid(shape_rid) + [/codeblock] </member> <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D( 1, 0, 0, 1, 0, 0 )"> The queried shape's transform matrix. diff --git a/doc/classes/PhysicsShapeQueryParameters3D.xml b/doc/classes/PhysicsShapeQueryParameters3D.xml index 6606cfbc59..f4191d4862 100644 --- a/doc/classes/PhysicsShapeQueryParameters3D.xml +++ b/doc/classes/PhysicsShapeQueryParameters3D.xml @@ -9,15 +9,6 @@ <tutorials> </tutorials> <methods> - <method name="set_shape"> - <return type="void"> - </return> - <argument index="0" name="shape" type="Resource"> - </argument> - <description> - Sets the [Shape3D] that will be used for collision/intersection queries. - </description> - </method> </methods> <members> <member name="collide_with_areas" type="bool" setter="set_collide_with_areas" getter="is_collide_with_areas_enabled" default="false"> @@ -35,8 +26,24 @@ <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.0"> The collision margin for the shape. </member> + <member name="shape" type="Resource" setter="set_shape" getter="get_shape"> + The [Shape3D] that will be used for collision/intersection queries. This stores the actual reference which avoids the shape to be released while being used for queries, so always prefer using this over [member shape_rid]. + </member> <member name="shape_rid" type="RID" setter="set_shape_rid" getter="get_shape_rid"> - The queried shape's [RID]. See also [method set_shape]. + The queried shape's [RID] that will be used for collision/intersection queries. Use this over [member shape] if you want to optimize for performance using the Servers API: + [codeblock] + var shape_rid = PhysicsServer3D.shape_create(PhysicsServer3D.SHAPE_SPHERE) + var radius = 2.0 + PhysicsServer3D.shape_set_data(shape_rid, radius) + + var params = PhysicsShapeQueryParameters3D.new() + params.shape_rid = shape_rid + + # Execute physics queries here... + + # Release the shape when done with physics queries. + PhysicsServer3D.free_rid(shape_rid) + [/codeblock] </member> <member name="transform" type="Transform" setter="set_transform" getter="get_transform" default="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> The queried shape's transform matrix. diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index daf8cb1d2f..7191492098 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -137,7 +137,7 @@ <argument index="0" name="file" type="String"> </argument> <description> - Saves the configuration to a custom file. + Saves the configuration to a custom file. The file extension must be [code].godot[/code] (to save in text-based [ConfigFile] format) or [code].binary[/code] (to save in binary format). </description> </method> <method name="set_initial_value"> @@ -821,6 +821,8 @@ </member> <member name="mono/profiler/enabled" type="bool" setter="" getter="" default="false"> </member> + <member name="mono/project/auto_update_project" type="bool" setter="" getter="" default="true"> + </member> <member name="mono/unhandled_exception_policy" type="int" setter="" getter="" default="0"> </member> <member name="network/limits/debugger/max_chars_per_second" type="int" setter="" getter="" default="32768"> diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml index 2e8be384c1..f3a7ba0476 100644 --- a/doc/classes/Rect2i.xml +++ b/doc/classes/Rect2i.xml @@ -46,7 +46,129 @@ Constructs a new [Rect2i] from [Rect2]. The floating point coordinates will be truncated. </description> </method> + <method name="abs"> + <return type="Rect2i"> + </return> + <description> + Returns a [Rect2i] with equivalent position and area, modified so that the top-left corner is the origin and [code]width[/code] and [code]height[/code] are positive. + </description> + </method> + <method name="clip"> + <return type="Rect2i"> + </return> + <argument index="0" name="b" type="Rect2i"> + </argument> + <description> + Returns the intersection of this [Rect2i] and b. + </description> + </method> + <method name="encloses"> + <return type="bool"> + </return> + <argument index="0" name="b" type="Rect2i"> + </argument> + <description> + Returns [code]true[/code] if this [Rect2i] completely encloses another one. + </description> + </method> + <method name="expand"> + <return type="Rect2i"> + </return> + <argument index="0" name="to" type="Vector2i"> + </argument> + <description> + Returns this [Rect2i] expanded to include a given point. + </description> + </method> + <method name="get_area"> + <return type="int"> + </return> + <description> + Returns the area of the [Rect2i]. + </description> + </method> + <method name="grow"> + <return type="Rect2i"> + </return> + <argument index="0" name="by" type="int"> + </argument> + <description> + Returns a copy of the [Rect2i] grown a given amount of units towards all the sides. + </description> + </method> + <method name="grow_individual"> + <return type="Rect2i"> + </return> + <argument index="0" name="left" type="int"> + </argument> + <argument index="1" name="top" type="int"> + </argument> + <argument index="2" name="right" type="int"> + </argument> + <argument index="3" name=" bottom" type="int"> + </argument> + <description> + Returns a copy of the [Rect2i] grown a given amount of units towards each direction individually. + </description> + </method> + <method name="grow_margin"> + <return type="Rect2i"> + </return> + <argument index="0" name="margin" type="int"> + </argument> + <argument index="1" name="by" type="int"> + </argument> + <description> + Returns a copy of the [Rect2i] grown a given amount of units towards the [enum Margin] direction. + </description> + </method> + <method name="has_no_area"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the [Rect2i] is flat or empty. + </description> + </method> + <method name="has_point"> + <return type="bool"> + </return> + <argument index="0" name="point" type="Vector2i"> + </argument> + <description> + Returns [code]true[/code] if the [Rect2i] contains a point. + </description> + </method> + <method name="intersects"> + <return type="bool"> + </return> + <argument index="0" name="b" type="Rect2i"> + </argument> + <description> + Returns [code]true[/code] if the [Rect2i] overlaps with [code]b[/code] (i.e. they have at least one point in common). + If [code]include_borders[/code] is [code]true[/code], they will also be considered overlapping if their borders touch, even without intersection. + </description> + </method> + <method name="merge"> + <return type="Rect2i"> + </return> + <argument index="0" name="b" type="Rect2i"> + </argument> + <description> + Returns a larger [Rect2i] that contains this [Rect2i] and [code]b[/code]. + </description> + </method> </methods> + <members> + <member name="end" type="Vector2i" setter="" getter="" default="Vector2i( 0, 0 )"> + Ending corner. + </member> + <member name="position" type="Vector2i" setter="" getter="" default="Vector2i( 0, 0 )"> + Position (starting corner). + </member> + <member name="size" type="Vector2i" setter="" getter="" default="Vector2i( 0, 0 )"> + Size from position to end. + </member> + </members> <constants> </constants> </class> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index d8be6d4bd7..8832c0ec4d 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -3009,6 +3009,11 @@ </description> </method> </methods> + <members> + <member name="render_loop_enabled" type="bool" setter="set_render_loop_enabled" getter="is_render_loop_enabled"> + If [code]false[/code], disables rendering completely, but the engine logic is still being processed. You can call [method force_draw] to draw a frame even with rendering disabled. + </member> + </members> <signals> <signal name="frame_post_draw"> <description> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index efc0c9d600..c44df72878 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -20,8 +20,10 @@ </argument> <argument index="2" name="height" type="int" default="0"> </argument> + <argument index="3" name="color" type="Color" default="Color( 1, 1, 1, 1 )"> + </argument> <description> - Adds an image's opening and closing tags to the tag stack, optionally providing a [code]width[/code] and [code]height[/code] to resize the image. + Adds an image's opening and closing tags to the tag stack, optionally providing a [code]width[/code] and [code]height[/code] to resize the image and a [code]color[/code] to tint the image. If [code]width[/code] or [code]height[/code] is set to 0, the image size will be adjusted in order to keep the original aspect ratio. </description> </method> @@ -50,7 +52,7 @@ Clears the tag stack and sets [member bbcode_text] to an empty string. </description> </method> - <method name="get_content_height"> + <method name="get_content_height" qualifiers="const"> <return type="int"> </return> <description> @@ -292,6 +294,10 @@ The currently installed custom effects. This is an array of [RichTextEffect]s. To add a custom effect, it's more convenient to use [method install_effect]. </member> + <member name="fit_content_height" type="bool" setter="set_fit_content_height" getter="is_fit_content_height_enabled" default="false"> + If [code]true[/code], the label's height will be automatically updated to fit its content. + [b]Note:[/b] This property is used as a workaround to fix issues with [RichTextLabel] in [Container]s, but it's unreliable in some cases and will be removed in future versions. + </member> <member name="meta_underlined" type="bool" setter="set_meta_underline" getter="is_meta_underlined" default="true"> If [code]true[/code], the label underlines meta tags such as [code][url]{text}[/url][/code]. </member> 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/Shape2D.xml b/doc/classes/Shape2D.xml index 9e913cb44d..5f41d05816 100644 --- a/doc/classes/Shape2D.xml +++ b/doc/classes/Shape2D.xml @@ -74,6 +74,17 @@ This method needs the transformation matrix for this shape ([code]local_xform[/code]), the movement to test on this shape ([code]local_motion[/code]), the shape to check collisions with ([code]with_shape[/code]), the transformation matrix of that shape ([code]shape_xform[/code]), and the movement to test onto the other object ([code]shape_motion[/code]). </description> </method> + <method name="draw"> + <return type="void"> + </return> + <argument index="0" name="canvas_item" type="RID"> + </argument> + <argument index="1" name="color" type="Color"> + </argument> + <description> + Draws a solid shape onto a [CanvasItem] with the [RenderingServer] API filled with the specified [code]color[/code]. The exact drawing method is specific for each shape and cannot be configured. + </description> + </method> </methods> <members> <member name="custom_solver_bias" type="float" setter="set_custom_solver_bias" getter="get_custom_solver_bias" default="0.0"> diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml index 4460b519fc..183fd5396f 100644 --- a/doc/classes/Skeleton3D.xml +++ b/doc/classes/Skeleton3D.xml @@ -31,6 +31,16 @@ [i]Deprecated soon.[/i] </description> </method> + <method name="bone_transform_to_world_transform"> + <return type="Transform"> + </return> + <argument index="0" name="bone_transform" type="Transform"> + </argument> + <description> + Takes the given bone pose/transform and converts it to a world transform, relative to the [Skeleton3D] node. + This is useful for using the bone transform in calculations with transforms from [Node3D]-based nodes. + </description> + </method> <method name="clear_bones"> <return type="void"> </return> @@ -42,6 +52,7 @@ <return type="void"> </return> <description> + Removes the global pose override on all bones in the skeleton. </description> </method> <method name="find_bone" qualifiers="const"> @@ -106,6 +117,12 @@ Returns the pose transform of the specified bone. Pose is applied on top of the custom pose, which is applied on top the rest pose. </description> </method> + <method name="get_bone_process_orders"> + <return type="PackedInt32Array"> + </return> + <description> + </description> + </method> <method name="get_bone_rest" qualifiers="const"> <return type="Transform"> </return> @@ -130,12 +147,14 @@ <argument index="0" name="bone_idx" type="int"> </argument> <description> + Returns whether the bone rest for the bone at [code]bone_idx[/code] is disabled. </description> </method> <method name="localize_rests"> <return type="void"> </return> <description> + Returns all bones in the skeleton to their rest poses. </description> </method> <method name="physical_bones_add_collision_exception"> @@ -144,6 +163,8 @@ <argument index="0" name="exception" type="RID"> </argument> <description> + Adds a collision exception to the physical bone. + Works just like the [RigidBody3D] node. </description> </method> <method name="physical_bones_remove_collision_exception"> @@ -152,6 +173,8 @@ <argument index="0" name="exception" type="RID"> </argument> <description> + Removes a collision exception to the physical bone. + Works just like the [RigidBody3D] node. </description> </method> <method name="physical_bones_start_simulation"> @@ -160,12 +183,15 @@ <argument index="0" name="bones" type="StringName[]" default="[ ]"> </argument> <description> + Tells the [PhysicalBone3D] nodes in the Skeleton to start simulating and reacting to the physics world. + Optionally, a list of bone names can be passed-in, allowing only the passed-in bones to be simulated. </description> </method> <method name="physical_bones_stop_simulation"> <return type="void"> </return> <description> + Tells the [PhysicalBone3D] nodes in the Skeleton to stop simulating. </description> </method> <method name="register_skin"> @@ -174,6 +200,7 @@ <argument index="0" name="skin" type="Skin"> </argument> <description> + Binds the given Skin to the Skeleton. </description> </method> <method name="set_bone_custom_pose"> @@ -184,6 +211,8 @@ <argument index="1" name="custom_pose" type="Transform"> </argument> <description> + Sets the custom pose transform, [code]custom_pose[/code], for the bone at [code]bone_idx[/code]. This pose is an addition to the bone rest pose. + [b]Note[/b]: The pose transform needs to be in bone space. Use [method world_transform_to_bone_transform] to convert a world transform, like one you can get from a [Node3D], to bone space. </description> </method> <method name="set_bone_disable_rest"> @@ -194,6 +223,7 @@ <argument index="1" name="disable" type="bool"> </argument> <description> + Disables the rest pose for the bone at [code]bone_idx[/code] if [code]true[/code], enables the bone rest if [code]false[/code]. </description> </method> <method name="set_bone_global_pose_override"> @@ -208,6 +238,9 @@ <argument index="3" name="persistent" type="bool" default="false"> </argument> <description> + Sets the global pose transform, [code]pose[/code], for the bone at [code]bone_idx[/code]. + [code]amount[/code] is the interpolation strengh that will be used when applying the pose, and [code]persistent[/code] determines if the applied pose will remain. + [b]Note[/b]: The pose transform needs to be in bone space. Use [method world_transform_to_bone_transform] to convert a world transform, like one you can get from a [Node3D], to bone space. </description> </method> <method name="set_bone_parent"> @@ -231,6 +264,7 @@ </argument> <description> Returns the pose transform for bone [code]bone_idx[/code]. + [b]Note[/b]: The pose transform needs to be in bone space. Use [method world_transform_to_bone_transform] to convert a world transform, like one you can get from a [Node3D], to bone space. </description> </method> <method name="set_bone_rest"> @@ -261,6 +295,17 @@ <argument index="0" name="bone_idx" type="int"> </argument> <description> + Unparents the bone at [code]bone_idx[/code] and sets its rest position to that of it's parent prior to being reset. + </description> + </method> + <method name="world_transform_to_bone_transform"> + <return type="Transform"> + </return> + <argument index="0" name="world_transform" type="Transform"> + </argument> + <description> + Takes the given world transform, relative to the [Skeleton3D], and converts it to a bone pose/transform. + This is useful for using setting bone poses using transforms from [Node3D]-based nodes. </description> </method> </methods> @@ -268,6 +313,12 @@ <member name="animate_physical_bones" type="bool" setter="set_animate_physical_bones" getter="get_animate_physical_bones" default="true"> </member> </members> + <signals> + <signal name="pose_updated"> + <description> + </description> + </signal> + </signals> <constants> <constant name="NOTIFICATION_UPDATE_SKELETON" value="50"> </constant> diff --git a/doc/classes/SpotLight3D.xml b/doc/classes/SpotLight3D.xml index f094818c21..423633e583 100644 --- a/doc/classes/SpotLight3D.xml +++ b/doc/classes/SpotLight3D.xml @@ -12,6 +12,8 @@ <methods> </methods> <members> + <member name="shadow_bias" type="float" setter="set_param" getter="get_param" override="true" default="0.02" /> + <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" override="true" default="1.0" /> <member name="spot_angle" type="float" setter="set_param" getter="get_param" default="45.0"> The spotlight's angle in degrees. </member> @@ -22,7 +24,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..6d9def7ccb 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -381,7 +381,7 @@ <return type="bool"> </return> <description> - Returns [code]true[/code] if the string is empty. + Returns [code]true[/code] if the length of the string equals [code]0[/code]. </description> </method> <method name="ends_with"> @@ -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"> diff --git a/doc/classes/ToolButton.xml b/doc/classes/ToolButton.xml deleted file mode 100644 index f78627b163..0000000000 --- a/doc/classes/ToolButton.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="ToolButton" inherits="Button" version="4.0"> - <brief_description> - Flat button helper class. - </brief_description> - <description> - This is a helper class to generate a flat [Button] (see [member Button.flat]), creating a [ToolButton] is equivalent to: - [codeblock] - var btn = Button.new() - btn.flat = true - [/codeblock] - </description> - <tutorials> - </tutorials> - <methods> - </methods> - <members> - <member name="flat" type="bool" setter="set_flat" getter="is_flat" override="true" default="true" /> - </members> - <constants> - </constants> - <theme_items> - <theme_item name="disabled" type="StyleBox"> - [StyleBox] used when the [ToolButton] is disabled. - </theme_item> - <theme_item name="focus" type="StyleBox"> - [StyleBox] used when the [ToolButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. - </theme_item> - <theme_item name="font" type="Font"> - [Font] of the [ToolButton]'s text. - </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> - Default text [Color] of the [ToolButton]. - </theme_item> - <theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.95, 1, 0.3 )"> - Text [Color] used when the [ToolButton] is disabled. - </theme_item> - <theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> - Text [Color] used when the [ToolButton] is being hovered. - </theme_item> - <theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )"> - Text [Color] used when the [ToolButton] is being pressed. - </theme_item> - <theme_item name="hover" type="StyleBox"> - [StyleBox] used when the [ToolButton] is being hovered. - </theme_item> - <theme_item name="hseparation" type="int" default="3"> - The horizontal space between [ToolButton]'s icon and text. - </theme_item> - <theme_item name="normal" type="StyleBox"> - Default [StyleBox] for the [ToolButton]. - </theme_item> - <theme_item name="pressed" type="StyleBox"> - [StyleBox] used when the [ToolButton] is being pressed. - </theme_item> - </theme_items> -</class> diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index 1938a3facb..56ccaaf383 100644 --- a/doc/classes/Tween.xml +++ b/doc/classes/Tween.xml @@ -15,7 +15,7 @@ tween.start() [/codeblock] Many methods require a property name, such as [code]"position"[/code] above. You can find the correct property name by hovering over the property in the Inspector. You can also provide the components of a property directly by using [code]"property:component"[/code] (eg. [code]position:x[/code]), where it would only apply to that particular component. - Many of the methods accept [code]trans_type[/code] and [code]ease_type[/code]. The first accepts an [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [url=https://easings.net/]easings.net[/url] for some examples). The second accepts an [enum EaseType] constant, and controls the where [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [constant EASE_IN_OUT], and use the one that looks best. + Many of the methods accept [code]trans_type[/code] and [code]ease_type[/code]. The first accepts an [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [url=https://easings.net/]easings.net[/url] for some examples). The second accepts an [enum EaseType] constant, and controls where the [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [constant EASE_IN_OUT], and use the one that looks best. [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/tween_cheatsheet.png]Tween easing and transition types cheatsheet[/url] </description> <tutorials> diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 64ebc1fa09..7f4a212679 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -5,7 +5,8 @@ </brief_description> <description> 2-element structure that can be used to represent positions in 2D space or any other pair of numeric values. - It uses floating point coordinates. + It uses floating-point coordinates. See [Vector2i] for its integer counterpart. + [b]Note:[/b] In a boolean context, a Vector2 will evaluate to [code]false[/code] if it's equal to [code]Vector2(0, 0)[/code]. Otherwise, a Vector2 will always evaluate to [code]true[/code]. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml index a516eb01dd..2f7ca985b2 100644 --- a/doc/classes/Vector2i.xml +++ b/doc/classes/Vector2i.xml @@ -5,7 +5,8 @@ </brief_description> <description> 2-element structure that can be used to represent positions in 2D space or any other pair of numeric values. - It uses integer coordinates. + It uses integer coordinates and is therefore preferable to [Vector2] when exact precision is required. + [b]Note:[/b] In a boolean context, a Vector2i will evaluate to [code]false[/code] if it's equal to [code]Vector2i(0, 0)[/code]. Otherwise, a Vector2i will always evaluate to [code]true[/code]. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> @@ -31,7 +32,36 @@ Constructs a new [Vector2i] from [Vector2]. The floating point coordinates will be truncated. </description> </method> + <method name="abs"> + <return type="Vector2i"> + </return> + <description> + Returns a new vector with all components in absolute values (i.e. positive). + </description> + </method> + <method name="aspect"> + <return type="float"> + </return> + <description> + Returns the ratio of [member x] to [member y]. + </description> + </method> + <method name="sign"> + <return type="Vector2i"> + </return> + <description> + Returns the vector with each component set to one or negative one, depending on the signs of the components. + </description> + </method> </methods> + <members> + <member name="x" type="int" setter="" getter="" default="0"> + The vector's X component. Also accessible by using the index position [code][0][/code]. + </member> + <member name="y" type="int" setter="" getter="" default="0"> + The vector's Y component. Also accessible by using the index position [code][1][/code]. + </member> + </members> <constants> <constant name="AXIS_X" value="0"> Enumerated value for the X axis. diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index 29222bb4d1..0c861e5ee2 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -5,7 +5,8 @@ </brief_description> <description> 3-element structure that can be used to represent positions in 3D space or any other pair of numeric values. - It uses floating point coordinates. + It uses floating-point coordinates. See [Vector3i] for its integer counterpart. + [b]Note:[/b] In a boolean context, a Vector3 will evaluate to [code]false[/code] if it's equal to [code]Vector3(0, 0, 0)[/code]. Otherwise, a Vector3 will always evaluate to [code]true[/code]. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml index 4f5a658b89..91d64ea609 100644 --- a/doc/classes/Vector3i.xml +++ b/doc/classes/Vector3i.xml @@ -5,7 +5,8 @@ </brief_description> <description> 3-element structure that can be used to represent positions in 3D space or any other pair of numeric values. - It uses integer coordinates. + It uses integer coordinates and is therefore preferable to [Vector3] when exact precision is required. + [b]Note:[/b] In a boolean context, a Vector3i will evaluate to [code]false[/code] if it's equal to [code]Vector3i(0, 0, 0)[/code]. Otherwise, a Vector3i will always evaluate to [code]true[/code]. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> @@ -33,7 +34,39 @@ Constructs a new [Vector3i] from [Vector3]. The floating point coordinates will be truncated. </description> </method> + <method name="max_axis"> + <return type="int"> + </return> + <description> + Returns the axis of the vector's largest value. See [code]AXIS_*[/code] constants. + </description> + </method> + <method name="min_axis"> + <return type="int"> + </return> + <description> + Returns the axis of the vector's smallest value. See [code]AXIS_*[/code] constants. + </description> + </method> + <method name="sign"> + <return type="Vector3i"> + </return> + <description> + Returns the vector with each component set to one or negative one, depending on the signs of the components. + </description> + </method> </methods> + <members> + <member name="x" type="int" setter="" getter="" default="0"> + The vector's X component. Also accessible by using the index position [code][0][/code]. + </member> + <member name="y" type="int" setter="" getter="" default="0"> + The vector's Y component. Also accessible by using the index position [code][1][/code]. + </member> + <member name="z" type="int" setter="" getter="" default="0"> + The vector's Z component. Also accessible by using the index position [code][2][/code]. + </member> + </members> <constants> <constant name="AXIS_X" value="0"> Enumerated value for the X axis. diff --git a/doc/classes/VisualShaderNodeSample3D.xml b/doc/classes/VisualShaderNodeSample3D.xml new file mode 100644 index 0000000000..cf6933ab55 --- /dev/null +++ b/doc/classes/VisualShaderNodeSample3D.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeSample3D" inherits="VisualShaderNode" version="4.0"> + <brief_description> + A base node for nodes which samples 3D textures in the visual shader graph. + </brief_description> + <description> + A virtual class, use the descendants instead. + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="source" type="int" setter="set_source" getter="get_source" enum="VisualShaderNodeSample3D.Source" default="0"> + An input source type. + </member> + </members> + <constants> + <constant name="SOURCE_TEXTURE" value="0" enum="Source"> + Creates internal uniform and provides a way to assign it within node. + </constant> + <constant name="SOURCE_PORT" value="1" enum="Source"> + Use the uniform texture from sampler port. + </constant> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeTexture2DArray.xml b/doc/classes/VisualShaderNodeTexture2DArray.xml new file mode 100644 index 0000000000..3c6d328ed0 --- /dev/null +++ b/doc/classes/VisualShaderNodeTexture2DArray.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeTexture2DArray" inherits="VisualShaderNodeSample3D" version="4.0"> + <brief_description> + A 2D texture uniform array to be used within the visual shader graph. + </brief_description> + <description> + Translated to [code]uniform sampler2DArray[/code] in the shader language. + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="texture_array" type="Texture2DArray" setter="set_texture_array" getter="get_texture_array"> + A source texture array. Used if [member VisualShaderNodeSample3D.source] is set to [constant VisualShaderNodeSample3D.SOURCE_TEXTURE]. + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeTexture2DArrayUniform.xml b/doc/classes/VisualShaderNodeTexture2DArrayUniform.xml new file mode 100644 index 0000000000..976fcf26c8 --- /dev/null +++ b/doc/classes/VisualShaderNodeTexture2DArrayUniform.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeTexture2DArrayUniform" inherits="VisualShaderNodeTextureUniform" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/bool.xml b/doc/classes/bool.xml index 4482a280b2..869fc14d40 100644 --- a/doc/classes/bool.xml +++ b/doc/classes/bool.xml @@ -4,14 +4,14 @@ Boolean built-in type. </brief_description> <description> - Boolean is a built-in type. It can represent any data type that is either a true or false value. You can think of it as an switch with on or off (1 or 0) setting. It's often used as part of programming logic in condition statements like [code]if[/code] statements. - [b]Note:[/b] In a code below [code]if can_shoot[/code] is equivalent of [code]if can_shoot == true[/code]. It is good practice to follow the natural spoken language structure when possible. Use [code]if can_shoot[/code] rather than [code]if can_shoot == true[/code] and use [code]if not can_shoot[/code] rather than [code]if can_shoot == false[/code]. + Boolean is a built-in type. There are two boolean values: [code]true[/code] and [code]false[/code]. You can think of it as an switch with on or off (1 or 0) setting. Booleans are used in programming for logic in condition statements, like [code]if[/code] statements. + Booleans can be directly used in [code]if[/code] statements. The code below demonstrates this on the [code]if can_shoot:[/code] line. You don't need to use [code]== true[/code], you only need [code]if can_shoot:[/code]. Similarly, use [code]if not can_shoot:[/code] rather than [code]== false[/code]. [codeblock] var can_shoot = true func shoot(): if can_shoot: - # Perform shooting actions here. + pass # Perform shooting actions here. [/codeblock] The following code will only create a bullet if both conditions are met: action "shoot" is pressed and if [code]can_shoot[/code] is [code]true[/code]. [b]Note:[/b] [code]Input.is_action_pressed("shoot")[/code] is also a boolean that is [code]true[/code] when "shoot" is pressed and [code]false[/code] when "shoot" isn't pressed. @@ -46,7 +46,7 @@ <argument index="0" name="from" type="int"> </argument> <description> - Cast an [int] value to a boolean value, this method will return [code]true[/code] if called with an integer value different to 0 and [code]false[/code] in other case. + Cast an [int] value to a boolean value, this method will return [code]false[/code] if [code]0[/code] is passed in, and [code]true[/code] for all other ints. </description> </method> <method name="bool"> @@ -55,7 +55,7 @@ <argument index="0" name="from" type="float"> </argument> <description> - Cast a [float] value to a boolean value, this method will return [code]true[/code] if called with a floating-point value different to 0 and [code]false[/code] in other case. + Cast a [float] value to a boolean value, this method will return [code]false[/code] if [code]0.0[/code] is passed in, and [code]true[/code] for all other floats. </description> </method> <method name="bool"> @@ -64,7 +64,8 @@ <argument index="0" name="from" type="String"> </argument> <description> - Cast a [String] value to a boolean value, this method will return [code]true[/code] if called with a non-empty string and [code]false[/code] in other case. Examples: [code]bool("False")[/code] returns [code]true[/code], [code]bool("")[/code] returns [code]false[/code]. + Cast a [String] value to a boolean value, this method will return [code]false[/code] if [code]""[/code] is passed in, and [code]true[/code] for all non-empty strings. + Examples: [code]bool("False")[/code] returns [code]true[/code], [code]bool("")[/code] returns [code]false[/code]. </description> </method> </methods> |