diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/@GDScript.xml | 13 | ||||
-rw-r--r-- | doc/classes/AnimationPlayer.xml | 4 | ||||
-rw-r--r-- | doc/classes/AnimationTreePlayer.xml | 2 | ||||
-rw-r--r-- | doc/classes/Array.xml | 64 | ||||
-rw-r--r-- | doc/classes/CPUParticles.xml | 1 | ||||
-rw-r--r-- | doc/classes/CollisionPolygon.xml | 2 | ||||
-rw-r--r-- | doc/classes/CollisionPolygon2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/Control.xml | 4 | ||||
-rw-r--r-- | doc/classes/EditorSpatialGizmo.xml | 2 | ||||
-rw-r--r-- | doc/classes/Engine.xml | 2 | ||||
-rw-r--r-- | doc/classes/Label.xml | 2 | ||||
-rw-r--r-- | doc/classes/MultiMesh.xml | 1 | ||||
-rw-r--r-- | doc/classes/OccluderPolygon2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/Polygon2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/ProjectSettings.xml | 10 | ||||
-rw-r--r-- | doc/classes/SceneTree.xml | 7 | ||||
-rw-r--r-- | doc/classes/SceneTreeTimer.xml | 11 | ||||
-rw-r--r-- | doc/classes/ScrollContainer.xml | 2 | ||||
-rw-r--r-- | doc/classes/StyleBox.xml | 13 | ||||
-rw-r--r-- | doc/classes/StyleBoxTexture.xml | 21 | ||||
-rw-r--r-- | doc/classes/UndoRedo.xml | 22 | ||||
-rw-r--r-- | doc/classes/Viewport.xml | 6 | ||||
-rw-r--r-- | doc/classes/int.xml | 16 |
23 files changed, 144 insertions, 67 deletions
diff --git a/doc/classes/@GDScript.xml b/doc/classes/@GDScript.xml index a7b58352cc..7b4b3e43ba 100644 --- a/doc/classes/@GDScript.xml +++ b/doc/classes/@GDScript.xml @@ -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/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/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/CollisionPolygon.xml b/doc/classes/CollisionPolygon.xml index 28e9ba4217..0b4f07578e 100644 --- a/doc/classes/CollisionPolygon.xml +++ b/doc/classes/CollisionPolygon.xml @@ -20,7 +20,7 @@ If true, no collision will be produced. </member> <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon"> - Array of vertices which define the polygon. + Array of vertices which define the polygon. Note that the returned value is a copy of the original. Methods which mutate the size or properties of the return value will not impact the original polygon. To change properties of the polygon, assign it to a temporary variable and make changes before reassigning the [code]polygon[/code] member. </member> </members> <constants> diff --git a/doc/classes/CollisionPolygon2D.xml b/doc/classes/CollisionPolygon2D.xml index 3dd87a4120..e754a2f2d1 100644 --- a/doc/classes/CollisionPolygon2D.xml +++ b/doc/classes/CollisionPolygon2D.xml @@ -25,7 +25,7 @@ <member name="one_way_collision_margin" type="float" setter="set_one_way_collision_margin" getter="get_one_way_collision_margin"> </member> <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon"> - The polygon's list of vertices. The final point will be connected to the first. + The polygon's list of vertices. The final point will be connected to the first. The returned value is a clone of the PoolVector2Array, not a reference. </member> </members> <constants> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index fe660be645..0152cca957 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -9,7 +9,7 @@ [b]User Interface nodes and input[/b] Godot sends input events to the scene's root node first, by calling [method Node._input]. [method Node._input] forwards the event down the node tree to the nodes under the mouse cursor, or on keyboard focus. To do so, it calls [method MainLoop._input_event]. Call [method accept_event] so no other node receives the event. Once you accepted an input, it becomes handled so [method Node._unhandled_input] will not process it. Only one [code]Control[/code] node can be in keyboard focus. Only the node in focus will receive keyboard events. To get the focus, call [method grab_focus]. [code]Control[/code] nodes lose focus when another node grabs it, or if you hide the node in focus. - Set [member mouse_filter] to MOUSE_FILTER_IGNORE to tell a [code]Control[/code] node to ignore mouse or touch events. You'll need it if you place an icon on top of a button. + Set [member mouse_filter] to [constant MOUSE_FILTER_IGNORE] to tell a [code]Control[/code] 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 [code]Control[/code] 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. </description> <tutorials> @@ -658,7 +658,7 @@ Controls the direction on the vertical axis in which the control should grow if its vertical minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size. </member> <member name="hint_tooltip" type="String" setter="set_tooltip" getter="_get_tooltip"> - Changes the tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments. + Changes the tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the [member mouse_filter] property is not [constant MOUSE_FILTER_IGNORE]. </member> <member name="margin_bottom" type="float" setter="set_margin" getter="get_margin"> Distance between the node's bottom edge and its parent control, based on [member anchor_bottom]. 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/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/Label.xml b/doc/classes/Label.xml index 90547b7c2f..36aa3c8b55 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -5,7 +5,7 @@ </brief_description> <description> Label displays plain text on the screen. It gives you control over the horizontal and vertical alignment, and can wrap the text inside the node's bounding rectangle. It doesn't support bold, italics or other formatting. For that, use [RichTextLabel] instead. - Note that contrarily to most other [Control]s, Label's [member Control.mouse_filter] defaults to MOUSE_FILTER_IGNORE (i.e. it doesn't react to mouse input events). + Note that contrarily to most other [Control]s, Label's [member Control.mouse_filter] defaults to MOUSE_FILTER_IGNORE (i.e. it doesn't react to mouse input events). This implies that a label won't display any configured [member Control.hint_tooltip], unless you change its mouse filter. </description> <tutorials> </tutorials> diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index 565e19c229..0cc9764e36 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -65,6 +65,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/OccluderPolygon2D.xml b/doc/classes/OccluderPolygon2D.xml index 58ad268f05..b8adc4c96f 100644 --- a/doc/classes/OccluderPolygon2D.xml +++ b/doc/classes/OccluderPolygon2D.xml @@ -20,7 +20,7 @@ Set the direction of the occlusion culling when not [code]CULL_DISABLED[/code]. Default value [code]DISABLED[/code]. </member> <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon"> - A [Vector2] array with the index for polygon's vertices positions. + A [Vector2] array with the index for polygon's vertices positions. Note that the returned value is a copy of the underlying array, rather than a reference. </member> </members> <constants> diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml index 9803837e5d..31ee0a9490 100644 --- a/doc/classes/Polygon2D.xml +++ b/doc/classes/Polygon2D.xml @@ -99,7 +99,7 @@ The offset applied to each vertex. </member> <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon"> - The polygon's list of vertices. The final point will be connected to the first. + The polygon's list of vertices. The final point will be connected to the first. Note that this returns a copy of the [PoolVector2Array] rather than a reference. </member> <member name="polygons" type="Array" setter="set_polygons" getter="get_polygons"> </member> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 6b53615535..1782edf25d 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -319,9 +319,6 @@ <member name="display/mouse_cursor/custom_image_hotspot" type="Vector2" setter="" getter=""> Hotspot for the custom mouse cursor image. </member> - <member name="display/window/allow_per_pixel_transparency" type="bool" setter="" getter=""> - Allow per pixel transparency in a Desktop window. This affects performance if not needed, so leave it off. - </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> @@ -331,9 +328,12 @@ <member name="display/window/handheld/orientation" type="String" setter="" getter=""> Default orientation for cell phone or tablet. </member> - <member name="display/window/per_pixel_transparency" type="bool" setter="" getter=""> + <member name="display/window/per_pixel_transparency/allowed" type="bool" setter="" getter=""> + Allow per pixel transparency in a Desktop window. This affects performance if not needed, so leave it off. + </member> + <member name="display/window/per_pixel_transparency/enabled" type="bool" setter="" getter=""> </member> - <member name="display/window/per_pixel_transparency_splash" type="bool" setter="" getter=""> + <member name="display/window/per_pixel_transparency/splash" type="bool" setter="" getter=""> </member> <member name="display/window/size/always_on_top" type="bool" setter="" getter=""> Force the window to be always on top. 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/StyleBox.xml b/doc/classes/StyleBox.xml index be21abe275..d8cc56cc8c 100644 --- a/doc/classes/StyleBox.xml +++ b/doc/classes/StyleBox.xml @@ -39,7 +39,8 @@ <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> - Return the offset of margin "margin" (see MARGIN_* enum). + Return the content margin offset for the specified margin + Positive values reduce size inwards, unlike [Control]'s margin values. </description> </method> <method name="get_minimum_size" qualifiers="const"> @@ -70,12 +71,22 @@ </methods> <members> <member name="content_margin_bottom" type="float" setter="set_default_margin" getter="get_default_margin"> + The bottom margin for the contents of this style box. Increasing this value reduces the space available to the contents from the bottom. + If this value is negative, it is ignored and a child-specific margin is used instead. For example for [StyleBoxFlat] the border thickness (if any) is used instead. + It is up to the code using this style box to decide what these contents are: for example, a [Button] respects this content margin for the textual contents of the button. + [method get_margin] should be used to fetch this value as consumer instead of reading these properties directly. This is because it correctly respects negative values and the fallback mentioned above. </member> <member name="content_margin_left" type="float" setter="set_default_margin" getter="get_default_margin"> + The left margin for the contents of this style box. Increasing this value reduces the space available to the contents from the left. + Refer to [member content_margin_bottom] for extra considerations. </member> <member name="content_margin_right" type="float" setter="set_default_margin" getter="get_default_margin"> + The right margin for the contents of this style box. Increasing this value reduces the space available to the contents from the right. + Refer to [member content_margin_bottom] for extra considerations. </member> <member name="content_margin_top" type="float" setter="set_default_margin" getter="get_default_margin"> + The top margin for the contents of this style box. Increasing this value reduces the space available to the contents from the top. + Refer to [member content_margin_bottom] for extra considerations. </member> </members> <constants> diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml index d8c378fde2..806ed1941a 100644 --- a/doc/classes/StyleBoxTexture.xml +++ b/doc/classes/StyleBoxTexture.xml @@ -42,28 +42,49 @@ <member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled"> </member> <member name="expand_margin_bottom" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size"> + Expands the bottom margin of this style box when drawing, causing it be drawn larger than requested. </member> <member name="expand_margin_left" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size"> + Expands the left margin of this style box when drawing, causing it be drawn larger than requested. </member> <member name="expand_margin_right" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size"> + Expands the right margin of this style box when drawing, causing it be drawn larger than requested. </member> <member name="expand_margin_top" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size"> + Expands the top margin of this style box when drawing, causing it be drawn larger than requested. </member> <member name="margin_bottom" type="float" setter="set_margin_size" getter="get_margin_size"> + Increases the bottom margin of the 3x3 texture box. + A higher value means more of the source texture is considered to be part of the bottom border of the 3x3 box. + This is also the value used as fallback for [member StyleBox.content_margin_bottom] if it is negative. </member> <member name="margin_left" type="float" setter="set_margin_size" getter="get_margin_size"> + Increases the left margin of the 3x3 texture box. + A higher value means more of the source texture is considered to be part of the left border of the 3x3 box. + This is also the value used as fallback for [member StyleBox.content_margin_left] if it is negative. </member> <member name="margin_right" type="float" setter="set_margin_size" getter="get_margin_size"> + Increases the right margin of the 3x3 texture box. + A higher value means more of the source texture is considered to be part of the right border of the 3x3 box. + This is also the value used as fallback for [member StyleBox.content_margin_right] if it is negative. </member> <member name="margin_top" type="float" setter="set_margin_size" getter="get_margin_size"> + Increases the top margin of the 3x3 texture box. + A higher value means more of the source texture is considered to be part of the top border of the 3x3 box. + This is also the value used as fallback for [member StyleBox.content_margin_top] if it is negative. </member> <member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate"> + Modulates the color of the texture when this style box is drawn. </member> <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map"> + The normal map to use when drawing this style box. </member> <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect"> + Species a sub region of the texture to use. + This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region. </member> <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> + The texture to use when drawing this style box. </member> </members> <signals> diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index 93806ac326..8d98bcfdb0 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"> @@ -159,10 +160,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> |