diff options
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/Area.xml | 2 | ||||
-rw-r--r-- | doc/classes/Area2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/Array.xml | 8 | ||||
-rw-r--r-- | doc/classes/BitmapFont.xml | 3 | ||||
-rw-r--r-- | doc/classes/HTTPRequest.xml | 21 | ||||
-rw-r--r-- | doc/classes/ImmediateGeometry.xml | 2 | ||||
-rw-r--r-- | doc/classes/InputEvent.xml | 1 | ||||
-rw-r--r-- | doc/classes/ItemList.xml | 31 | ||||
-rw-r--r-- | doc/classes/KinematicCollision.xml | 2 | ||||
-rw-r--r-- | doc/classes/KinematicCollision2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/Light2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/Node2D.xml | 4 | ||||
-rw-r--r-- | doc/classes/OS.xml | 2 | ||||
-rw-r--r-- | doc/classes/Object.xml | 6 | ||||
-rw-r--r-- | doc/classes/ScrollContainer.xml | 3 |
15 files changed, 69 insertions, 22 deletions
diff --git a/doc/classes/Area.xml b/doc/classes/Area.xml index 6bd1382488..4b0858935d 100644 --- a/doc/classes/Area.xml +++ b/doc/classes/Area.xml @@ -166,7 +166,7 @@ <argument index="3" name="self_shape" type="int"> </argument> <description> - Emitted when another area enters, reporting which areas overlapped. + Emitted when another area enters, reporting which areas overlapped. [code]shape_owner_get_owner(shape_find_owner(shape))[/code] returns the parent object of the owner of the [code]shape[/code]. </description> </signal> <signal name="area_shape_exited"> diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index 9a5870c73d..be3acee9ef 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -155,7 +155,7 @@ <argument index="3" name="self_shape" type="int"> </argument> <description> - Emitted when another area enters, reporting which shapes overlapped. + Emitted when another area enters, reporting which shapes overlapped. [code]shape_owner_get_owner(shape_find_owner(shape))[/code] returns the parent object of the owner of the [code]shape[/code]. </description> </signal> <signal name="area_shape_exited"> diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index e09c1f4b08..2d330fc935 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -93,7 +93,7 @@ <return type="Variant"> </return> <description> - Returns the last element of the array if the array is not empty. + Returns the last element of the array, or [code]null[/code] if the array is empty. </description> </method> <method name="bsearch"> @@ -186,7 +186,7 @@ <return type="Variant"> </return> <description> - Returns the first element of the array if the array is not empty. + Returns the first element of the array, or [code]null[/code] if the array is empty. </description> </method> <method name="has"> @@ -243,14 +243,14 @@ <return type="Variant"> </return> <description> - Removes the last element of the array. + Removes and returns the last element of the array. Returns [code]null[/code] if the array is empty. </description> </method> <method name="pop_front"> <return type="Variant"> </return> <description> - Removes the first element of the array. + Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty. </description> </method> <method name="push_back"> diff --git a/doc/classes/BitmapFont.xml b/doc/classes/BitmapFont.xml index 16a28978d5..5b7c3def63 100644 --- a/doc/classes/BitmapFont.xml +++ b/doc/classes/BitmapFont.xml @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="BitmapFont" inherits="Font" category="Core" version="3.2"> <brief_description> - Renders text using [code]*.fnt[/code] fonts. + Renders text using fonts under the [url=https://www.angelcode.com/products/bmfont/]BMFont[/url] format. + Handles files with the [code].fnt[/code] extension </brief_description> <description> Renders text using [code]*.fnt[/code] fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see [DynamicFont]. diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index 2fed423a32..748ed504c3 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -6,6 +6,27 @@ <description> A node with the ability to send HTTP requests. Uses [HTTPClient] internally. Can be used to make HTTP requests, i.e. download or upload files or web content via HTTP. + [b]Example of contacting a REST API and printing one of its returned fields:[/b] + [codeblock] + func _ready(): + # Create an HTTP request node and connect its completion signal. + var http_request = HTTPRequest.new() + add_child(http_request) + http_request.connect("request_completed", self, "_http_request_completed") + + # Perform the HTTP request. The URL below returns some JSON as of writing. + var error = http_request.request("https://httpbin.org/get") + if error != OK: + push_error("An error occurred in the HTTP request.") + + + # Called when the HTTP request is completed. + func _http_request_completed(result, response_code, headers, body): + var response = parse_json(body.get_string_from_utf8()) + + # Will print the user agent string used by the HTTPRequest node (as recognized by httpbin.org). + print(response.headers["User-Agent"]) + [/codeblock] [b]Example of loading and displaying an image using HTTPRequest:[/b] [codeblock] func _ready(): diff --git a/doc/classes/ImmediateGeometry.xml b/doc/classes/ImmediateGeometry.xml index e0807760f7..416128c9b1 100644 --- a/doc/classes/ImmediateGeometry.xml +++ b/doc/classes/ImmediateGeometry.xml @@ -30,7 +30,7 @@ <argument index="0" name="position" type="Vector3"> </argument> <description> - Adds a vertex with the currently set color/uv/etc. + Adds a vertex in local coordinate space with the currently set color/uv/etc. </description> </method> <method name="begin"> diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index d412ce09e2..ccb5c5400a 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -111,6 +111,7 @@ <members> <member name="device" type="int" setter="set_device" getter="get_device" default="0"> The event's device ID. + [b]Note:[/b] This device ID will always be [code]-1[/code] for emulated mouse input from a touchscreen. This can be used to distinguish emulated mouse input from physical mouse input. </member> </members> <constants> diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index c82d6a27c0..51d13627ad 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -6,6 +6,7 @@ <description> This control provides a selectable list of items that may be in a single (or multiple columns) with option of text, icons, or both text and icon. Tooltips are supported and may be different for every item in the list. Selectable items in the list may be selected or deselected and multiple selection may be enabled. Selection with right mouse button may also be enabled to allow use of popup context menus. Items may also be "activated" by double-clicking them or by pressing Enter. + Item text only supports single-line strings, newline characters (e.g. [code]\n[/code]) in the string won't produce a newline. Text wrapping is enabled in [constant ICON_MODE_TOP] mode, but column's width is adjusted to fully fit its content by default. You need to set [member fixed_column_width] greater than zero to wrap the text. </description> <tutorials> </tutorials> @@ -57,7 +58,8 @@ <argument index="1" name="exact" type="bool" default="false"> </argument> <description> - Given a position within the control return the item (if any) at that point. + Returns the item index at the given [code]position[/code]. + When there is no item at that point, -1 will be returned if [code]exact[/code] is [code]true[/code], and the closest item index will be returned otherwise. </description> </method> <method name="get_item_count" qualifiers="const"> @@ -109,6 +111,7 @@ <argument index="0" name="idx" type="int"> </argument> <description> + Returns the region of item's icon used. The whole icon will be used if the region has no area. </description> </method> <method name="get_item_metadata" qualifiers="const"> @@ -174,6 +177,7 @@ <argument index="0" name="idx" type="int"> </argument> <description> + Returns [code]true[/code] if the item icon will be drawn transposed, i.e. the X and Y axes are swapped. </description> </method> <method name="is_item_selectable" qualifiers="const"> @@ -307,6 +311,7 @@ <argument index="1" name="rect" type="Rect2"> </argument> <description> + Sets the region of item's icon used. The whole icon will be used if the region has no area. </description> </method> <method name="set_item_icon_transposed"> @@ -314,9 +319,10 @@ </return> <argument index="0" name="idx" type="int"> </argument> - <argument index="1" name="rect" type="bool"> + <argument index="1" name="transposed" type="bool"> </argument> <description> + Sets whether the item icon will be drawn transposed. </description> </method> <method name="set_item_metadata"> @@ -409,26 +415,33 @@ If [code]true[/code], the control will automatically resize the height to fit its content. </member> <member name="fixed_column_width" type="int" setter="set_fixed_column_width" getter="get_fixed_column_width" default="0"> - Sets the default column width in pixels. If left to default value, each item will have a width equal to the width of its content and the columns will have an uneven width. + The width all columns will be adjusted to. + A value of zero disables the adjustment, each item will have a width equal to the width of its content and the columns will have an uneven width. </member> <member name="fixed_icon_size" type="Vector2" setter="set_fixed_icon_size" getter="get_fixed_icon_size" default="Vector2( 0, 0 )"> - Sets the default icon size in pixels. + The size all icons will be adjusted to. + If either X or Y component is not greater than zero, icon size won't be affected. </member> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="2" /> <member name="icon_mode" type="int" setter="set_icon_mode" getter="get_icon_mode" enum="ItemList.IconMode" default="1"> - Sets the default position of the icon to either [constant ICON_MODE_LEFT] or [constant ICON_MODE_TOP]. + The icon position, whether above or to the left of the text. See the [enum IconMode] constants. </member> <member name="icon_scale" type="float" setter="set_icon_scale" getter="get_icon_scale" default="1.0"> - Sets the icon size to its initial size multiplied by the specified scale. + The scale of icon applied after [member fixed_icon_size] and transposing takes effect. </member> <member name="max_columns" type="int" setter="set_max_columns" getter="get_max_columns" default="1"> - Sets the maximum columns the list will have. If set to anything other than the default, the content will be split among the specified columns. + Maximum columns the list will have. + If greater than zero, the content will be split among the specified columns. + A value of zero means unlimited columns, i.e. all items will be put in the same row. </member> <member name="max_text_lines" type="int" setter="set_max_text_lines" getter="get_max_text_lines" default="1"> + Maximum lines of text allowed in each item. Space will be reserved even when there is not enough lines of text to display. + [b]Note:[/b] This property takes effect only when [member icon_mode] is [constant ICON_MODE_TOP]. To make the text wrap, [member fixed_column_width] should be greater than zero. </member> <member name="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents" override="true" default="true" /> <member name="same_column_width" type="bool" setter="set_same_column_width" getter="is_same_column_width" default="false"> - If set to [code]true[/code], all columns will have the same width specified by [member fixed_column_width]. + Whether all columns will have the same width. + If [code]true[/code], the width is equal to the largest column width of all columns. </member> <member name="select_mode" type="int" setter="set_select_mode" getter="get_select_mode" enum="ItemList.SelectMode" default="0"> Allows single or multiple item selection. See the [enum SelectMode] constants. @@ -486,8 +499,10 @@ </signals> <constants> <constant name="ICON_MODE_TOP" value="0" enum="IconMode"> + Icon is drawn above the text. </constant> <constant name="ICON_MODE_LEFT" value="1" enum="IconMode"> + Icon is drawn to the left of the text. </constant> <constant name="SELECT_SINGLE" value="0" enum="SelectMode"> Only allow selecting a single item. diff --git a/doc/classes/KinematicCollision.xml b/doc/classes/KinematicCollision.xml index 44447c8fc8..46e4176e9f 100644 --- a/doc/classes/KinematicCollision.xml +++ b/doc/classes/KinematicCollision.xml @@ -16,7 +16,7 @@ The colliding body. </member> <member name="collider_id" type="int" setter="" getter="get_collider_id" default="0"> - The colliding body's unique [RID]. + The colliding body's unique instance ID. See [method Object.get_instance_id]. </member> <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata"> The colliding body's metadata. See [Object]. diff --git a/doc/classes/KinematicCollision2D.xml b/doc/classes/KinematicCollision2D.xml index 51c2277fb2..4c9337f82d 100644 --- a/doc/classes/KinematicCollision2D.xml +++ b/doc/classes/KinematicCollision2D.xml @@ -16,7 +16,7 @@ The colliding body. </member> <member name="collider_id" type="int" setter="" getter="get_collider_id" default="0"> - The colliding body's unique [RID]. + The colliding body's unique instance ID. See [method Object.get_instance_id]. </member> <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata"> The colliding body's metadata. See [Object]. diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml index 5bb90daaf4..cdc0270269 100644 --- a/doc/classes/Light2D.xml +++ b/doc/classes/Light2D.xml @@ -68,7 +68,7 @@ Smooth shadow gradient length. </member> <member name="shadow_item_cull_mask" type="int" setter="set_item_shadow_cull_mask" getter="get_item_shadow_cull_mask" default="1"> - The shadow mask. Used with [LightOccluder2D] to cast shadows. Only occluders with a matching shadow mask will cast shadows. + The shadow mask. Used with [LightOccluder2D] to cast shadows. Only occluders with a matching light mask will cast shadows. </member> <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> [Texture] used for the Light2D's appearance. diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml index 29c4680685..67e9597781 100644 --- a/doc/classes/Node2D.xml +++ b/doc/classes/Node2D.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Node2D" inherits="CanvasItem" category="Core" version="3.2"> <brief_description> - A 2D game object, parent of all 2D-related nodes. Has a position, rotation, scale and Z index. + A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and Z index. </brief_description> <description> - A 2D game object, with a position, rotation and scale. All 2D physics nodes and sprites inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control on the node's render order. + A 2D game object, with a transform (position, rotation, and scale). All 2D nodes, including physics objects and sprites, inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control of the node's render order. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 54b4f3df64..265e87eba3 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -905,7 +905,7 @@ The current screen index (starting from 0). </member> <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. + 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). </member> <member name="keep_screen_on" type="bool" setter="set_keep_screen_on" getter="is_keep_screen_on" default="true"> If [code]true[/code], the engine tries to keep the screen on while the game is running. Useful on mobile. diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index 5a09fe39c0..1e5b8669fd 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -9,6 +9,12 @@ Objects do not manage memory. If a class inherits from Object, you will have to delete instances of it manually. To do so, call the [method free] method from your script or delete the instance from C++. Some classes that extend Object add memory management. This is the case of [Reference], which counts references and deletes itself automatically when no longer referenced. [Node], another fundamental type, deletes all its children when freed from memory. Objects export properties, which are mainly useful for storage and editing, but not really so much in programming. Properties are exported in [method _get_property_list] and handled in [method _get] and [method _set]. However, scripting languages and C++ have simpler means to export them. + Property membership can be tested directly in GDScript using [code]in[/code]: + [codeblock] + var n = Node2D.new() + print("position" in n) # Prints "True". + print("other_property" in n) # Prints "False". + [/codeblock] Objects also receive notifications. Notifications are a simple way to notify the object about different events, so they can all be handled together. See [method _notification]. </description> <tutorials> diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml index 5218b65886..f57730a591 100644 --- a/doc/classes/ScrollContainer.xml +++ b/doc/classes/ScrollContainer.xml @@ -24,6 +24,9 @@ </methods> <members> <member name="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents" override="true" default="true" /> + <member name="follow_focus" type="bool" setter="set_follow_focus" getter="is_following_focus" default="false"> + If [code]true[/code], the ScrollContainer will automatically scroll to focused children (including indirect children) to make sure they are fully visible. + </member> <member name="scroll_deadzone" type="int" setter="set_deadzone" getter="get_deadzone" default="0"> </member> <member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0"> |