diff options
Diffstat (limited to 'doc')
61 files changed, 804 insertions, 521 deletions
diff --git a/doc/classes/@GDScript.xml b/doc/classes/@GDScript.xml index 2bdfc56c44..601b1385ae 100644 --- a/doc/classes/@GDScript.xml +++ b/doc/classes/@GDScript.xml @@ -415,6 +415,21 @@ <return type="Array"> </return> <description> + Returns an array of dictionaries representing the current call stack. + [codeblock] + func _ready(): + foo() + + func foo(): + bar() + + func bar(): + print(get_stack()) + [/codeblock] + would print + [codeblock] + [{function:bar, line:12, source:res://script.gd}, {function:foo, line:9, source:res://script.gd}, {function:_ready, line:6, source:res://script.gd}] + [/codeblock] </description> </method> <method name="hash"> @@ -488,7 +503,7 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns True/False whether [code]s[/code] is an infinity value (either positive infinity or negative infinity). + Returns whether [code]s[/code] is an infinity value (either positive infinity or negative infinity). </description> </method> <method name="is_instance_valid"> @@ -497,6 +512,7 @@ <argument index="0" name="instance" type="Object"> </argument> <description> + Returns whether [code]instance[/code] is a valid object (e.g. has not been deleted from memory). </description> </method> <method name="is_nan"> @@ -505,7 +521,7 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns True/False whether [code]s[/code] is a NaN (Not-A-Number) value. + Returns whether [code]s[/code] is a NaN (Not-A-Number) value. </description> </method> <method name="len"> @@ -690,6 +706,7 @@ <return type="void"> </return> <description> + Like [method print], but prints only when used in debug mode. </description> </method> <method name="print_stack"> diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml index 0f16c5e4a9..a98facf541 100644 --- a/doc/classes/AnimationNode.xml +++ b/doc/classes/AnimationNode.xml @@ -54,7 +54,7 @@ <argument index="5" name="optimize" type="bool" default="true"> </argument> <description> - Blend an input. This is only useful for nodes created for an AnimationBlendTree. Time is a delta, unless "seek" is true, in which case it is absolute. A filter mode may be optionally passed. + Blend an input. This is only useful for nodes created for an [AnimationNodeBlendTree]. Time is a delta, unless "seek" is true, in which case it is absolute. A filter mode may be optionally passed. </description> </method> <method name="blend_node"> @@ -105,7 +105,7 @@ <return type="int"> </return> <description> - Amount of inputs in this node, only useful for nodes that go into [AnimationBlendTree]. + Amount of inputs in this node, only useful for nodes that go into [AnimationNodeBlendTree]. </description> </method> <method name="get_input_name"> @@ -139,8 +139,7 @@ <return type="Array"> </return> <description> - Get the property information for parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. - Format is similar to [Object.get_property_list] + Get the property information for parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to [method Object.get_property_list]. </description> </method> <method name="has_filter" qualifiers="virtual"> diff --git a/doc/classes/Area.xml b/doc/classes/Area.xml index 203af27f45..a538fe9935 100644 --- a/doc/classes/Area.xml +++ b/doc/classes/Area.xml @@ -69,7 +69,7 @@ <argument index="1" name="value" type="bool"> </argument> <description> - Set/clear individual bits on the layer mask. This simplifies editing this [code]Area[code]'s layers. + Set/clear individual bits on the layer mask. This simplifies editing this [code]Area[/code]'s layers. </description> </method> <method name="set_collision_mask_bit"> diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index 11aef07c47..7980fe79ba 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -125,7 +125,7 @@ The area's priority. Higher priority areas are processed first. Default value: 0. </member> <member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" enum="Area2D.SpaceOverride"> - Override mode for gravity and damping calculations within this area. See [Area2D.SpaceOverride] for possible values. + Override mode for gravity and damping calculations within this area. See [enum Area2D.SpaceOverride] for possible values. </member> </members> <signals> diff --git a/doc/classes/AudioStream.xml b/doc/classes/AudioStream.xml index 96ce53b14f..c0a16adda9 100644 --- a/doc/classes/AudioStream.xml +++ b/doc/classes/AudioStream.xml @@ -4,7 +4,7 @@ Base class for audio streams. </brief_description> <description> - Base class for audio streams. Audio streams are used for music playback, or other types of streamed sounds that don't fit or require more flexibility than a [Sample]. + Base class for audio streams. Audio streams are used for sound effects and music playback, and support WAV (via [AudioStreamSample]) and OGG (via [AudioStreamOGGVorbis]) file formats. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml index e04a808f34..e880fc1323 100644 --- a/doc/classes/AudioStreamPlayer.xml +++ b/doc/classes/AudioStreamPlayer.xml @@ -7,7 +7,6 @@ Plays background audio. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/learning/features/audio/index.html</link> <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> </tutorials> <demos> diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml index 2051675488..28754f8695 100644 --- a/doc/classes/AudioStreamPlayer2D.xml +++ b/doc/classes/AudioStreamPlayer2D.xml @@ -7,7 +7,6 @@ Plays audio that dampens with distance from screen center. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/learning/features/audio/index.html</link> <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> </tutorials> <demos> diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml index c7c9f4df9b..a0260d8261 100644 --- a/doc/classes/AudioStreamPlayer3D.xml +++ b/doc/classes/AudioStreamPlayer3D.xml @@ -7,7 +7,6 @@ Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/learning/features/audio/index.html</link> <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> </tutorials> <demos> diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml index 8798ca5274..05ffe6cc11 100644 --- a/doc/classes/BaseButton.xml +++ b/doc/classes/BaseButton.xml @@ -54,7 +54,7 @@ If [code]true[/code], the button is in disabled state and can't be clicked or toggled. </member> <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" enum="Control.FocusMode"> - Focus access mode to use when switching between enabled/disabled (see [method Control.set_focus_mode] and [member disabled]). + Focus access mode to use when switching between enabled/disabled (see [member Control.focus_mode] and [member disabled]). </member> <member name="group" type="ButtonGroup" setter="set_button_group" getter="get_button_group"> [ButtonGroup] associated to the button. @@ -63,7 +63,7 @@ If [code]true[/code], the button's state is pressed. Means the button is pressed down or toggled (if toggle_mode is active). </member> <member name="shortcut" type="ShortCut" setter="set_shortcut" getter="get_shortcut"> - [Shortcut] associated to the button. + [ShortCut] associated to the button. </member> <member name="shortcut_in_tooltip" type="bool" setter="set_shortcut_in_tooltip" getter="is_shortcut_in_tooltip_enabled"> If [code]true[/code], the button will add information about its shortcut in the tooltip. diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index 95f6346321..b96daed6fc 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -9,7 +9,6 @@ </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link> - <link>https://docs.godotengine.org/en/latest/tutorials/math/rotations.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml index 4e9efaea2d..fa907dd648 100644 --- a/doc/classes/Camera2D.xml +++ b/doc/classes/Camera2D.xml @@ -124,6 +124,8 @@ <member name="offset_v" type="float" setter="set_v_offset" getter="get_v_offset"> The vertical offset of the camera, relative to the drag margins. Default value: [code]0[/code] </member> + <member name="process_mode" type="int" setter="set_process_mode" getter="get_process_mode" enum="Camera2D.Camera2DProcessMode"> + </member> <member name="rotating" type="bool" setter="set_rotating" getter="is_rotating"> If [code]true[/code], the camera rotates with the target. Default value: [code]false[/code] </member> @@ -144,5 +146,9 @@ <constant name="ANCHOR_MODE_DRAG_CENTER" value="1" enum="AnchorMode"> The camera's position takes into account vertical/horizontal offsets and the screen size. </constant> + <constant name="CAMERA2D_PROCESS_PHYSICS" value="0" enum="Camera2DProcessMode"> + </constant> + <constant name="CAMERA2D_PROCESS_IDLE" value="1" enum="Camera2DProcessMode"> + </constant> </constants> </class> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index f050378d03..f067b50c72 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -120,7 +120,7 @@ <argument index="1" name="stylebox" type="StyleBox"> </argument> <description> - Overrides the [code]name[/code] [Stylebox] in the [member theme] resource the node uses. If [code]stylebox[/code] is empty, Godot clears the override. + Overrides the [code]name[/code] [StyleBox] in the [member theme] resource the node uses. If [code]stylebox[/code] is empty, Godot clears the override. </description> </method> <method name="can_drop_data" qualifiers="virtual"> @@ -798,7 +798,7 @@ Sent when the node's [member theme] changes, right before Godot redraws the control. Happens when you call one of the [code]add_*_override[/code] methods. </constant> <constant name="NOTIFICATION_MODAL_CLOSE" value="46"> - Sent when an open modal dialog closes. See [member show_modal]. + Sent when an open modal dialog closes. See [method show_modal]. </constant> <constant name="NOTIFICATION_SCROLL_BEGIN" value="47"> Sent when this node is inside a [ScrollContainer] which has begun being scrolled. diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml index 3aaf7b8afb..b2e64f96a6 100644 --- a/doc/classes/Curve3D.xml +++ b/doc/classes/Curve3D.xml @@ -53,7 +53,7 @@ <return type="PoolRealArray"> </return> <description> - Returns the cache of tilts as a [RealArray]. + Returns the cache of tilts as a [PoolRealArray]. </description> </method> <method name="get_baked_up_vectors" qualifiers="const"> diff --git a/doc/classes/DirectionalLight.xml b/doc/classes/DirectionalLight.xml index 63d686fe24..4a2802ffa4 100644 --- a/doc/classes/DirectionalLight.xml +++ b/doc/classes/DirectionalLight.xml @@ -33,13 +33,13 @@ Can be used to fix special cases of self shadowing when objects are perpendicular to the light. </member> <member name="directional_shadow_split_1" type="float" setter="set_param" getter="get_param"> - The distance from camera to shadow split 1. Relative to [member directional_shadow_max_distance]. Only used in [enum directional_shadow_mode] SHADOW_PARALLEL_*_SPLITS. + The distance from camera to shadow split 1. Relative to [member directional_shadow_max_distance]. Only used when [member directional_shadow_mode] is one of the [code]SHADOW_PARALLEL_*_SPLITS[/code] constants. </member> <member name="directional_shadow_split_2" type="float" setter="set_param" getter="get_param"> - The distance from shadow split 1 to split 2. Relative to [member directional_shadow_max_distance]. Only used in [enum directional_shadow_mode] SHADOW_PARALLEL_*_SPLITS. + The distance from shadow split 1 to split 2. Relative to [member directional_shadow_max_distance]. Only used when [member directional_shadow_mode] is [code]SHADOW_PARALLEL_3_SPLITS[/code] or [code]SHADOW_PARALLEL_4_SPLITS[/code]. </member> <member name="directional_shadow_split_3" type="float" setter="set_param" getter="get_param"> - The distance from shadow split 2 to split 3. Relative to [member directional_shadow_max_distance]. Only used in [enum directional_shadow_mode] SHADOW_PARALLEL_4_SPLITS. + The distance from shadow split 2 to split 3. Relative to [member directional_shadow_max_distance]. Only used when [member directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]. </member> </members> <constants> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index f1c3481562..bcf6d3009c 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -7,7 +7,7 @@ Plugins are used by the editor to extend functionality. The most common types of plugins are those which edit a given node or resource type, import plugins and export plugins. Also see [EditorScript] to add functions to the editor. </description> <tutorials> - <link>https://docs.godotengine.org/en/latest/development/plugins/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/plugins/editor/index.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/EditorSpatialGizmo.xml b/doc/classes/EditorSpatialGizmo.xml index 2081ae7a4d..c3ecd3c3b7 100644 --- a/doc/classes/EditorSpatialGizmo.xml +++ b/doc/classes/EditorSpatialGizmo.xml @@ -4,7 +4,7 @@ Custom gizmo for editing Spatial objects. </brief_description> <description> - Custom gizmo that is used for providing custom visualization and editing (handles) for 3D Spatial objects. These are created by [method EditorPlugin.create_spatial_gizmo]. + Custom gizmo that is used for providing custom visualization and editing (handles) for 3D Spatial objects. These are created by [method EditorSpatialGizmoPlugin.create_gizmo]. </description> <tutorials> </tutorials> diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index e778a6423a..715c23d869 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -5,7 +5,7 @@ </brief_description> <description> GraphEdit manages the showing of GraphNodes it contains, as well as connections and disconnections between them. Signals are sent for each of these two events. Disconnection between GraphNodes slots is disabled by default. - It is greatly advised to enable low processor usage mode (see [method OS.set_low_processor_usage_mode]) when using GraphEdits. + It is greatly advised to enable low processor usage mode (see [member OS.low_processor_usage_mode]) when using GraphEdits. </description> <tutorials> </tutorials> diff --git a/doc/classes/InputMap.xml b/doc/classes/InputMap.xml index 8c25f851db..3779aa399f 100644 --- a/doc/classes/InputMap.xml +++ b/doc/classes/InputMap.xml @@ -93,7 +93,7 @@ <argument index="1" name="action" type="String"> </argument> <description> - Returns [true] if the given event is part of an existing action. This method ignores keyboard modifiers if the given [InputEvent] is not pressed (for proper release detection). See [method action_has_event] if you don't want this behavior. + Returns [code]true[/code] if the given event is part of an existing action. This method ignores keyboard modifiers if the given [InputEvent] is not pressed (for proper release detection). See [method action_has_event] if you don't want this behavior. </description> </method> <method name="get_action_list"> diff --git a/doc/classes/JSONParseResult.xml b/doc/classes/JSONParseResult.xml index a9162e2d95..4d2987cc04 100644 --- a/doc/classes/JSONParseResult.xml +++ b/doc/classes/JSONParseResult.xml @@ -24,7 +24,7 @@ </member> <member name="result" type="Variant" setter="set_result" getter="get_result"> A [Variant] containing the parsed JSON. Use typeof() to check if it is what you expect. For example, if JSON source starts with curly braces ([code]{}[/code]) a [Dictionary] will be returned, if JSON source starts with braces ([code][][/code]) an [Array] will be returned. - [i]Be aware that the JSON specification does not define integer or float types, but only a number type. Therefore, parsing a JSON text will convert all numerical values to float types. + [i]Be aware that the JSON specification does not define integer or float types, but only a number type. Therefore, parsing a JSON text will convert all numerical values to float types.[/i] Note that JSON objects do not preserve key order like Godot dictionaries, thus you should not rely on keys being in a certain order if a dictionary is constructed from JSON. In contrast, JSON arrays retain the order of their elements:[/i] [codeblock] var p = JSON.parse('["hello", "world", "!"]') diff --git a/doc/classes/Joint.xml b/doc/classes/Joint.xml index 6c93b1d1d2..32fdb31a99 100644 --- a/doc/classes/Joint.xml +++ b/doc/classes/Joint.xml @@ -4,7 +4,7 @@ Base class for all 3D joints </brief_description> <description> - All 3D joints link two nodes, has a priority, and can decide if the two bodies of the nodes should be able to collide with each other + Joints are used to bind together two physics bodies. They have a solver priority and can define if the bodies of the two attached nodes should be able to collide with each other. </description> <tutorials> </tutorials> @@ -17,13 +17,13 @@ If [code]true[/code], the two bodies of the nodes are not able to collide with each other. </member> <member name="nodes/node_a" type="NodePath" setter="set_node_a" getter="get_node_a"> - The [Node], the first side of the Joint attaches to. + The node attached to the first side (A) of the joint. </member> <member name="nodes/node_b" type="NodePath" setter="set_node_b" getter="get_node_b"> - The [Node], the second side of the Joint attaches to. + The node attached to the second side (B) of the joint. </member> <member name="solver/priority" type="int" setter="set_solver_priority" getter="get_solver_priority"> - The order in which the solver is executed compared to the other [Joints], the lower, the earlier. + The priority used to define which solver is executed first for multiple joints. The lower the value, the higher the priority. </member> </members> <constants> diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml index 476156846d..0d754f1d4e 100644 --- a/doc/classes/Light2D.xml +++ b/doc/classes/Light2D.xml @@ -59,7 +59,7 @@ If [code]true[/code], the Light2D will cast shadows. Default value: [code]false[/code]. </member> <member name="shadow_filter" type="int" setter="set_shadow_filter" getter="get_shadow_filter" enum="Light2D.ShadowFilter"> - Shadow filter type. Use SHADOW_FILTER_* constants to set [code]shadow_filter[/code]. Default value: [code]None[/code]. + Shadow filter type. Use [enum Light2D.ShadowFilter] constants as values. Default value: [code]SHADOW_FILTER_NONE[/code]. </member> <member name="shadow_filter_smooth" type="float" setter="set_shadow_smooth" getter="get_shadow_smooth"> Smoothing value for shadows. @@ -91,22 +91,22 @@ The light texture of the Light2D is used as a mask, hiding or revealing parts of the screen underneath depending on the value of each pixel of the light (mask) texture. </constant> <constant name="SHADOW_FILTER_NONE" value="0" enum="ShadowFilter"> - No filter applies to the shadow map. See [method shadow_filter]. + No filter applies to the shadow map. See [member shadow_filter]. </constant> <constant name="SHADOW_FILTER_PCF3" value="1" enum="ShadowFilter"> - Percentage closer filtering (3 samples) applies to the shadow map. See [method shadow_filter]. + Percentage closer filtering (3 samples) applies to the shadow map. See [member shadow_filter]. </constant> <constant name="SHADOW_FILTER_PCF5" value="2" enum="ShadowFilter"> - Percentage closer filtering (5 samples) applies to the shadow map. See [method shadow_filter]. + Percentage closer filtering (5 samples) applies to the shadow map. See [member shadow_filter]. </constant> <constant name="SHADOW_FILTER_PCF7" value="3" enum="ShadowFilter"> - Percentage closer filtering (7 samples) applies to the shadow map. See [method shadow_filter]. + Percentage closer filtering (7 samples) applies to the shadow map. See [member shadow_filter]. </constant> <constant name="SHADOW_FILTER_PCF9" value="4" enum="ShadowFilter"> - Percentage closer filtering (9 samples) applies to the shadow map. See [method shadow_filter]. + Percentage closer filtering (9 samples) applies to the shadow map. See [member shadow_filter]. </constant> <constant name="SHADOW_FILTER_PCF13" value="5" enum="ShadowFilter"> - Percentage closer filtering (13 samples) applies to the shadow map. See [method shadow_filter]. + Percentage closer filtering (13 samples) applies to the shadow map. See [member shadow_filter]. </constant> </constants> </class> diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 930680c2ad..1e1ffd71b5 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -24,7 +24,7 @@ <return type="void"> </return> <description> - Erases the [LineEdit] text. + Erases the [code]LineEdit[/code] text. </description> </method> <method name="deselect"> @@ -38,7 +38,7 @@ <return type="PopupMenu"> </return> <description> - Returns the [PopupMenu] of this [code]LineEdit[/code]. By default, this menu is displayed when right-clicking on the [LineEdit]. + Returns the [PopupMenu] of this [code]LineEdit[/code]. By default, this menu is displayed when right-clicking on the [code]LineEdit[/code]. </description> </method> <method name="menu_option"> @@ -58,7 +58,7 @@ <argument index="1" name="to" type="int" default="-1"> </argument> <description> - Selects characters inside [LineEdit] between [code]from[/code] and [code]to[/code]. By default [code]from[/code] is at the beginning and [code]to[/code] at the end. + Selects characters inside [code]LineEdit[/code] between [code]from[/code] and [code]to[/code]. By default [code]from[/code] is at the beginning and [code]to[/code] at the end. [codeblock] text = "Welcome" select() # Welcome @@ -98,19 +98,19 @@ If [code]false[/code], existing text cannot be modified and new text cannot be added. </member> <member name="expand_to_text_length" type="bool" setter="set_expand_to_text_length" getter="get_expand_to_text_length"> - If [code]true[/code], the [LineEdit] width will increase to stay longer than the [member text]. It will [b]not[/b] compress if the [member text] is shortened. + If [code]true[/code], the [code]LineEdit[/code] width will increase to stay longer than the [member text]. It will [b]not[/b] compress if the [member text] is shortened. </member> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode"> - Defines how the [LineEdit] can grab focus (Keyboard and mouse, only keyboard, or none). See [code]enum FocusMode[/code] in [Control] for details. + Defines how the [code]LineEdit[/code] can grab focus (Keyboard and mouse, only keyboard, or none). See [code]enum FocusMode[/code] in [Control] for details. </member> <member name="max_length" type="int" setter="set_max_length" getter="get_max_length"> - Maximum amount of characters that can be entered inside the [LineEdit]. If [code]0[/code], there is no limit. + Maximum amount of characters that can be entered inside the [code]LineEdit[/code]. If [code]0[/code], there is no limit. </member> <member name="placeholder_alpha" type="float" setter="set_placeholder_alpha" getter="get_placeholder_alpha"> Opacity of the [member placeholder_text]. From [code]0[/code] to [code]1[/code]. </member> <member name="placeholder_text" type="String" setter="set_placeholder" getter="get_placeholder"> - Text shown when the [LineEdit] is empty. It is [b]not[/b] the [LineEdit]'s default value (see [member text]). + Text shown when the [code]LineEdit[/code] is empty. It is [b]not[/b] the [code]LineEdit[/code]'s default value (see [member text]). </member> <member name="secret" type="bool" setter="set_secret" getter="is_secret"> If [code]true[/code], every character is replaced with the secret character (see [member secret_character]). @@ -119,7 +119,7 @@ The character to use to mask secret input (defaults to "*"). Only a single character can be used as the secret character. </member> <member name="text" type="String" setter="set_text" getter="get_text"> - String value of the [LineEdit]. + String value of the [code]LineEdit[/code]. </member> </members> <signals> @@ -134,25 +134,25 @@ <argument index="0" name="new_text" type="String"> </argument> <description> - Emitted when the user presses KEY_ENTER on the [code]LineEdit[/code]. + Emitted when the user presses [code]KEY_ENTER[/code] on the [code]LineEdit[/code]. </description> </signal> </signals> <constants> <constant name="ALIGN_LEFT" value="0" enum="Align"> - Aligns the text on the left hand side of the [LineEdit]. + Aligns the text on the left hand side of the [code]LineEdit[/code]. </constant> <constant name="ALIGN_CENTER" value="1" enum="Align"> - Centers the text in the middle of the [LineEdit]. + Centers the text in the middle of the [code]LineEdit[/code]. </constant> <constant name="ALIGN_RIGHT" value="2" enum="Align"> - Aligns the text on the right hand side of the [LineEdit]. + Aligns the text on the right hand side of the [code]LineEdit[/code]. </constant> <constant name="ALIGN_FILL" value="3" enum="Align"> - Stretches whitespaces to fit the [LineEdit]'s width. + Stretches whitespaces to fit the [code]LineEdit[/code]'s width. </constant> <constant name="MENU_CUT" value="0" enum="MenuItems"> - Cuts (Copies and clears) the selected text. + Cuts (copies and clears) the selected text. </constant> <constant name="MENU_COPY" value="1" enum="MenuItems"> Copies the selected text. @@ -161,10 +161,10 @@ Pastes the clipboard text over the selected text (or at the cursor's position). </constant> <constant name="MENU_CLEAR" value="3" enum="MenuItems"> - Erases the whole [Linedit] text. + Erases the whole [code]LineEdit[/code] text. </constant> <constant name="MENU_SELECT_ALL" value="4" enum="MenuItems"> - Selects the whole [Linedit] text. + Selects the whole [code]LineEdit[/code] text. </constant> <constant name="MENU_UNDO" value="5" enum="MenuItems"> Undoes the previous action. diff --git a/doc/classes/Mutex.xml b/doc/classes/Mutex.xml index 8f2751af98..718b3b04b2 100644 --- a/doc/classes/Mutex.xml +++ b/doc/classes/Mutex.xml @@ -22,7 +22,7 @@ <return type="int" enum="Error"> </return> <description> - Try locking this [code]Mutex[/code], does not block. Returns [OK] on success, [ERR_BUSY] otherwise. + Try locking this [code]Mutex[/code], does not block. Returns [code]OK[/code] on success, [code]ERR_BUSY[/code] otherwise. </description> </method> <method name="unlock"> diff --git a/doc/classes/Navigation.xml b/doc/classes/Navigation.xml index 08f22d49d3..9d830168d3 100644 --- a/doc/classes/Navigation.xml +++ b/doc/classes/Navigation.xml @@ -35,7 +35,7 @@ <argument index="0" name="to_point" type="Vector3"> </argument> <description> - Returns the owner of the [NavigationMesh] which contains the navigation point closest to the point given. This is usually a [NavigtionMeshInstance]. For meshes added via [method navmesh_add], returns the owner that was given (or [code]null[/code] if the [code]owner[/code] parameter was omitted). + Returns the owner of the [NavigationMesh] which contains the navigation point closest to the point given. This is usually a [NavigationMeshInstance]. For meshes added via [method navmesh_add], returns the owner that was given (or [code]null[/code] if the [code]owner[/code] parameter was omitted). </description> </method> <method name="get_closest_point_to_segment"> diff --git a/doc/classes/Navigation2D.xml b/doc/classes/Navigation2D.xml index 364da55f99..4982c6f87d 100644 --- a/doc/classes/Navigation2D.xml +++ b/doc/classes/Navigation2D.xml @@ -26,7 +26,7 @@ <argument index="0" name="to_point" type="Vector2"> </argument> <description> - Returns the owner of the [NavigationPolygon] which contains the navigation point closest to the point given. This is usually a [NavigtionPolygonInstance]. For polygons added via [method navpoly_add], returns the owner that was given (or [code]null[/code] if the [code]owner[/code] parameter was omitted). + Returns the owner of the [NavigationPolygon] which contains the navigation point closest to the point given. This is usually a [NavigationPolygonInstance]. For polygons added via [method navpoly_add], returns the owner that was given (or [code]null[/code] if the [code]owner[/code] parameter was omitted). </description> </method> <method name="get_simple_path"> diff --git a/doc/classes/NavigationPolygon.xml b/doc/classes/NavigationPolygon.xml index 4ede80b98c..53389d6599 100644 --- a/doc/classes/NavigationPolygon.xml +++ b/doc/classes/NavigationPolygon.xml @@ -6,22 +6,22 @@ <description> There are two ways to create polygons. Either by using the [method add_outline] method or using the [method add_polygon] method. Using [method add_outline]: - [code] + [codeblock] var polygon = NavigationPolygon.new() var outline = PoolVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)]) polygon.add_outline(outline) polygon.make_polygons_from_outlines() $NavigationPolygonInstance.navpoly = polygon - [/code] + [/codeblock] Using [method add_polygon] and indices of the vertices array. - [code] + [codeblock] var polygon = NavigationPolygon.new() var vertices = PoolVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)]) polygon.set_vertices(vertices) var indices = PoolIntArray(0, 3, 1) polygon.add_polygon(indices) $NavigationPolygonInstance.navpoly = polygon - [/code] + [/codeblock] </description> <tutorials> </tutorials> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 62c5d9b694..f6ad71b6e2 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -371,7 +371,7 @@ <argument index="0" name="dir" type="int" enum="OS.SystemDir"> </argument> <description> - Returns the actual path to commonly used folders across different platforms. Available locations are specified in [OS.SystemDir]. + Returns the actual path to commonly used folders across different platforms. Available locations are specified in [enum OS.SystemDir]. </description> </method> <method name="get_system_time_msecs" qualifiers="const"> @@ -746,7 +746,7 @@ <description> Requests the OS to open a resource with the most appropriate program. For example. [code]OS.shell_open("C:\\Users\name\Downloads")[/code] on Windows opens the file explorer at the downloads folders of the user. - [code]OS.shell_open("http://godotengine.org")[/code] opens the default web browser on the official Godot website. + [code]OS.shell_open("https://godotengine.org")[/code] opens the default web browser on the official Godot website. </description> </method> <method name="show_virtual_keyboard"> diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml index 7dea004b90..432ca4b23f 100644 --- a/doc/classes/PackedScene.xml +++ b/doc/classes/PackedScene.xml @@ -18,7 +18,7 @@ node.add_child(rigid) # change owner of rigid, but not of collision - rigid.set_owner(node) + rigid.owner = node var scene = PackedScene.new() # only node and rigid are now packed @@ -61,7 +61,7 @@ <argument index="0" name="path" type="Node"> </argument> <description> - Pack will ignore any sub-nodes not owned by given node. See [method Node.set_owner]. + Pack will ignore any sub-nodes not owned by given node. See [member Node.owner]. </description> </method> </methods> diff --git a/doc/classes/ParticlesMaterial.xml b/doc/classes/ParticlesMaterial.xml index b34272d176..89913d9e0d 100644 --- a/doc/classes/ParticlesMaterial.xml +++ b/doc/classes/ParticlesMaterial.xml @@ -6,6 +6,7 @@ <description> ParticlesMaterial defines particle properties and behavior. It is used in the [code]process_material[/code] of [Particles] and [Particles2D] emitter nodes. Some of this material's properties are applied to each particle when emitted, while others can have a [CurveTexture] applied to vary values over the lifetime of the particle. + When a randomness ratio is applied to a property it is used to scale that property by a random amount. The random ratio is used to interpolate between [code]1.0[/code] and a random number less than one, the result is multiplied by the property to obtain the randomized property. For example a random ratio of [code]0.4[/code] would scale the original property between [code]0.4-1.0[/code] of its original value. </description> <tutorials> </tutorials> @@ -15,7 +16,8 @@ </methods> <members> <member name="angle" type="float" setter="set_param" getter="get_param"> - Initial rotation applied to each particle. + Initial rotation applied to each particle, in degrees. + Only applied when [member flag_disable_z] or [member flag_rotate_y] are [code]true[/code] or the [SpatialMaterial] being used to draw the particle is using [code]BillboardMode.BILLBOARD_PARTICLES[/code]. </member> <member name="angle_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's rotation will be animated along this [CurveTexture]. @@ -24,7 +26,8 @@ Rotation randomness ratio. Default value: [code]0[/code]. </member> <member name="angular_velocity" type="float" setter="set_param" getter="get_param"> - Initial angular velocity applied to each particle. + Initial angular velocity applied to each particle. Sets the speed of rotation of the particle. + Only applied when [member flag_disable_z] or [member flag_rotate_y] are [code]true[/code] or the [SpatialMaterial] being used to draw the particle is using [code]BillboardMode.BILLBOARD_PARTICLES[/code]. </member> <member name="angular_velocity_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's angular velocity will vary along this [CurveTexture]. @@ -51,7 +54,7 @@ Animation speed randomness ratio. Default value: [code]0[/code]. </member> <member name="color" type="Color" setter="set_color" getter="get_color"> - Each particle's initial color. If the [Particle2D]'s [code]texture[/code] is defined, it will be multiplied by this color. + Each particle's initial color. If the [Particles2D]'s [code]texture[/code] is defined, it will be multiplied by this color. To have particle display color in a [SpatialMaterial] make sure to set [member SpatialMaterial.vertex_color_use_as_albedo] to [code]true[/code]. </member> <member name="color_ramp" type="Texture" setter="set_color_ramp" getter="get_color_ramp"> Each particle's color will vary along this [GradientTexture]. @@ -69,13 +72,16 @@ The box's extents if [code]emission_shape[/code] is set to [code]EMISSION_SHAPE_BOX[/code]. </member> <member name="emission_color_texture" type="Texture" setter="set_emission_color_texture" getter="get_emission_color_texture"> + Particle color will be modulated by color determined by sampling this texture at the same point as the [member emission_point_texture]. </member> <member name="emission_normal_texture" type="Texture" setter="set_emission_normal_texture" getter="get_emission_normal_texture"> + Particle velocity and rotation will be set by sampling this texture at the same point as the [member emission_point_texture]. Used only in [code]EMISSION_SHAPE_DIRECTED[/code]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. </member> <member name="emission_point_count" type="int" setter="set_emission_point_count" getter="get_emission_point_count"> The number of emission points if [code]emission_shape[/code] is set to [code]EMISSION_SHAPE_POINTS[/code] or [code]EMISSION_SHAPE_DIRECTED_POINTS[/code]. </member> <member name="emission_point_texture" type="Texture" setter="set_emission_point_texture" getter="get_emission_point_texture"> + Particles will be emitted at positions determined by sampling this texture at a random position. Used with [code]EMISSION_SHAPE_POINTS[/code] and [code]EMISSION_SHAPE_DIRECTED_POINTS[/code]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. </member> <member name="emission_shape" type="int" setter="set_emission_shape" getter="get_emission_shape" enum="ParticlesMaterial.EmissionShape"> Particles will be emitted inside this region. Use [code]EMISSION_SHAPE_*[/code] constants for values. Default value: [code]EMISSION_SHAPE_POINT[/code]. @@ -84,13 +90,16 @@ The sphere's radius if [code]emission_shape[/code] is set to [code]EMISSION_SHAPE_SPHERE[/code]. </member> <member name="flag_align_y" type="bool" setter="set_flag" getter="get_flag"> + Align y-axis of particle with the direction of its velocity. </member> <member name="flag_disable_z" type="bool" setter="set_flag" getter="get_flag"> If [code]true[/code], particles will not move on the z axis. Default value: [code]true[/code] for [Particles2D], [code]false[/code] for [Particles]. </member> <member name="flag_rotate_y" type="bool" setter="set_flag" getter="get_flag"> + If [code]true[/code], particles rotate around y-axis by [member angle]. </member> <member name="flatness" type="float" setter="set_flatness" getter="get_flatness"> + Amount of [member spread] in Y/Z plane. A value of [code]1[/code] restricts particles to X/Z plane. Default [code]0[/code]. </member> <member name="gravity" type="Vector3" setter="set_gravity" getter="get_gravity"> Gravity applied to every particle. Default value: [code](0, 98, 0)[/code]. @@ -105,13 +114,13 @@ Hue variation randomness ratio. Default value: [code]0[/code]. </member> <member name="initial_velocity" type="float" setter="set_param" getter="get_param"> - Initial velocity for each particle. + Initial velocity magnitude for each particle. Direction comes from [member spread]. </member> <member name="initial_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness"> Initial velocity randomness ratio. Default value: [code]0[/code]. </member> <member name="linear_accel" type="float" setter="set_param" getter="get_param"> - Linear acceleration applied to each particle. + Linear acceleration applied to each particle. Acceleration increases velocity magnitude each frame without affecting direction. </member> <member name="linear_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's linear acceleration will vary along this [CurveTexture]. @@ -120,7 +129,8 @@ Linear acceleration randomness ratio. Default value: [code]0[/code]. </member> <member name="orbit_velocity" type="float" setter="set_param" getter="get_param"> - Orbital velocity applied to each particle. + Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. + Only available when [member flag_disable_z] is [code]true[/code]. </member> <member name="orbit_velocity_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's orbital velocity will vary along this [CurveTexture]. @@ -129,7 +139,7 @@ Orbital velocity randomness ratio. Default value: [code]0[/code]. </member> <member name="radial_accel" type="float" setter="set_param" getter="get_param"> - Radial acceleration applied to each particle. + Radial acceleration applied to each particle. Makes particle accelerate away from origin. </member> <member name="radial_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's radial acceleration will vary along this [CurveTexture]. @@ -147,10 +157,10 @@ Scale randomness ratio. Default value: [code]0[/code]. </member> <member name="spread" type="float" setter="set_spread" getter="get_spread"> - Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. Default value: [code]45[/code]. + Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. Default value: [code]45[/code]. Applied to X/Z plane and Y/Z planes. </member> <member name="tangential_accel" type="float" setter="set_param" getter="get_param"> - Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity. + Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. </member> <member name="tangential_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's tangential acceleration will vary along this [CurveTexture]. @@ -225,8 +235,10 @@ Particles will be emitted in the volume of a box. </constant> <constant name="EMISSION_SHAPE_POINTS" value="3" enum="EmissionShape"> + Particles will be emitted at a position determined by sampling a random point on the [member emission_point_texture]. Particle color will be modulated by [member emission_color_texture]. </constant> <constant name="EMISSION_SHAPE_DIRECTED_POINTS" value="4" enum="EmissionShape"> + Particles will be emitted at a position determined by sampling a random point on the [member emission_point_texture]. Particle velocity and rotation will be set based on [member emission_normal_texture]. Particle color will be modulated by [member emission_color_texture]. </constant> </constants> </class> diff --git a/doc/classes/Physics2DDirectSpaceState.xml b/doc/classes/Physics2DDirectSpaceState.xml index 81db70f435..1bffea0c09 100644 --- a/doc/classes/Physics2DDirectSpaceState.xml +++ b/doc/classes/Physics2DDirectSpaceState.xml @@ -18,7 +18,7 @@ <argument index="0" name="shape" type="Physics2DShapeQueryParameters"> </argument> <description> - Checks how far the shape can travel toward a point. Note that both the shape and the motion are supplied through a [Physics2DShapeQueryParameters] object. The method will return an array with two floats between 0 and 1, both representing a fraction of [code]motion[/code]. The first is how far the shape can move without triggering a collision, and the second is the point at which a collision will occur. If no collision is detected, the returned array will be [1, 1]. + Checks how far the shape can travel toward a point. Note that both the shape and the motion are supplied through a [Physics2DShapeQueryParameters] object. The method will return an array with two floats between 0 and 1, both representing a fraction of [code]motion[/code]. The first is how far the shape can move without triggering a collision, and the second is the point at which a collision will occur. If no collision is detected, the returned array will be [code][1, 1][/code]. If the shape can not move, the array will be empty. </description> </method> diff --git a/doc/classes/Physics2DServer.xml b/doc/classes/Physics2DServer.xml index 84e15d3b26..cd887ff950 100644 --- a/doc/classes/Physics2DServer.xml +++ b/doc/classes/Physics2DServer.xml @@ -1128,7 +1128,7 @@ This is the constant for creating capsule shapes. A capsule shape is defined by a radius and a length. It can be used for intersections and inside/outside checks. </constant> <constant name="SHAPE_CONVEX_POLYGON" value="6" enum="ShapeType"> - This is the constant for creating convex polygon shapes. A polygon is defined by a list of points. It can be used for intersections and inside/outside checks. Unlike the method [method CollisionPolygon2D.set_polygon], polygons modified with [method shape_set_data] do not verify that the points supplied form is a convex polygon. + This is the constant for creating convex polygon shapes. A polygon is defined by a list of points. It can be used for intersections and inside/outside checks. Unlike the [member CollisionPolygon2D.polygon] property, polygons modified with [method shape_set_data] do not verify that the points supplied form is a convex polygon. </constant> <constant name="SHAPE_CONCAVE_POLYGON" value="7" enum="ShapeType"> This is the constant for creating concave polygon shapes. A polygon is defined by a list of points. It can be used for intersections checks, but not for inside/outside checks. diff --git a/doc/classes/PhysicsDirectSpaceState.xml b/doc/classes/PhysicsDirectSpaceState.xml index 350a9ed3ce..c4dc103b72 100644 --- a/doc/classes/PhysicsDirectSpaceState.xml +++ b/doc/classes/PhysicsDirectSpaceState.xml @@ -20,8 +20,8 @@ <argument index="1" name="motion" type="Vector3"> </argument> <description> - Checks whether the shape can travel to a point. The method will return an array with two floats between 0 and 1, both representing a fraction of [code]motion[/code]. The first is how far the shape can move without triggering a collision, and the second is the point at which a collision will occur. If no collision is detected, the returned array will be [1, 1]. - If the shape can not move, the returned array will be [0, 0]. + Checks whether the shape can travel to a point. The method will return an array with two floats between 0 and 1, both representing a fraction of [code]motion[/code]. The first is how far the shape can move without triggering a collision, and the second is the point at which a collision will occur. If no collision is detected, the returned array will be [code][1, 1][/code]. + If the shape can not move, the returned array will be [code][0, 0][/code]. </description> </method> <method name="collide_shape"> diff --git a/doc/classes/PhysicsServer.xml b/doc/classes/PhysicsServer.xml index 40ee06fe6c..e3ed43e7bc 100644 --- a/doc/classes/PhysicsServer.xml +++ b/doc/classes/PhysicsServer.xml @@ -773,7 +773,7 @@ <argument index="1" name="space" type="RID"> </argument> <description> - Assigns a space to the body (see [method create_space]). + Assigns a space to the body (see [method space_create]). </description> </method> <method name="body_set_state"> @@ -884,7 +884,7 @@ <argument index="0" name="process_info" type="int" enum="PhysicsServer.ProcessInfo"> </argument> <description> - Returns an Info defined by the [ProcessInfo] input given. + Returns an Info defined by the [enum PhysicsServer.ProcessInfo] input given. </description> </method> <method name="hinge_joint_get_flag" qualifiers="const"> diff --git a/doc/classes/PoolByteArray.xml b/doc/classes/PoolByteArray.xml index ae722b1053..83a138be97 100644 --- a/doc/classes/PoolByteArray.xml +++ b/doc/classes/PoolByteArray.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PoolByteArray" category="Built-In Types" version="3.1"> <brief_description> - Raw byte array. + A pooled [Array] of bytes. </brief_description> <description> - Raw byte array. Contains bytes. Optimized for memory usage, can't fragment the memory. Note that this type is passed by value and not by reference. + An [Array] specifically designed to hold bytes. Optimized for memory usage, does not fragment the memory. Note that this type is passed by value and not by reference. </description> <tutorials> </tutorials> @@ -17,7 +17,7 @@ <argument index="0" name="from" type="Array"> </argument> <description> - Create from a generic array. + Construct a new [code]PoolByteArray[/code]. Optionally, you can pass in a generic [Array] that will be converted. </description> </method> <method name="append"> @@ -40,7 +40,7 @@ <argument index="0" name="compression_mode" type="int" default="0"> </argument> <description> - Returns a new [code]PoolByteArray[/code] with the data compressed. Set the compression mode using one of [File]'s COMPRESS_* constants. + Returns a new [code]PoolByteArray[/code] with the data compressed. Set the compression mode using one of [enum File.CompressionMode]'s constants. </description> </method> <method name="decompress"> @@ -51,21 +51,21 @@ <argument index="1" name="compression_mode" type="int" default="0"> </argument> <description> - Returns a new [code]PoolByteArray[/code] with the data decompressed. Set buffer_size to the size of the uncompressed data. Set the compression mode using one of [File]'s COMPRESS_* constants. + Returns a new [code]PoolByteArray[/code] with the data decompressed. Set [code]buffer_size[/code] to the size of the uncompressed data. Set the compression mode using one of [enum File.CompressionMode]'s constants. </description> </method> <method name="get_string_from_ascii"> <return type="String"> </return> <description> - Returns a copy of the array's contents as [String]. Fast alternative to [method PoolByteArray.get_string_from_utf8] if the content is ASCII-only. Unlike the UTF-8 function this function maps every byte to a character in the array. Multibyte sequences will not be interpreted correctly. For parsing user input always use [method PoolByteArray.get_string_from_utf8]. + Returns a copy of the array's contents as [String]. Fast alternative to [method get_string_from_utf8] if the content is ASCII-only. Unlike the UTF-8 function this function maps every byte to a character in the array. Multibyte sequences will not be interpreted correctly. For parsing user input always use [method get_string_from_utf8]. </description> </method> <method name="get_string_from_utf8"> <return type="String"> </return> <description> - Returns a copy of the array's contents as [String]. Slower than [method PoolByteArray.get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. + Returns a copy of the array's contents as [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. </description> </method> <method name="insert"> @@ -76,7 +76,7 @@ <argument index="1" name="byte" type="int"> </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 (pos==size()). + Insert a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> <method name="invert"> diff --git a/doc/classes/PoolColorArray.xml b/doc/classes/PoolColorArray.xml index 021d5f5089..9fdd1090ae 100644 --- a/doc/classes/PoolColorArray.xml +++ b/doc/classes/PoolColorArray.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PoolColorArray" category="Built-In Types" version="3.1"> <brief_description> - Array of Colors + A pooled [Array] of [Color]. </brief_description> <description> - Array of Color, Contains colors. Optimized for memory usage, can't fragment the memory. Note that this type is passed by value and not by reference. + An [Array] specifically designed to hold [Color]. Optimized for memory usage, does not fragment the memory. Note that this type is passed by value and not by reference. </description> <tutorials> </tutorials> @@ -17,7 +17,7 @@ <argument index="0" name="from" type="Array"> </argument> <description> - Create from a generic array. + Construct a new [code]PoolColorArray[/code]. Optionally, you can pass in a generic [Array] that will be converted. </description> </method> <method name="append"> @@ -42,7 +42,7 @@ <argument index="1" name="color" type="Color"> </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 (pos==size()). + Insert a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> <method name="invert"> diff --git a/doc/classes/PoolIntArray.xml b/doc/classes/PoolIntArray.xml index 347dcb09f2..a8808284b5 100644 --- a/doc/classes/PoolIntArray.xml +++ b/doc/classes/PoolIntArray.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PoolIntArray" category="Built-In Types" version="3.1"> <brief_description> - Integer Array. + A pooled [Array] of integers ([int]). </brief_description> <description> - Integer Array. Contains integers. Optimized for memory usage, can't fragment the memory. Note that this type is passed by value and not by reference. + An [Array] specifically designed to hold integer values ([int]). Optimized for memory usage, does not fragment the memory. Note that this type is passed by value and not by reference. </description> <tutorials> </tutorials> @@ -17,7 +17,7 @@ <argument index="0" name="from" type="Array"> </argument> <description> - Create from a generic array. + Construct a new [code]PoolIntArray[/code]. Optionally, you can pass in a generic [Array] that will be converted. </description> </method> <method name="append"> @@ -31,7 +31,7 @@ <argument index="0" name="array" type="PoolIntArray"> </argument> <description> - Append an [code]PoolIntArray[/code] at the end of this array. + Append a [code]PoolIntArray[/code] at the end of this array. </description> </method> <method name="insert"> @@ -42,7 +42,7 @@ <argument index="1" name="integer" type="int"> </argument> <description> - Insert a new int at a given position in the array. The position must be valid, or at the end of the array (pos==size()). + Insert a new int at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> <method name="invert"> diff --git a/doc/classes/PoolRealArray.xml b/doc/classes/PoolRealArray.xml index c0c6ef8700..3eb485ce12 100644 --- a/doc/classes/PoolRealArray.xml +++ b/doc/classes/PoolRealArray.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PoolRealArray" category="Built-In Types" version="3.1"> <brief_description> - Real Array. + A pooled [Array] of reals ([float]). </brief_description> <description> - Real Array. Array of floating point values. Can only contain floats. Optimized for memory usage, can't fragment the memory. Note that this type is passed by value and not by reference. + An [Array] specifically designed to hold floating point values ([float]). Optimized for memory usage, does not fragment the memory. Note that this type is passed by value and not by reference. </description> <tutorials> </tutorials> @@ -17,7 +17,7 @@ <argument index="0" name="from" type="Array"> </argument> <description> - Create from a generic array. + Construct a new [code]PoolRealArray[/code]. Optionally, you can pass in a generic [Array] that will be converted. </description> </method> <method name="append"> @@ -31,7 +31,7 @@ <argument index="0" name="array" type="PoolRealArray"> </argument> <description> - Append an [RealArray] at the end of this array. + Append a [code]PoolRealArray[/code] at the end of this array. </description> </method> <method name="insert"> @@ -42,7 +42,7 @@ <argument index="1" name="value" type="float"> </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 (pos==size()). + Insert a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> <method name="invert"> diff --git a/doc/classes/PoolStringArray.xml b/doc/classes/PoolStringArray.xml index 8b3ac4c16a..a02c6c1bdb 100644 --- a/doc/classes/PoolStringArray.xml +++ b/doc/classes/PoolStringArray.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PoolStringArray" category="Built-In Types" version="3.1"> <brief_description> - String Array. + A pooled [Array] of [String]. </brief_description> <description> - String Array. Array of strings. Can only contain strings. Optimized for memory usage, can't fragment the memory. Note that this type is passed by value and not by reference. + An [Array] specifically designed to hold [String]. Optimized for memory usage, does not fragment the memory. Note that this type is passed by value and not by reference. </description> <tutorials> </tutorials> @@ -17,7 +17,7 @@ <argument index="0" name="from" type="Array"> </argument> <description> - Create from a generic array. + Construct a new [code]PoolStringArray[/code]. Optionally, you can pass in a generic [Array] that will be converted. </description> </method> <method name="append"> @@ -31,7 +31,7 @@ <argument index="0" name="array" type="PoolStringArray"> </argument> <description> - Append an [StringArray] at the end of this array. + Append a [code]PoolStringArray[/code] at the end of this array. </description> </method> <method name="insert"> @@ -42,7 +42,7 @@ <argument index="1" name="string" type="String"> </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 (pos==size()). + Insert a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> <method name="invert"> @@ -56,7 +56,7 @@ <argument index="0" name="delimiter" type="String"> </argument> <description> - Returns a [String] with each element of the array joined with the delimiter. + Returns a [String] with each element of the array joined with the given [code]delimiter[/code]. </description> </method> <method name="push_back"> diff --git a/doc/classes/PoolVector2Array.xml b/doc/classes/PoolVector2Array.xml index ecf8f5a6ba..39d89c2ebd 100644 --- a/doc/classes/PoolVector2Array.xml +++ b/doc/classes/PoolVector2Array.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PoolVector2Array" category="Built-In Types" version="3.1"> <brief_description> - An Array of Vector2. + A pooled [Array] of [Vector2]. </brief_description> <description> - An Array specifically designed to hold Vector2. Note that this type is passed by value and not by reference. + An [Array] specifically designed to hold [Vector2]. Optimized for memory usage, does not fragment the memory. Note that this type is passed by value and not by reference. </description> <tutorials> </tutorials> @@ -17,7 +17,7 @@ <argument index="0" name="from" type="Array"> </argument> <description> - Construct a new [code]PoolVector2Array[/code]. Optionally, you can pass in an Array that will be converted. + Construct a new [code]PoolVector2Array[/code]. Optionally, you can pass in a generic [Array] that will be converted. </description> </method> <method name="append"> @@ -31,7 +31,7 @@ <argument index="0" name="array" type="PoolVector2Array"> </argument> <description> - Append an [code]PoolVector2Array[/code] at the end of this array. + Append a [code]PoolVector2Array[/code] at the end of this array. </description> </method> <method name="insert"> @@ -42,7 +42,7 @@ <argument index="1" name="vector2" type="Vector2"> </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 (pos==size()). + Insert a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> <method name="invert"> diff --git a/doc/classes/PoolVector3Array.xml b/doc/classes/PoolVector3Array.xml index 456b54d209..3f77e737f6 100644 --- a/doc/classes/PoolVector3Array.xml +++ b/doc/classes/PoolVector3Array.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PoolVector3Array" category="Built-In Types" version="3.1"> <brief_description> - An Array of Vector3. + A pooled [Array] of [Vector3]. </brief_description> <description> - An Array specifically designed to hold Vector3. Note that this type is passed by value and not by reference. + An [Array] specifically designed to hold [Vector3]. Optimized for memory usage, does not fragment the memory. Note that this type is passed by value and not by reference. </description> <tutorials> </tutorials> @@ -17,7 +17,7 @@ <argument index="0" name="from" type="Array"> </argument> <description> - Construct a new PoolVector3Array. Optionally, you can pass in an Array that will be converted. + Construct a new [code]PoolVector3Array[/code]. Optionally, you can pass in a generic [Array] that will be converted. </description> </method> <method name="append"> @@ -31,7 +31,7 @@ <argument index="0" name="array" type="PoolVector3Array"> </argument> <description> - Append an [code]PoolVector3Array[/code] at the end of this array. + Append a [code]PoolVector3Array[/code] at the end of this array. </description> </method> <method name="insert"> @@ -42,7 +42,7 @@ <argument index="1" name="vector3" type="Vector3"> </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 (pos==size()). + Insert a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> <method name="invert"> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 1d2057eb4e..172a50d779 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -173,7 +173,7 @@ </member> <member name="application/config/custom_user_dir_name" type="String" setter="" getter=""> This user directory is used for storing persistent data ([code]user://[/code] filesystem). By default (no custom name defined), [code]user://[/code] resolves to a project-specific folder in Godot's own configuration folder (see [method OS.get_user_data_dir]). If a custom directory name is defined, this name will be used instead and appended to the system-specific user data directory (same parent folder as the Godot configuration folder documented in [method OS.get_user_data_dir]). - The [member use_custom_user_dir] setting must be enabled for this to take effect. + The [member application/config/use_custom_user_dir] setting must be enabled for this to take effect. </member> <member name="application/config/icon" type="String" setter="" getter=""> Icon used for the project, set when project loads. Exporters will use this icon when possible to. @@ -185,7 +185,7 @@ Specifies a file to override project settings. For example: [code]user://custom_settings.cfg[/code]. </member> <member name="application/config/use_custom_user_dir" type="bool" setter="" getter=""> - Allow the project to save to its own custom user dir (see [member custom_user_dir_name]). This setting only works for desktop platforms. A name must be set in the [member custom_user_dir_name] setting for this to take effect. + Allow the project to save to its own custom user dir (see [member application/config/custom_user_dir_name]). This setting only works for desktop platforms. A name must be set in the [member application/config/custom_user_dir_name] setting for this to take effect. </member> <member name="application/run/disable_stderr" type="bool" setter="" getter=""> Disable printing to stderr on exported build. diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml index 468839dfba..990dcc7a91 100644 --- a/doc/classes/Quat.xml +++ b/doc/classes/Quat.xml @@ -10,7 +10,6 @@ </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html#interpolating-with-quaternions</link> - <link>https://docs.godotengine.org/en/latest/tutorials/math/rotations.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index 1392e53f8d..45bfd16cb8 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -111,7 +111,7 @@ <argument index="1" name="by" type="float"> </argument> <description> - Returns a copy of the [code]Rect2[/code] grown a given amount of units towards the [Margin] direction. + Returns a copy of the [code]Rect2[/code] grown a given amount of units towards the [enum Margin] direction. </description> </method> <method name="has_no_area"> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index ae5e0496cb..dcfb980e21 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -118,7 +118,7 @@ <return type="void"> </return> <description> - Adds a [code][cell][/code] tag to the tag stack. Must be inside a [table] tag. See [method push_table] for details. + Adds a [code][cell][/code] tag to the tag stack. Must be inside a [code][table][/code] tag. See [method push_table] for details. </description> </method> <method name="push_color"> @@ -231,7 +231,7 @@ The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited. </member> <member name="meta_underlined" type="bool" setter="set_meta_underline" getter="is_meta_underlined"> - If [code]true[/code], the label underlines meta tags such as [url]{text}[/url]. Default value: [code]true[/code]. + If [code]true[/code], the label underlines meta tags such as [code][url]{text}[/url][/code]. Default value: [code]true[/code]. </member> <member name="override_selected_font_color" type="bool" setter="set_override_selected_font_color" getter="is_overriding_selected_font_color"> If [code]true[/code], the label uses the custom font color. Default value: [code]false[/code]. @@ -264,7 +264,7 @@ <argument index="0" name="meta" type="Nil"> </argument> <description> - Triggered when the user clicks on content between [url] tags. If the meta is defined in text, e.g. [code][url={"data"="hi"}]hi[/url][/code], then the parameter for this signal will be a [String] type. If a particular type or an object is desired, the [method push_meta] method must be used to manually insert the data into the tag stack. + Triggered when the user clicks on content between [code][url][/code] tags. If the meta is defined in text, e.g. [code][url={"data"="hi"}]hi[/url][/code], then the parameter for this signal will be a [String] type. If a particular type or an object is desired, the [method push_meta] method must be used to manually insert the data into the tag stack. </description> </signal> <signal name="meta_hover_ended"> diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml index d4e0374bed..68e78ba5d4 100644 --- a/doc/classes/RigidBody2D.xml +++ b/doc/classes/RigidBody2D.xml @@ -20,7 +20,7 @@ <argument index="0" name="state" type="Physics2DDirectBodyState"> </argument> <description> - Allows you to read and safely modify the simulation state for the object. Use this instead of [Node._physics_process] if you need to directly change the body's [code]position[/code] or other physics properties. By default, it works in addition to the usual physics behavior, but [member custom_integrator] allows you to disable the default behavior and write custom force integration for a body. + Allows you to read and safely modify the simulation state for the object. Use this instead of [method Node._physics_process] if you need to directly change the body's [code]position[/code] or other physics properties. By default, it works in addition to the usual physics behavior, but [member custom_integrator] allows you to disable the default behavior and write custom force integration for a body. </description> </method> <method name="add_central_force"> diff --git a/doc/classes/ScriptCreateDialog.xml b/doc/classes/ScriptCreateDialog.xml index ac0384e1d4..2e24a2626b 100644 --- a/doc/classes/ScriptCreateDialog.xml +++ b/doc/classes/ScriptCreateDialog.xml @@ -4,7 +4,7 @@ The Editor's popup dialog for creating new [Script] files. </brief_description> <description> - The ScriptCreateDialog creates script files according to a given template for a given scripting language. The standard use is to configure its fields prior to calling a [method popup]() method. + The [code]ScriptCreateDialog[/code] creates script files according to a given template for a given scripting language. The standard use is to configure its fields prior to calling one of the [method Popup.popup] methods. [codeblock] func _ready(): dialog.config("Node", "res://new_node.gd") # for in-engine types diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml index d310561233..0b427fc089 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 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). </description> <tutorials> </tutorials> diff --git a/doc/classes/Semaphore.xml b/doc/classes/Semaphore.xml index f3a37b78e1..5f46b949aa 100644 --- a/doc/classes/Semaphore.xml +++ b/doc/classes/Semaphore.xml @@ -15,14 +15,14 @@ <return type="int" enum="Error"> </return> <description> - Lowers the [code]Semaphore[/code], allowing one more thread in. Returns [OK] on success, [ERR_BUSY] otherwise. + Lowers the [code]Semaphore[/code], allowing one more thread in. Returns [code]OK[/code] on success, [code]ERR_BUSY[/code] otherwise. </description> </method> <method name="wait"> <return type="int" enum="Error"> </return> <description> - Tries to wait for the [code]Semaphore[/code], if its value is zero, blocks until non-zero. Returns [OK] on success, [ERR_BUSY] otherwise. + Tries to wait for the [code]Semaphore[/code], if its value is zero, blocks until non-zero. Returns [code]OK[/code] on success, [code]ERR_BUSY[/code] otherwise. </description> </method> </methods> diff --git a/doc/classes/SliderJoint.xml b/doc/classes/SliderJoint.xml index edb8e6d562..b3d59d6b75 100644 --- a/doc/classes/SliderJoint.xml +++ b/doc/classes/SliderJoint.xml @@ -4,7 +4,7 @@ Piston kind of slider between two bodies in 3D. </brief_description> <description> - Slides across the x-axis of the [Pivot] object. + Slides across the x-axis of the pivot object. </description> <tutorials> </tutorials> diff --git a/doc/classes/Spatial.xml b/doc/classes/Spatial.xml index e7dc0dcc3f..518a942cc2 100644 --- a/doc/classes/Spatial.xml +++ b/doc/classes/Spatial.xml @@ -4,8 +4,8 @@ Most basic 3D game object, parent of all 3D related nodes. </brief_description> <description> - Most basic 3D game object, with a 3D [Transform] and visibility settings. All other 3D game objects inherit from Spatial. Use Spatial as a parent node to move, scale, rotate and show/hide children in a 3D project. - Affine operations (rotate, scale, translate) happen in parent's local coordinate system, unless the Spatial object is set as top level. Affine operations in this coordinate system correspond to direct affine operations on the Spatial's transform. The word local below refers to this coordinate system. The coordinate system that is attached to the Spatial object itself is referred to as object-local coordinate system. + Most basic 3D game object, with a 3D [Transform] and visibility settings. All other 3D game objects inherit from Spatial. Use [code]Spatial[/code] as a parent node to move, scale, rotate and show/hide children in a 3D project. + Affine operations (rotate, scale, translate) happen in parent's local coordinate system, unless the [code]Spatial[/code] object is set as top level. Affine operations in this coordinate system correspond to direct affine operations on the [code]Spatial[/code]'s transform. The word local below refers to this coordinate system. The coordinate system that is attached to the [code]Spatial[/code] object itself is referred to as object-local coordinate system. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/3d/introduction_to_3d.html</link> @@ -30,7 +30,7 @@ <return type="World"> </return> <description> - Returns the current [World] resource this Spatial node is registered to. + Returns the current [World] resource this [code]Spatial[/code] node is registered to. </description> </method> <method name="global_rotate"> @@ -65,14 +65,14 @@ <return type="void"> </return> <description> - Disables rendering of this node. Change Spatial Visible property to false. + Disables rendering of this node. Changes [member visible] to [code]false[/code]. </description> </method> <method name="is_local_transform_notification_enabled" qualifiers="const"> <return type="bool"> </return> <description> - Returns whether node notifies about its local transformation changes. Spatial will not propagate this by default. + Returns whether node notifies about its local transformation changes. [code]Spatial[/code] will not propagate this by default. </description> </method> <method name="is_scale_disabled" qualifiers="const"> @@ -92,7 +92,7 @@ <return type="bool"> </return> <description> - Returns whether the node notifies about its global and local transformation changes. Spatial will not propagate this by default. + Returns whether the node notifies about its global and local transformation changes. [code]Spatial[/code] will not propagate this by default. </description> </method> <method name="is_visible_in_tree" qualifiers="const"> @@ -132,7 +132,7 @@ <return type="void"> </return> <description> - Resets this node's transformations (like scale, skew and taper) preserving its rotation and translation by performing Gram-Schmidt orthonormalization on this node's [Transform3D]. + Resets this node's transformations (like scale, skew and taper) preserving its rotation and translation by performing Gram-Schmidt orthonormalization on this node's [Transform]. </description> </method> <method name="rotate"> @@ -214,7 +214,7 @@ <return type="void"> </return> <description> - Reset all transformations for this node. Set its [Transform3D] to identity matrix. + Reset all transformations for this node. Set its [Transform] to identity matrix. </description> </method> <method name="set_ignore_transform_notification"> @@ -232,7 +232,7 @@ <argument index="0" name="enable" type="bool"> </argument> <description> - Set whether the node notifies about its local transformation changes. Spatial will not propagate this by default. + Set whether the node notifies about its local transformation changes. [code]Spatial[/code] will not propagate this by default. </description> </method> <method name="set_notify_transform"> @@ -241,14 +241,14 @@ <argument index="0" name="enable" type="bool"> </argument> <description> - Set whether the node notifies about its global and local transformation changes. Spatial will not propagate this by default. + Set whether the node notifies about its global and local transformation changes. [code]Spatial[/code] will not propagate this by default. </description> </method> <method name="show"> <return type="void"> </return> <description> - Enables rendering of this node. Change Spatial Visible property to "True". + Enables rendering of this node. Changes [member visible] to [code]true[/code]. </description> </method> <method name="to_global" qualifiers="const"> @@ -296,7 +296,7 @@ </methods> <members> <member name="gizmo" type="SpatialGizmo" setter="set_gizmo" getter="get_gizmo"> - The SpatialGizmo for this node. Used for example in [EditorSpatialGizmo] as custom visualization and editing handles in Editor. + The [SpatialGizmo] for this node. Used for example in [EditorSpatialGizmo] as custom visualization and editing handles in Editor. </member> <member name="global_transform" type="Transform" setter="set_global_transform" getter="get_global_transform"> World space (global) [Transform] of this node. @@ -331,7 +331,7 @@ <constants> <constant name="NOTIFICATION_TRANSFORM_CHANGED" value="29"> Spatial nodes receives this notification when their global transform changes. This means that either the current or a parent node changed its transform. - In order for NOTIFICATION_TRANSFORM_CHANGED to work user first needs to ask for it, with set_notify_transform(true). + In order for [code]NOTIFICATION_TRANSFORM_CHANGED[/code] to work, users first need to ask for it, with [method set_notify_transform]. </constant> <constant name="NOTIFICATION_ENTER_WORLD" value="41"> Spatial nodes receives this notification when they are registered to new [World] resource. diff --git a/doc/classes/StaticBody.xml b/doc/classes/StaticBody.xml index 442a520e30..01f5b07329 100644 --- a/doc/classes/StaticBody.xml +++ b/doc/classes/StaticBody.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="StaticBody" inherits="PhysicsBody" category="Core" version="3.1"> <brief_description> - Static body for 3D Physics. + Static body for 3D physics. </brief_description> <description> - Static body for 3D Physics. A static body is a simple body that is not intended to move. They don't consume any CPU resources in contrast to a [RigidBody3D] so they are great for scenario collision. + Static body for 3D physics. A static body is a simple body that is not intended to move. They don't consume any CPU resources in contrast to a [RigidBody] so they are great for scenario collision. A static body can also be animated by using simulated motion mode. This is useful for implementing functionalities such as moving platforms. When this mode is active the body can be animated and automatically computes linear and angular velocity to apply in that frame and to influence other bodies. Alternatively, a constant linear or angular velocity can be set for the static body, so even if it doesn't move, it affects other bodies as if it was moving (this is useful for simulating conveyor belts or conveyor wheels). </description> diff --git a/doc/classes/StreamPeerTCP.xml b/doc/classes/StreamPeerTCP.xml index 9a0fceddab..18324d9043 100644 --- a/doc/classes/StreamPeerTCP.xml +++ b/doc/classes/StreamPeerTCP.xml @@ -19,7 +19,7 @@ <argument index="1" name="port" type="int"> </argument> <description> - Connect to the specified host:port pair. A hostname will be resolved if valid. Returns [OK] on success or [FAILED] on failure. + Connect to the specified host:port pair. A hostname will be resolved if valid. Returns [code]OK[/code] on success or [code]FAILED[/code] on failure. </description> </method> <method name="disconnect_from_host"> @@ -47,14 +47,14 @@ <return type="int" enum="StreamPeerTCP.Status"> </return> <description> - Return the status of the connection, one of STATUS_* enum. + Return the status of the connection, see [enum StreamPeerTCP.Status]. </description> </method> <method name="is_connected_to_host" qualifiers="const"> <return type="bool"> </return> <description> - Returns [code]true[/code] if this peer is currently connected to a host, [code]false[code] otherwise. + Returns [code]true[/code] if this peer is currently connected to a host, [code]false[/code] otherwise. </description> </method> <method name="set_no_delay"> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index dbef84fc15..6ac47a89c2 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -459,7 +459,7 @@ <return type="bool"> </return> <description> - Returns [code]true[/code] if this string is a valid identifier. A valid identifier may contain only letters, digits and underscores (_) and the first character may not be a digit. + Returns [code]true[/code] if this string is a valid identifier. A valid identifier may contain only letters, digits and underscores ([code]_[/code]) and the first character may not be a digit. </description> </method> <method name="is_valid_integer"> @@ -514,7 +514,7 @@ <argument index="0" name="expr" type="String"> </argument> <description> - Does a simple expression match, where '*' matches zero or more arbitrary characters and '?' matches any single character except '.'. + Does a simple expression match, where [code]*[/code] matches zero or more arbitrary characters and [code]?[/code] matches any single character except '.'. </description> </method> <method name="matchn"> @@ -523,7 +523,7 @@ <argument index="0" name="expr" type="String"> </argument> <description> - Does a simple case insensitive expression match, using ? and * wildcards (see [method match]). + Does a simple case insensitive expression match, using [code]?[/code] and [code]*[/code] wildcards (see [method match]). </description> </method> <method name="md5_buffer"> @@ -663,7 +663,7 @@ </argument> <description> Splits the string by a [code]divisor[/code] string and returns an array of the substrings, starting from right. - [b]Example:[/b] "One,Two,Three" will return ["One","Two","Three"] if split by ",". + [b]Example:[/b] [code]"One,Two,Three"[/code] will return [code]["One","Two","Three"][/code] if split by [code]","[/code]. If [code]maxsplit[/code] is specified, then it is number of splits to do, default is 0 which splits all the items. </description> </method> @@ -710,7 +710,7 @@ </argument> <description> Splits the string by a divisor string and returns an array of the substrings. - [b]Example:[/b] "One,Two,Three" will return ["One","Two","Three"] if split by ",". + [b]Example:[/b] [code]"One,Two,Three"[/code] will return [code]["One","Two","Three"][/code] if split by [code]","[/code]. If [code]maxsplit[/code] is given, at most maxsplit number of splits occur, and the remainder of the string is returned as the final element of the list (thus, the list will have at most maxsplit+1 elements) </description> </method> @@ -723,7 +723,7 @@ </argument> <description> Splits the string in floats by using a divisor string and returns an array of the substrings. - [b]Example:[/b] "1,2.5,3" will return [1,2.5,3] if split by ",". + [b]Example:[/b] [code]"1,2.5,3"[/code] will return [code][1,2.5,3][/code] if split by [code]","[/code]. </description> </method> <method name="strip_edges"> @@ -752,7 +752,7 @@ <return type="PoolByteArray"> </return> <description> - Converts the String (which is a character array) to [PoolByteArray] (which is an array of bytes). The conversion is sped up in comparison to to_utf8() with the assumption that all the characters the String contains are only ASCII characters. + Converts the String (which is a character array) to [PoolByteArray] (which is an array of bytes). The conversion is sped up in comparison to [method to_utf8] with the assumption that all the characters the String contains are only ASCII characters. </description> </method> <method name="to_float"> @@ -787,7 +787,7 @@ <return type="PoolByteArray"> </return> <description> - Converts the String (which is an array of characters) to [PoolByteArray] (which is an array of bytes). The conversion is a bit slower than to_ascii(), but supports all UTF-8 characters. Therefore, you should prefer this function over to_ascii(). + Converts the String (which is an array of characters) to [PoolByteArray] (which is an array of bytes). The conversion is a bit slower than [method to_ascii], but supports all UTF-8 characters. Therefore, you should prefer this function over [method to_ascii]. </description> </method> <method name="trim_prefix"> diff --git a/doc/classes/TextureButton.xml b/doc/classes/TextureButton.xml index f61db22138..b25c69c680 100644 --- a/doc/classes/TextureButton.xml +++ b/doc/classes/TextureButton.xml @@ -21,7 +21,7 @@ Controls the texture's behavior when you resize the node's bounding rectangle, [b]only if[/b] [member expand] is [code]true[/code]. Set it to one of the [code]STRETCH_*[/code] constants. See the constants to learn more. </member> <member name="texture_click_mask" type="BitMap" setter="set_click_mask" getter="get_click_mask"> - Pure black and white [Bitmap] image to use for click detection. On the mask, white pixels represent the button's clickable area. Use it to create buttons with curved shapes. + Pure black and white [BitMap] image to use for click detection. On the mask, white pixels represent the button's clickable area. Use it to create buttons with curved shapes. </member> <member name="texture_disabled" type="Texture" setter="set_disabled_texture" getter="get_disabled_texture"> Texture to display when the node is disabled. See [member BaseButton.disabled]. diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index fadc6fbcb9..9e31f7e1b1 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -46,7 +46,7 @@ </description> </method> <method name="autotile_get_bitmask"> - <return type="int" enum="TileSet.AutotileBindings"> + <return type="int"> </return> <argument index="0" name="id" type="int"> </argument> @@ -146,7 +146,7 @@ </argument> <argument index="1" name="bitmask" type="Vector2"> </argument> - <argument index="2" name="flag" type="int" enum="TileSet.AutotileBindings"> + <argument index="2" name="flag" type="int"> </argument> <description> Sets the bitmask of the subtile from an autotile given its coordinates. diff --git a/doc/classes/ToolButton.xml b/doc/classes/ToolButton.xml index d8db95a854..b52e1d39dc 100644 --- a/doc/classes/ToolButton.xml +++ b/doc/classes/ToolButton.xml @@ -4,10 +4,10 @@ Flat button helper class. </brief_description> <description> - This is a helper class to generate a flat [Button] (see [method Button.set_flat]), creating a ToolButton is equivalent to: + This is a helper class to generate a flat [Button] (see [member Button.flat]), creating a [code]ToolButton[/code] is equivalent to: [codeblock] var btn = Button.new() - btn.set_flat(true) + btn.flat = true [/codeblock] </description> <tutorials> diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index b902821fb2..c3af586b21 100644 --- a/doc/classes/Tween.xml +++ b/doc/classes/Tween.xml @@ -340,7 +340,7 @@ </methods> <members> <member name="playback_process_mode" type="int" setter="set_tween_process_mode" getter="get_tween_process_mode" enum="Tween.TweenProcessMode"> - The tween's animation process thread. See [enum TweenProcessMode]. Default value: [enum TWEEN_PROCESS_IDLE]. + The tween's animation process thread. See [enum TweenProcessMode]. Default value: [constant TWEEN_PROCESS_IDLE]. </member> <member name="playback_speed" type="float" setter="set_speed_scale" getter="get_speed_scale"> The tween's speed multiplier. For example, set it to [code]1.0[/code] for normal speed, [code]2.0[/code] for two times normal speed, or [code]0.5[/code] for half of the normal speed. A value of [code]0[/code] pauses the animation, but see also [method set_active] or [method stop_all] for this. diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 006a843c32..1770dec80d 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -164,7 +164,7 @@ <return type="float"> </return> <description> - Returns the vector's length squared. Prefer this function over [member length] if you need to sort vectors or need the squared length for some formula. + Returns the vector's length squared. Prefer this method over [method length] if you need to sort vectors or need the squared length for some formula. </description> </method> <method name="linear_interpolate"> diff --git a/doc/classes/VehicleBody.xml b/doc/classes/VehicleBody.xml index 3ce0cadde9..53a47ec7d6 100644 --- a/doc/classes/VehicleBody.xml +++ b/doc/classes/VehicleBody.xml @@ -18,11 +18,11 @@ Slows down the vehicle by applying a braking force. The vehicle is only slowed down if the wheels are in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the [member RigidBody.mass] of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking. </member> <member name="engine_force" type="float" setter="set_engine_force" getter="get_engine_force"> - Accelerates the vehicle by applying an engine force. The vehicle is only speed up if the wheels that have [member VehicleWheel.set_use_as_traction] set to true and are in contact with a surface. The [member RigidBody.mass] of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration. Note that the simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears. + Accelerates the vehicle by applying an engine force. The vehicle is only speed up if the wheels that have [member VehicleWheel.use_as_traction] set to true and are in contact with a surface. The [member RigidBody.mass] of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration. Note that the simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears. A negative value will result in the vehicle reversing. </member> <member name="steering" type="float" setter="set_steering" getter="get_steering"> - The steering angle for the vehicle. Setting this to a non-zero value will result in the vehicle turning when it's moving. Wheels that have [member VehicleWheel.set_use_as_steering] set to true will automatically be rotated. + The steering angle for the vehicle. Setting this to a non-zero value will result in the vehicle turning when it's moving. Wheels that have [member VehicleWheel.use_as_steering] set to true will automatically be rotated. </member> </members> <constants> diff --git a/doc/classes/VisualServer.xml b/doc/classes/VisualServer.xml index 62dfb73b2d..26a6bae48c 100644 --- a/doc/classes/VisualServer.xml +++ b/doc/classes/VisualServer.xml @@ -3660,7 +3660,7 @@ <argument index="1" name="clear_mode" type="int" enum="VisualServer.ViewportClearMode"> </argument> <description> - Sets the clear mode of a viewport. See VIEWPORT_CLEAR_MODE_* constants for options. + Sets the clear mode of a viewport. See [enum VisualServer.ViewportClearMode] for options. </description> </method> <method name="viewport_set_debug_draw"> @@ -3671,7 +3671,7 @@ <argument index="1" name="draw" type="int" enum="VisualServer.ViewportDebugDraw"> </argument> <description> - Sets the debug draw mode of a viewport. See VIEWPORT_DEBUG_DRAW_* constants for options. + Sets the debug draw mode of a viewport. See [enum VisualServer.ViewportDebugDraw] for options. </description> </method> <method name="viewport_set_disable_3d"> @@ -4160,7 +4160,7 @@ The viewport is never cleared before drawing. </constant> <constant name="VIEWPORT_CLEAR_ONLY_NEXT_FRAME" value="2" enum="ViewportClearMode"> - The viewport is cleared once, then the clear mode is set to [VIEWPORT_CLEAR_NEVER]. + The viewport is cleared once, then the clear mode is set to [code]VIEWPORT_CLEAR_NEVER[/code]. </constant> <constant name="VIEWPORT_MSAA_DISABLED" value="0" enum="ViewportMSAA"> Multisample antialiasing is disabled. @@ -4353,6 +4353,12 @@ </constant> <constant name="MULTIMESH_COLOR_FLOAT" value="2" enum="MultimeshColorFormat"> </constant> + <constant name="MULTIMESH_CUSTOM_DATA_NONE" value="0" enum="MultimeshCustomDataFormat"> + </constant> + <constant name="MULTIMESH_CUSTOM_DATA_8BIT" value="1" enum="MultimeshCustomDataFormat"> + </constant> + <constant name="MULTIMESH_CUSTOM_DATA_FLOAT" value="2" enum="MultimeshCustomDataFormat"> + </constant> <constant name="REFLECTION_PROBE_UPDATE_ONCE" value="0" enum="ReflectionProbeUpdateMode"> </constant> <constant name="REFLECTION_PROBE_UPDATE_ALWAYS" value="1" enum="ReflectionProbeUpdateMode"> diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 25edd49ba5..22c0b5d1fd 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -1,47 +1,295 @@ #!/usr/bin/env python3 +import argparse import sys import os import re import xml.etree.ElementTree as ET -from collections import defaultdict +from collections import defaultdict, OrderedDict # Uncomment to do type checks. I have it commented out so it works below Python 3.5 -#from typing import List, Dict, TextIO, Tuple, Iterable, Optional, DefaultDict - -input_list = [] # type: List[str] -current_reading_class = "" -class_names = [] # type: List[str] -classes = {} # type: Dict[str, ET.Element] +#from typing import List, Dict, TextIO, Tuple, Iterable, Optional, DefaultDict, Any, Union # http(s)://docs.godotengine.org/<langcode>/<tag>/path/to/page.html(#fragment-tag) GODOT_DOCS_PATTERN = re.compile(r'^http(?:s)?://docs\.godotengine\.org/(?:[a-zA-Z0-9.\-_]*)/(?:[a-zA-Z0-9.\-_]*)/(.*)\.html(#.*)?$') -def main(): # type: () -> None - global current_reading_class - for arg in sys.argv[1:]: - if arg.endswith(os.sep): - arg = arg[:-1] - input_list.append(arg) +def print_error(error, state): # type: (str, State) -> None + print(error) + state.errored = True + + +class TypeName: + def __init__(self, type_name, enum=None): # type: (str, Optional[str]) -> None + self.type_name = type_name + self.enum = enum + + def to_rst(self, state): # type: ("State") -> str + if self.enum is not None: + return make_enum(self.enum, state) + elif self.type_name == "void": + return "void" + else: + return make_type(self.type_name, state) + + @classmethod + def from_element(cls, element): # type: (ET.Element) -> "TypeName" + return cls(element.attrib["type"], element.get("enum")) + + +class PropertyDef: + def __init__(self, name, type_name, setter, getter, text): # type: (str, TypeName, Optional[str], Optional[str], Optional[str]) -> None + self.name = name + self.type_name = type_name + self.setter = setter + self.getter = getter + self.text = text + +class ParameterDef: + def __init__(self, name, type_name, default_value): # type: (str, TypeName, Optional[str]) -> None + self.name = name + self.type_name = type_name + self.default_value = default_value + + +class SignalDef: + def __init__(self, name, parameters, description): # type: (str, List[ParameterDef], Optional[str]) -> None + self.name = name + self.parameters = parameters + self.description = description + + +class MethodDef: + def __init__(self, name, return_type, parameters, description, qualifiers): # type: (str, TypeName, List[ParameterDef], Optional[str], Optional[str]) -> None + self.name = name + self.return_type = return_type + self.parameters = parameters + self.description = description + self.qualifiers = qualifiers + + +class ConstantDef: + def __init__(self, name, value, text): # type: (str, str, Optional[str]) -> None + self.name = name + self.value = value + self.text = text + + +class EnumDef: + def __init__(self, name): # type: (str) -> None + self.name = name + self.values = OrderedDict() # type: OrderedDict[str, ConstantDef] + + +class ThemeItemDef: + def __init__(self, name, type_name): # type: (str, TypeName) -> None + self.name = name + self.type_name = type_name + + +class ClassDef: + def __init__(self, name): # type: (str) -> None + self.name = name + self.constants = OrderedDict() # type: OrderedDict[str, ConstantDef] + self.enums = OrderedDict() # type: OrderedDict[str, EnumDef] + self.properties = OrderedDict() # type: OrderedDict[str, PropertyDef] + self.methods = OrderedDict() # type: OrderedDict[str, List[MethodDef]] + self.signals = OrderedDict() # type: OrderedDict[str, SignalDef] + self.inherits = None # type: Optional[str] + self.category = None # type: Optional[str] + self.brief_description = None # type: Optional[str] + self.description = None # type: Optional[str] + self.theme_items = None # type: Optional[OrderedDict[str, List[ThemeItemDef]]] + self.tutorials = [] # type: List[str] + + +class State: + def __init__(self): # type: () -> None + # Has any error been reported? + self.errored = False + self.classes = OrderedDict() # type: OrderedDict[str, ClassDef] + self.current_class = "" # type: str + + def parse_class(self, class_root): # type: (ET.Element) -> None + class_name = class_root.attrib["name"] + + class_def = ClassDef(class_name) + self.classes[class_name] = class_def + + inherits = class_root.get("inherits") + if inherits is not None: + class_def.inherits = inherits + + category = class_root.get("category") + if category is not None: + class_def.category = category + + brief_desc = class_root.find("brief_description") + if brief_desc is not None and brief_desc.text: + class_def.brief_description = brief_desc.text + + desc = class_root.find("description") + if desc is not None and desc.text: + class_def.description = desc.text + + properties = class_root.find("members") + if properties is not None: + for property in properties: + assert property.tag == "member" + + property_name = property.attrib["name"] + if property_name in class_def.properties: + print_error("Duplicate property '{}', file: {}".format(property_name, class_name), self) + continue + + type_name = TypeName.from_element(property) + setter = property.get("setter") or None # Use or None so '' gets turned into None. + getter = property.get("getter") or None + + property_def = PropertyDef(property_name, type_name, setter, getter, property.text) + class_def.properties[property_name] = property_def + + methods = class_root.find("methods") + if methods is not None: + for method in methods: + assert method.tag == "method" + + method_name = method.attrib["name"] + qualifiers = method.get("qualifiers") + + return_element = method.find("return") + if return_element is not None: + return_type = TypeName.from_element(return_element) + + else: + return_type = TypeName("void") + + params = parse_arguments(method) + + desc_element = method.find("description") + method_desc = None + if desc_element is not None: + method_desc = desc_element.text + + method_def = MethodDef(method_name, return_type, params, method_desc, qualifiers) + if method_name not in class_def.methods: + class_def.methods[method_name] = [] + + class_def.methods[method_name].append(method_def) + + constants = class_root.find("constants") + if constants is not None: + for constant in constants: + assert constant.tag == "constant" + + constant_name = constant.attrib["name"] + value = constant.attrib["value"] + enum = constant.get("enum") + constant_def = ConstantDef(constant_name, value, constant.text) + if enum is None: + if constant_name in class_def.constants: + print_error("Duplicate constant '{}', file: {}".format(constant_name, class_name), self) + continue - if len(input_list) < 1: - print('usage: makerst.py <path to folders> and/or <path to .xml files> (order of arguments irrelevant)') - print('example: makerst.py "../../modules/" "../classes" path_to/some_class.xml') - sys.exit(1) + class_def.constants[constant_name] = constant_def + + else: + if enum in class_def.enums: + enum_def = class_def.enums[enum] + + else: + enum_def = EnumDef(enum) + class_def.enums[enum] = enum_def + + enum_def.values[constant_name] = constant_def + + signals = class_root.find("signals") + if signals is not None: + for signal in signals: + assert signal.tag == "signal" + + signal_name = signal.attrib["name"] + + if signal_name in class_def.signals: + print_error("Duplicate signal '{}', file: {}".format(signal_name, class_name), self) + continue + + params = parse_arguments(signal) + + desc_element = signal.find("description") + signal_desc = None + if desc_element is not None: + signal_desc = desc_element.text + + signal_def = SignalDef(signal_name, params, signal_desc) + class_def.signals[signal_name] = signal_def + + theme_items = class_root.find("theme_items") + if theme_items is not None: + class_def.theme_items = OrderedDict() + for theme_item in theme_items: + assert theme_item.tag == "theme_item" + + theme_item_name = theme_item.attrib["name"] + theme_item_def = ThemeItemDef(theme_item_name, TypeName.from_element(theme_item)) + if theme_item_name not in class_def.theme_items: + class_def.theme_items[theme_item_name] = [] + class_def.theme_items[theme_item_name].append(theme_item_def) + + tutorials = class_root.find("tutorials") + if tutorials is not None: + for link in tutorials: + assert link.tag == "link" + + if link.text is not None: + class_def.tutorials.append(link.text) + + + + def sort_classes(self): # type: () -> None + self.classes = OrderedDict(sorted(self.classes.items(), key=lambda t: t[0])) + + +def parse_arguments(root): # type: (ET.Element) -> List[ParameterDef] + param_elements = root.findall("argument") + params = [None] * len(param_elements) # type: Any + for param_element in param_elements: + param_name = param_element.attrib["name"] + index = int(param_element.attrib["index"]) + type_name = TypeName.from_element(param_element) + default = param_element.get("default") + + params[index] = ParameterDef(param_name, type_name, default) + + cast = params # type: List[ParameterDef] + + return cast + + +def main(): # type: () -> None + parser = argparse.ArgumentParser() + parser.add_argument("path", nargs="+", help="A path to an XML file or a directory containing XML files to parse.") + group = parser.add_mutually_exclusive_group() + group.add_argument("--output", "-o", default=".", help="The directory to save output .rst files in.") + group.add_argument("--dry-run", action="store_true", help="If passed, no output will be generated and XML files are only checked for errors.") + args = parser.parse_args() file_list = [] # type: List[str] - for path in input_list: + for path in args.path: + # Cut off trailing slashes so os.path.basename doesn't choke. + if path.endswith(os.sep): + path = path[:-1] + if os.path.basename(path) == 'modules': for subdir, dirs, _ in os.walk(path): if 'doc_classes' in dirs: doc_dir = os.path.join(subdir, 'doc_classes') - class_file_names = [f for f in os.listdir(doc_dir) if f.endswith('.xml')] - file_list += [os.path.join(doc_dir, f) for f in class_file_names] + class_file_names = (f for f in os.listdir(doc_dir) if f.endswith('.xml')) + file_list += (os.path.join(doc_dir, f) for f in class_file_names) elif os.path.isdir(path): - file_list += [os.path.join(path, f) for f in os.listdir(path) if f.endswith('.xml')] + file_list += (os.path.join(path, f) for f in os.listdir(path) if f.endswith('.xml')) elif os.path.isfile(path): if not path.endswith(".xml"): @@ -50,34 +298,242 @@ def main(): # type: () -> None file_list.append(path) + classes = {} # type: Dict[str, ET.Element] + state = State() for cur_file in file_list: try: tree = ET.parse(cur_file) except ET.ParseError as e: - print("Parse error reading file '{}': {}".format(cur_file, e)) - sys.exit(1) + print_error("Parse error reading file '{}': {}".format(cur_file, e), state) + continue doc = tree.getroot() if 'version' not in doc.attrib: - print("Version missing from 'doc'") - sys.exit(255) + print_error("Version missing from 'doc', file: {}".format(cur_file), state) + continue name = doc.attrib["name"] if name in classes: + print_error("Duplicate class '{}'".format(name), state) continue - class_names.append(name) classes[name] = doc - class_names.sort() + for name, data in classes.items(): + try: + state.parse_class(data) + except Exception as e: + print_error("Exception while parsing class '{}': {}".format(name, e), state) + + state.sort_classes() + + for class_name, class_def in state.classes.items(): + state.current_class = class_name + make_rst_class(class_def, state, args.dry_run, args.output) + + if state.errored: + exit(1) + +def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, State, bool, str) -> None + class_name = class_def.name + + if dry_run: + f = open(os.devnull, "w") + else: + f = open(os.path.join(output_dir, "class_" + class_name.lower() + '.rst'), 'w', encoding='utf-8') + + # Warn contributors not to edit this file directly + f.write(".. Generated automatically by doc/tools/makerst.py in Godot's source tree.\n") + f.write(".. DO NOT EDIT THIS FILE, but the " + class_name + ".xml source instead.\n") + f.write(".. The source is found in doc/classes or modules/<name>/doc_classes.\n\n") + + f.write(".. _class_" + class_name + ":\n\n") + f.write(make_heading(class_name, '=')) + + # Inheritance tree + # Ascendants + if class_def.inherits: + inh = class_def.inherits.strip() + f.write('**Inherits:** ') + first = True + while inh in state.classes: + if not first: + f.write(" **<** ") + else: + first = False + + f.write(make_type(inh, state)) + inode = state.classes[inh].inherits + if inode: + inh = inode.strip() + else: + break + f.write("\n\n") + + # Descendents + inherited = [] + for c in state.classes.values(): + if c.inherits and c.inherits.strip() == class_name: + inherited.append(c.name) + + if len(inherited): + f.write('**Inherited By:** ') + for i, child in enumerate(inherited): + if i > 0: + f.write(", ") + f.write(make_type(child, state)) + f.write("\n\n") + + # Category + if class_def.category is not None: + f.write('**Category:** ' + class_def.category.strip() + "\n\n") + + # Brief description + f.write(make_heading('Brief Description', '-')) + if class_def.brief_description is not None: + f.write(rstize_text(class_def.brief_description.strip(), state) + "\n\n") + + # Properties overview + if len(class_def.properties) > 0: + f.write(make_heading('Properties', '-')) + ml = [] # type: List[Tuple[str, str]] + for property_def in class_def.properties.values(): + type_rst = property_def.type_name.to_rst(state) + ref = ":ref:`{0}<class_{1}_property_{0}>`".format(property_def.name, class_name) + ml.append((type_rst, ref)) + format_table(f, ml) + + # Methods overview + if len(class_def.methods) > 0: + f.write(make_heading('Methods', '-')) + ml = [] + for method_list in class_def.methods.values(): + for m in method_list: + ml.append(make_method_signature(class_def, m, True, state)) + format_table(f, ml) + + # Theme properties + if class_def.theme_items is not None and len(class_def.theme_items) > 0: + f.write(make_heading('Theme Properties', '-')) + ml = [] + for theme_item_list in class_def.theme_items.values(): + for theme_item in theme_item_list: + ml.append((theme_item.type_name.to_rst(state), theme_item.name)) + format_table(f, ml) - # Don't make class list for Sphinx, :toctree: handles it - # make_class_list(class_names, 2) + # Signals + if len(class_def.signals) > 0: + f.write(make_heading('Signals', '-')) + for signal in class_def.signals.values(): + #f.write(".. _class_{}_{}:\n\n".format(class_name, signal.name)) + f.write(".. _class_{}_signal_{}:\n\n".format(class_name, signal.name)) + _, signature = make_method_signature(class_def, signal, False, state) + f.write("- {}\n\n".format(signature)) - for c in class_names: - current_reading_class = c - make_rst_class(classes[c]) + if signal.description is None or signal.description.strip() == '': + continue + f.write(rstize_text(signal.description.strip(), state)) + f.write("\n\n") + + # Enums + if len(class_def.enums) > 0: + f.write(make_heading('Enumerations', '-')) + for e in class_def.enums.values(): + f.write(".. _enum_{}_{}:\n\n".format(class_name, e.name)) + # Sphinx seems to divide the bullet list into individual <ul> tags if we weave the labels into it. + # As such I'll put them all above the list. Won't be perfect but better than making the list visually broken. + # As to why I'm not modifying the reference parser to directly link to the _enum label: + # If somebody gets annoyed enough to fix it, all existing references will magically improve. + for value in e.values.values(): + f.write(".. _class_{}_constant_{}:\n\n".format(class_name, value.name)) + + f.write("enum **{}**:\n\n".format(e.name)) + for value in e.values.values(): + f.write("- **{}** = **{}**".format(value.name, value.value)) + if value.text is not None and value.text.strip() != '': + f.write(' --- ' + rstize_text(value.text.strip(), state)) + f.write('\n\n') + + # Constants + if len(class_def.constants) > 0: + f.write(make_heading('Constants', '-')) + # Sphinx seems to divide the bullet list into individual <ul> tags if we weave the labels into it. + # As such I'll put them all above the list. Won't be perfect but better than making the list visually broken. + for constant in class_def.constants.values(): + f.write(".. _class_{}_constant_{}:\n\n".format(class_name, constant.name)) + + for constant in class_def.constants.values(): + f.write("- **{}** = **{}**".format(constant.name, constant.value)) + if constant.text is not None and constant.text.strip() != '': + f.write(' --- ' + rstize_text(constant.text.strip(), state)) + f.write('\n\n') + + # Class description + if class_def.description is not None and class_def.description.strip() != '': + f.write(make_heading('Description', '-')) + f.write(rstize_text(class_def.description.strip(), state) + "\n\n") + + # Online tutorials + if len(class_def.tutorials) > 0: + f.write(make_heading('Tutorials', '-')) + for t in class_def.tutorials: + link = t.strip() + match = GODOT_DOCS_PATTERN.search(link) + if match: + groups = match.groups() + if match.lastindex == 2: + # Doc reference with fragment identifier: emit direct link to section with reference to page, for example: + # `#calling-javascript-from-script in Exporting For Web` + f.write("- `" + groups[1] + " <../" + groups[0] + ".html" + groups[1] + ">`_ in :doc:`../" + groups[0] + "`\n\n") + # Commented out alternative: Instead just emit: + # `Subsection in Exporting For Web` + # f.write("- `Subsection <../" + groups[0] + ".html" + groups[1] + ">`_ in :doc:`../" + groups[0] + "`\n\n") + elif match.lastindex == 1: + # Doc reference, for example: + # `Math` + f.write("- :doc:`../" + groups[0] + "`\n\n") + else: + # External link, for example: + # `http://enet.bespin.org/usergroup0.html` + f.write("- `" + link + " <" + link + ">`_\n\n") + + # Property descriptions + if len(class_def.properties) > 0: + f.write(make_heading('Property Descriptions', '-')) + for property_def in class_def.properties.values(): + #f.write(".. _class_{}_{}:\n\n".format(class_name, property_def.name)) + f.write(".. _class_{}_property_{}:\n\n".format(class_name, property_def.name)) + f.write('- {} **{}**\n\n'.format(property_def.type_name.to_rst(state), property_def.name)) + + setget = [] + if property_def.setter is not None and not property_def.setter.startswith("_"): + setget.append(("*Setter*", property_def.setter + '(value)')) + if property_def.getter is not None and not property_def.getter.startswith("_"): + setget.append(('*Getter*', property_def.getter + '()')) + + if len(setget) > 0: + format_table(f, setget) + + if property_def.text is not None and property_def.text.strip() != '': + f.write(rstize_text(property_def.text.strip(), state)) + f.write('\n\n') + + # Method descriptions + if len(class_def.methods) > 0: + f.write(make_heading('Method Descriptions', '-')) + for method_list in class_def.methods.values(): + for i, m in enumerate(method_list): + if i == 0: + #f.write(".. _class_{}_{}:\n\n".format(class_name, m.name)) + f.write(".. _class_{}_method_{}:\n\n".format(class_name, m.name)) + ret_type, signature = make_method_signature(class_def, m, False, state) + f.write("- {} {}\n\n".format(ret_type, signature)) + + if m.description is None or m.description.strip() == '': + continue + f.write(rstize_text(m.description.strip(), state)) + f.write("\n\n") def make_class_list(class_list, columns): # type: (List[str], int) -> None @@ -93,7 +549,7 @@ def make_class_list(class_list, columns): # type: (List[str], int) -> None indexers = [] # type List[str] last_initial = '' - for (idx, name) in enumerate(class_list): + for idx, name in enumerate(class_list): col = idx // col_max if col >= columns: col = columns - 1 @@ -145,7 +601,7 @@ def make_class_list(class_list, columns): # type: (List[str], int) -> None f.close() -def rstize_text(text, cclass): # type: (str, str) -> str +def rstize_text(text, state): # type: (str, State) -> str # Linebreak + tabs in the XML should become two line breaks unless in a "codeblock" pos = 0 while True: @@ -162,7 +618,8 @@ def rstize_text(text, cclass): # type: (str, str) -> str if post_text.startswith("[codeblock]"): end_pos = post_text.find("[/codeblock]") if end_pos == -1: - sys.exit("ERROR! [codeblock] without a closing tag!") + print_error("[codeblock] without a closing tag, file: {}".format(state.current_class), state) + return "" code_text = post_text[len("[codeblock]"):end_pos] post_text = post_text[end_pos:] @@ -228,6 +685,7 @@ def rstize_text(text, cclass): # type: (str, str) -> str # Handle [tags] inside_code = False pos = 0 + tag_depth = 0 while True: pos = text.find('[', pos) if pos == -1: @@ -243,20 +701,22 @@ def rstize_text(text, cclass): # type: (str, str) -> str escape_post = False - if tag_text in classes: - tag_text = make_type(tag_text) + if tag_text in state.classes: + tag_text = make_type(tag_text, state) escape_post = True else: # command cmd = tag_text space_pos = tag_text.find(' ') if cmd == '/codeblock': tag_text = '' + tag_depth -= 1 inside_code = False # Strip newline if the tag was alone on one if pre_text[-1] == '\n': pre_text = pre_text[:-1] elif cmd == '/code': tag_text = '``' + tag_depth -= 1 inside_code = False escape_post = True elif inside_code: @@ -264,30 +724,77 @@ def rstize_text(text, cclass): # type: (str, str) -> str elif cmd.find('html') == 0: param = tag_text[space_pos + 1:] tag_text = param - elif cmd.find('method') == 0 or cmd.find('member') == 0 or cmd.find('signal') == 0: + elif cmd.startswith('method') or cmd.startswith('member') or cmd.startswith('signal') or cmd.startswith('constant'): param = tag_text[space_pos + 1:] if param.find('.') != -1: ss = param.split('.') if len(ss) > 2: - sys.exit("Bad reference: '" + param + "' in class: " + current_reading_class) - (class_param, method_param) = ss - tag_text = ':ref:`' + class_param + '.' + method_param + '<class_' + class_param + '_' + method_param + '>`' + print_error("Bad reference: '{}', file: {}".format(param, state.current_class), state) + class_param, method_param = ss + + else: + class_param = state.current_class + method_param = param + + ref_type = "" + if class_param in state.classes: + class_def = state.classes[class_param] + if cmd.startswith("method"): + if method_param not in class_def.methods: + print_error("Unresolved method '{}', file: {}".format(param, state.current_class), state) + ref_type = "_method" + + elif cmd.startswith("member"): + if method_param not in class_def.properties: + print_error("Unresolved member '{}', file: {}".format(param, state.current_class), state) + ref_type = "_property" + + elif cmd.startswith("signal"): + if method_param not in class_def.signals: + print_error("Unresolved signal '{}', file: {}".format(param, state.current_class), state) + ref_type = "_signal" + + elif cmd.startswith("constant"): + found = False + if method_param in class_def.constants: + found = True + + else: + for enum in class_def.enums.values(): + if method_param in enum.values: + found = True + break + + if not found: + print_error("Unresolved constant '{}', file: {}".format(param, state.current_class), state) + ref_type = "_constant" + else: - tag_text = ':ref:`' + param + '<class_' + cclass + "_" + param + '>`' + print_error("Unresolved type reference '{}' in method reference '{}', file: {}".format(class_param, param, state.current_class), state) + + repl_text = method_param + if class_param != state.current_class: + repl_text = "{}.{}".format(class_param, method_param) + tag_text = ':ref:`{}<class_{}{}_{}>`'.format(repl_text, class_param, ref_type, method_param) escape_post = True elif cmd.find('image=') == 0: tag_text = "" # '' elif cmd.find('url=') == 0: tag_text = ':ref:`' + cmd[4:] + '<' + cmd[4:] + ">`" + tag_depth += 1 elif cmd == '/url': tag_text = '' + tag_depth -= 1 escape_post = True elif cmd == 'center': + tag_depth += 1 tag_text = '' elif cmd == '/center': + tag_depth -= 1 tag_text = '' elif cmd == 'codeblock': + tag_depth += 1 tag_text = '\n::\n' inside_code = True elif cmd == 'br': @@ -297,18 +804,31 @@ def rstize_text(text, cclass): # type: (str, str) -> str while post_text[0] == ' ': post_text = post_text[1:] elif cmd == 'i' or cmd == '/i': + if cmd == "/i": + tag_depth -= 1 + else: + tag_depth += 1 tag_text = '*' elif cmd == 'b' or cmd == '/b': + if cmd == "/b": + tag_depth -= 1 + else: + tag_depth += 1 tag_text = '**' elif cmd == 'u' or cmd == '/u': + if cmd == "/u": + tag_depth -= 1 + else: + tag_depth += 1 tag_text = '' elif cmd == 'code': tag_text = '``' + tag_depth += 1 inside_code = True elif cmd.startswith('enum '): - tag_text = make_enum(cmd[5:]) + tag_text = make_enum(cmd[5:], state) else: - tag_text = make_type(tag_text) + tag_text = make_type(tag_text, state) escape_post = True # Properly escape things like `[Node]s` @@ -338,6 +858,9 @@ def rstize_text(text, cclass): # type: (str, str) -> str text = pre_text + tag_text + post_text pos = len(pre_text) + len(tag_text) + if tag_depth > 0: + print_error("Tag depth mismatch: too many/little open/close tags, file: {}".format(state.current_class), state) + return text @@ -372,16 +895,15 @@ def format_table(f, pp): # type: (TextIO, Iterable[Tuple[str, ...]]) -> None f.write('\n') -def make_type(t): # type: (str) -> str - if t in classes: - return ':ref:`' + t + '<class_' + t + '>`' - print("Warning: unresolved type reference '{}' in class '{}'".format(t, current_reading_class)) +def make_type(t, state): # type: (str, State) -> str + if t in state.classes: + return ':ref:`{0}<class_{0}>`'.format(t) + print_error("Unresolved type '{}', file: {}".format(t, state.current_class), state) return t -def make_enum(t): # type: (str) -> str +def make_enum(t, state): # type: (str, State) -> str p = t.find(".") - # Global enums such as Error are relative to @GlobalScope. if p >= 0: c = t[0:p] e = t[p + 1:] @@ -390,329 +912,55 @@ def make_enum(t): # type: (str) -> str c = "@GlobalScope" e = "Variant." + e else: - # Things in GlobalScope don't have a period. - c = "@GlobalScope" + c = state.current_class e = t - if c in class_names: - return ':ref:`' + e + '<enum_' + c + '_' + e + '>`' - return t + if c in state.classes and e not in state.classes[c].enums: + c = "@GlobalScope" + if c in state.classes and e in state.classes[c].enums: + return ":ref:`{0}<enum_{1}_{0}>`".format(e, c) + print_error("Unresolved enum '{}', file: {}".format(t, state.current_class), state) + return t -def make_method( - f, # type: TextIO - cname, # type: str - method_data, # type: ET.Element - declare, # type: bool - event=False, # type: bool - pp=None # type: Optional[List[Tuple[str, str]]] -): # type: (...) -> None - if declare or pp is None: - t = '- ' - else: - t = "" - - argidx = [] # type: List[int] - args = list(method_data) - mdata = {} # type: Dict[int, ET.Element] - for arg in args: - if arg.tag == 'return': - idx = -1 - elif arg.tag == 'argument': - idx = int(arg.attrib['index']) - else: - continue - argidx.append(idx) - mdata[idx] = arg +def make_method_signature(class_def, method_def, make_ref, state): # type: (ClassDef, Union[MethodDef, SignalDef], bool, State) -> Tuple[str, str] + ret_type = " " - if not event: - if -1 in argidx: - if 'enum' in mdata[-1].attrib: - t += make_enum(mdata[-1].attrib['enum']) - else: - if mdata[-1].attrib['type'] == 'void': - t += 'void' - else: - t += make_type(mdata[-1].attrib['type']) - else: - t += 'void' - t += ' ' + ref_type = "signal" + if isinstance(method_def, MethodDef): + ret_type = method_def.return_type.to_rst(state) + ref_type = "method" - if declare or pp is None: + out = "" - s = '**' + method_data.attrib['name'] + '** ' + if make_ref: + out += ":ref:`{0}<class_{1}_{2}_{0}>` ".format(method_def.name, class_def.name, ref_type) else: - s = ':ref:`' + method_data.attrib['name'] + '<class_' + cname + "_" + method_data.attrib['name'] + '>` ' + out += "**{}** ".format(method_def.name) - s += '**(**' - for a in argidx: - arg = mdata[a] - if a < 0: - continue - if a > 0: - s += ', ' + out += '**(**' + for i, arg in enumerate(method_def.parameters): + if i > 0: + out += ', ' else: - s += ' ' + out += ' ' - if 'enum' in arg.attrib: - s += make_enum(arg.attrib['enum']) - else: - s += make_type(arg.attrib['type']) - if 'name' in arg.attrib: - s += ' ' + arg.attrib['name'] - else: - s += ' arg' + str(a) + out += "{} {}".format(arg.type_name.to_rst(state), arg.name) - if 'default' in arg.attrib: - s += '=' + arg.attrib['default'] + if arg.default_value is not None: + out += '=' + arg.default_value - s += ' **)**' + out += ' **)**' - if 'qualifiers' in method_data.attrib: - s += ' ' + method_data.attrib['qualifiers'] - - if not declare: - if pp is not None: - pp.append((t, s)) - else: - f.write("- " + t + " " + s + "\n") - else: - f.write(t + s + "\n") - - -def make_properties( - f, # type: TextIO - cname, # type: str - prop_data, # type: ET.Element - description=False, # type: bool - pp=None # type: Optional[List[Tuple[str, str]]] -): # type: (...) -> None - t = "" - if 'enum' in prop_data.attrib: - t += make_enum(prop_data.attrib['enum']) - else: - t += make_type(prop_data.attrib['type']) - - if description: - s = '**' + prop_data.attrib['name'] + '**' - setget = [] - if 'setter' in prop_data.attrib and prop_data.attrib['setter'] != '' and not prop_data.attrib['setter'].startswith('_'): - setget.append(("*Setter*", prop_data.attrib['setter'] + '(value)')) - if 'getter' in prop_data.attrib and prop_data.attrib['getter'] != '' and not prop_data.attrib['getter'].startswith('_'): - setget.append(('*Getter*', prop_data.attrib['getter'] + '()')) - else: - s = ':ref:`' + prop_data.attrib['name'] + '<class_' + cname + "_" + prop_data.attrib['name'] + '>`' + if isinstance(method_def, MethodDef) and method_def.qualifiers is not None: + out += ' ' + method_def.qualifiers - if pp is not None: - pp.append((t, s)) - elif description: - f.write('- ' + t + ' ' + s + '\n\n') - if len(setget) > 0: - format_table(f, setget) + return ret_type, out def make_heading(title, underline): # type: (str, str) -> str return title + '\n' + (underline * len(title)) + "\n\n" -def make_rst_class(node): # type: (ET.Element) -> None - name = node.attrib['name'] - - f = open("class_" + name.lower() + '.rst', 'w', encoding='utf-8') - - # Warn contributors not to edit this file directly - f.write(".. Generated automatically by doc/tools/makerst.py in Godot's source tree.\n") - f.write(".. DO NOT EDIT THIS FILE, but the " + name + ".xml source instead.\n") - f.write(".. The source is found in doc/classes or modules/<name>/doc_classes.\n\n") - - f.write(".. _class_" + name + ":\n\n") - f.write(make_heading(name, '=')) - - # Inheritance tree - # Ascendents - if 'inherits' in node.attrib: - inh = node.attrib['inherits'].strip() - f.write('**Inherits:** ') - first = True - while inh in classes: - if not first: - f.write(" **<** ") - else: - first = False - - f.write(make_type(inh)) - inode = classes[inh] - if 'inherits' in inode.attrib: - inh = inode.attrib['inherits'].strip() - else: - break - f.write("\n\n") - - # Descendents - inherited = [] - for cn in class_names: - c = classes[cn] - if 'inherits' in c.attrib: - if c.attrib['inherits'].strip() == name: - inherited.append(c.attrib['name']) - if len(inherited): - f.write('**Inherited By:** ') - for i in range(len(inherited)): - if i > 0: - f.write(", ") - f.write(make_type(inherited[i])) - f.write("\n\n") - - # Category - if 'category' in node.attrib: - f.write('**Category:** ' + node.attrib['category'].strip() + "\n\n") - - # Brief description - f.write(make_heading('Brief Description', '-')) - briefd = node.find('brief_description') - if briefd is not None and briefd.text is not None: - f.write(rstize_text(briefd.text.strip(), name) + "\n\n") - - # Properties overview - members = node.find('members') - if members is not None and len(list(members)) > 0: - f.write(make_heading('Properties', '-')) - ml = [] # type: List[Tuple[str, str]] - for m in members: - make_properties(f, name, m, False, ml) - format_table(f, ml) - - # Methods overview - methods = node.find('methods') - if methods is not None and len(list(methods)) > 0: - f.write(make_heading('Methods', '-')) - ml = [] - for m in methods: - make_method(f, name, m, False, False, ml) - format_table(f, ml) - - # Theme properties - theme_items = node.find('theme_items') - if theme_items is not None and len(list(theme_items)) > 0: - f.write(make_heading('Theme Properties', '-')) - ml = [] - for m in theme_items: - make_properties(f, name, m, False, ml) - format_table(f, ml) - - # Signals - events = node.find('signals') - if events is not None and len(list(events)) > 0: - f.write(make_heading('Signals', '-')) - for m in events: - f.write(".. _class_" + name + "_" + m.attrib['name'] + ":\n\n") - make_method(f, name, m, True, True) - f.write('\n') - d = m.find('description') - if d is None or d.text is None or d.text.strip() == '': - continue - f.write(rstize_text(d.text.strip(), name)) - f.write("\n\n") - - # Constants and enums - constants = node.find('constants') - consts = [] - enum_names = [] - enums = defaultdict(list) # type: DefaultDict[str, List[ET.Element]] - if constants is not None and len(list(constants)) > 0: - for c in constants: - if 'enum' in c.attrib: - ename = c.attrib['enum'] - if ename not in enums: - enum_names.append(ename) - enums[ename].append(c) - else: - consts.append(c) - - # Enums - if len(enum_names) > 0: - f.write(make_heading('Enumerations', '-')) - for e in enum_names: - f.write(".. _enum_" + name + "_" + e + ":\n\n") - f.write("enum **" + e + "**:\n\n") - for c in enums[e]: - s = '- ' - s += '**' + c.attrib['name'] + '**' - if 'value' in c.attrib: - s += ' = **' + c.attrib['value'] + '**' - if c.text is not None and c.text.strip() != '': - s += ' --- ' + rstize_text(c.text.strip(), name) - f.write(s + '\n\n') - - # Constants - if len(consts) > 0: - f.write(make_heading('Constants', '-')) - for c in consts: - s = '- ' - s += '**' + c.attrib['name'] + '**' - if 'value' in c.attrib: - s += ' = **' + c.attrib['value'] + '**' - if c.text is not None and c.text.strip() != '': - s += ' --- ' + rstize_text(c.text.strip(), name) - f.write(s + '\n\n') - - # Class description - descr = node.find('description') - if descr is not None and descr.text is not None and descr.text.strip() != '': - f.write(make_heading('Description', '-')) - f.write(rstize_text(descr.text.strip(), name) + "\n\n") - - # Online tutorials - tutorials = node.find('tutorials') - if tutorials is not None and len(tutorials) > 0: - f.write(make_heading('Tutorials', '-')) - for t in tutorials: - if t.text is None: - continue - link = t.text.strip() - match = GODOT_DOCS_PATTERN.search(link) - if match: - groups = match.groups() - if match.lastindex == 2: - # Doc reference with fragment identifier: emit direct link to section with reference to page, for example: - # `#calling-javascript-from-script in Exporting For Web` - f.write("- `" + groups[1] + " <../" + groups[0] + ".html" + groups[1] + ">`_ in :doc:`../" + groups[0] + "`\n\n") - # Commented out alternative: Instead just emit: - # `Subsection in Exporting For Web` - # f.write("- `Subsection <../" + groups[0] + ".html" + groups[1] + ">`_ in :doc:`../" + groups[0] + "`\n\n") - elif match.lastindex == 1: - # Doc reference, for example: - # `Math` - f.write("- :doc:`../" + groups[0] + "`\n\n") - else: - # External link, for example: - # `http://enet.bespin.org/usergroup0.html` - f.write("- `" + link + " <" + link + ">`_\n\n") - - # Property descriptions - members = node.find('members') - if members is not None and len(list(members)) > 0: - f.write(make_heading('Property Descriptions', '-')) - for m in members: - f.write(".. _class_" + name + "_" + m.attrib['name'] + ":\n\n") - make_properties(f, name, m, True) - if m.text is not None and m.text.strip() != '': - f.write(rstize_text(m.text.strip(), name)) - f.write('\n\n') - - # Method descriptions - methods = node.find('methods') - if methods is not None and len(list(methods)) > 0: - f.write(make_heading('Method Descriptions', '-')) - for m in methods: - f.write(".. _class_" + name + "_" + m.attrib['name'] + ":\n\n") - make_method(f, name, m, True) - f.write('\n') - d = m.find('description') - if d is None or d.text is None or d.text.strip() == '': - continue - f.write(rstize_text(d.text.strip(), name)) - f.write("\n\n") - if __name__ == '__main__': main() |