diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/@GlobalScope.xml | 4 | ||||
-rw-r--r-- | doc/classes/AnimationLibrary.xml | 70 | ||||
-rw-r--r-- | doc/classes/AnimationPlayer.xml | 34 | ||||
-rw-r--r-- | doc/classes/Camera3D.xml | 2 | ||||
-rw-r--r-- | doc/classes/CanvasItem.xml | 7 | ||||
-rw-r--r-- | doc/classes/CharacterBody2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/CharacterBody3D.xml | 2 | ||||
-rw-r--r-- | doc/classes/CheckBox.xml | 10 | ||||
-rw-r--r-- | doc/classes/CollisionObject2D.xml | 1 | ||||
-rw-r--r-- | doc/classes/Color.xml | 26 | ||||
-rw-r--r-- | doc/classes/EditorInspector.xml | 10 | ||||
-rw-r--r-- | doc/classes/NavigationServer2D.xml | 6 | ||||
-rw-r--r-- | doc/classes/NavigationServer3D.xml | 6 | ||||
-rw-r--r-- | doc/classes/OptionButton.xml | 20 | ||||
-rw-r--r-- | doc/classes/RenderingServer.xml | 5 | ||||
-rw-r--r-- | doc/classes/RichTextLabel.xml | 26 | ||||
-rw-r--r-- | doc/classes/Signal.xml | 2 | ||||
-rw-r--r-- | doc/classes/TextServer.xml | 4 | ||||
-rw-r--r-- | doc/classes/Tree.xml | 3 | ||||
-rw-r--r-- | doc/classes/Viewport.xml | 4 | ||||
-rw-r--r-- | doc/classes/Window.xml | 9 | ||||
-rwxr-xr-x | doc/tools/make_rst.py | 78 |
22 files changed, 245 insertions, 86 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index a2b310ca82..da6513a08b 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -2546,13 +2546,13 @@ The property is a translatable string. </constant> <constant name="PROPERTY_USAGE_GROUP" value="128" enum="PropertyUsageFlags"> - Used to group properties together in the editor. + Used to group properties together in the editor. See [EditorInspector]. </constant> <constant name="PROPERTY_USAGE_CATEGORY" value="256" enum="PropertyUsageFlags"> Used to categorize properties together in the editor. </constant> <constant name="PROPERTY_USAGE_SUBGROUP" value="512" enum="PropertyUsageFlags"> - Used to group properties together in the editor in a subgroup (under a group). + Used to group properties together in the editor in a subgroup (under a group). See [EditorInspector]. </constant> <constant name="PROPERTY_USAGE_NO_INSTANCE_STATE" value="2048" enum="PropertyUsageFlags"> The property does not save its state in [PackedScene]. diff --git a/doc/classes/AnimationLibrary.xml b/doc/classes/AnimationLibrary.xml new file mode 100644 index 0000000000..0a731edadd --- /dev/null +++ b/doc/classes/AnimationLibrary.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="AnimationLibrary" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="add_animation"> + <return type="int" enum="Error" /> + <argument index="0" name="name" type="StringName" /> + <argument index="1" name="animation" type="Animation" /> + <description> + </description> + </method> + <method name="get_animation" qualifiers="const"> + <return type="Animation" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> + <method name="get_animation_list" qualifiers="const"> + <return type="StringName[]" /> + <description> + </description> + </method> + <method name="has_animation" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> + <method name="remove_animation"> + <return type="void" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> + <method name="rename_animation"> + <return type="void" /> + <argument index="0" name="name" type="StringName" /> + <argument index="1" name="newname" type="StringName" /> + <description> + </description> + </method> + </methods> + <members> + <member name="_data" type="Dictionary" setter="_set_data" getter="_get_data" default="{}"> + </member> + </members> + <signals> + <signal name="animation_added"> + <argument index="0" name="name" type="Animation" /> + <description> + </description> + </signal> + <signal name="animation_removed"> + <argument index="0" name="name" type="Animation" /> + <description> + </description> + </signal> + <signal name="animation_renamed"> + <argument index="0" name="name" type="Animation" /> + <argument index="1" name="to_name" type="Animation" /> + <description> + </description> + </signal> + </signals> +</class> diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index b1d04ce1f2..625cf3c47c 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -14,12 +14,11 @@ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> </tutorials> <methods> - <method name="add_animation"> + <method name="add_animation_library"> <return type="int" enum="Error" /> <argument index="0" name="name" type="StringName" /> - <argument index="1" name="animation" type="Animation" /> + <argument index="1" name="library" type="AnimationLibrary" /> <description> - Adds [code]animation[/code] to the player accessible with the key [code]name[/code]. </description> </method> <method name="advance"> @@ -63,6 +62,12 @@ Returns the name of [code]animation[/code] or an empty string if not found. </description> </method> + <method name="find_animation_library" qualifiers="const"> + <return type="StringName" /> + <argument index="0" name="animation" type="Animation" /> + <description> + </description> + </method> <method name="get_animation" qualifiers="const"> <return type="Animation" /> <argument index="0" name="name" type="StringName" /> @@ -70,6 +75,17 @@ Returns the [Animation] with key [code]name[/code] or [code]null[/code] if not found. </description> </method> + <method name="get_animation_library" qualifiers="const"> + <return type="AnimationLibrary" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> + <method name="get_animation_library_list" qualifiers="const"> + <return type="StringName[]" /> + <description> + </description> + </method> <method name="get_animation_list" qualifiers="const"> <return type="PackedStringArray" /> <description> @@ -103,6 +119,12 @@ Returns [code]true[/code] if the [AnimationPlayer] stores an [Animation] with key [code]name[/code]. </description> </method> + <method name="has_animation_library" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="name" type="StringName" /> + <description> + </description> + </method> <method name="is_playing" qualifiers="const"> <return type="bool" /> <description> @@ -138,19 +160,17 @@ [b]Note:[/b] If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow. </description> </method> - <method name="remove_animation"> + <method name="remove_animation_library"> <return type="void" /> <argument index="0" name="name" type="StringName" /> <description> - Removes the animation with key [code]name[/code]. </description> </method> - <method name="rename_animation"> + <method name="rename_animation_library"> <return type="void" /> <argument index="0" name="name" type="StringName" /> <argument index="1" name="newname" type="StringName" /> <description> - Renames an existing animation with key [code]name[/code] to [code]newname[/code]. </description> </method> <method name="seek"> diff --git a/doc/classes/Camera3D.xml b/doc/classes/Camera3D.xml index f7a0d41626..5008cd826e 100644 --- a/doc/classes/Camera3D.xml +++ b/doc/classes/Camera3D.xml @@ -192,7 +192,7 @@ The camera's projection mode. In [constant PROJECTION_PERSPECTIVE] mode, objects' Z distance from the camera's local space scales their perceived size. </member> <member name="size" type="float" setter="set_size" getter="get_size" default="1.0"> - The camera's size measured as 1/2 the width or height. Only applicable in orthogonal mode. Since [member keep_aspect] locks on axis, [code]size[/code] sets the other axis' size length. + The camera's size measured as 1/2 the width or height. Only applicable in orthogonal and frustum modes. Since [member keep_aspect] locks on axis, [code]size[/code] sets the other axis' size length. </member> <member name="v_offset" type="float" setter="set_v_offset" getter="get_v_offset" default="0.0"> The vertical (Y) offset of the camera viewport. diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index baaf33956f..6cd2da520f 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -103,8 +103,9 @@ <argument index="1" name="to" type="Vector2" /> <argument index="2" name="color" type="Color" /> <argument index="3" name="width" type="float" default="1.0" /> + <argument index="4" name="antialiased" type="bool" default="false" /> <description> - Draws a line from a 2D point to another, with a given color and width. See also [method draw_multiline] and [method draw_polyline]. + Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. See also [method draw_multiline] and [method draw_polyline]. </description> </method> <method name="draw_mesh"> @@ -191,7 +192,7 @@ <argument index="2" name="width" type="float" default="1.0" /> <argument index="3" name="antialiased" type="bool" default="false" /> <description> - Draws interconnected line segments with a uniform [code]color[/code] and [code]width[/code]. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline] instead. See also [method draw_polygon]. + Draws interconnected line segments with a uniform [code]color[/code] and [code]width[/code] and optional antialiasing. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline] instead. See also [method draw_polygon]. </description> </method> <method name="draw_polyline_colors"> @@ -201,7 +202,7 @@ <argument index="2" name="width" type="float" default="1.0" /> <argument index="3" name="antialiased" type="bool" default="false" /> <description> - Draws interconnected line segments with a uniform [code]width[/code] and segment-by-segment coloring. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code]. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline_colors] instead. See also [method draw_polygon]. + Draws interconnected line segments with a uniform [code]width[/code] and segment-by-segment coloring, and optional antialiasing. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code]. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline_colors] instead. See also [method draw_polygon]. </description> </method> <method name="draw_primitive"> diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml index 28060f6579..63d493248f 100644 --- a/doc/classes/CharacterBody2D.xml +++ b/doc/classes/CharacterBody2D.xml @@ -183,7 +183,7 @@ If [code]true[/code], during a jump against the ceiling, the body will slide, if [code]false[/code] it will be stopped and will fall vertically. </member> <member name="up_direction" type="Vector2" setter="set_up_direction" getter="get_up_direction" default="Vector2(0, -1)"> - Direction vector used to determine what is a wall and what is a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. Defaults to [code]Vector2.UP[/code]. If set to [code]Vector2(0, 0)[/code], everything is considered a wall. This is useful for topdown games. + Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [method move_and_slide]. Defaults to [code]Vector2.UP[/code]. As the vector will be normalized it can't be equal to [constant Vector2.ZERO], if you want all collisions to be reported as walls, consider using [constant MOTION_MODE_FLOATING] as [member motion_mode]. </member> <member name="velocity" type="Vector2" setter="set_velocity" getter="get_velocity" default="Vector2(0, 0)"> Current velocity vector in pixels per second, used and modified during calls to [method move_and_slide]. diff --git a/doc/classes/CharacterBody3D.xml b/doc/classes/CharacterBody3D.xml index 4895e2cff7..6c5cd62fe1 100644 --- a/doc/classes/CharacterBody3D.xml +++ b/doc/classes/CharacterBody3D.xml @@ -168,7 +168,7 @@ If [code]true[/code], during a jump against the ceiling, the body will slide, if [code]false[/code] it will be stopped and will fall vertically. </member> <member name="up_direction" type="Vector3" setter="set_up_direction" getter="get_up_direction" default="Vector3(0, 1, 0)"> - Direction vector used to determine what is a wall and what is a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. Defaults to [code]Vector3.UP[/code]. If set to [code]Vector3(0, 0, 0)[/code], everything is considered a wall. This is useful for topdown games. + Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [method move_and_slide]. Defaults to [code]Vector3.UP[/code]. As the vector will be normalized it can't be equal to [constant Vector3.ZERO], if you want all collisions to be reported as walls, consider using [constant MOTION_MODE_FLOATING] as [member motion_mode]. </member> <member name="velocity" type="Vector3" setter="set_velocity" getter="get_velocity" default="Vector3(0, 0, 0)"> Current velocity vector (typically meters per second), used and modified during calls to [method move_and_slide]. diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 606f5ca51f..462ab81587 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -54,23 +54,25 @@ The check icon to display when the [CheckBox] is checked. </theme_item> <theme_item name="checked_disabled" data_type="icon" type="Texture2D"> - The check icon to display when the [CheckBox] is checked and disabled. + The check icon to display when the [CheckBox] is checked and is disabled. </theme_item> <theme_item name="radio_checked" data_type="icon" type="Texture2D"> - If the [CheckBox] is configured as a radio button, the icon to display when the [CheckBox] is checked. + The check icon to display when the [CheckBox] is configured as a radio button and is checked. </theme_item> <theme_item name="radio_checked_disabled" data_type="icon" type="Texture2D"> + The check icon to display when the [CheckBox] is configured as a radio button, is disabled, and is unchecked. </theme_item> <theme_item name="radio_unchecked" data_type="icon" type="Texture2D"> - If the [CheckBox] is configured as a radio button, the icon to display when the [CheckBox] is unchecked. + The check icon to display when the [CheckBox] is configured as a radio button and is unchecked. </theme_item> <theme_item name="radio_unchecked_disabled" data_type="icon" type="Texture2D"> + The check icon to display when the [CheckBox] is configured as a radio button, is disabled, and is unchecked. </theme_item> <theme_item name="unchecked" data_type="icon" type="Texture2D"> The check icon to display when the [CheckBox] is unchecked. </theme_item> <theme_item name="unchecked_disabled" data_type="icon" type="Texture2D"> - The check icon to display when the [CheckBox] is unchecked and disabled. + The check icon to display when the [CheckBox] is unchecked and is disabled. </theme_item> <theme_item name="disabled" data_type="style" type="StyleBox"> The [StyleBox] to display as a background when the [CheckBox] is disabled. diff --git a/doc/classes/CollisionObject2D.xml b/doc/classes/CollisionObject2D.xml index 99bf9f7853..5d025985cc 100644 --- a/doc/classes/CollisionObject2D.xml +++ b/doc/classes/CollisionObject2D.xml @@ -5,6 +5,7 @@ </brief_description> <description> CollisionObject2D is the base class for 2D physics objects. It can hold any number of 2D collision [Shape2D]s. Each shape must be assigned to a [i]shape owner[/i]. The CollisionObject2D can have any number of shape owners. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the [code]shape_owner_*[/code] methods. + [b]Note:[/b] Only collisions between objects within the same canvas ([Viewport] canvas or [CanvasLayer]) are supported. The behavior of collisions between objects in different canvases is undefined. </description> <tutorials> </tutorials> diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index 5b48804d9d..7b8a57ed22 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -183,7 +183,7 @@ <description> Returns the luminance of the color in the [code][0.0, 1.0][/code] range. This is useful when determining light or dark color. Colors with a luminance smaller than 0.5 can be generally considered dark. - [b]Note:[/b] [method get_luminance] relies on the colour being in the linear color space to return an accurate relative luminance value. If the color is in the sRGB color space, use [method to_linear] to convert it to the linear color space first. + [b]Note:[/b] [method get_luminance] relies on the colour being in the linear color space to return an accurate relative luminance value. If the color is in the sRGB color space, use [method srgb_to_linear] to convert it to the linear color space first. </description> </method> <method name="get_named_color" qualifiers="static"> @@ -321,6 +321,18 @@ [/codeblocks] </description> </method> + <method name="linear_to_srgb" qualifiers="const"> + <return type="Color" /> + <description> + Returns the color converted to the [url=https://en.wikipedia.org/wiki/SRGB]sRGB[/url] color space. This assumes the original color is in the linear color space. See also [method srgb_to_linear] which performs the opposite operation. + </description> + </method> + <method name="srgb_to_linear" qualifiers="const"> + <return type="Color" /> + <description> + Returns the color converted to the linear color space. This assumes the original color is in the sRGB color space. See also [method linear_to_srgb] which performs the opposite operation. + </description> + </method> <method name="to_abgr32" qualifiers="const"> <return type="int" /> <description> @@ -405,12 +417,6 @@ [/codeblocks] </description> </method> - <method name="to_linear" qualifiers="const"> - <return type="Color" /> - <description> - Returns the color converted to the linear color space. This assumes the original color is in the sRGB color space. See also [method to_srgb] which performs the opposite operation. - </description> - </method> <method name="to_rgba32" qualifiers="const"> <return type="int" /> <description> @@ -443,12 +449,6 @@ [/codeblocks] </description> </method> - <method name="to_srgb" qualifiers="const"> - <return type="Color" /> - <description> - Returns the color converted to the [url=https://en.wikipedia.org/wiki/SRGB]sRGB[/url] color space. This assumes the original color is in the linear color space. See also [method to_linear] which performs the opposite operation. - </description> - </method> </methods> <members> <member name="a" type="float" setter="" getter="" default="1.0"> diff --git a/doc/classes/EditorInspector.xml b/doc/classes/EditorInspector.xml index cd249ed319..365e1f13a9 100644 --- a/doc/classes/EditorInspector.xml +++ b/doc/classes/EditorInspector.xml @@ -1,11 +1,15 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="EditorInspector" inherits="ScrollContainer" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A tab used to edit properties of the selected node. + A control used to edit properties of an object. </brief_description> <description> - The editor inspector is by default located on the right-hand side of the editor. It's used to edit the properties of the selected node. For example, you can select a node such as the Sprite2D then edit its transform through the inspector tool. The editor inspector is an essential tool in the game development workflow. - [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_inspector]. + This is the control that implements property editing in the editor's Settings dialogs, the Inspector dock, etc. To get the [EditorInspector] used in the editor's Inspector dock, use [method EditorInterface.get_inspector]. + [EditorInspector] will show properties in the same order as the array returned by [method Object.get_property_list]. + If a property's name is path-like (i.e. if it contains forward slashes), [EditorInspector] will create nested sections for "directories" along the path. For example, if a property is named [code]highlighting/gdscript/node_path_color[/code], it will be shown as "Node Path Color" inside the "GDScript" section nested inside the "Highlighting" section. + If a property has [constant @GlobalScope.PROPERTY_USAGE_GROUP] usage, it will group subsequent properties whose name starts with the property's hint string. The group ends when a property does not start with that hint string or when a new group starts. An empty group name effectively ends the current group. [EditorInspector] will create a top-level section for each group. For example, if a property with group usage is named [code]Collide With[/code] and its hint string is [code]collide_with_[/code], a subsequent [code]collide_with_area[/code] property will be shown as "Area" inside the "Collide With" section. + If a property has [constant @GlobalScope.PROPERTY_USAGE_SUBGROUP] usage, a subgroup will be created in the same way as a group, and a second-level section will be created for each subgroup. + [b]Note:[/b] Unlike sections created from path-like property names, [EditorInspector] won't capitalize the name for sections created from groups. So properties with group usage usually use capitalized names instead of snake_cased names. </description> <tutorials> </tutorials> diff --git a/doc/classes/NavigationServer2D.xml b/doc/classes/NavigationServer2D.xml index a59666356c..e007dfd9b5 100644 --- a/doc/classes/NavigationServer2D.xml +++ b/doc/classes/NavigationServer2D.xml @@ -110,11 +110,11 @@ Sets the current velocity of the agent. </description> </method> - <method name="free" qualifiers="const"> + <method name="free_rid" qualifiers="const"> <return type="void" /> - <argument index="0" name="object" type="RID" /> + <argument index="0" name="rid" type="RID" /> <description> - Destroy the RID + Destroys the given RID. </description> </method> <method name="map_create" qualifiers="const"> diff --git a/doc/classes/NavigationServer3D.xml b/doc/classes/NavigationServer3D.xml index 7d11a30647..c987bc9042 100644 --- a/doc/classes/NavigationServer3D.xml +++ b/doc/classes/NavigationServer3D.xml @@ -110,11 +110,11 @@ Sets the current velocity of the agent. </description> </method> - <method name="free" qualifiers="const"> + <method name="free_rid" qualifiers="const"> <return type="void" /> - <argument index="0" name="object" type="RID" /> + <argument index="0" name="rid" type="RID" /> <description> - Destroy the RID + Destroys the given RID. </description> </method> <method name="map_create" qualifiers="const"> diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index 25e41116a2..b7145ab923 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -30,8 +30,9 @@ </method> <method name="add_separator"> <return type="void" /> + <argument index="0" name="text" type="String" default="""" /> <description> - Adds a separator to the list of items. Separators help to group items. Separator also takes up an index and is appended at the end. + Adds a separator to the list of items. Separators help to group items, and can optionally be given a [code]text[/code] header. A separator also gets an index assigned, and is appended at the end of the item list. </description> </method> <method name="clear"> @@ -89,6 +90,12 @@ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property. </description> </method> + <method name="get_selectable_item" qualifiers="const"> + <return type="int" /> + <argument index="0" name="from_last" type="bool" default="false" /> + <description> + </description> + </method> <method name="get_selected_id" qualifiers="const"> <return type="int" /> <description> @@ -101,6 +108,11 @@ Gets the metadata of the selected item. Metadata for items can be set using [method set_item_metadata]. </description> </method> + <method name="has_selectable_items" qualifiers="const"> + <return type="bool" /> + <description> + </description> + </method> <method name="is_item_disabled" qualifiers="const"> <return type="bool" /> <argument index="0" name="idx" type="int" /> @@ -108,6 +120,12 @@ Returns [code]true[/code] if the item at index [code]idx[/code] is disabled. </description> </method> + <method name="is_item_separator" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="idx" type="int" /> + <description> + </description> + </method> <method name="remove_item"> <return type="void" /> <argument index="0" name="idx" type="int" /> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index f1a15a08dd..5bb83c8ffd 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -183,6 +183,7 @@ <argument index="2" name="to" type="Vector2" /> <argument index="3" name="color" type="Color" /> <argument index="4" name="width" type="float" default="1.0" /> + <argument index="5" name="antialiased" type="bool" default="false" /> <description> </description> </method> @@ -3932,10 +3933,10 @@ [FogVolume] will have no shape, will cover the whole world and will not be culled. </constant> <constant name="VIEWPORT_SCALING_3D_MODE_BILINEAR" value="0" enum="ViewportScaling3DMode"> - Enables bilinear scaling on 3D viewports. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less then [code]1.0[/code] will result in undersampling while values greater than [code]1.0[/code] will result in supersampling. A value of [code]1.0[/code] disables scaling. + Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less then [code]1.0[/code] will result in undersampling while values greater than [code]1.0[/code] will result in supersampling. A value of [code]1.0[/code] disables scaling. </constant> <constant name="VIEWPORT_SCALING_3D_MODE_FSR" value="1" enum="ViewportScaling3DMode"> - Enables FSR upscaling on 3D viewports. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less then [code]1.0[/code] will be result in the viewport being upscaled using FSR. Values greater than [code]1.0[/code] are not supported and bilinear supersampling will be used instead. A value of [code]1.0[/code] disables scaling. + Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less then [code]1.0[/code] will be result in the viewport being upscaled using FSR. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] disables scaling. </constant> <constant name="VIEWPORT_SCALING_3D_MODE_MAX" value="2" enum="ViewportScaling3DMode"> </constant> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index a882a6c66f..02b67a4a5b 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -94,6 +94,13 @@ Returns the vertical offset of the line found at the provided index. </description> </method> + <method name="get_menu" qualifiers="const"> + <return type="PopupMenu" /> + <description> + Returns the [PopupMenu] of this [RichTextLabel]. By default, this menu is displayed when right-clicking on the [RichTextLabel]. + [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property. + </description> + </method> <method name="get_paragraph_count" qualifiers="const"> <return type="int" /> <description> @@ -163,6 +170,12 @@ Installs a custom effect. [code]effect[/code] should be a valid [RichTextEffect]. </description> </method> + <method name="is_menu_visible" qualifiers="const"> + <return type="bool" /> + <description> + Returns whether the menu is visible. Use this instead of [code]get_menu().visible[/code] to improve performance (so the creation of the menu is avoided). + </description> + </method> <method name="newline"> <return type="void" /> <description> @@ -376,6 +389,13 @@ Scrolls the window's top line to match first line of the [code]paragraph[/code]. </description> </method> + <method name="select_all"> + <return type="void" /> + <description> + Select all the text. + If [member selection_enabled] is [code]false[/code], no selection will occur. + </description> + </method> <method name="set_cell_border_color"> <return type="void" /> <argument index="0" name="color" type="Color" /> @@ -426,6 +446,9 @@ If [code]true[/code], the label uses BBCode formatting. </member> <member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" overrides="Control" default="true" /> + <member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled" default="false"> + If [code]true[/code], a right-click displays the context menu. + </member> <member name="custom_effects" type="Array" setter="set_effects" getter="get_effects" default="[]"> The currently installed custom effects. This is an array of [RichTextEffect]s. To add a custom effect, it's more convenient to use [method install_effect]. @@ -462,6 +485,9 @@ <member name="selection_enabled" type="bool" setter="set_selection_enabled" getter="is_selection_enabled" default="false"> If [code]true[/code], the label allows text selection. </member> + <member name="shortcut_keys_enabled" type="bool" setter="set_shortcut_keys_enabled" getter="is_shortcut_keys_enabled" default="true"> + If [code]true[/code], shortcut keys for context menu items are enabled, even if the context menu is disabled. + </member> <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0"> Set BiDi algorithm override for the structured text. </member> diff --git a/doc/classes/Signal.xml b/doc/classes/Signal.xml index c5855e30a4..049e7f8777 100644 --- a/doc/classes/Signal.xml +++ b/doc/classes/Signal.xml @@ -6,6 +6,8 @@ <description> </description> <tutorials> + <link title="Using Signals">$DOCS_URL/getting_started/step_by_step/signals.html</link> + <link title="GDScript Basics">$DOCS_URL/tutorials/scripting/gdscript/gdscript_basics.html#signals</link> </tutorials> <constructors> <constructor name="Signal"> diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index b4339bef11..9ef800d7e1 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -1249,9 +1249,9 @@ <method name="shaped_text_get_word_breaks" qualifiers="const"> <return type="PackedInt32Array" /> <argument index="0" name="shaped" type="RID" /> - <argument index="1" name="grapheme_flags" type="int" /> + <argument index="1" name="grapheme_flags" type="int" default="264" /> <description> - Breaks text into words and returns array of character ranges. + Breaks text into words and returns array of character ranges. Use [code]grapheme_flags[/code] to set what characters are used for breaking (see [enum GraphemeFlag]). </description> </method> <method name="shaped_text_hit_test_grapheme" qualifiers="const"> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index b8c39bee49..5abec4b437 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -179,8 +179,9 @@ <return type="Rect2" /> <argument index="0" name="item" type="TreeItem" /> <argument index="1" name="column" type="int" default="-1" /> + <argument index="2" name="button_index" type="int" default="-1" /> <description> - Returns the rectangle area for the specified [TreeItem]. If [code]column[/code] is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. + Returns the rectangle area for the specified [TreeItem]. If [code]column[/code] is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. If a button index is specified, the rectangle of that button will be returned. </description> </method> <method name="get_item_at_position" qualifiers="const"> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index b5916f8c17..6f4720491d 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -332,10 +332,10 @@ Represents the size of the [enum ShadowAtlasQuadrantSubdiv] enum. </constant> <constant name="SCALING_3D_MODE_BILINEAR" value="0" enum="Scaling3DMode"> - Enables bilinear scaling on 3D viewports. The amount of scaling can be set using [member scaling_3d_scale]. Values less then [code]1.0[/code] will result in undersampling while values greater than [code]1.0[/code] will result in supersampling. A value of [code]1.0[/code] disables scaling. + Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can be set using [member scaling_3d_scale]. Values less then [code]1.0[/code] will result in undersampling while values greater than [code]1.0[/code] will result in supersampling. A value of [code]1.0[/code] disables scaling. </constant> <constant name="SCALING_3D_MODE_FSR" value="1" enum="Scaling3DMode"> - Enables FSR upscaling on 3D viewports. The amount of scaling can be set using [member scaling_3d_scale]. Values less then [code]1.0[/code] will be result in the viewport being upscaled using FSR. Values greater than [code]1.0[/code] are not supported and bilinear supersampling will be used instead. A value of [code]1.0[/code] disables scaling. + Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member scaling_3d_scale]. Values less then [code]1.0[/code] will be result in the viewport being upscaled using FSR. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] disables scaling. </constant> <constant name="SCALING_3D_MODE_MAX" value="2" enum="Scaling3DMode"> Represents the size of the [enum Scaling3DMode] enum. diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index 9853f906bc..87a65db192 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -349,6 +349,15 @@ <argument index="0" name="files" type="PackedStringArray" /> <description> Emitted when files are dragged from the OS file manager and dropped in the game window. The argument is a list of file paths. + Note that this method only works with non-embedded windows, i.e. the main window and [Window]-derived nodes when [member Viewport.gui_embed_subwindows] is disabled in the main viewport. + Example usage: + [codeblock] + func _ready(): + get_viewport().files_dropped.connect(on_files_dropped) + + func on_files_dropped(files): + print(files) + [/codeblock] </description> </signal> <signal name="focus_entered"> diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index 365beb434b..eba4cee33a 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -58,7 +58,7 @@ strings_l10n = {} def print_error(error, state): # type: (str, State) -> None print("ERROR: {}".format(error)) - state.errored = True + state.num_errors += 1 class TypeName: @@ -163,8 +163,7 @@ class ClassDef: class State: def __init__(self): # type: () -> None - # Has any error been reported? - self.errored = False + self.num_errors = 0 self.classes = OrderedDict() # type: OrderedDict[str, ClassDef] self.current_class = "" # type: str @@ -194,7 +193,7 @@ class State: property_name = property.attrib["name"] if property_name in class_def.properties: - print_error("Duplicate property '{}', file: {}".format(property_name, class_name), self) + print_error('{}.xml: Duplicate property "{}".'.format(class_name, property_name), self) continue type_name = TypeName.from_element(property) @@ -305,7 +304,7 @@ class State: 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) + print_error('{}.xml: Duplicate constant "{}".'.format(class_name, constant_name), self) continue class_def.constants[constant_name] = constant_def @@ -328,7 +327,7 @@ class State: signal_name = signal.attrib["name"] if signal_name in class_def.signals: - print_error("Duplicate signal '{}', file: {}".format(signal_name, class_name), self) + print_error('{}.xml: Duplicate signal "{}".'.format(class_name, signal_name), self) continue params = parse_arguments(signal) @@ -351,8 +350,8 @@ class State: theme_item_id = "{}_{}".format(theme_item_data_name, theme_item_name) if theme_item_id in class_def.theme_items: print_error( - "Duplicate theme property '{}' of type '{}', file: {}".format( - theme_item_name, theme_item_data_name, class_name + '{}.xml: Duplicate theme item "{}" of type "{}".'.format( + class_name, theme_item_name, theme_item_data_name ), self, ) @@ -430,7 +429,7 @@ def main(): # type: () -> None if entry.msgid in BASE_STRINGS: strings_l10n[entry.msgid] = entry.msgstr else: - print("No PO file at '{}' for language '{}'.".format(lang_file, args.lang)) + print('No PO file at "{}" for language "{}".'.format(lang_file, args.lang)) print("Checking for errors in the XML class reference...") @@ -453,7 +452,7 @@ def main(): # type: () -> None elif os.path.isfile(path): if not path.endswith(".xml"): - print("Got non-.xml file '{}' in input, skipping.".format(path)) + print('Got non-.xml file "{}" in input, skipping.'.format(path)) continue file_list.append(path) @@ -465,17 +464,17 @@ def main(): # type: () -> None try: tree = ET.parse(cur_file) except ET.ParseError as e: - print_error("Parse error reading file '{}': {}".format(cur_file, e), state) + print_error("{}.xml: Parse error while reading the file: {}".format(cur_file, e), state) continue doc = tree.getroot() if "version" not in doc.attrib: - print_error("Version missing from 'doc', file: {}".format(cur_file), state) + print_error('{}.xml: "version" attribute missing from "doc".'.format(cur_file), state) continue name = doc.attrib["name"] if name in classes: - print_error("Duplicate class '{}'".format(name), state) + print_error('{}.xml: Duplicate class "{}".'.format(cur_file, name), state) continue classes[name] = (doc, cur_file) @@ -484,7 +483,7 @@ def main(): # type: () -> None try: state.parse_class(data[0], data[1]) except Exception as e: - print_error("Exception while parsing class '{}': {}".format(name, e), state) + print_error("{}.xml: Exception while parsing class: {}".format(name, e), state) state.sort_classes() @@ -499,12 +498,17 @@ def main(): # type: () -> None state.current_class = class_name make_rst_class(class_def, state, args.dry_run, args.output) - if not state.errored: - print("No errors found.") + if state.num_errors == 0: + print("No errors found in the class reference XML.") if not args.dry_run: print("Wrote reStructuredText files for each class to: %s" % args.output) else: - print("Errors were found in the class reference XML. Please check the messages above.") + if state.num_errors >= 2: + print( + "%d errors were found in the class reference XML. Please check the messages above." % state.num_errors + ) + else: + print("1 error was found in the class reference XML. Please check the messages above.") exit(1) @@ -856,7 +860,7 @@ def escape_rst(text, until_pos=-1): # type: (str) -> str def format_codeblock(code_type, post_text, indent_level, state): # types: str, str, int, state end_pos = post_text.find("[/" + code_type + "]") if end_pos == -1: - print_error("[" + code_type + "] without a closing tag, file: {}".format(state.current_class), state) + print_error("{}.xml: [" + code_type + "] without a closing tag.".format(state.current_class), state) return None code_text = post_text[len("[" + code_type + "]") : end_pos] @@ -875,9 +879,9 @@ def format_codeblock(code_type, post_text, indent_level, state): # types: str, if to_skip > indent_level: print_error( - "Four spaces should be used for indentation within [" + "{}.xml: Four spaces should be used for indentation within [" + code_type - + "], file: {}".format(state.current_class), + + "].".format(state.current_class), state, ) @@ -987,7 +991,7 @@ def rstize_text(text, state): # type: (str, State) -> str if param.find(".") != -1: ss = param.split(".") if len(ss) > 2: - print_error("Bad reference: '{}', file: {}".format(param, state.current_class), state) + print_error('{}.xml: Bad reference: "{}".'.format(state.current_class, param), state) class_param, method_param = ss else: @@ -1000,33 +1004,31 @@ def rstize_text(text, state): # type: (str, State) -> str if cmd.startswith("constructor"): if method_param not in class_def.constructors: print_error( - "Unresolved constructor '{}', file: {}".format(param, state.current_class), state + '{}.xml: Unresolved constructor "{}".'.format(state.current_class, param), state ) ref_type = "_constructor" if cmd.startswith("method"): if method_param not in class_def.methods: - print_error("Unresolved method '{}', file: {}".format(param, state.current_class), state) + print_error('{}.xml: Unresolved method "{}".'.format(state.current_class, param), state) ref_type = "_method" if cmd.startswith("operator"): if method_param not in class_def.operators: - print_error("Unresolved operator '{}', file: {}".format(param, state.current_class), state) + print_error('{}.xml: Unresolved operator "{}".'.format(state.current_class, param), state) ref_type = "_operator" elif cmd.startswith("member"): if method_param not in class_def.properties: - print_error("Unresolved member '{}', file: {}".format(param, state.current_class), state) + print_error('{}.xml: Unresolved member "{}".'.format(state.current_class, param), state) ref_type = "_property" elif cmd.startswith("theme_item"): if method_param not in class_def.theme_items: - print_error( - "Unresolved theme item '{}', file: {}".format(param, state.current_class), state - ) + print_error('{}.xml: Unresolved theme item "{}".'.format(state.current_class, param), state) ref_type = "_theme_{}".format(class_def.theme_items[method_param].data_name) elif cmd.startswith("signal"): if method_param not in class_def.signals: - print_error("Unresolved signal '{}', file: {}".format(param, state.current_class), state) + print_error('{}.xml: Unresolved signal "{}".'.format(state.current_class, param), state) ref_type = "_signal" elif cmd.startswith("constant"): @@ -1052,13 +1054,13 @@ def rstize_text(text, state): # type: (str, State) -> str break if not found: - print_error("Unresolved constant '{}', file: {}".format(param, state.current_class), state) + print_error('{}.xml: Unresolved constant "{}".'.format(state.current_class, param), state) ref_type = "_constant" else: print_error( - "Unresolved type reference '{}' in method reference '{}', file: {}".format( - class_param, param, state.current_class + '{}.xml: Unresolved type reference "{}" in method reference "{}".'.format( + state.current_class, class_param, param ), state, ) @@ -1078,7 +1080,7 @@ def rstize_text(text, state): # type: (str, State) -> str endurl_pos = text.find("[/url]", endq_pos + 1) if endurl_pos == -1: print_error( - "Tag depth mismatch for [url]: no closing [/url], file: {}".format(state.current_class), state + "{}.xml: Tag depth mismatch for [url]: no closing [/url]".format(state.current_class), state ) break link_title = text[endq_pos + 1 : endurl_pos] @@ -1203,7 +1205,9 @@ def rstize_text(text, state): # type: (str, State) -> str previous_pos = pos if tag_depth > 0: - print_error("Tag depth mismatch: too many/little open/close tags, file: {}".format(state.current_class), state) + print_error( + "{}.xml: Tag depth mismatch: too many (or too little) open/close tags.".format(state.current_class), state + ) return text @@ -1247,7 +1251,7 @@ def make_type(klass, state): # type: (str, State) -> str link_type = link_type[:-2] if link_type in state.classes: return ":ref:`{}<class_{}>`".format(klass, link_type) - print_error("Unresolved type '{}', file: {}".format(klass, state.current_class), state) + print_error('{}.xml: Unresolved type "{}".'.format(state.current_class, klass), state) return klass @@ -1271,7 +1275,7 @@ def make_enum(t, state): # type: (str, State) -> str # Don't fail for `Vector3.Axis`, as this enum is a special case which is expected not to be resolved. if "{}.{}".format(c, e) != "Vector3.Axis": - print_error("Unresolved enum '{}', file: {}".format(t, state.current_class), state) + print_error('{}.xml: Unresolved enum "{}".'.format(state.current_class, t), state) return t @@ -1429,7 +1433,7 @@ def sanitize_operator_name(dirty_name, state): # type: (str, State) -> str else: clear_name = "xxx" - print_error("Unsupported operator type '{}', please add the missing rule.".format(dirty_name), state) + print_error('Unsupported operator type "{}", please add the missing rule.'.format(dirty_name), state) return clear_name |