Skip to content

Commit

Permalink
Merge pull request #44911 from akien-mga/doc-sync
Browse files Browse the repository at this point in the history
doc: Sync classref with current source
  • Loading branch information
akien-mga authored Jan 4, 2021
2 parents 8cfec72 + 215d188 commit 51e5e20
Show file tree
Hide file tree
Showing 76 changed files with 1,290 additions and 1,480 deletions.
32 changes: 16 additions & 16 deletions doc/classes/@GlobalScope.xml
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,22 @@
[/codeblock]
</description>
</method>
<method name="snapped">
<return type="float">
</return>
<argument index="0" name="x" type="float">
</argument>
<argument index="1" name="step" type="float">
</argument>
<description>
Snaps float value [code]x[/code] to a given [code]step[/code]. This can also be used to round a floating point number to an arbitrary number of decimals.
[codeblock]
snapped(100, 32) # Returns 96
snapped(3.14159, 0.01) # Returns 3.14
[/codeblock]
See also [method ceil], [method floor], and [method round].
</description>
</method>
<method name="sqrt">
<return type="float">
</return>
Expand Down Expand Up @@ -974,22 +990,6 @@
[/codeblock]
</description>
</method>
<method name="snapped">
<return type="float">
</return>
<argument index="0" name="x" type="float">
</argument>
<argument index="1" name="step" type="float">
</argument>
<description>
Snaps float value [code]x[/code] to a given [code]step[/code]. This can also be used to round a floating point number to an arbitrary number of decimals.
[codeblock]
snapped(100, 32) # Returns 96
snapped(3.14159, 0.01) # Returns 3.14
[/codeblock]
See also [method ceil], [method floor], and [method round].
</description>
</method>
<method name="str" qualifiers="vararg">
<return type="String">
</return>
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/AABB.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
<argument index="0" name="aabb" type="AABB">
</argument>
<description>
Returns [code]true[/code] if this [AABB] and [code]aabb[/code] are approximately equal, by calling [method @GDScript.is_equal_approx] on each component.
Returns [code]true[/code] if this [AABB] and [code]aabb[/code] are approximately equal, by calling [method @GlobalScope.is_equal_approx] on each component.
</description>
</method>
<method name="merge">
Expand Down
4 changes: 2 additions & 2 deletions doc/classes/Animation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@
<argument index="1" name="key_idx" type="int">
</argument>
<description>
Returns the transition curve (easing) for a specific key (see the built-in math function [method @GDScript.ease]).
Returns the transition curve (easing) for a specific key (see the built-in math function [method @GlobalScope.ease]).
</description>
</method>
<method name="track_get_key_value" qualifiers="const">
Expand Down Expand Up @@ -592,7 +592,7 @@
<argument index="2" name="transition" type="float">
</argument>
<description>
Sets the transition curve (easing) for a specific key (see the built-in math function [method @GDScript.ease]).
Sets the transition curve (easing) for a specific key (see the built-in math function [method @GlobalScope.ease]).
</description>
</method>
<method name="track_set_key_value">
Expand Down
18 changes: 12 additions & 6 deletions doc/classes/AnimationNodeStateMachinePlayback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@
<link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
</tutorials>
<methods>
<method name="get_current_node" qualifiers="const">
<return type="StringName">
<method name="get_current_length" qualifiers="const">
<return type="float">
</return>
<description>
Returns the currently playing animation state.
</description>
</method>
<method name="get_travel_path" qualifiers="const">
<return type="PackedStringArray">
<method name="get_current_node" qualifiers="const">
<return type="StringName">
</return>
<description>
Returns the current travel path as computed internally by the A* algorithm.
Returns the currently playing animation state.
</description>
</method>
<method name="get_current_play_position" qualifiers="const">
Expand All @@ -42,6 +41,13 @@
Returns the playback position within the current animation state.
</description>
</method>
<method name="get_travel_path" qualifiers="const">
<return type="PackedStringArray">
</return>
<description>
Returns the current travel path as computed internally by the A* algorithm.
</description>
</method>
<method name="is_playing" qualifiers="const">
<return type="bool">
</return>
Expand Down
16 changes: 8 additions & 8 deletions doc/classes/Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,6 @@
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="is_empty">
<return type="bool">
</return>
<description>
Returns [code]true[/code] if the array is empty.
</description>
</method>
<method name="erase">
<return type="void">
</return>
Expand Down Expand Up @@ -339,6 +332,13 @@
Reverses the order of the elements in the array.
</description>
</method>
<method name="is_empty">
<return type="bool">
</return>
<description>
Returns [code]true[/code] if the array is empty.
</description>
</method>
<method name="max">
<return type="Variant">
</return>
Expand Down Expand Up @@ -482,7 +482,7 @@
<return type="void">
</return>
<description>
Shuffles the array such that the items will have a random order. This method uses the global random number generator common to methods such as [method @GDScript.randi]. Call [method @GDScript.randomize] to ensure that a new seed will be used each time if you want non-reproducible shuffling.
Shuffles the array such that the items will have a random order. This method uses the global random number generator common to methods such as [method @GlobalScope.randi]. Call [method @GlobalScope.randomize] to ensure that a new seed will be used each time if you want non-reproducible shuffling.
</description>
</method>
<method name="size">
Expand Down
10 changes: 2 additions & 8 deletions doc/classes/ArrayMesh.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,19 +209,13 @@
</method>
</methods>
<members>
<member name="blend_shape_mode" type="int" setter="set_blend_shape_mode" getter="get_blend_shape_mode" enum="ArrayMesh.BlendShapeMode" default="1">
Sets the blend shape mode to one of [enum ArrayMesh.BlendShapeMode].
<member name="blend_shape_mode" type="int" setter="set_blend_shape_mode" getter="get_blend_shape_mode" enum="Mesh.BlendShapeMode" default="1">
Sets the blend shape mode to one of [enum Mesh.BlendShapeMode].
</member>
<member name="custom_aabb" type="AABB" setter="set_custom_aabb" getter="get_custom_aabb" default="AABB( 0, 0, 0, 0, 0, 0 )">
Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices.
</member>
</members>
<constants>
<constant name="BLEND_SHAPE_MODE_NORMALIZED" value="0" enum="BlendShapeMode">
Blend shapes are normalized.
</constant>
<constant name="BLEND_SHAPE_MODE_RELATIVE" value="1" enum="BlendShapeMode">
Blend shapes are relative to base weight.
</constant>
</constants>
</class>
14 changes: 7 additions & 7 deletions doc/classes/Camera2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<method name="get_drag_margin" qualifiers="const">
<return type="float">
</return>
<argument index="0" name="side" type="int" enum="Side">
<argument index="0" name="margin" type="int" enum="Side">
</argument>
<description>
Returns the specified [enum Side]'s margin. See also [member drag_bottom_margin], [member drag_top_margin], [member drag_left_margin], and [member drag_right_margin].
Expand All @@ -61,7 +61,7 @@
<method name="get_limit" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="side" type="int" enum="Side">
<argument index="0" name="margin" type="int" enum="Side">
</argument>
<description>
Returns the camera limit for the specified [enum Side]. See also [member limit_bottom], [member limit_top], [member limit_left], and [member limit_right].
Expand All @@ -85,7 +85,7 @@
<method name="set_drag_margin">
<return type="void">
</return>
<argument index="0" name="side" type="int" enum="Side">
<argument index="0" name="margin" type="int" enum="Side">
</argument>
<argument index="1" name="drag_margin" type="float">
</argument>
Expand All @@ -96,7 +96,7 @@
<method name="set_limit">
<return type="void">
</return>
<argument index="0" name="side" type="int" enum="Side">
<argument index="0" name="margin" type="int" enum="Side">
</argument>
<argument index="1" name="limit" type="int">
</argument>
Expand All @@ -118,10 +118,10 @@
<member name="drag_bottom_margin" type="float" setter="set_drag_margin" getter="get_drag_margin" default="0.2">
Bottom margin needed to drag the camera. A value of [code]1[/code] makes the camera move only when reaching the bottom edge of the screen.
</member>
<member name="drag_horizontal_enabled" type="bool" setter="set_h_drag_enabled" getter="is_h_drag_enabled" default="false">
<member name="drag_horizontal_enabled" type="bool" setter="set_drag_horizontal_enabled" getter="is_drag_horizontal_enabled" default="false">
If [code]true[/code], the camera only moves when reaching the horizontal (left and right) drag margins. If [code]false[/code], the camera moves horizontally regardless of margins.
</member>
<member name="drag_horizontal_offset" type="float" setter="set_h_offset" getter="get_h_offset" default="0.0">
<member name="drag_horizontal_offset" type="float" setter="set_drag_horizontal_offset" getter="get_drag_horizontal_offset" default="0.0">
The relative horizontal drag offset of the camera between the right ([code]-1[/code]) and left ([code]1[/code]) drag margins.
[b]Note:[/b] Used to set the initial horizontal drag offset; determine the current offset; or force the current offset. It's not automatically updated when the horizontal drag margin is enabled or the drag margins are changed.
</member>
Expand All @@ -137,7 +137,7 @@
<member name="drag_vertical_enabled" type="bool" setter="set_drag_vertical_enabled" getter="is_drag_vertical_enabled" default="false">
If [code]true[/code], the camera only moves when reaching the vertical (top and bottom) drag margins. If [code]false[/code], the camera moves vertically regardless of the drag margins.
</member>
<member name="drag_vertical_offset" type="float" setter="set_drag_verticaloffset" getter="get_drag_vertical_offset" default="0.0">
<member name="drag_vertical_offset" type="float" setter="set_drag_vertical_offset" getter="get_drag_vertical_offset" default="0.0">
The relative vertical drag offset of the camera between the bottom ([code]-1[/code]) and top ([code]1[/code]) drag margins.
[b]Note:[/b] Used to set the initial vertical drag offset; determine the current offset; or force the current offset. It's not automatically updated when the vertical drag margin is enabled or the drag margins are changed.
</member>
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/CanvasItem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Canvas items are drawn in tree order. By default, children are on top of their parents so a root [CanvasItem] will be drawn behind everything. This behavior can be changed on a per-item basis.
A [CanvasItem] can also be hidden, which will also hide its children. It provides many ways to change parameters such as modulation (for itself and its children) and self modulation (only for itself), as well as its blend mode.
Ultimately, a transform notification can be requested, which will notify the node that its global position changed in case the parent tree changed.
[b]Note:[/b] Unless otherwise specified, all methods that have angle parameters must have angles specified as [i]radians[/i]. To convert degrees to radians, use [method @GDScript.deg2rad].
[b]Note:[/b] Unless otherwise specified, all methods that have angle parameters must have angles specified as [i]radians[/i]. To convert degrees to radians, use [method @GlobalScope.deg2rad].
</description>
<tutorials>
<link title="Viewport and canvas transforms">https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
Expand Down
4 changes: 2 additions & 2 deletions doc/classes/Color.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</brief_description>
<description>
A color represented by red, green, blue, and alpha (RGBA) components. The alpha component is often used for transparency. Values are in floating-point and usually range from 0 to 1. Some properties (such as CanvasItem.modulate) may accept values greater than 1 (overbright or HDR colors).
You can also create a color from standardized color names by using [method @GDScript.ColorN] or directly using the color constants defined here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url].
You can also create a color from standardized color names by using [code]ColorN[/code] ([b]FIXME:[/b] No longer true, a Color(String) constructor should be re-implemented for that) or directly using the color constants defined here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url].
If you want to supply values in a range of 0 to 255, you should use [method @GDScript.Color8].
[b]Note:[/b] In a boolean context, a Color will evaluate to [code]false[/code] if it's equal to [code]Color(0, 0, 0, 1)[/code] (opaque black). Otherwise, a Color will always evaluate to [code]true[/code].
[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/color_constants.png]Color constants cheatsheet[/url]
Expand Down Expand Up @@ -158,7 +158,7 @@
<argument index="0" name="to" type="Color">
</argument>
<description>
Returns [code]true[/code] if this color and [code]color[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
Returns [code]true[/code] if this color and [code]color[/code] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component.
</description>
</method>
<method name="lerp">
Expand Down
50 changes: 15 additions & 35 deletions doc/classes/Control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,6 @@
Overrides the icon with given [code]name[/code] in the [member theme] resource the control uses. If [code]icon[/code] is [code]null[/code] or invalid, the override is cleared and the icon from assigned [Theme] is used.
</description>
</method>
<method name="add_theme_shader_override">
<return type="void">
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="shader" type="Shader">
</argument>
<description>
Overrides the [Shader] with given [code]name[/code] in the [member theme] resource the control uses. If [code]shader[/code] is [code]null[/code] or invalid, the override is cleared and the shader from assigned [Theme] is used.
</description>
</method>
<method name="add_theme_stylebox_override">
<return type="void">
</return>
Expand Down Expand Up @@ -417,20 +406,20 @@
Returns the position and size of the control relative to the top-left corner of the screen. See [member rect_position] and [member rect_size].
</description>
</method>
<method name="get_offset" qualifiers="const">
<return type="float">
<method name="get_minimum_size" qualifiers="const">
<return type="Vector2">
</return>
<argument index="0" name="side" type="int" enum="Side">
</argument>
<description>
Returns the anchor for the specified [enum Side]. A getter method for [member offset_bottom], [member offset_left], [member offset_right] and [member offset_top].
Returns the minimum size for this control. See [member rect_min_size].
</description>
</method>
<method name="get_minimum_size" qualifiers="const">
<return type="Vector2">
<method name="get_offset" qualifiers="const">
<return type="float">
</return>
<argument index="0" name="offset" type="int" enum="Side">
</argument>
<description>
Returns the minimum size for this control. See [member rect_min_size].
Returns the anchor for the specified [enum Side]. A getter method for [member offset_bottom], [member offset_left], [member offset_right] and [member offset_top].
</description>
</method>
<method name="get_parent_area_size" qualifiers="const">
Expand Down Expand Up @@ -685,15 +674,6 @@
Returns [code]true[/code] if icon with given [code]name[/code] has a valid override in this [Control] node.
</description>
</method>
<method name="has_theme_shader_override" qualifiers="const">
<return type="bool">
</return>
<argument index="0" name="name" type="StringName">
</argument>
<description>
Returns [code]true[/code] if [Shader] with given [code]name[/code] has a valid override in this [Control] node.
</description>
</method>
<method name="has_theme_stylebox" qualifiers="const">
<return type="bool">
</return>
Expand Down Expand Up @@ -1063,6 +1043,13 @@
<member name="layout_direction" type="int" setter="set_layout_direction" getter="get_layout_direction" enum="Control.LayoutDirection" default="0">
Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew).
</member>
<member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" enum="Control.CursorShape" default="0">
The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors.
[b]Note:[/b] On Linux, shapes may vary depending on the cursor theme of the system.
</member>
<member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" enum="Control.MouseFilter" default="0">
Controls whether the control will be able to receive mouse button input events through [method _gui_input] and how these events should be handled. Also controls whether the control can receive the [signal mouse_entered], and [signal mouse_exited] signals. See the constants to learn what each does.
</member>
<member name="offset_bottom" type="float" setter="set_offset" getter="get_offset" default="0.0">
Distance between the node's bottom edge and its parent control, based on [member anchor_bottom].
Offsets are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Offsets update automatically when you move or resize the node.
Expand All @@ -1079,13 +1066,6 @@
Distance between the node's top edge and its parent control, based on [member anchor_top].
Offsets are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Offsets update automatically when you move or resize the node.
</member>
<member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" enum="Control.CursorShape" default="0">
The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors.
[b]Note:[/b] On Linux, shapes may vary depending on the cursor theme of the system.
</member>
<member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" enum="Control.MouseFilter" default="0">
Controls whether the control will be able to receive mouse button input events through [method _gui_input] and how these events should be handled. Also controls whether the control can receive the [signal mouse_entered], and [signal mouse_exited] signals. See the constants to learn what each does.
</member>
<member name="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents" default="false">
Enables whether rendering of [CanvasItem] based children should be clipped to this control's rectangle. If [code]true[/code], parts of a child which would be visibly outside of this control's rectangle will not be rendered.
</member>
Expand Down
Loading

0 comments on commit 51e5e20

Please sign in to comment.