diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 0820ab175df..00000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -patreon: godotengine -custom: https://godotengine.org/donate diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index f10438769da..00000000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,4 +0,0 @@ -# Code of Conduct - -By participating in this repository, you agree to abide by the -[Godot Engine Code of Conduct](https://godotengine.org/code-of-conduct). diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 7471ab42412..5fa368e4815 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -896,6 +896,9 @@ void ResourceLoader::load_translation_remaps() { void ResourceLoader::clear_translation_remaps() { translation_remaps.clear(); + while (remapped_list.first() != nullptr) { + remapped_list.remove(remapped_list.first()); + } } void ResourceLoader::load_path_remaps() { diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 7fdb8afa58d..0e97a65d04d 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -341,16 +341,16 @@ Right Direction key. - Back key. + Media back key. Not to be confused with the Back button on an Android device. - Forward key. + Media forward key. - Stop key. + Media stop key. - Refresh key. + Media refresh key. Volume down key. diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index d5f5b466347..843f47e533c 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -236,7 +236,8 @@ The name of the animation to play when the scene loads. - The name of the current animation, "" if not playing anything. When being set, does not restart the animation. See also [method play]. + The name of the currently playing animation. If no animation is playing, the property's value is an empty string. Changing this value does not restart the animation. See [method play] for more information on playing animations. + [b]Note[/b]: while this property appears in the inspector, it's not meant to be edited and it's not saved in the scene. This property is mainly used to get the currently playing animation, and internally for animation playback tracks. For more information, see [Animation]. The length (in seconds) of the currently being played animation. diff --git a/doc/classes/Area.xml b/doc/classes/Area.xml index c7b1d8ca074..b0f8cf91ebc 100644 --- a/doc/classes/Area.xml +++ b/doc/classes/Area.xml @@ -96,10 +96,10 @@ If [code]true[/code], the area's audio bus overrides the default audio bus. - The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask]. + The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask]. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. - The physics layers this area scans to determine collision detection. + The physics layers this area scans to determine collision detection. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. The area's gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction. diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index 7698b4585c4..0614c5bee33 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -97,10 +97,10 @@ If [code]true[/code], the area's audio bus overrides the default audio bus. - The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask]. + The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask]. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. - The physics layers this area scans to determine collision detection. + The physics layers this area scans to determine collision detection. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. The area's gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction. diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml index c6b23b380b0..378d6ee87d5 100644 --- a/doc/classes/AudioStreamPlayer3D.xml +++ b/doc/classes/AudioStreamPlayer3D.xml @@ -5,6 +5,7 @@ Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space. + By default, audio is heard from the camera position. This can be changed by adding a [Listener] node to the scene and enabling it by calling [method Listener.make_current] on it. https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html diff --git a/doc/classes/ClippedCamera.xml b/doc/classes/ClippedCamera.xml index 7d2454b48a3..3d8a9cf758b 100644 --- a/doc/classes/ClippedCamera.xml +++ b/doc/classes/ClippedCamera.xml @@ -90,7 +90,7 @@ If [code]true[/code], the camera stops on contact with [PhysicsBody]s. - The camera's collision mask. Only objects in at least one collision layer matching the mask will be detected. + The camera's collision mask. Only objects in at least one collision layer matching the mask will be detected. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. The camera's collision margin. The camera can't get closer than this distance to a colliding object. diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index cb8bb064249..273ff061c7d 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -11,6 +11,7 @@ Only one [Control] node can be in keyboard focus. Only the node in focus will receive keyboard events. To get the focus, call [method grab_focus]. [Control] nodes lose focus when another node grabs it, or if you hide the node in focus. Sets [member mouse_filter] to [constant MOUSE_FILTER_IGNORE] to tell a [Control] node to ignore mouse or touch events. You'll need it if you place an icon on top of a button. [Theme] resources change the Control's appearance. If you change the [Theme] on a [Control] node, it affects all of its children. To override some of the theme's parameters, call one of the [code]add_*_override[/code] methods, like [method add_font_override]. You can override the theme with the inspector. + [b]Note:[/b] Theme items are [i]not[/i] [Object] properties. This means you can't access their values using [method Object.get] and [method Object.set]. Instead, use [method get_color], [method get_constant], [method get_font], [method get_icon], [method get_stylebox], and the [code]add_*_override[/code] methods provided by this class. https://docs.godotengine.org/en/latest/tutorials/gui/index.html @@ -95,7 +96,17 @@ - Overrides the [Color] with given [code]name[/code] in the [member theme] resource the control uses. If the [code]color[/code] is empty or invalid, the override is cleared and the color from assigned [Theme] is used. + Overrides the [Color] with given [code]name[/code] in the [member theme] resource the control uses. + [b]Note:[/b] Unlike other theme overrides, there is no way to undo a color override without manually assigning the previous color. + [b]Example of overriding a label's color and resetting it later:[/b] + [codeblock] + # Override the child node "MyLabel"'s font color to orange. + $MyLabel.add_color_override("font_color", Color(1, 0.5, 0)) + + # Reset the color by creating a new node to get the default value: + var default_label_color = Label.new().get_color("font_color") + $MyLabel.add_color_override("font_color", default_label_color) + [/codeblock] @@ -106,7 +117,7 @@ - Overrides an integer constant with given [code]name[/code] in the [member theme] resource the control uses. If the [code]constant[/code] is empty or invalid, the override is cleared and the constant from assigned [Theme] is used. + Overrides an integer constant with given [code]name[/code] in the [member theme] resource the control uses. If the [code]constant[/code] is [code]0[/code], the override is cleared and the constant from assigned [Theme] is used. @@ -117,7 +128,7 @@ - Overrides the font with given [code]name[/code] in the [member theme] resource the control uses. If [code]font[/code] is empty or invalid, the override is cleared and the font from assigned [Theme] is used. + Overrides the font with given [code]name[/code] in the [member theme] resource the control uses. If [code]font[/code] is [code]null[/code] or invalid, the override is cleared and the font from assigned [Theme] is used. @@ -128,7 +139,7 @@ - Overrides the icon with given [code]name[/code] in the [member theme] resource the control uses. If [code]icon[/code] is empty or invalid, the override is cleared and the icon from assigned [Theme] is used. + Overrides the icon with given [code]name[/code] in the [member theme] resource the control uses. If [code]icon[/code] is [code]null[/code] or invalid, the override is cleared and the icon from assigned [Theme] is used. @@ -139,7 +150,7 @@ - Overrides the [Shader] with given [code]name[/code] in the [member theme] resource the control uses. If [code]shader[/code] is empty or invalid, the override is cleared and the shader from assigned [Theme] is used. + Overrides the [Shader] with given [code]name[/code] in the [member theme] resource the control uses. If [code]shader[/code] is [code]null[/code] or invalid, the override is cleared and the shader from assigned [Theme] is used. @@ -151,6 +162,19 @@ Overrides the [StyleBox] with given [code]name[/code] in the [member theme] resource the control uses. If [code]stylebox[/code] is empty or invalid, the override is cleared and the [StyleBox] from assigned [Theme] is used. + [b]Example of modifying a property in a StyleBox by duplicating it:[/b] + [codeblock] + # The snippet below assumes the child node MyButton has a StyleBoxFlat assigned. + # Resources are shared across instances, so we need to duplicate it + # to avoid modifying the appearance of all other buttons. + var new_stylebox_normal = $MyButton.get_stylebox("normal").duplicate() + new_stylebox_normal.border_width_top = 3 + new_stylebox_normal.border_color = Color(0, 1, 0.5) + $MyButton.add_stylebox_override("normal", new_stylebox_normal) + + # Remove the stylebox override: + $MyButton.add_stylebox_override("normal", null) + [/codeblock] diff --git a/doc/classes/File.xml b/doc/classes/File.xml index 5a280ad96b1..ea1973bcc01 100644 --- a/doc/classes/File.xml +++ b/doc/classes/File.xml @@ -451,16 +451,16 @@ - Opens the file for read operations. + Opens the file for read operations. The cursor is positioned at the beginning of the file. - Opens the file for write operations. Create it if the file does not exist and truncate if it exists. + Opens the file for write operations. The file is created if it does not exist, and truncated if it does. - Opens the file for read and write operations. Does not truncate the file. + Opens the file for read and write operations. Does not truncate the file. The cursor is positioned at the beginning of the file. - Opens the file for read and write operations. Create it if the file does not exist and truncate if it exists. + Opens the file for read and write operations. The file is created if it does not exist, and truncated if it does. The cursor is positioned at the beginning of the file. Uses the [url=http://fastlz.org/]FastLZ[/url] compression method. diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml index 401d8074e69..f8c028b6104 100644 --- a/doc/classes/HTTPClient.xml +++ b/doc/classes/HTTPClient.xml @@ -1,10 +1,10 @@ - Hyper-text transfer protocol client. + Low-level hyper-text transfer protocol client. - Hyper-text transfer protocol client (sometimes called "User Agent"). Used to make HTTP requests to download web content, upload files and other data or to communicate with various services, among other use cases. See [HTTPRequest] for an higher-level alternative. + Hyper-text transfer protocol client (sometimes called "User Agent"). Used to make HTTP requests to download web content, upload files and other data or to communicate with various services, among other use cases. [b]See the [HTTPRequest] node for an higher-level alternative.[/b] [b]Note:[/b] This client only needs to connect to a host once (see [method connect_to_host]) to send multiple requests. Because of this, methods that take URLs usually take just the part after the host instead of the full URL, as the client is already connected to a host. See [method request] for a full example and to get started. A [HTTPClient] should be reused between multiple requests or to connect to different hosts instead of creating one client per request. Supports SSL and SSL server certificate verification. HTTP status codes in the 2xx range indicate success, 3xx redirection (i.e. "try again, but over here"), 4xx something was wrong with the request, and 5xx something went wrong on the server's side. For more information on HTTP, see https://developer.mozilla.org/en-US/docs/Web/HTTP (or read RFC 2616 to get it straight from the source: https://tools.ietf.org/html/rfc2616). @@ -152,6 +152,7 @@ var headers = ["Content-Type: application/x-www-form-urlencoded", "Content-Length: " + str(query_string.length())] var result = http_client.request(http_client.METHOD_POST, "index.php", headers, query_string) [/codeblock] + [b]Note:[/b] The [code]request_data[/code] parameter is ignored if [code]method[/code] is [constant HTTPClient.METHOD_GET]. This is because GET methods can't contain request data. As a workaround, you can pass request data as a query string in the URL. See [method String.http_escape] for an example. diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index ddd3464bdad..b2e6caafcdb 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -116,6 +116,7 @@ Creates request on the underlying [HTTPClient]. If there is no configuration errors, it tries to connect using [method HTTPClient.connect_to_host] and passes parameters onto [method HTTPClient.request]. Returns [constant OK] if request is successfully created. (Does not imply that the server has responded), [constant ERR_UNCONFIGURED] if not in the tree, [constant ERR_BUSY] if still processing previous request, [constant ERR_INVALID_PARAMETER] if given string is not a valid URL format, or [constant ERR_CANT_CONNECT] if not using thread and the [HTTPClient] cannot connect to host. + [b]Note:[/b] The [code]request_data[/code] parameter is ignored if [code]method[/code] is [constant HTTPClient.METHOD_GET]. This is because GET methods can't contain request data. As a workaround, you can pass request data as a query string in the URL. See [method String.http_escape] for an example. diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index e699cb7896c..133eb763ebb 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -47,8 +47,9 @@ - If the device has an accelerometer, this will return the acceleration. Otherwise, it returns an empty [Vector3]. + Returns the acceleration of the device's accelerometer, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. Note this method returns an empty [Vector3] when running from the editor even when your device has an accelerometer. You must export your project to a supported device to read values from the accelerometer. + [b]Note:[/b] This method only works on iOS, Android, and UWP. On other platforms, it always returns [constant Vector3.ZERO]. @@ -78,14 +79,16 @@ - If the device has an accelerometer, this will return the gravity. Otherwise, it returns an empty [Vector3]. + Returns the gravity of the device's accelerometer, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. + [b]Note:[/b] This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO]. - If the device has a gyroscope, this will return the rate of rotation in rad/s around a device's X, Y, and Z axes. Otherwise, it returns an empty [Vector3]. + Returns the rotation rate in rad/s around a device's X, Y, and Z axes of the gyroscope, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. + [b]Note:[/b] This method only works on Android. On other platforms, it always returns [constant Vector3.ZERO]. @@ -182,7 +185,8 @@ - If the device has a magnetometer, this will return the magnetic field strength in micro-Tesla for all axes. + Returns the the magnetic field strength in micro-Tesla for all axes of the device's magnetometer, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. + [b]Note:[/b] This method only works on Android and UWP. On other platforms, it always returns [constant Vector3.ZERO]. @@ -417,7 +421,8 @@ Makes the mouse cursor hidden if it is visible. - Captures the mouse. The mouse will be hidden and unable to leave the game window, but it will still register movement and mouse button presses. On Windows and Linux, the mouse will use raw input mode, which means the reported movement will be unaffected by the OS' mouse acceleration settings. + Captures the mouse. The mouse will be hidden and its position locked at the center of the screen. + [b]Note:[/b] If you want to process the mouse's movement in this mode, you need to use [member InputEventMouseMotion.relative]. Makes the mouse cursor visible but confines it to the game window. diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 2a8762cb606..11ca7a309e5 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -194,6 +194,7 @@ Finds a descendant of this node whose name matches [code]mask[/code] as in [method String.match] (i.e. case-sensitive, but [code]"*"[/code] matches zero or more characters and [code]"?"[/code] matches any single character except [code]"."[/code]). [b]Note:[/b] It does not match against the full path, just against individual node names. If [code]owned[/code] is [code]true[/code], this method only finds nodes whose owner is this node. This is especially important for scenes instantiated through a script, because those scenes don't have an owner. + [b]Note:[/b] As this method walks through all the descendants of the node, it is the slowest way to get a reference to another node. Whenever possible, consider using [method get_node] instead. To avoid using [method find_node] too often, consider caching the node reference into a variable. @@ -204,6 +205,7 @@ Finds the first parent of the current node whose name matches [code]mask[/code] as in [method String.match] (i.e. case-sensitive, but [code]"*"[/code] matches zero or more characters and [code]"?"[/code] matches any single character except [code]"."[/code]). [b]Note:[/b] It does not match against the full path, just against individual node names. + [b]Note:[/b] As this method walks upwards in the scene tree, it can be slow in large, deeply nested scene trees. Whenever possible, consider using [method get_node] instead. To avoid using [method find_parent] too often, consider caching the node reference into a variable. diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index 94b22c7acaf..170d524aebb 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -217,7 +217,7 @@ - Emitted the when user navigates to an item using the [code]ui_up[/code] or [code]ui_down[/code] actions. The index of the item selected is passed as argument. + Emitted when the user navigates to an item using the [code]ui_up[/code] or [code]ui_down[/code] actions. The index of the item selected is passed as argument. diff --git a/doc/classes/Physics2DShapeQueryParameters.xml b/doc/classes/Physics2DShapeQueryParameters.xml index 20b931227a4..dbf1073fe75 100644 --- a/doc/classes/Physics2DShapeQueryParameters.xml +++ b/doc/classes/Physics2DShapeQueryParameters.xml @@ -27,7 +27,7 @@ If [code]true[/code], the query will take [PhysicsBody2D]s into account. - The physics layer(s) the query will take into account (as a bitmask). + The physics layer(s) the query will take into account (as a bitmask). See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. The list of objects or object [RID]s that will be excluded from collisions. diff --git a/doc/classes/PhysicsBody.xml b/doc/classes/PhysicsBody.xml index 8af69452e33..15dab17507a 100644 --- a/doc/classes/PhysicsBody.xml +++ b/doc/classes/PhysicsBody.xml @@ -80,10 +80,10 @@ The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the [member collision_mask] property. - A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. + A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. - The physics layers this area scans for collisions. + The physics layers this area scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. diff --git a/doc/classes/PhysicsBody2D.xml b/doc/classes/PhysicsBody2D.xml index dd9460e8440..ab0b857fdf8 100644 --- a/doc/classes/PhysicsBody2D.xml +++ b/doc/classes/PhysicsBody2D.xml @@ -80,10 +80,10 @@ The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the [member collision_mask] property. - A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. + A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. - The physics layers this area scans for collisions. + The physics layers this area scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. diff --git a/doc/classes/PhysicsShapeQueryParameters.xml b/doc/classes/PhysicsShapeQueryParameters.xml index b3ba195212b..80cfe3419c1 100644 --- a/doc/classes/PhysicsShapeQueryParameters.xml +++ b/doc/classes/PhysicsShapeQueryParameters.xml @@ -27,7 +27,7 @@ If [code]true[/code], the query will take [PhysicsBody]s into account. - The physics layer(s) the query will take into account (as a bitmask). + The physics layer(s) the query will take into account (as a bitmask). See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. The list of objects or object [RID]s that will be excluded from collisions. diff --git a/doc/classes/RayCast.xml b/doc/classes/RayCast.xml index 72a718e3af8..997bb93ba99 100644 --- a/doc/classes/RayCast.xml +++ b/doc/classes/RayCast.xml @@ -136,7 +136,7 @@ If [code]true[/code], collision with [PhysicsBody]s will be reported. - The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. + The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. If [code]true[/code], collisions will be reported. diff --git a/doc/classes/RayCast2D.xml b/doc/classes/RayCast2D.xml index dd20e25f4e0..dfeff6e8018 100644 --- a/doc/classes/RayCast2D.xml +++ b/doc/classes/RayCast2D.xml @@ -133,7 +133,7 @@ If [code]true[/code], collision with [PhysicsBody2D]s will be reported. - The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. + The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. If [code]true[/code], collisions will be reported. diff --git a/doc/classes/RigidBody.xml b/doc/classes/RigidBody.xml index feb445ab36d..e525ae00a73 100644 --- a/doc/classes/RigidBody.xml +++ b/doc/classes/RigidBody.xml @@ -8,6 +8,7 @@ A RigidBody has 4 behavior [member mode]s: Rigid, Static, Character, and Kinematic. [b]Note:[/b] Don't change a RigidBody's position every frame or very often. Sporadic changes work fine, but physics runs at a different granularity (fixed Hz) than usual rendering (process callback) and maybe even in a separate thread, so changing this from a process loop may result in strange behavior. If you need to directly affect the body's state, use [method _integrate_forces], which allows you to directly access the physics state. If you need to override the default physics behavior, you can write a custom force integration function. See [member custom_integrator]. + With Bullet physics (the default), the center of mass is the RigidBody3D center. With GodotPhysics, the center of mass is the average of the [CollisionShape] centers. https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml index 415769e3105..3e93bb8e3ad 100644 --- a/doc/classes/RigidBody2D.xml +++ b/doc/classes/RigidBody2D.xml @@ -9,6 +9,7 @@ [b]Note:[/b] You should not change a RigidBody2D's [code]position[/code] or [code]linear_velocity[/code] every frame or even very often. If you need to directly affect the body's state, use [method _integrate_forces], which allows you to directly access the physics state. Please also keep in mind that physics bodies manage their own transform which overwrites the ones you set. So any direct or indirect transformation (including scaling of the node or its parent) will be visible in the editor only, and immediately reset at runtime. If you need to override the default physics behavior or add a transformation at runtime, you can write a custom force integration. See [member custom_integrator]. + The center of mass is always located at the node's origin without taking into account the [CollisionShape2D] centroid offsets. diff --git a/doc/classes/SoftBody.xml b/doc/classes/SoftBody.xml index c9626abbc90..88e61d90299 100644 --- a/doc/classes/SoftBody.xml +++ b/doc/classes/SoftBody.xml @@ -82,10 +82,10 @@ The physics layers this SoftBody is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. - A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. + A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. - The physics layers this SoftBody scans for collisions. + The physics layers this SoftBody scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. diff --git a/doc/classes/SpringArm.xml b/doc/classes/SpringArm.xml index 6fc3cd187bb..5051a210b94 100644 --- a/doc/classes/SpringArm.xml +++ b/doc/classes/SpringArm.xml @@ -47,7 +47,7 @@ - The layers against which the collision check shall be done. + The layers against which the collision check shall be done. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. When the collision check is made, a candidate length for the SpringArm is given. diff --git a/doc/classes/Texture.xml b/doc/classes/Texture.xml index b0d379f6d0e..3ab5367fcd1 100644 --- a/doc/classes/Texture.xml +++ b/doc/classes/Texture.xml @@ -72,7 +72,7 @@ - Returns an [Image] with the data from this [Texture]. [Image]s can be accessed and manipulated directly. + Returns an [Image] that is a copy of data from this [Texture]. [Image]s can be accessed and manipulated directly. diff --git a/doc/classes/Thread.xml b/doc/classes/Thread.xml index 5b9c115524c..6d790c6edc7 100644 --- a/doc/classes/Thread.xml +++ b/doc/classes/Thread.xml @@ -5,6 +5,7 @@ A unit of execution in a process. Can run methods on [Object]s simultaneously. The use of synchronization via [Mutex] or [Semaphore] is advised if working with shared objects. + [b]Note:[/b] Breakpoints won't break on code if it's running in a thread. This is a current limitation of the GDScript debugger. https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html @@ -15,7 +16,7 @@ - Returns the current [Thread]'s ID, uniquely identifying it among all threads. + Returns the current [Thread]'s ID, uniquely identifying it among all threads. If the [Thread] is not running this returns an empty string. diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index 8b3712367aa..328d24733ee 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -166,7 +166,7 @@ If you need these to be immediately updated, you can call [method update_dirty_quadrants]. Overriding this method also overrides it internally, allowing custom logic to be implemented when tiles are placed/removed: [codeblock] - func set_cell(x, y, tile, flip_x, flip_y, transpose, autotile_coord) + func set_cell(x, y, tile, flip_x=false, flip_y=false, transpose=false, autotile_coord=Vector2()) # Write your custom logic here. # To call the default method: .set_cell(x, y, tile, flip_x, flip_y, transpose, autotile_coord) @@ -287,10 +287,10 @@ Friction value for static body collisions (see [code]collision_use_kinematic[/code]). - The collision layer(s) for all colliders in the TileMap. + The collision layer(s) for all colliders in the TileMap. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. - The collision mask(s) for all colliders in the TileMap. + The collision mask(s) for all colliders in the TileMap. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. If [code]true[/code], TileMap collisions will be handled as a kinematic body. If [code]false[/code], collisions will be handled as static body. diff --git a/doc/classes/TouchScreenButton.xml b/doc/classes/TouchScreenButton.xml index 91591cce352..4b6173e812e 100644 --- a/doc/classes/TouchScreenButton.xml +++ b/doc/classes/TouchScreenButton.xml @@ -1,10 +1,12 @@ - Button for touch screen devices. + Button for touch screen devices for gameplay use. - Button for touch screen devices. You can set it to be visible on all screens, or only on touch devices. + TouchScreenButton allows you to create on-screen buttons for touch devices. It's intended for gameplay use, such as a unit you have to touch to move. + This node inherits from [Node2D]. Unlike with [Control] nodes, you cannot set anchors on it. If you want to create menus or user interfaces, you may want to use [Button] nodes instead. To make button nodes react to touch events, you can enable the Emulate Mouse option in the Project Settings. + You can configure TouchScreenButton to be visible only on touch devices, helping you develop your game both for desktop and mobile devices. diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 22105f7ed42..35e5b955e8d 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -634,7 +634,7 @@ ThemeEditor::ThemeEditor() { ScrollContainer *scroll = memnew(ScrollContainer); add_child(scroll); scroll->set_enable_v_scroll(true); - scroll->set_enable_h_scroll(false); + scroll->set_enable_h_scroll(true); scroll->set_v_size_flags(SIZE_EXPAND_FILL); MarginContainer *root_container = memnew(MarginContainer); diff --git a/modules/csg/doc_classes/CSGShape.xml b/modules/csg/doc_classes/CSGShape.xml index e7048f21a76..cb53bf2fdbf 100644 --- a/modules/csg/doc_classes/CSGShape.xml +++ b/modules/csg/doc_classes/CSGShape.xml @@ -71,10 +71,10 @@ The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. - A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. + A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. - The physics layers this CSG shape scans for collisions. + The physics layers this CSG shape scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. The operation that is performed on this shape. This is ignored for the first CSG child node as the operation is between this node and the previous child of this nodes parent. diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index ee95f81255c..c6a66159e7f 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -167,6 +167,7 @@ i = ceil(1.45) # i is 2 i = ceil(1.001) # i is 2 [/codeblock] + See also [method floor], [method round], and [method stepify]. @@ -347,6 +348,7 @@ # a is -3.0 a = floor(-2.99) [/codeblock] + See also [method ceil], [method round], and [method stepify]. [b]Note:[/b] This method returns a float. If you need an integer, you can use [code]int(s)[/code] directly. @@ -1042,6 +1044,7 @@ [codeblock] round(2.6) # Returns 3 [/codeblock] + See also [method floor], [method ceil], and [method stepify]. @@ -1157,6 +1160,7 @@ stepify(100, 32) # Returns 96 stepify(3.14159, 0.01) # Returns 3.14 [/codeblock] + See also [method ceil], [method floor], and [method round]. diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml index 1e34ebc2f66..626cf424ff7 100644 --- a/modules/gridmap/doc_classes/GridMap.xml +++ b/modules/gridmap/doc_classes/GridMap.xml @@ -221,7 +221,7 @@ GridMaps act as static bodies, meaning they aren't affected by gravity or other forces. They only affect other physics bodies that collide with them. - The physics layers this GridMap detects collisions in. + The physics layers this GridMap detects collisions in. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. The assigned [MeshLibrary]. diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs b/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs index d11b7432e70..7629223d8ce 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs @@ -161,8 +161,21 @@ namespace GodotTools.Build // Try to find 15.0 with vswhere - string vsWherePath = Environment.GetEnvironmentVariable(Internal.GodotIs32Bits() ? "ProgramFiles" : "ProgramFiles(x86)"); - vsWherePath += "\\Microsoft Visual Studio\\Installer\\vswhere.exe"; + var envNames = Internal.GodotIs32Bits() ? new[] { "ProgramFiles", "ProgramW6432" } : new[] { "ProgramFiles(x86)", "ProgramFiles" }; + + string vsWherePath = null; + foreach (var envName in envNames) + { + vsWherePath = Environment.GetEnvironmentVariable(envName); + if (!string.IsNullOrEmpty(vsWherePath)) + { + vsWherePath += "\\Microsoft Visual Studio\\Installer\\vswhere.exe"; + if (File.Exists(vsWherePath)) + break; + } + + vsWherePath = null; + } var vsWhereArgs = new[] { "-latest", "-products", "*", "-requires", "Microsoft.Component.MSBuild" }; diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 805297d5ac3..7474e885c53 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -1263,7 +1263,12 @@ void LineEdit::delete_text(int p_from_column, int p_to_column) { void LineEdit::set_text(String p_text) { clear_internal(); - append_at_cursor(p_text); + + if (p_text.length() > max_length) { + append_at_cursor(p_text.substr(0, max_length)); + } else { + append_at_cursor(p_text); + } if (expand_to_text_length) { minimum_size_changed(); diff --git a/scene/resources/texture.h b/scene/resources/texture.h index 98a0302e47e..47c2ea9f008 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -675,11 +675,12 @@ class AnimatedTexture : public Texture { //use readers writers lock for this, since its far more times read than written to RWLock *rw_lock; -private: +public: enum { MAX_FRAMES = 256 }; +private: RID proxy; struct Frame {