diff options
Diffstat (limited to 'doc')
42 files changed, 260 insertions, 111 deletions
diff --git a/doc/classes/@GDScript.xml b/doc/classes/@GDScript.xml index a7b58352cc..0a430fea4d 100644 --- a/doc/classes/@GDScript.xml +++ b/doc/classes/@GDScript.xml @@ -127,7 +127,7 @@ <description> Returns the arc tangent of [code]y/x[/code] in radians. Use to get the angle of tangent [code]y/x[/code]. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant. [codeblock] - a = atan(0, -1) # a is 3.141593 + a = atan2(0, -1) # a is 3.141593 [/codeblock] </description> </method> @@ -811,7 +811,7 @@ <description> Random range, any floating point value between [code]from[/code] and [code]to[/code]. [codeblock] - prints(rand_range(0, 1), rand_range(0, 1)) # prints 0.135591 0.405263 + prints(rand_range(0, 1), rand_range(0, 1)) # prints e.g. 0.135591 0.405263 [/codeblock] </description> </method> @@ -830,7 +830,7 @@ <description> Returns a random floating point value on the interval [code][0, 1][/code]. [codeblock] - randf() # returns 0.375671 + randf() # returns e.g. 0.375671 [/codeblock] </description> </method> @@ -838,11 +838,12 @@ <return type="int"> </return> <description> - Returns a random 32 bit integer. Use remainder to obtain a random value in the interval [code][0, N][/code] (where N is smaller than 2^32 -1). + Returns a random unsigned 32 bit integer. Use remainder to obtain a random value in the interval [code][0, N][/code] (where N is smaller than 2^32 -1). [codeblock] - randi() % 20 # returns random number between 0 and 19 - randi() % 100 # returns random number between 0 and 99 - randi() % 100 + 1 # returns random number between 1 and 100 + randi() # returns random integer between 0 and 2^32 - 1 + randi() % 20 # returns random integer between 0 and 19 + randi() % 100 # returns random integer between 0 and 99 + randi() % 100 + 1 # returns random integer between 1 and 100 [/codeblock] </description> </method> diff --git a/doc/classes/AnimatedTexture.xml b/doc/classes/AnimatedTexture.xml index 08cd79e78f..871ae1a701 100644 --- a/doc/classes/AnimatedTexture.xml +++ b/doc/classes/AnimatedTexture.xml @@ -4,7 +4,7 @@ Proxy texture for simple frame-based animations. </brief_description> <description> - [code]AnimatedTexture[/code] is a resource format for simple frame-based animations, where multiple frames textures can be chained automatically with a predefined delay for each frame. It's not a [Node], contrarily to [AnimationPlayer] or [AnimatedSprite], but has the advantage of being usable at any place where a [Texture] resource can be used, e.g. in a [TileSet]. + [code]AnimatedTexture[/code] is a resource format for frame-based animations, where multiple textures can be chained automatically with a predefined delay for each frame. Unlike [AnimationPlayer] or [AnimatedSprite], it isn't a [Node], but has the advantage of being usable anywhere a [Texture] resource can be used, e.g. in a [TileSet]. The playback of the animation is controlled by the [member fps] property as well as each frame's optional delay (see [method set_frame_delay]). The animation loops, i.e. it will restart at frame 0 automatically after playing the last frame. [code]AnimatedTexture[/code] currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one. </description> @@ -19,7 +19,7 @@ <argument index="0" name="frame" type="int"> </argument> <description> - Retrieves the delayed assigned to the given [code]frame[/code] ID. + Returns the given frame's delay value. </description> </method> <method name="get_frame_texture" qualifiers="const"> @@ -28,7 +28,7 @@ <argument index="0" name="frame" type="int"> </argument> <description> - Retrieves the [Texture] assigned to the given [code]frame[/code] ID. + Returns the given frame's [Texture]. </description> </method> <method name="set_frame_delay"> @@ -39,7 +39,7 @@ <argument index="1" name="delay" type="float"> </argument> <description> - Defines an additional delay (in seconds) between this frame and the next one, that will be added to the time interval defined by [member fps]. By default, frames have no delay defined. If a delay value is defined, the final time interval between this frame and the next will be [code]1.0 / fps + delay[/code]. + Sets an additional delay (in seconds) between this frame and the next one, that will be added to the time interval defined by [member fps]. By default, frames have no delay defined. If a delay value is defined, the final time interval between this frame and the next will be [code]1.0 / fps + delay[/code]. For example, for an animation with 3 frames, 2 FPS and a frame delay on the second frame of 1.2, the resulting playback will be: [codeblock] Frame 0: 0.5 s (1 / fps) @@ -57,15 +57,15 @@ <argument index="1" name="texture" type="Texture"> </argument> <description> - Assigns a [Texture] to the given [code]frame[/code] ID. IDs start at 0 (so the first frame has ID 0, and the last frame of the animation has ID [member frames] - 1). - You can define any frame texture up to [constant MAX_FRAMES], but keep in mind that only frames from 0 to [member frames] - 1 will be part of the animation. + Assigns a [Texture] to the given frame. Frame IDs start at 0, so the first frame has ID 0, and the last frame of the animation has ID [member frames] - 1. + You can define any number of textures up to [constant MAX_FRAMES], but keep in mind that only frames from 0 to [member frames] - 1 will be part of the animation. </description> </method> </methods> <members> <member name="fps" type="float" setter="set_fps" getter="get_fps"> - Number of frames per second. This value defines the default time interval between two frames of the animation, and thus the overall duration of the animation loop based on the [member frames] property. A value of 0 means no predefined number of frames per second, the animation will play according to each frame's frame delay (see [method set_frame_delay]). Default value: 4. - For example, an animation with 8 frames, no frame delay and a [code]fps[/code] value of 2 will run over 4 seconds, with one frame each 0.5 seconds. + Animation speed in frames per second. This value defines the default time interval between two frames of the animation, and thus the overall duration of the animation loop based on the [member frames] property. A value of 0 means no predefined number of frames per second, the animation will play according to each frame's frame delay (see [method set_frame_delay]). Default value: 4. + For example, an animation with 8 frames, no frame delay and a [code]fps[/code] value of 2 will run for 4 seconds, with each frame lasting 0.5 seconds. </member> <member name="frames" type="int" setter="set_frames" getter="get_frames"> Number of frames to use in the animation. While you can create the frames independently with [method set_frame_texture], you need to set this value for the animation to take new frames into account. The maximum number of frames is [constant MAX_FRAMES]. Default value: 1. diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index 9d68102952..21aba282ee 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -30,7 +30,7 @@ <argument index="0" name="delta" type="float"> </argument> <description> - Shifts position in the animation timeline. Delta is the time in seconds to shift. + Shifts position in the animation timeline. Delta is the time in seconds to shift. Events between the current frame and [code]delta[/code] are handled. </description> </method> <method name="animation_get_next" qualifiers="const"> @@ -197,7 +197,7 @@ <argument index="1" name="update" type="bool" default="false"> </argument> <description> - Seek the animation to the [code]seconds[/code] point in time (in seconds). If [code]update[/code] is [code]true[/code], the animation updates too, otherwise it updates at process time. + Seek the animation to the [code]seconds[/code] point in time (in seconds). If [code]update[/code] is [code]true[/code], the animation updates too, otherwise it updates at process time. Events between the current frame and [code]seconds[/code] are skipped. </description> </method> <method name="set_blend_time"> diff --git a/doc/classes/AnimationTreePlayer.xml b/doc/classes/AnimationTreePlayer.xml index b0b58fc7bd..cfec75bc3a 100644 --- a/doc/classes/AnimationTreePlayer.xml +++ b/doc/classes/AnimationTreePlayer.xml @@ -29,7 +29,7 @@ <argument index="0" name="delta" type="float"> </argument> <description> - Shifts position in the animation timeline. Delta is the time in seconds to shift. + Shifts position in the animation timeline. Delta is the time in seconds to shift. Events between the current frame and [code]delta[/code] are handled. </description> </method> <method name="animation_node_get_animation" qualifiers="const"> diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 6bd0ef3421..0b5c0eb0b3 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -4,7 +4,7 @@ Generic array datatype. </brief_description> <description> - Generic array, contains several elements of any type, accessible by a numerical index starting at 0. Negative indices can be used to count from the back, like in Python (-1 is the last element, -2 the second to last, etc.). Example: + Generic array which can contain several elements of any type, accessible by a numerical index starting at 0. Negative indices can be used to count from the back, like in Python (-1 is the last element, -2 the second to last, etc.). Example: [codeblock] var array = ["One", 2, 3, "Four"] print(array[0]) # One @@ -26,7 +26,7 @@ <argument index="0" name="from" type="PoolColorArray"> </argument> <description> - Construct an array from a [PoolColorArray]. + Constructs an array from a [PoolColorArray]. </description> </method> <method name="Array"> @@ -35,7 +35,7 @@ <argument index="0" name="from" type="PoolVector3Array"> </argument> <description> - Construct an array from a [PoolVector3Array]. + Constructs an array from a [PoolVector3Array]. </description> </method> <method name="Array"> @@ -44,7 +44,7 @@ <argument index="0" name="from" type="PoolVector2Array"> </argument> <description> - Construct an array from a [PoolVector2Array]. + Constructs an array from a [PoolVector2Array]. </description> </method> <method name="Array"> @@ -53,7 +53,7 @@ <argument index="0" name="from" type="PoolStringArray"> </argument> <description> - Construct an array from a [PoolStringArray]. + Constructs an array from a [PoolStringArray]. </description> </method> <method name="Array"> @@ -62,7 +62,7 @@ <argument index="0" name="from" type="PoolRealArray"> </argument> <description> - Construct an array from a [PoolRealArray]. + Constructs an array from a [PoolRealArray]. </description> </method> <method name="Array"> @@ -71,7 +71,7 @@ <argument index="0" name="from" type="PoolIntArray"> </argument> <description> - Construct an array from a [PoolIntArray]. + Constructs an array from a [PoolIntArray]. </description> </method> <method name="Array"> @@ -80,21 +80,21 @@ <argument index="0" name="from" type="PoolByteArray"> </argument> <description> - Construct an array from a [PoolByteArray]. + Constructs an array from a [PoolByteArray]. </description> </method> <method name="append"> <argument index="0" name="value" type="Variant"> </argument> <description> - Append an element at the end of the array (alias of [method push_back]). + Appends an element at the end of the array (alias of [method push_back]). </description> </method> <method name="back"> <return type="Variant"> </return> <description> - Returns the last element of the array if the array is not empty (size>0). + Returns the last element of the array if the array is not empty. </description> </method> <method name="bsearch"> @@ -125,7 +125,7 @@ </method> <method name="clear"> <description> - Clear the array (resize to 0). + Clears the array (resizes to 0). </description> </method> <method name="count"> @@ -134,7 +134,7 @@ <argument index="0" name="value" type="Variant"> </argument> <description> - Return the amount of times an element is in the array. + Returns the number of times an element is in the array. </description> </method> <method name="duplicate"> @@ -144,21 +144,21 @@ </argument> <description> Returns a copy of the array. - If [code]deep[/code] is [code]true[/code], a deep copy is be performed: all nested arrays and dictionaries are duplicated and will not be shared with the original array. If [code]false[/code], a shallow copy is made and references to the original nested arrays and dictionaries are kept, so that modifying a sub-array or dictionary in the copy will also impact those referenced in the source array. + If [code]deep[/code] is [code]true[/code], a deep copy is performed: all nested arrays and dictionaries are duplicated and will not be shared with the original array. If [code]false[/code], a shallow copy is made and references to the original nested arrays and dictionaries are kept, so that modifying a sub-array or dictionary in the copy will also impact those referenced in the source array. </description> </method> <method name="empty"> <return type="bool"> </return> <description> - Return true if the array is empty (size==0). + Returns [code]true[/code] if the array is empty. </description> </method> <method name="erase"> <argument index="0" name="value" type="Variant"> </argument> <description> - Remove the first occurrence of a value from the array. + Removes the first occurrence of a value from the array. </description> </method> <method name="find"> @@ -185,7 +185,7 @@ <return type="Variant"> </return> <description> - Returns the first element of the array if the array is not empty (size>0). + Returns the first element of the array if the array is not empty. </description> </method> <method name="has"> @@ -194,7 +194,7 @@ <argument index="0" name="value" type="Variant"> </argument> <description> - Return true if the array contains given value. + Returns [code]true[/code] if the array contains the given value. [codeblock] ["inside", 7].has("inside") == true ["inside", 7].has("outside") == false @@ -207,7 +207,7 @@ <return type="int"> </return> <description> - Return a hashed integer value representing the array contents. + Returns a hashed integer value representing the array contents. </description> </method> <method name="insert"> @@ -216,68 +216,68 @@ <argument index="1" name="value" type="Variant"> </argument> <description> - Insert a new element at a given position in the array. The position must be valid, or at the end of the array ([code]pos == size()[/code]). + Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]pos == size()[/code]). </description> </method> <method name="invert"> <description> - Reverse the order of the elements in the array. + Reverses the order of the elements in the array. </description> </method> <method name="max"> <return type="Variant"> </return> <description> - Return maximum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned. + Returns the maximum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned. </description> </method> <method name="min"> <return type="Variant"> </return> <description> - Return minimum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned. + Returns the minimum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned. </description> </method> <method name="pop_back"> <return type="Variant"> </return> <description> - Remove the last element of the array. + Removes the last element of the array. </description> </method> <method name="pop_front"> <return type="Variant"> </return> <description> - Remove the first element of the array. + Removes the first element of the array. </description> </method> <method name="push_back"> <argument index="0" name="value" type="Variant"> </argument> <description> - Append an element at the end of the array. + Appends an element at the end of the array. </description> </method> <method name="push_front"> <argument index="0" name="value" type="Variant"> </argument> <description> - Add an element at the beginning of the array. + Adds an element at the beginning of the array. </description> </method> <method name="remove"> <argument index="0" name="position" type="int"> </argument> <description> - Remove an element from the array by index. + Removes an element from the array by index. </description> </method> <method name="resize"> <argument index="0" name="size" type="int"> </argument> <description> - Resize the array to contain a different number of elements. If the array size is smaller, elements are cleared, if bigger, new elements are Null. + Resizes the array to contain a different number of elements. If the array size is smaller, elements are cleared, if bigger, new elements are Null. </description> </method> <method name="rfind"> @@ -293,19 +293,19 @@ </method> <method name="shuffle"> <description> - Shuffle the array such that the items will have a random order. + Shuffles the array such that the items will have a random order. </description> </method> <method name="size"> <return type="int"> </return> <description> - Return the amount of elements in the array. + Returns the number of elements in the array. </description> </method> <method name="sort"> <description> - Sort the array using natural order. + Sorts the array. Note: strings are sorted in alphabetical, not natural order. </description> </method> <method name="sort_custom"> @@ -314,7 +314,7 @@ <argument index="1" name="func" type="String"> </argument> <description> - Sort the array using a custom method. The arguments are an object that holds the method and the name of such method. The custom method receives two arguments (a pair of elements from the array) and must return true if the first argument is less than the second, and return false otherwise. + Sorts the array using a custom method. The arguments are an object that holds the method and the name of such method. The custom method receives two arguments (a pair of elements from the array) and must return true if the first argument is less than the second, and return false otherwise. [b]Note:[/b] you cannot randomize the return value as the heapsort algorithm expects a deterministic result. Doing so will result in unexpected behavior. [codeblock] class MyCustomSorter: diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml index bcb9b4f6da..fd66777997 100644 --- a/doc/classes/ArrayMesh.xml +++ b/doc/classes/ArrayMesh.xml @@ -53,13 +53,6 @@ Godot uses clockwise winding order for front faces of triangle primitive modes. </description> </method> - <method name="center_geometry"> - <return type="void"> - </return> - <description> - Centers the geometry. - </description> - </method> <method name="clear_blend_shapes"> <return type="void"> </return> diff --git a/doc/classes/AudioStreamSample.xml b/doc/classes/AudioStreamSample.xml index 77d5f14ab7..fdaa942018 100644 --- a/doc/classes/AudioStreamSample.xml +++ b/doc/classes/AudioStreamSample.xml @@ -12,11 +12,13 @@ </demos> <methods> <method name="save_to_wav"> - <return type="void"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> <description> + Saves the AudioStreamSample as a WAV file to [code]path[/code]. Samples with IMA ADPCM format can't be saved. + Note that a [code].wav[/code] extension is automatically appended to [code]path[/code] if it is missing. </description> </method> </methods> diff --git a/doc/classes/CPUParticles.xml b/doc/classes/CPUParticles.xml index 2073ca0664..6db2acac43 100644 --- a/doc/classes/CPUParticles.xml +++ b/doc/classes/CPUParticles.xml @@ -54,6 +54,7 @@ <member name="color" type="Color" setter="set_color" getter="get_color"> </member> <member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp"> + Each particle's vertex color will vary along this [GradientTexture]. </member> <member name="damping" type="float" setter="set_param" getter="get_param"> </member> diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 9c78853cfe..d87b029676 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -6,8 +6,18 @@ <description> Dictionary type. Associative container which contains values referenced by unique keys. Dictionaries are always passed by reference. Erasing elements while iterating over them [b]is not supported[/b]. + Creating a dictionary: + [codeblock] + var d = {4: 5, "A key": "A value", 28: [1, 2, 3]} + [/codeblock] + To add a key to an existing dictionary, access it like an existing key and assign to it: + [codeblock] + d[4] = "hello" # Add integer 4 as a key and assign the String "hello" as its value. + d["Godot"] = 3.01 # Add String "Godot" as a key and assign the value 3.01 to it. + [/codeblock] </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_basics.html#dictionary</link> </tutorials> <demos> </demos> diff --git a/doc/classes/EditorSpatialGizmo.xml b/doc/classes/EditorSpatialGizmo.xml index 45b92276f1..0bec11e183 100644 --- a/doc/classes/EditorSpatialGizmo.xml +++ b/doc/classes/EditorSpatialGizmo.xml @@ -66,6 +66,8 @@ </argument> <argument index="2" name="skeleton" type="RID"> </argument> + <argument index="3" name="material" type="Material" default="null"> + </argument> <description> </description> </method> diff --git a/doc/classes/EditorSpatialGizmoPlugin.xml b/doc/classes/EditorSpatialGizmoPlugin.xml index a6c0413c19..d49a50893d 100644 --- a/doc/classes/EditorSpatialGizmoPlugin.xml +++ b/doc/classes/EditorSpatialGizmoPlugin.xml @@ -137,6 +137,12 @@ Override this method to provide the name that will appear in the gizmo visibility menu. </description> </method> + <method name="get_priority" qualifiers="virtual"> + <return type="String"> + </return> + <description> + </description> + </method> <method name="has_gizmo" qualifiers="virtual"> <return type="bool"> </return> diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index b8808b8b53..d947784676 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -96,7 +96,7 @@ "string" - major + minor + patch + status + build in a single String The "hex" value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be [code]0x03010C[/code]. Note that it's still an int internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for easy version comparisons from code: [codeblock] - if Engine.get_version_info().hex >= 0x030200: + if Engine.get_version_info().hex >= 0x030200: # do things specific to version 3.2 or later else: # do things specific to versions before 3.2 diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml index 3e47b167ef..6cb5e0b17a 100644 --- a/doc/classes/Font.xml +++ b/doc/classes/Font.xml @@ -4,7 +4,7 @@ Internationalized font and text drawing support. </brief_description> <description> - Font contains a unicode compatible character set, as well as the ability to draw it with variable width, ascent, descent and kerning. For creating fonts from TTF files (or other font formats), see the editor support for fonts. TODO check wikipedia for graph of ascent/baseline/descent/height/etc. + Font contains a unicode compatible character set, as well as the ability to draw it with variable width, ascent, descent and kerning. For creating fonts from TTF files (or other font formats), see the editor support for fonts. </description> <tutorials> </tutorials> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 724e6a078d..29c60f902e 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -325,6 +325,15 @@ Set the mouse mode. See the constants for more information. </description> </method> + <method name="set_use_accumulated_input"> + <return type="void"> + </return> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + Whether to accumulate similar input events sent by the operating system. Defaults to [code]true[/code]. + </description> + </method> <method name="start_joy_vibration"> <return type="void"> </return> diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index c880823aee..cd08cd4fe7 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -13,6 +13,14 @@ <demos> </demos> <methods> + <method name="accumulate"> + <return type="bool"> + </return> + <argument index="0" name="with_event" type="InputEvent"> + </argument> + <description> + </description> + </method> <method name="as_text" qualifiers="const"> <return type="String"> </return> diff --git a/doc/classes/KinematicBody.xml b/doc/classes/KinematicBody.xml index a4fade6ab2..78012dd31c 100644 --- a/doc/classes/KinematicBody.xml +++ b/doc/classes/KinematicBody.xml @@ -65,7 +65,9 @@ </argument> <argument index="1" name="infinite_inertia" type="bool" default="true"> </argument> - <argument index="2" name="test_only" type="bool" default="false"> + <argument index="2" name="exclude_raycast_shapes" type="bool" default="true"> + </argument> + <argument index="3" name="test_only" type="bool" default="false"> </argument> <description> Moves the body along the vector [code]rel_vec[/code]. The body will stop if it collides. Returns a [KinematicCollision], which contains information about the collision. @@ -91,10 +93,11 @@ Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [code]KinematicBody[/code] or [RigidBody], it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes. [code]linear_velocity[/code] is the velocity vector (typically meters per second). Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity. [code]floor_normal[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector3(0, 0, 0)[/code], everything is considered a wall. This is useful for topdown games. - [i]TODO: Update for new stop_on_slode argument.[/i] If the body is standing on a slope and the horizontal speed (relative to the floor's speed) goes below [code]slope_stop_min_velocity[/code], the body will stop completely. This prevents the body from sliding down slopes when you include gravity in [code]linear_velocity[/code]. When set to lower values, the body will not be able to stand still on steep slopes. + If [code]stop_on_slope[/code] is true, body will not slide on slopes if you include gravity in [code]linear_velocity[/code]. If the body collides, it will change direction a maximum of [code]max_slides[/code] times before it stops. [code]floor_max_angle[/code] is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees. - Returns the movement that remained when the body stopped. To get more detailed information about collisions that occurred, use [method get_slide_collision]. + If [code]infinite_inertia[/code] is true, body will be able to push [RigidBody] nodes, but it won't also detect any collisions with them. When false, it will interact with [RigidBody] nodes like with [StaticBody]. + Returns the [code]linear_velocity[/code] vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use [method get_slide_collision]. </description> </method> <method name="move_and_slide_with_snap"> diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml index b94304b9a8..3eca698bba 100644 --- a/doc/classes/KinematicBody2D.xml +++ b/doc/classes/KinematicBody2D.xml @@ -27,6 +27,12 @@ </argument> <description> Returns a [KinematicCollision2D], which contains information about a collision that occurred during the last [method move_and_slide] call. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_count] - 1). + Example usage: + [codeblock] + for i in get_slide_count(): + var collision = get_slide_collision(i) + print("Collided with: ", collision.collider.name) + [/codeblock] </description> </method> <method name="get_slide_count" qualifiers="const"> @@ -91,10 +97,11 @@ Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [code]KinematicBody2D[/code] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes. [code]linear_velocity[/code] is the velocity vector in pixels per second. Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity. [code]floor_normal[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector2(0, 0)[/code], everything is considered a wall. This is useful for topdown games. - [i]TODO: Update for stop_on_slope argument.[/i] If the body is standing on a slope and the horizontal speed (relative to the floor's speed) goes below [code]slope_stop_min_velocity[/code], the body will stop completely. This prevents the body from sliding down slopes when you include gravity in [code]linear_velocity[/code]. When set to lower values, the body will not be able to stand still on steep slopes. + If [code]stop_on_slope[/code] is true, body will not slide on slopes when you include gravity in [code]linear_velocity[/code] and the body is standing still. If the body collides, it will change direction a maximum of [code]max_slides[/code] times before it stops. [code]floor_max_angle[/code] is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees. - Returns the [code]linear_velocity[/code] vector, rotated and/or scaled if a slide collision occurred. To get more detailed information about collisions that occurred, use [method get_slide_collision]. + If [code]infinite_inertia[/code] is true, body will be able to push [RigidBody2D] nodes, but it won't also detect any collisions with them. When false, it will interact with [RigidBody2D] nodes like with [StaticBody2D]. + Returns the [code]linear_velocity[/code] vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use [method get_slide_collision]. </description> </method> <method name="move_and_slide_with_snap"> @@ -138,7 +145,7 @@ If the body is at least this close to another body, this body will consider them to be colliding. </member> <member name="motion/sync_to_physics" type="bool" setter="set_sync_to_physics" getter="is_sync_to_physics_enabled"> - If [code]true[/code], the body's movement will be synchronized to the physics frame. This is useful when animating movement via [AnimationPlayer], for example on moving platforms. + If [code]true[/code], the body's movement will be synchronized to the physics frame. This is useful when animating movement via [AnimationPlayer], for example on moving platforms. Do [b]not[/b] use together with [method move_and_slide] or [method move_and_collide] functions. </member> </members> <constants> diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml index 0d754f1d4e..3cb785e7b8 100644 --- a/doc/classes/Light2D.xml +++ b/doc/classes/Light2D.xml @@ -7,6 +7,7 @@ Casts light in a 2D environment. Light is defined by a (usually grayscale) texture, a color, an energy value, a mode (see constants), and various other parameters (range and shadows-related). Note that Light2D can be used as a mask. </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/2d/2d_lights_and_shadows.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/LightOccluder2D.xml b/doc/classes/LightOccluder2D.xml index 38b9054411..c7dfe9606b 100644 --- a/doc/classes/LightOccluder2D.xml +++ b/doc/classes/LightOccluder2D.xml @@ -7,6 +7,7 @@ Occludes light cast by a Light2D, casting shadows. The LightOccluder2D must be provided with an [OccluderPolygon2D] in order for the shadow to be computed. </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/2d/2d_lights_and_shadows.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/MeshInstance2D.xml b/doc/classes/MeshInstance2D.xml index 7f0136bf77..c26665b6b5 100644 --- a/doc/classes/MeshInstance2D.xml +++ b/doc/classes/MeshInstance2D.xml @@ -5,6 +5,7 @@ <description> </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/2d/2d_meshes.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index 565e19c229..9bee8e2100 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -10,6 +10,7 @@ Since instances may have any behavior, the AABB used for visibility must be provided by the user. </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/animating_thousands_of_fish.html</link> </tutorials> <demos> </demos> @@ -65,6 +66,7 @@ </argument> <description> Set the color of a specific instance. + For the color to take effect, ensure that [member color_format] is non-[code]null[/code] on the [code]MultiMesh[/code] and [member SpatialMaterial.vertex_color_use_as_albedo] is [code]true[/code] on the material. </description> </method> <method name="set_instance_custom_data"> diff --git a/doc/classes/MultiMeshInstance.xml b/doc/classes/MultiMeshInstance.xml index 5e021dfe9b..866ffffb5f 100644 --- a/doc/classes/MultiMeshInstance.xml +++ b/doc/classes/MultiMeshInstance.xml @@ -8,6 +8,8 @@ This is useful to optimize the rendering of a high amount of instances of a given mesh (for example tree in a forest or grass strands). </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/animating_thousands_of_fish.html</link> + <link>http://docs.godotengine.org/en/latest/tutorials/3d/using_multi_mesh_instance.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 5e71ed094e..edf8f507f0 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -684,6 +684,15 @@ Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX. </description> </method> + <method name="request_permission"> + <return type="bool"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> + At the moment this function is only used by [code]AudioDriverOpenSL[/code] to request permission for [code]RECORD_AUDIO[/code] on Android. + </description> + </method> <method name="set_icon"> <return type="void"> </return> diff --git a/doc/classes/Particles.xml b/doc/classes/Particles.xml index b6e31d3576..5d80f32bc2 100644 --- a/doc/classes/Particles.xml +++ b/doc/classes/Particles.xml @@ -8,6 +8,7 @@ Use the [code]process_material[/code] property to add a [ParticlesMaterial] to configure particle appearance and behavior. Alternatively, you can add a [ShaderMaterial] which will be applied to all particles. </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/controlling_thousands_of_fish.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Particles2D.xml b/doc/classes/Particles2D.xml index 91c1a0ca9b..53088e909e 100644 --- a/doc/classes/Particles2D.xml +++ b/doc/classes/Particles2D.xml @@ -8,6 +8,7 @@ Use the [code]process_material[/code] property to add a [ParticlesMaterial] to configure particle appearance and behavior. Alternatively, you can add a [ShaderMaterial] which will be applied to all particles. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/2d/particle_systems_2d.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Physics2DDirectBodyState.xml b/doc/classes/Physics2DDirectBodyState.xml index 52c89248ff..5b320a051f 100644 --- a/doc/classes/Physics2DDirectBodyState.xml +++ b/doc/classes/Physics2DDirectBodyState.xml @@ -4,9 +4,10 @@ Direct access object to a physics body in the [Physics2DServer]. </brief_description> <description> - Direct access object to a physics body in the [Physics2DServer]. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body. + Provides direct access to a physics body in the [Physics2DServer], allowing safe changes to physics properties. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body. See [method RigidBody2D._integrate_forces]. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <demos> </demos> @@ -17,6 +18,7 @@ <argument index="0" name="force" type="Vector2"> </argument> <description> + Adds a constant directional force without affecting rotation. </description> </method> <method name="add_force"> @@ -27,6 +29,7 @@ <argument index="1" name="force" type="Vector2"> </argument> <description> + Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. </description> </method> <method name="add_torque"> @@ -35,6 +38,7 @@ <argument index="0" name="torque" type="float"> </argument> <description> + Adds a constant rotational force. </description> </method> <method name="apply_central_impulse"> @@ -43,6 +47,7 @@ <argument index="0" name="impulse" type="Vector2"> </argument> <description> + Applies a directional impulse without affecting rotation. </description> </method> <method name="apply_impulse"> @@ -53,6 +58,7 @@ <argument index="1" name="impulse" type="Vector2"> </argument> <description> + Applies a positioned impulse to the body. An impulse is time independent! Applying an impulse every frame would result in a framerate dependent force. For this reason it should only be used when simulating one-time impacts (use the "_force" functions otherwise). The offset uses the rotation of the global coordinate system, but is centered at the object's origin. </description> </method> <method name="apply_torque_impulse"> @@ -61,6 +67,7 @@ <argument index="0" name="impulse" type="float"> </argument> <description> + Applies a rotational impulse to the body. </description> </method> <method name="get_contact_collider" qualifiers="const"> @@ -69,7 +76,7 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> - Return the [RID] of the collider. + Returns the collider's [RID]. </description> </method> <method name="get_contact_collider_id" qualifiers="const"> @@ -78,7 +85,7 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> - Return the object id of the collider. + Returns the collider's object id. </description> </method> <method name="get_contact_collider_object" qualifiers="const"> @@ -87,7 +94,7 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> - Return the collider object, this depends on how it was created (will return a scene node if such was used to create it). + Returns the collider object. This depends on how it was created (will return a scene node if such was used to create it). </description> </method> <method name="get_contact_collider_position" qualifiers="const"> @@ -96,7 +103,7 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> - Return the contact position in the collider. + Returns the contact position in the collider. </description> </method> <method name="get_contact_collider_shape" qualifiers="const"> @@ -105,7 +112,7 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> - Return the collider shape index. + Returns the collider's shape index. </description> </method> <method name="get_contact_collider_shape_metadata" qualifiers="const"> @@ -114,7 +121,7 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> - Return the metadata of the collided shape. This metadata is different from [method Object.get_meta], and is set with [method Physics2DServer.shape_set_data]. + Returns the collided shape's metadata. This metadata is different from [method Object.get_meta], and is set with [method Physics2DServer.shape_set_data]. </description> </method> <method name="get_contact_collider_velocity_at_position" qualifiers="const"> @@ -123,14 +130,14 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> - Return the linear velocity vector at contact point of the collider. + Returns the linear velocity vector at the collider's contact point. </description> </method> <method name="get_contact_count" qualifiers="const"> <return type="int"> </return> <description> - Return the amount of contacts this body has with other bodies. Note that by default this returns 0 unless bodies are configured to log contacts. + Returns the number of contacts this body has with other bodies. Note that by default this returns 0 unless bodies are configured to log contacts. See [member RigidBody2D.contact_monitor]. </description> </method> <method name="get_contact_local_normal" qualifiers="const"> @@ -139,7 +146,7 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> - Return the local normal (of this body) of the contact point. + Returns the local normal at the contact point. </description> </method> <method name="get_contact_local_position" qualifiers="const"> @@ -148,7 +155,7 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> - Return the local position (of this body) of the contact point. + Returns the local position of the contact point. </description> </method> <method name="get_contact_local_shape" qualifiers="const"> @@ -157,27 +164,27 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> - Return the local shape index of the collision. + Returns the local shape index of the collision. </description> </method> <method name="get_space_state"> <return type="Physics2DDirectSpaceState"> </return> <description> - Return the current state of space, useful for queries. + Returns the current state of the space, useful for queries. </description> </method> <method name="integrate_forces"> <return type="void"> </return> <description> - Call the built-in force integration code. + Calls the built-in force integration code. </description> </method> </methods> <members> <member name="angular_velocity" type="float" setter="set_angular_velocity" getter="get_angular_velocity"> - The angular velocity of the body. + The body's rotational velocity. </member> <member name="inverse_inertia" type="float" setter="" getter="get_inverse_inertia"> The inverse of the inertia of the body. @@ -186,10 +193,10 @@ The inverse of the mass of the body. </member> <member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity"> - The linear velocity of the body. + The body's linear velocity. </member> <member name="sleeping" type="bool" setter="set_sleep_state" getter="is_sleeping"> - [code]true[/code] if this body is currently sleeping (not active). + If [code]true[/code], this body is currently sleeping (not active). </member> <member name="step" type="float" setter="" getter="get_step"> The timestep (delta) used for the simulation. @@ -204,7 +211,7 @@ The rate at which the body stops moving, if there are not any other forces moving it. </member> <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform"> - The transformation matrix of the body. + The body's transformation matrix. </member> </members> <constants> diff --git a/doc/classes/PhysicsDirectBodyState.xml b/doc/classes/PhysicsDirectBodyState.xml index cf718f06b2..10b5199128 100644 --- a/doc/classes/PhysicsDirectBodyState.xml +++ b/doc/classes/PhysicsDirectBodyState.xml @@ -1,14 +1,16 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PhysicsDirectBodyState" inherits="Object" category="Core" version="3.1"> <brief_description> + Direct access object to a physics body in the [PhysicsServer]. </brief_description> <description> + Provides direct access to a physics body in the [PhysicsServer], allowing safe changes to physics properties. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body. See [method RigidBody._integrate_forces]. </description> <tutorials> </tutorials> <demos> </demos> - <methods> + <methods>( <method name="add_central_force"> <return type="void"> </return> @@ -27,7 +29,7 @@ <argument index="1" name="position" type="Vector3"> </argument> <description> - Adds a constant force (i.e. acceleration). + Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. </description> </method> <method name="add_torque"> @@ -36,7 +38,7 @@ <argument index="0" name="torque" type="Vector3"> </argument> <description> - Adds a constant rotational force (i.e. a motor) without affecting position. + Adds a constant rotational force without affecting position. </description> </method> <method name="apply_central_impulse"> @@ -75,6 +77,7 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> + Returns the collider's [RID]. </description> </method> <method name="get_contact_collider_id" qualifiers="const"> @@ -83,6 +86,7 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> + Returns the collider's object id. </description> </method> <method name="get_contact_collider_object" qualifiers="const"> @@ -91,6 +95,7 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> + Returns the collider object. </description> </method> <method name="get_contact_collider_position" qualifiers="const"> @@ -99,6 +104,7 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> + Returns the contact position in the collider. </description> </method> <method name="get_contact_collider_shape" qualifiers="const"> @@ -107,6 +113,7 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> + Returns the collider's shape index. </description> </method> <method name="get_contact_collider_velocity_at_position" qualifiers="const"> @@ -115,12 +122,14 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> + Returns the linear velocity vector at the collider's contact point. </description> </method> <method name="get_contact_count" qualifiers="const"> <return type="int"> </return> <description> + Returns the number of contacts this body has with other bodies. Note that by default this returns 0 unless bodies are configured to log contacts. See [member RigidBody.contact_monitor]. </description> </method> <method name="get_contact_impulse" qualifiers="const"> @@ -138,6 +147,7 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> + Returns the local normal at the contact point. </description> </method> <method name="get_contact_local_position" qualifiers="const"> @@ -146,6 +156,7 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> + Returns the local position of the contact point. </description> </method> <method name="get_contact_local_shape" qualifiers="const"> @@ -154,24 +165,27 @@ <argument index="0" name="contact_idx" type="int"> </argument> <description> + Returns the local shape index of the collision. </description> </method> <method name="get_space_state"> <return type="PhysicsDirectSpaceState"> </return> <description> + Returns the current state of the space, useful for queries. </description> </method> <method name="integrate_forces"> <return type="void"> </return> <description> + Calls the built-in force integration code. </description> </method> </methods> <members> <member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity"> - The angular velocity of the body. + The body's rotational velocity. </member> <member name="center_of_mass" type="Vector3" setter="" getter="get_center_of_mass"> </member> @@ -182,12 +196,12 @@ The inverse of the mass of the body. </member> <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity"> - The linear velocity of the body. + The body's linear velocity. </member> <member name="principal_inertia_axes" type="Basis" setter="" getter="get_principal_inertia_axes"> </member> <member name="sleeping" type="bool" setter="set_sleep_state" getter="is_sleeping"> - [code]true[/code] if this body is currently sleeping (not active). + If [code]true[/code], this body is currently sleeping (not active). </member> <member name="step" type="float" setter="" getter="get_step"> The timestep (delta) used for the simulation. @@ -202,7 +216,7 @@ The rate at which the body stops moving, if there are not any other forces moving it. </member> <member name="transform" type="Transform" setter="set_transform" getter="get_transform"> - The transformation matrix of the body. + The body's transformation matrix. </member> </members> <constants> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 1782edf25d..77a695d070 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -163,7 +163,11 @@ </method> </methods> <members> + <member name="android/modules" type="String" setter="" getter=""> + Comma-separated list of custom Android modules (which must have been built in the Android export templates) using their Java package path, e.g. [code]org/godotengine/org/GodotPaymentV3,org/godotengine/godot/MyCustomSingleton"[/code]. + </member> <member name="application/boot_splash/bg_color" type="Color" setter="" getter=""> + Background color for the boot splash. </member> <member name="application/boot_splash/fullsize" type="bool" setter="" getter=""> Scale the boot splash image to the full window length when engine starts (will leave it as default pixel size otherwise). @@ -319,6 +323,9 @@ <member name="display/mouse_cursor/custom_image_hotspot" type="Vector2" setter="" getter=""> Hotspot for the custom mouse cursor image. </member> + <member name="display/mouse_cursor/tooltip_position_offset" type="Vector2" setter="" getter=""> + Position offset for tooltips, relative to the hotspot of the mouse cursor. + </member> <member name="display/window/dpi/allow_hidpi" type="bool" setter="" getter=""> Allow HiDPI display on Windows and OSX. On Desktop Linux, this can't be enabled or disabled. </member> @@ -688,10 +695,13 @@ </member> <member name="rendering/quality/directional_shadow/size.mobile" type="int" setter="" getter=""> </member> - <member name="rendering/quality/driver/driver_fallback" type="String" setter="" getter=""> - Whether to allow falling back to other graphics drivers if the preferred driver is not available. Best means use the best working driver (this is the default). Never means never fall back to another driver even if it does not work. This means the project will not run if the preferred driver does not function. - </member> <member name="rendering/quality/driver/driver_name" type="String" setter="" getter=""> + Name of the configured video driver ("GLES2" or "GLES3"). + Note that the backend in use can be overridden at runtime via the [code]--video-driver[/code] command line argument, or by the [member rendering/quality/driver/fallback_to_gles2] option if the target system does not support GLES3 and falls back to GLES2. In such cases, this property is not updated, so use [method OS.get_current_video_driver] to query it at runtime. + </member> + <member name="rendering/quality/driver/fallback_to_gles2" type="bool" setter="" getter=""> + Whether to allow falling back to the GLES2 driver if the GLES3 driver is not supported. Default value: [code]false[/code]. + Note that the two video drivers are not drop-in replacements for each other, so a game designed for GLES3 might not work properly when falling back to GLES2. In particular, some features of the GLES3 backend are not available in GLES2. Enabling this setting also means that both ETC and ETC2 VRAM-compressed textures will be exported on Android and iOS, increasing the size of the game data pack. </member> <member name="rendering/quality/filters/anisotropic_filter_level" type="int" setter="" getter=""> Maximum Anisotropic filter level used for textures when anisotropy enabled. diff --git a/doc/classes/RayCast.xml b/doc/classes/RayCast.xml index 61f2737c01..22c70b789f 100644 --- a/doc/classes/RayCast.xml +++ b/doc/classes/RayCast.xml @@ -5,10 +5,10 @@ </brief_description> <description> A RayCast represents a line from its origin to its destination position, [code]cast_to[/code]. It is used to query the 3D space in order to find the closest object along the path of the ray. - RayCast can ignore some objects by adding them to the exception list via [code]add_exception[/code], by setting proper filtering with collision layers, or by filtering object types with type masks. + RayCast can ignore some objects by adding them to the exception list via [code]add_exception[/code] or by setting proper filtering with collision layers and masks. RayCast can be configured to report collisions with [Area]s ([member collide_with_areas]) and/or [PhysicsBody]s ([member collide_with_bodies]). Only enabled raycasts will be able to query the space and report collisions. - RayCast calculates intersection every physics frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame) use [method force_raycast_update] after adjusting the raycast. + RayCast calculates intersection every physics frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame), use [method force_raycast_update] after adjusting the raycast. </description> <tutorials> </tutorials> diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index 45bfd16cb8..248b3a6010 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -145,7 +145,7 @@ <argument index="0" name="b" type="Rect2"> </argument> <description> - Returns a larger Rect2 that contains this Rect2 and [code]with[/code]. + Returns a larger Rect2 that contains this Rect2 and [code]b[/code]. </description> </method> </methods> diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index f39d221d89..7e696badb2 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -64,6 +64,13 @@ </argument> <description> Returns a [SceneTreeTimer] which will [signal SceneTreeTimer.timeout] after the given time in seconds elapsed in this SceneTree. If [code]pause_mode_process[/code] is set to false, pausing the SceneTree will also pause the timer. + Commonly used to create a one-shot delay timer as in the following example: + [codeblock] + func some_function(): + print("start") + yield(get_tree().create_timer(1.0), "timeout") + print("end") + [/codeblock] </description> </method> <method name="get_frame" qualifiers="const"> diff --git a/doc/classes/SceneTreeTimer.xml b/doc/classes/SceneTreeTimer.xml index e1234ce88a..f58c531ed5 100644 --- a/doc/classes/SceneTreeTimer.xml +++ b/doc/classes/SceneTreeTimer.xml @@ -1,8 +1,17 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="SceneTreeTimer" inherits="Reference" category="Core" version="3.1"> <brief_description> + One-shot timer. </brief_description> <description> + A one-shot timer managed by the scene tree, which emits [signal timeout] on completion. See also [method SceneTree.create_timer]. + As opposed to [Timer], it does not require the instantiation of a node. Commonly used to create a one-shot delay timer as in the following example: + [codeblock] + func some_function(): + print("start") + yield(get_tree().create_timer(1.0), "timeout") + print("end") + [/codeblock] </description> <tutorials> </tutorials> @@ -12,11 +21,13 @@ </methods> <members> <member name="time_left" type="float" setter="set_time_left" getter="get_time_left"> + The time remaining. </member> </members> <signals> <signal name="timeout"> <description> + Emitted when the timer reaches 0. </description> </signal> </signals> diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml index 0b427fc089..c8c7fa1d01 100644 --- a/doc/classes/ScrollContainer.xml +++ b/doc/classes/ScrollContainer.xml @@ -4,7 +4,7 @@ A helper node for displaying scrollable elements (e.g. lists). </brief_description> <description> - A ScrollContainer node with a [Control] child and scrollbar child ([HScrollBar], [VScrollBar], or both) will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the minimum_size of the Control relative to the ScrollContainer. Works great with a [Panel] control. You can set EXPAND on children size flags, so they will upscale to ScrollContainer size if ScrollContainer size is bigger (scroll is invisible for chosen dimension). + A ScrollContainer node meant to contain a [Control] child. ScrollContainers will automatically create a scrollbar child ([HScrollBar], [VScrollBar], or both) when needed and will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the minimum_size of the Control relative to the ScrollContainer. Works great with a [Panel] control. You can set EXPAND on children size flags, so they will upscale to ScrollContainer size if ScrollContainer size is bigger (scroll is invisible for chosen dimension). </description> <tutorials> </tutorials> diff --git a/doc/classes/ShaderMaterial.xml b/doc/classes/ShaderMaterial.xml index 7491d22479..9b15c6e8b4 100644 --- a/doc/classes/ShaderMaterial.xml +++ b/doc/classes/ShaderMaterial.xml @@ -7,6 +7,7 @@ A material that uses a custom [Shader] program to render either items to screen or process particles. You can create multiple materials for the same shader but configure different values for the uniforms defined in the shader. </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/shading/index.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Skeleton.xml b/doc/classes/Skeleton.xml index 233df28255..f07329f31f 100644 --- a/doc/classes/Skeleton.xml +++ b/doc/classes/Skeleton.xml @@ -259,6 +259,10 @@ </description> </method> </methods> + <members> + <member name="bones_in_world_transform" type="bool" setter="set_use_bones_in_world_transform" getter="is_using_bones_in_world_transform"> + </member> + </members> <constants> <constant name="NOTIFICATION_UPDATE_SKELETON" value="50"> </constant> diff --git a/doc/classes/Skeleton2D.xml b/doc/classes/Skeleton2D.xml index d40b8a2fc7..258525c396 100644 --- a/doc/classes/Skeleton2D.xml +++ b/doc/classes/Skeleton2D.xml @@ -5,6 +5,7 @@ <description> </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/animation/2d_skeletons.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/SpotLight.xml b/doc/classes/SpotLight.xml index 11f914aac2..56ba2fc5b9 100644 --- a/doc/classes/SpotLight.xml +++ b/doc/classes/SpotLight.xml @@ -4,7 +4,7 @@ Spotlight [Light], such as a reflector spotlight or a lantern. </brief_description> <description> - A SpotLight light is a type of [Light] node that emits lights in a specific direction, in the shape of a cone. The light is attenuated through the distance and this attenuation can be configured by changing the energy, radius and attenuation parameters of [Light]. TODO: Image of a spotlight. + A SpotLight light is a type of [Light] node that emits lights in a specific direction, in the shape of a cone. The light is attenuated through the distance and this attenuation can be configured by changing the energy, radius and attenuation parameters of [Light]. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index c3af586b21..f5f50a75b1 100644 --- a/doc/classes/Tween.xml +++ b/doc/classes/Tween.xml @@ -13,7 +13,7 @@ Tween.TRANS_LINEAR, Tween.EASE_IN_OUT) tween.start() [/codeblock] - Many methods require a property name, such as "position" above. You can find the correct property name by hovering over the property in the Inspector. + Many methods require a property name, such as "position" 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 "property:component" (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 [code]http://easings.net/[/code] 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 [code]EASE_IN_OUT[/code], and use the one that looks best. </description> <tutorials> diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index 93806ac326..f0980f6414 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -8,22 +8,22 @@ Common behavior is to create an action, then add do/undo calls to functions or property changes, then committing the action. Here's an example on how to add an action to Godot editor's own 'undoredo': [codeblock] - var undoredo = get_undo_redo() # method of EditorPlugin + var undo_redo = get_undo_redo() # Method of EditorPlugin. func do_something(): - pass # put your code here + pass # Put your code here. func undo_something(): - pass # put here the code that reverts what's done by "do_something()" + pass # Put here the code that reverts what's done by "do_something()". func _on_MyButton_pressed(): var node = get_node("MyNode2D") - undoredo.create_action("Move the node") - undoredo.add_do_method(self, "do_something") - undoredo.add_undo_method(self, "undo_something") - undoredo.add_do_property(node, "position", Vector2(100,100)) - undoredo.add_undo_property(node, "position", node.position) - undoredo.commit_action() + undo_redo.create_action("Move the node") + undo_redo.add_do_method(self, "do_something") + undo_redo.add_undo_method(self, "undo_something") + undo_redo.add_do_property(node, "position", Vector2(100,100)) + undo_redo.add_undo_property(node, "position", node.position) + undo_redo.commit_action() [/codeblock] [method create_action], [method add_do_method], [method add_undo_method], [method add_do_property], [method add_undo_property], and [method commit_action] should be called one after the other, like in the example. Not doing so could lead to crashes. If you don't need to register a method you can leave [method add_do_method] and [method add_undo_method] out, and so it goes for properties. You can register more than one method/property. @@ -125,6 +125,7 @@ </argument> <description> Create a new action. After this is called, do all your calls to [method add_do_method], [method add_undo_method], [method add_do_property], and [method add_undo_property], then commit the action with [method commit_action]. + The way actions are merged is dictated by the [code]merge_mode[/code] argument. See [enum MergeMode] for details. </description> </method> <method name="get_current_action_name" qualifiers="const"> @@ -142,6 +143,12 @@ This is useful mostly to check if something changed from a saved version. </description> </method> + <method name="is_commiting_action" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="redo"> <return type="bool"> </return> @@ -159,10 +166,13 @@ </methods> <constants> <constant name="MERGE_DISABLE" value="0" enum="MergeMode"> + Makes [code]do[/code]/[code]undo[/code] operations stay in separate actions. </constant> <constant name="MERGE_ENDS" value="1" enum="MergeMode"> + Makes so that the action's [code]do[/code] operation is from the first action created and the [code]undo[/code] operation is from the last subsequent action with the same name. </constant> <constant name="MERGE_ALL" value="2" enum="MergeMode"> + Makes subsequent actions with the same name be merged into one. </constant> </constants> </class> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 880dc43c90..09891ca889 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -80,7 +80,11 @@ <return type="ViewportTexture"> </return> <description> - Returns the viewport's texture. + Returns the viewport's texture. Note that due to the way OpenGL works, the resulting [ViewportTexture] is flipped vertically. You can use [method Image.flip_y] on the result of [method Texture.get_data] to flip it back, for example: + [codeblock] + var img = get_viewport().get_texture().get_data() + img.flip_y() + [/codeblock] </description> </method> <method name="get_viewport_rid" qualifiers="const"> diff --git a/doc/classes/int.xml b/doc/classes/int.xml index 4855fa2848..7175b9fd88 100644 --- a/doc/classes/int.xml +++ b/doc/classes/int.xml @@ -4,7 +4,21 @@ Integer built-in type. </brief_description> <description> - Integer built-in type. + Signed 64-bit integer type. + It can take values in the interval [code][-2^63, 2^63 - 1][/code], i.e. [code][-9223372036854775808, 9223372036854775807][/code]. Exceeding those bounds will wrap around. + [code]int[/code] is a [Variant] type, and will thus be used when assigning an integer value to a [Variant]. It can also be enforced with the [code]: int[/code] type hint. + [codeblock] + var my_variant = 0 # int, value 0 + my_variant += 4.2 # float, value 4.2 + var my_int: int = 1 # int, value 1 + my_int = 4.2 # int, value 4, the right value is implicitly cast to int + my_int = int("6.7") # int, value 6, the String is explicitly cast with [method int] + + var max_int = 9223372036854775807 + print(max_int) # 9223372036854775807, OK + max_int += 1 + print(max_int) # -9223372036854775808, we overflowed and wrapped around + [/codeblock] </description> <tutorials> </tutorials> diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 22c0b5d1fd..40dde48432 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -950,6 +950,12 @@ def make_method_signature(class_def, method_def, make_ref, state): # type: (Cla if arg.default_value is not None: out += '=' + arg.default_value + if isinstance(method_def, MethodDef) and method_def.qualifiers is not None and 'vararg' in method_def.qualifiers: + if len(method_def.parameters) > 0: + out += ', ...' + else: + out += ' ...' + out += ' **)**' if isinstance(method_def, MethodDef) and method_def.qualifiers is not None: |