diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/Makefile | 11 | ||||
-rw-r--r-- | doc/classes/@GlobalScope.xml | 2 | ||||
-rw-r--r-- | doc/classes/Area2D.xml | 8 | ||||
-rw-r--r-- | doc/classes/Area3D.xml | 8 | ||||
-rw-r--r-- | doc/classes/Array.xml | 2 | ||||
-rw-r--r-- | doc/classes/Button.xml | 1 | ||||
-rw-r--r-- | doc/classes/Control.xml | 2 | ||||
-rw-r--r-- | doc/classes/FontData.xml | 52 | ||||
-rw-r--r-- | doc/classes/OS.xml | 26 | ||||
-rw-r--r-- | doc/classes/ProjectSettings.xml | 3 | ||||
-rw-r--r-- | doc/classes/SceneTree.xml | 6 | ||||
-rw-r--r-- | doc/classes/SpinBox.xml | 1 | ||||
-rw-r--r-- | doc/classes/TextServer.xml | 58 | ||||
-rw-r--r-- | doc/classes/Theme.xml | 4 | ||||
-rw-r--r-- | doc/classes/TouchScreenButton.xml | 2 | ||||
-rw-r--r-- | doc/classes/Tree.xml | 7 |
16 files changed, 167 insertions, 26 deletions
diff --git a/doc/Makefile b/doc/Makefile index 9534da9bd5..d4bc53bcf9 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -2,6 +2,7 @@ BASEDIR = $(CURDIR) CLASSES = $(BASEDIR)/classes/ $(BASEDIR)/../modules/ OUTPUTDIR = $(BASEDIR)/_build TOOLSDIR = $(BASEDIR)/tools +JSDIR = $(BASEDIR)/../platform/javascript .ONESHELL: @@ -16,6 +17,10 @@ doxygen: rst: rm -rf $(OUTPUTDIR)/rst mkdir -p $(OUTPUTDIR)/rst - pushd $(OUTPUTDIR)/rst - python3 $(TOOLSDIR)/makerst.py $(CLASSES) - popd + python3 $(TOOLSDIR)/makerst.py -o $(OUTPUTDIR)/rst $(CLASSES) + +rstjs: + rm -rf $(OUTPUTDIR)/rstjs + mkdir -p $(OUTPUTDIR)/rstjs + npm --prefix $(JSDIR) ci + npm --prefix $(JSDIR) run docs -- --destination $(OUTPUTDIR)/rstjs/html5_shell_classref.rst diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index e5bcc773fe..3ca7e0716b 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -935,7 +935,7 @@ <description> Returns the result of smoothly interpolating the value of [code]x[/code] between [code]0[/code] and [code]1[/code], based on the where [code]x[/code] lies with respect to the edges [code]from[/code] and [code]to[/code]. The return value is [code]0[/code] if [code]x <= from[/code], and [code]1[/code] if [code]x >= to[/code]. If [code]x[/code] lies between [code]from[/code] and [code]to[/code], the returned value follows an S-shaped curve that maps [code]x[/code] between [code]0[/code] and [code]1[/code]. - This S-shaped curve is the cubic Hermite interpolator, given by [code]f(x) = 3*x^2 - 2*x^3[/code]. + This S-shaped curve is the cubic Hermite interpolator, given by [code]f(y) = 3*y^2 - 2*y^3[/code] where [code]y = (x-from) / (to-from)[/code]. [codeblock] smoothstep(0, 2, -5.0) # Returns 0.0 smoothstep(0, 2, 0.5) # Returns 0.15625 diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index a02f077cf7..9711a2a35b 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -187,7 +187,7 @@ </description> </signal> <signal name="body_entered"> - <argument index="0" name="body" type="Node"> + <argument index="0" name="body" type="Node2D"> </argument> <description> Emitted when a [PhysicsBody2D] or [TileMap] enters this Area2D. Requires [member monitoring] to be set to [code]true[/code]. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s. @@ -195,7 +195,7 @@ </description> </signal> <signal name="body_exited"> - <argument index="0" name="body" type="Node"> + <argument index="0" name="body" type="Node2D"> </argument> <description> Emitted when a [PhysicsBody2D] or [TileMap] exits this Area2D. Requires [member monitoring] to be set to [code]true[/code]. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s. @@ -205,7 +205,7 @@ <signal name="body_shape_entered"> <argument index="0" name="body_id" type="int"> </argument> - <argument index="1" name="body" type="Node"> + <argument index="1" name="body" type="Node2D"> </argument> <argument index="2" name="body_shape" type="int"> </argument> @@ -222,7 +222,7 @@ <signal name="body_shape_exited"> <argument index="0" name="body_id" type="int"> </argument> - <argument index="1" name="body" type="Node"> + <argument index="1" name="body" type="Node2D"> </argument> <argument index="2" name="body_shape" type="int"> </argument> diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml index bd43d619dd..4271769155 100644 --- a/doc/classes/Area3D.xml +++ b/doc/classes/Area3D.xml @@ -197,7 +197,7 @@ </description> </signal> <signal name="body_entered"> - <argument index="0" name="body" type="Node"> + <argument index="0" name="body" type="Node3D"> </argument> <description> Emitted when a [PhysicsBody3D] or [GridMap] enters this Area3D. Requires [member monitoring] to be set to [code]true[/code]. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s. @@ -205,7 +205,7 @@ </description> </signal> <signal name="body_exited"> - <argument index="0" name="body" type="Node"> + <argument index="0" name="body" type="Node3D"> </argument> <description> Emitted when a [PhysicsBody3D] or [GridMap] exits this Area3D. Requires [member monitoring] to be set to [code]true[/code]. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s. @@ -215,7 +215,7 @@ <signal name="body_shape_entered"> <argument index="0" name="body_id" type="int"> </argument> - <argument index="1" name="body" type="Node"> + <argument index="1" name="body" type="Node3D"> </argument> <argument index="2" name="body_shape" type="int"> </argument> @@ -232,7 +232,7 @@ <signal name="body_shape_exited"> <argument index="0" name="body_id" type="int"> </argument> - <argument index="1" name="body" type="Node"> + <argument index="1" name="body" type="Node3D"> </argument> <argument index="2" name="body_shape" type="int"> </argument> diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index cea5360234..8fb688a8ae 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -197,7 +197,7 @@ </argument> <description> Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search and a custom comparison method. Optionally, a [code]before[/code] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array. The custom method receives two arguments (an element from the array and the value searched for) and must return [code]true[/code] if the first argument is less than the second, and return [code]false[/code] otherwise. - [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. + [b]Note:[/b] Calling [method bsearch_custom] on an unsorted array results in unexpected behavior. </description> </method> <method name="clear"> diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index 96ff5e0293..51c35b15ce 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -34,6 +34,7 @@ [/codeblocks] Buttons (like all Control nodes) can also be created in the editor, but some situations may require creating them from code. See also [BaseButton] which contains common properties and methods associated with this node. + [b]Note:[/b] Buttons do not interpret touch input and therefore don't support multitouch, since mouse emulation can only press one button at a given time. Use [TouchScreenButton] for buttons that trigger gameplay movement or actions, as [TouchScreenButton] supports multitouch. </description> <tutorials> <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index e5285587eb..c5e820e9fe 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -869,7 +869,7 @@ <argument index="0" name="control" type="Control"> </argument> <description> - Shows the given control at the mouse pointer. A good time to call this method is in [method get_drag_data]. The control must not be in the scene tree. + Shows the given control at the mouse pointer. A good time to call this method is in [method get_drag_data]. The control must not be in the scene tree. You should not free the control, and you should not keep a reference to the control beyond the duration of the drag. It will be deleted automatically after the drag has ended. [codeblocks] [gdscript] export (Color, RGBA) var color = Color(1, 0, 0, 1) diff --git a/doc/classes/FontData.xml b/doc/classes/FontData.xml index 7e99510124..6c54af05cd 100644 --- a/doc/classes/FontData.xml +++ b/doc/classes/FontData.xml @@ -11,6 +11,45 @@ <tutorials> </tutorials> <methods> + <method name="bitmap_add_char"> + <return type="void"> + </return> + <argument index="0" name="char" type="int"> + </argument> + <argument index="1" name="texture_idx" type="int"> + </argument> + <argument index="2" name="rect" type="Rect2"> + </argument> + <argument index="3" name="align" type="Vector2"> + </argument> + <argument index="4" name="advance" type="float"> + </argument> + <description> + Adds a character to the font, where [code]character[/code] is the Unicode value, [code]texture[/code] is the texture index, [code]rect[/code] is the region in the texture (in pixels!), [code]align[/code] is the (optional) alignment for the character and [code]advance[/code] is the (optional) advance. + </description> + </method> + <method name="bitmap_add_kerning_pair"> + <return type="void"> + </return> + <argument index="0" name="A" type="int"> + </argument> + <argument index="1" name="B" type="int"> + </argument> + <argument index="2" name="kerning" type="int"> + </argument> + <description> + Adds a kerning pair to the bitmap font as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character. + </description> + </method> + <method name="bitmap_add_texture"> + <return type="void"> + </return> + <argument index="0" name="texture" type="Texture"> + </argument> + <description> + Adds a texture to the bitmap font. + </description> + </method> <method name="draw_glyph" qualifiers="const"> <return type="Vector2"> </return> @@ -265,6 +304,19 @@ Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method get_base_size] to check actual font size. </description> </method> + <method name="new_bitmap"> + <return type="void"> + </return> + <argument index="0" name="height" type="float"> + </argument> + <argument index="1" name="ascent" type="float"> + </argument> + <argument index="2" name="base_size" type="int"> + </argument> + <description> + Creates new, empty bitmap font. + </description> + </method> <method name="remove_language_support_override"> <return type="void"> </return> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index f6602d5f4d..057a2b8d1a 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -207,10 +207,11 @@ <method name="get_environment" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="environment" type="String"> + <argument index="0" name="variable" type="String"> </argument> <description> - Returns an environment variable. + Returns the value of an environment variable. Returns an empty string if the environment variable doesn't exist. + [b]Note:[/b] Double-check the casing of [code]variable[/code]. Environment variable names are case-sensitive on all platforms except Windows. </description> </method> <method name="get_executable_path" qualifiers="const"> @@ -383,10 +384,11 @@ <method name="has_environment" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="environment" type="String"> + <argument index="0" name="variable" type="String"> </argument> <description> - Returns [code]true[/code] if an environment variable exists. + Returns [code]true[/code] if the environment variable with the name [code]variable[/code] exists. + [b]Note:[/b] Double-check the casing of [code]variable[/code]. Environment variable names are case-sensitive on all platforms except Windows. </description> </method> <method name="has_feature" qualifiers="const"> @@ -501,6 +503,18 @@ [b]Note:[/b] This method is implemented on Android. </description> </method> + <method name="set_environment" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="variable" type="String"> + </argument> + <argument index="1" name="value" type="String"> + </argument> + <description> + Sets the value of the environment variable [code]variable[/code] to [code]value[/code]. The environment variable will be set for the Godot process and any process executed with [method execute] after running [method set_environment]. The environment variable will [i]not[/i] persist to processes run after the Godot process was terminated. + [b]Note:[/b] Double-check the casing of [code]variable[/code]. Environment variable names are case-sensitive on all platforms except Windows. + </description> + </method> <method name="set_thread_name"> <return type="int" enum="Error"> </return> @@ -535,10 +549,6 @@ </method> </methods> <members> - <member name="exit_code" type="int" setter="set_exit_code" getter="get_exit_code" default="0"> - The exit code passed to the OS when the main loop exits. By convention, an exit code of [code]0[/code] indicates success whereas a non-zero exit code indicates an error. For portability reasons, the exit code should be set between 0 and 125 (inclusive). - [b]Note:[/b] This value will be ignored if using [method SceneTree.quit] with an [code]exit_code[/code] argument passed. - </member> <member name="low_processor_usage_mode" type="bool" setter="set_low_processor_usage_mode" getter="is_in_low_processor_usage_mode" default="false"> If [code]true[/code], the engine optimizes for low processor usage by only refreshing the screen if needed. Can improve battery consumption on mobile. </member> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index b056eff658..b68ca2ac67 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -460,6 +460,9 @@ <member name="debug/shapes/collision/contact_color" type="Color" setter="" getter="" default="Color( 1, 0.2, 0.1, 0.8 )"> Color of the contact points between collision shapes, visible when "Visible Collision Shapes" is enabled in the Debug menu. </member> + <member name="debug/shapes/collision/draw_2d_outlines" type="bool" setter="" getter="" default="true"> + Sets whether 2D physics will display collision outlines in game when "Visible Collision Shapes" is enabled in the Debug menu. + </member> <member name="debug/shapes/collision/max_contacts_displayed" type="int" setter="" getter="" default="10000"> Maximum number of contact points between collision shapes to display when "Visible Collision Shapes" is enabled in the Debug menu. </member> diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index f65d013bfc..c54e2f4b88 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -181,10 +181,12 @@ <method name="quit"> <return type="void"> </return> - <argument index="0" name="exit_code" type="int" default="-1"> + <argument index="0" name="exit_code" type="int" default="0"> </argument> <description> - Quits the application at the end of the current iteration. A process [code]exit_code[/code] can optionally be passed as an argument. If this argument is [code]0[/code] or greater, it will override the [member OS.exit_code] defined before quitting the application. + Quits the application at the end of the current iteration. Argument [code]exit_code[/code] can optionally be given (defaulting to 0) to customize the exit status code. + By convention, an exit code of [code]0[/code] indicates success whereas a non-zero exit code indicates an error. + For portability reasons, the exit code should be set between 0 and 125 (inclusive). </description> </method> <method name="reload_current_scene"> diff --git a/doc/classes/SpinBox.xml b/doc/classes/SpinBox.xml index e674ceb57e..a08d4f5b44 100644 --- a/doc/classes/SpinBox.xml +++ b/doc/classes/SpinBox.xml @@ -15,6 +15,7 @@ [/codeblock] The above code will create a [SpinBox], disable context menu on it and set the text alignment to right. See [Range] class for more options over the [SpinBox]. + [b]Note:[/b] [SpinBox] relies on an underlying [LineEdit] node. To theme a [SpinBox]'s background, add theme items for [LineEdit] and customize them. </description> <tutorials> </tutorials> diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index 79ab6e28e7..5635ec2be0 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -9,6 +9,19 @@ <tutorials> </tutorials> <methods> + <method name="create_font_bitmap"> + <return type="RID"> + </return> + <argument index="0" name="height" type="float"> + </argument> + <argument index="1" name="ascent" type="float"> + </argument> + <argument index="2" name="base_size" type="int"> + </argument> + <description> + Creates new, empty bitmap font. To free the resulting font, use [method free_rid] method. + </description> + </method> <method name="create_font_memory"> <return type="RID"> </return> @@ -78,6 +91,51 @@ Draws box displaying character hexadecimal code. Used for replacing missing characters. </description> </method> + <method name="font_bitmap_add_char"> + <return type="void"> + </return> + <argument index="0" name="font" type="RID"> + </argument> + <argument index="1" name="char" type="int"> + </argument> + <argument index="2" name="texture_idx" type="int"> + </argument> + <argument index="3" name="rect" type="Rect2"> + </argument> + <argument index="4" name="align" type="Vector2"> + </argument> + <argument index="5" name="advance" type="float"> + </argument> + <description> + Adds a character to the font, where [code]character[/code] is the Unicode value, [code]texture[/code] is the texture index, [code]rect[/code] is the region in the texture (in pixels!), [code]align[/code] is the (optional) alignment for the character and [code]advance[/code] is the (optional) advance. + </description> + </method> + <method name="font_bitmap_add_kerning_pair"> + <return type="void"> + </return> + <argument index="0" name="font" type="RID"> + </argument> + <argument index="1" name="A" type="int"> + </argument> + <argument index="2" name="B" type="int"> + </argument> + <argument index="3" name="kerning" type="int"> + </argument> + <description> + Adds a kerning pair to the bitmap font as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character. + </description> + </method> + <method name="font_bitmap_add_texture"> + <return type="void"> + </return> + <argument index="0" name="font" type="RID"> + </argument> + <argument index="1" name="texture" type="Texture"> + </argument> + <description> + Adds a texture to the bitmap font. + </description> + </method> <method name="font_draw_glyph" qualifiers="const"> <return type="Vector2"> </return> diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml index 3f7f22ebcd..9f976838e9 100644 --- a/doc/classes/Theme.xml +++ b/doc/classes/Theme.xml @@ -236,7 +236,8 @@ <argument index="1" name="node_type" type="StringName"> </argument> <description> - Returns the icon [StyleBox] at [code]name[/code] if the theme has [code]node_type[/code]. + Returns the [StyleBox] at [code]name[/code] if the theme has [code]node_type[/code]. + Valid [code]name[/code]s may be found using [method get_stylebox_list]. Valid [code]node_type[/code]s may be found using [method get_stylebox_type_list]. </description> </method> <method name="get_stylebox_list" qualifiers="const"> @@ -246,6 +247,7 @@ </argument> <description> Returns all the [StyleBox]s as a [PackedStringArray] filled with each [StyleBox]'s name, for use in [method get_stylebox], if the theme has [code]node_type[/code]. + Valid [code]node_type[/code]s may be found using [method get_stylebox_type_list]. </description> </method> <method name="get_stylebox_type_list" qualifiers="const"> diff --git a/doc/classes/TouchScreenButton.xml b/doc/classes/TouchScreenButton.xml index 768971aecf..bb4c17c531 100644 --- a/doc/classes/TouchScreenButton.xml +++ b/doc/classes/TouchScreenButton.xml @@ -4,7 +4,7 @@ Button for touch screen devices for gameplay use. </brief_description> <description> - TouchScreenButton allows you to create on-screen buttons for touch devices. It's intended for gameplay use, such as a unit you have to touch to move. + TouchScreenButton allows you to create on-screen buttons for touch devices. It's intended for gameplay use, such as a unit you have to touch to move. Unlike [Button], TouchScreenButton supports multitouch out of the box. Several TouchScreenButtons can be pressed at the same time with touch input. This node inherits from [Node2D]. Unlike with [Control] nodes, you cannot set anchors on it. If you want to create menus or user interfaces, you may want to use [Button] nodes instead. To make button nodes react to touch events, you can enable the Emulate Mouse option in the Project Settings. You can configure TouchScreenButton to be visible only on touch devices, helping you develop your game both for desktop and mobile devices. </description> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index f1e799898d..8502707096 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -57,6 +57,13 @@ The new item will be the [code]idx[/code]th child of parent, or it will be the last child if there are not enough siblings. </description> </method> + <method name="edit_selected"> + <return type="bool"> + </return> + <description> + Edits the selected tree item as if it was clicked. The item must be set editable with [method TreeItem.set_editable]. Returns [code]true[/code] if the item could be edited. Fails if no item is selected. + </description> + </method> <method name="ensure_cursor_is_visible"> <return type="void"> </return> |