diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/AStar2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/AStar3D.xml (renamed from doc/classes/AStar.xml) | 36 | ||||
-rw-r--r-- | doc/classes/DisplayServer.xml | 329 | ||||
-rw-r--r-- | doc/classes/FontData.xml | 4 | ||||
-rw-r--r-- | doc/classes/Object.xml | 3 |
5 files changed, 348 insertions, 26 deletions
diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml index 2dde3ad340..4b65a64389 100644 --- a/doc/classes/AStar2D.xml +++ b/doc/classes/AStar2D.xml @@ -4,7 +4,7 @@ AStar class representation that uses 2D vectors as edges. </brief_description> <description> - This is a wrapper for the [AStar] class which uses 2D vectors instead of 3D vectors. + This is a wrapper for the [AStar3D] class which uses 2D vectors instead of 3D vectors. </description> <tutorials> </tutorials> diff --git a/doc/classes/AStar.xml b/doc/classes/AStar3D.xml index cb76fe8cf6..3087b9e363 100644 --- a/doc/classes/AStar.xml +++ b/doc/classes/AStar3D.xml @@ -1,16 +1,16 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AStar" inherits="RefCounted" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="AStar3D" inherits="RefCounted" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> An implementation of A* to find the shortest paths among connected points in space. </brief_description> <description> A* (A star) is a computer algorithm that is widely used in pathfinding and graph traversal, the process of plotting short paths among vertices (points), passing through a given set of edges (segments). It enjoys widespread use due to its performance and accuracy. Godot's A* implementation uses points in three-dimensional space and Euclidean distances by default. You must add points manually with [method add_point] and create segments manually with [method connect_points]. Then you can test if there is a path between two points with the [method are_points_connected] function, get a path containing indices by [method get_id_path], or one containing actual coordinates with [method get_point_path]. - It is also possible to use non-Euclidean distances. To do so, create a class that extends [code]AStar[/code] and override methods [method _compute_cost] and [method _estimate_cost]. Both take two indices and return a length, as is shown in the following example. + It is also possible to use non-Euclidean distances. To do so, create a class that extends [code]AStar3D[/code] and override methods [method _compute_cost] and [method _estimate_cost]. Both take two indices and return a length, as is shown in the following example. [codeblocks] [gdscript] class MyAStar: - extends AStar + extends AStar3D func _compute_cost(u, v): return abs(u - v) @@ -19,7 +19,7 @@ return min(0, abs(u - v) - 1) [/gdscript] [csharp] - public class MyAStar : AStar + public class MyAStar : AStar3D { public override float _ComputeCost(int u, int v) { @@ -44,7 +44,7 @@ <argument index="1" name="to_id" type="int" /> <description> Called when computing the cost between two connected points. - Note that this function is hidden in the default [code]AStar[/code] class. + Note that this function is hidden in the default [code]AStar3D[/code] class. </description> </method> <method name="_estimate_cost" qualifiers="virtual const"> @@ -53,7 +53,7 @@ <argument index="1" name="to_id" type="int" /> <description> Called when estimating the cost between a point and the path's ending point. - Note that this function is hidden in the default [code]AStar[/code] class. + Note that this function is hidden in the default [code]AStar3D[/code] class. </description> </method> <method name="add_point"> @@ -66,11 +66,11 @@ The [code]weight_scale[/code] is multiplied by the result of [method _compute_cost] when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower [code]weight_scale[/code]s to form a path. [codeblocks] [gdscript] - var astar = AStar.new() + var astar = AStar3D.new() astar.add_point(1, Vector3(1, 0, 0), 4) # Adds the point (1, 0, 0) with weight_scale 4 and id 1 [/gdscript] [csharp] - var astar = new AStar(); + var astar = new AStar3D(); astar.AddPoint(1, new Vector3(1, 0, 0), 4); // Adds the point (1, 0, 0) with weight_scale 4 and id 1 [/csharp] [/codeblocks] @@ -101,13 +101,13 @@ Creates a segment between the given points. If [code]bidirectional[/code] is [code]false[/code], only movement from [code]id[/code] to [code]to_id[/code] is allowed, not the reverse direction. [codeblocks] [gdscript] - var astar = AStar.new() + var astar = AStar3D.new() astar.add_point(1, Vector3(1, 1, 0)) astar.add_point(2, Vector3(0, 5, 0)) astar.connect_points(1, 2, false) [/gdscript] [csharp] - var astar = new AStar(); + var astar = new AStar3D(); astar.AddPoint(1, new Vector3(1, 1, 0)); astar.AddPoint(2, new Vector3(0, 5, 0)); astar.ConnectPoints(1, 2, false); @@ -146,14 +146,14 @@ Returns the closest position to [code]to_position[/code] that resides inside a segment between two connected points. [codeblocks] [gdscript] - var astar = AStar.new() + var astar = AStar3D.new() astar.add_point(1, Vector3(0, 0, 0)) astar.add_point(2, Vector3(0, 5, 0)) astar.connect_points(1, 2) var res = astar.get_closest_position_in_segment(Vector3(3, 3, 0)) # Returns (0, 3, 0) [/gdscript] [csharp] - var astar = new AStar(); + var astar = new AStar3D(); astar.AddPoint(1, new Vector3(0, 0, 0)); astar.AddPoint(2, new Vector3(0, 5, 0)); astar.ConnectPoints(1, 2); @@ -168,10 +168,10 @@ <argument index="0" name="from_id" type="int" /> <argument index="1" name="to_id" type="int" /> <description> - Returns an array with the IDs of the points that form the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path. + Returns an array with the IDs of the points that form the path found by AStar3D between the given points. The array is ordered from the starting point to the ending point of the path. [codeblocks] [gdscript] - var astar = AStar.new() + var astar = AStar3D.new() astar.add_point(1, Vector3(0, 0, 0)) astar.add_point(2, Vector3(0, 1, 0), 1) # Default weight is 1 astar.add_point(3, Vector3(1, 1, 0)) @@ -185,7 +185,7 @@ var res = astar.get_id_path(1, 3) # Returns [1, 2, 3] [/gdscript] [csharp] - var astar = new AStar(); + var astar = new AStar3D(); astar.AddPoint(1, new Vector3(0, 0, 0)); astar.AddPoint(2, new Vector3(0, 1, 0), 1); // Default weight is 1 astar.AddPoint(3, new Vector3(1, 1, 0)); @@ -213,7 +213,7 @@ Returns an array with the IDs of the points that form the connection with the given point. [codeblocks] [gdscript] - var astar = AStar.new() + var astar = AStar3D.new() astar.add_point(1, Vector3(0, 0, 0)) astar.add_point(2, Vector3(0, 1, 0)) astar.add_point(3, Vector3(1, 1, 0)) @@ -225,7 +225,7 @@ var neighbors = astar.get_point_connections(1) # Returns [2, 3] [/gdscript] [csharp] - var astar = new AStar(); + var astar = new AStar3D(); astar.AddPoint(1, new Vector3(0, 0, 0)); astar.AddPoint(2, new Vector3(0, 1, 0)); astar.AddPoint(3, new Vector3(1, 1, 0)); @@ -255,7 +255,7 @@ <argument index="0" name="from_id" type="int" /> <argument index="1" name="to_id" type="int" /> <description> - Returns an array with the points that are in the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path. + Returns an array with the points that are in the path found by AStar3D between the given points. The array is ordered from the starting point to the ending point of the path. [b]Note:[/b] This method is not thread-safe. If called from a [Thread], it will return an empty [PackedVector3Array] and will print an error message. </description> </method> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 5a67170086..47bc496100 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -136,7 +136,74 @@ <argument index="1" name="label" type="String" /> <argument index="2" name="callback" type="Callable" /> <argument index="3" name="tag" type="Variant" default="null" /> + <argument index="4" name="accelerator" type="int" enum="Key" default="0" /> + <argument index="5" name="index" type="int" default="-1" /> <description> + Adds a new checkable item with text [code]label[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + </description> + </method> + <method name="global_menu_add_icon_check_item"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="icon" type="Texture2D" /> + <argument index="2" name="label" type="String" /> + <argument index="3" name="callback" type="Callable" /> + <argument index="4" name="tag" type="Variant" default="null" /> + <argument index="5" name="accelerator" type="int" enum="Key" default="0" /> + <argument index="6" name="index" type="int" default="-1" /> + <description> + Adds a new checkable item with text [code]label[/code] and icon [code]icon[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + </description> + </method> + <method name="global_menu_add_icon_item"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="icon" type="Texture2D" /> + <argument index="2" name="label" type="String" /> + <argument index="3" name="callback" type="Callable" /> + <argument index="4" name="tag" type="Variant" default="null" /> + <argument index="5" name="accelerator" type="int" enum="Key" default="0" /> + <argument index="6" name="index" type="int" default="-1" /> + <description> + Adds a new item with text [code]label[/code] and icon [code]icon[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + </description> + </method> + <method name="global_menu_add_icon_radio_check_item"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="icon" type="Texture2D" /> + <argument index="2" name="label" type="String" /> + <argument index="3" name="callback" type="Callable" /> + <argument index="4" name="tag" type="Variant" default="null" /> + <argument index="5" name="accelerator" type="int" enum="Key" default="0" /> + <argument index="6" name="index" type="int" default="-1" /> + <description> + Adds a new radio-checkable item with text [code]label[/code] and icon [code]icon[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] </description> </method> <method name="global_menu_add_item"> @@ -145,13 +212,70 @@ <argument index="1" name="label" type="String" /> <argument index="2" name="callback" type="Callable" /> <argument index="3" name="tag" type="Variant" default="null" /> + <argument index="4" name="accelerator" type="int" enum="Key" default="0" /> + <argument index="5" name="index" type="int" default="-1" /> + <description> + Adds a new item with text [code]label[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + </description> + </method> + <method name="global_menu_add_multistate_item"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="labe" type="String" /> + <argument index="2" name="max_states" type="int" /> + <argument index="3" name="default_state" type="int" /> + <argument index="4" name="callback" type="Callable" /> + <argument index="5" name="tag" type="Variant" default="null" /> + <argument index="6" name="accelerator" type="int" enum="Key" default="0" /> + <argument index="7" name="index" type="int" default="-1" /> + <description> + Adds a new item with text [code]label[/code] to the global menu with ID [code]menu_root[/code]. + Contrarily to normal binary items, multistate items can have more than two states, as defined by [code]max_states[/code]. Each press or activate of the item will increase the state by one. The default value is defined by [code]default_state[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + </description> + </method> + <method name="global_menu_add_radio_check_item"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="label" type="String" /> + <argument index="2" name="callback" type="Callable" /> + <argument index="3" name="tag" type="Variant" default="null" /> + <argument index="4" name="accelerator" type="int" enum="Key" default="0" /> + <argument index="5" name="index" type="int" default="-1" /> <description> + Adds a new radio-checkable item with text [code]label[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] </description> </method> <method name="global_menu_add_separator"> <return type="void" /> <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="index" type="int" default="-1" /> <description> + Adds a separator between items to the global menu with ID [code]menu_root[/code]. Separators also occupy an index. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] </description> </method> <method name="global_menu_add_submenu_item"> @@ -159,41 +283,127 @@ <argument index="0" name="menu_root" type="String" /> <argument index="1" name="label" type="String" /> <argument index="2" name="submenu" type="String" /> + <argument index="3" name="index" type="int" default="-1" /> <description> + Adds an item that will act as a submenu of the global menu [code]menu_root[/code]. The [code]submenu[/code] argument is the ID of the global menu root that will be shown when the item is clicked. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] </description> </method> <method name="global_menu_clear"> <return type="void" /> <argument index="0" name="menu_root" type="String" /> <description> + Removes all items from the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] </description> </method> - <method name="global_menu_get_item_callback"> + <method name="global_menu_get_item_accelerator" qualifiers="const"> + <return type="int" enum="Key" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <description> + Returns the accelerator of the item at index [code]idx[/code]. Accelerators are special combinations of keys that activate the item, no matter which control is focused. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_get_item_callback" qualifiers="const"> <return type="Callable" /> <argument index="0" name="menu_root" type="String" /> <argument index="1" name="idx" type="int" /> <description> + Returns the callback of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_get_item_icon" qualifiers="const"> + <return type="Texture2D" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <description> + Returns the icon of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_get_item_index_from_tag" qualifiers="const"> + <return type="int" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="tag" type="Variant" /> + <description> + Returns the index of the item with the specified [code]tag[/code]. Index is automatically assigned to each item by the engine. Index can not be set manually. + [b]Note:[/b] This method is implemented on macOS. </description> </method> - <method name="global_menu_get_item_submenu"> + <method name="global_menu_get_item_index_from_text" qualifiers="const"> + <return type="int" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="text" type="String" /> + <description> + Returns the index of the item with the specified [code]text[/code]. Index is automatically assigned to each item by the engine. Index can not be set manually. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_get_item_max_states" qualifiers="const"> + <return type="int" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <description> + Returns number of states of an multistate item. See [method global_menu_add_multistate_item] for details. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_get_item_state" qualifiers="const"> + <return type="int" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <description> + Returns the state of an multistate item. See [method global_menu_add_multistate_item] for details. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_get_item_submenu" qualifiers="const"> <return type="String" /> <argument index="0" name="menu_root" type="String" /> <argument index="1" name="idx" type="int" /> <description> + Returns the submenu ID of the item at index [code]idx[/code]. See [method global_menu_add_submenu_item] for more info on how to add a submenu. + [b]Note:[/b] This method is implemented on macOS. </description> </method> - <method name="global_menu_get_item_tag"> + <method name="global_menu_get_item_tag" qualifiers="const"> <return type="Variant" /> <argument index="0" name="menu_root" type="String" /> <argument index="1" name="idx" type="int" /> <description> + Returns the metadata of the specified item, which might be of any type. You can set it with [method global_menu_set_item_tag], which provides a simple way of assigning context data to items. + [b]Note:[/b] This method is implemented on macOS. </description> </method> - <method name="global_menu_get_item_text"> + <method name="global_menu_get_item_text" qualifiers="const"> <return type="String" /> <argument index="0" name="menu_root" type="String" /> <argument index="1" name="idx" type="int" /> <description> + Returns the text of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_get_item_tooltip" qualifiers="const"> + <return type="String" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <description> + Returns the tooltip associated with the specified index index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_is_item_checkable" qualifiers="const"> @@ -201,6 +411,8 @@ <argument index="0" name="menu_root" type="String" /> <argument index="1" name="idx" type="int" /> <description> + Returns [code]true[/code] if the item at index [code]idx[/code] is checkable in some way, i.e. if it has a checkbox or radio button. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_is_item_checked" qualifiers="const"> @@ -208,6 +420,28 @@ <argument index="0" name="menu_root" type="String" /> <argument index="1" name="idx" type="int" /> <description> + Returns [code]true[/code] if the item at index [code]idx[/code] is checked. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_is_item_disabled" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <description> + Returns [code]true[/code] if the item at index [code]idx[/code] is disabled. When it is disabled it can't be selected, or its action invoked. + See [method global_menu_set_item_disabled] for more info on how to disable an item. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_is_item_radio_checkable" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <description> + Returns [code]true[/code] if the item at index [code]idx[/code] has radio button-style checkability. + [b]Note:[/b] This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_remove_item"> @@ -215,6 +449,19 @@ <argument index="0" name="menu_root" type="String" /> <argument index="1" name="idx" type="int" /> <description> + Removes the item at index [code]idx[/code] from the global menu [code]menu_root[/code]. + [b]Note:[/b] The indices of items after the removed item will be shifted by one. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_set_item_accelerator"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <argument index="2" name="keycode" type="int" enum="Key" /> + <description> + Sets the accelerator of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_set_item_callback"> @@ -223,6 +470,8 @@ <argument index="1" name="idx" type="int" /> <argument index="2" name="callback" type="Callable" /> <description> + Sets the callback of the item at index [code]idx[/code]. Callback is emitted when an item is pressed or its accelerator is activated. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_set_item_checkable"> @@ -231,6 +480,8 @@ <argument index="1" name="idx" type="int" /> <argument index="2" name="checkable" type="bool" /> <description> + Sets whether the item at index [code]idx[/code] has a checkbox. If [code]false[/code], sets the type of the item to plain text. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_set_item_checked"> @@ -239,6 +490,60 @@ <argument index="1" name="idx" type="int" /> <argument index="2" name="checked" type="bool" /> <description> + Sets the checkstate status of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_set_item_disabled"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <argument index="2" name="disabled" type="bool" /> + <description> + Enables/disables the item at index [code]idx[/code]. When it is disabled, it can't be selected and its action can't be invoked. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_set_item_icon"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <argument index="2" name="icon" type="Texture2D" /> + <description> + Replaces the [Texture2D] icon of the specified [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Note:[/b] This method is not supported by macOS "_dock" menu items. + </description> + </method> + <method name="global_menu_set_item_max_states"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <argument index="2" name="max_states" type="int" /> + <description> + Sets number of state of an multistate item. See [method global_menu_add_multistate_item] for details. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_set_item_radio_checkable"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <argument index="2" name="checkable" type="bool" /> + <description> + Sets the type of the item at the specified index [code]idx[/code] to radio button. If [code]false[/code], sets the type of the item to plain text + [b]Note:[/b] This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_set_item_state"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <argument index="2" name="state" type="int" /> + <description> + Sets the state of an multistate item. See [method global_menu_add_multistate_item] for details. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_set_item_submenu"> @@ -247,6 +552,8 @@ <argument index="1" name="idx" type="int" /> <argument index="2" name="submenu" type="String" /> <description> + Sets the submenu of the item at index [code]idx[/code]. The submenu is the ID of a global menu root that would be shown when the item is clicked. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_set_item_tag"> @@ -255,6 +562,8 @@ <argument index="1" name="idx" type="int" /> <argument index="2" name="tag" type="Variant" /> <description> + Sets the metadata of an item, which may be of any type. You can later get it with [method global_menu_get_item_tag], which provides a simple way of assigning context data to items. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="global_menu_set_item_text"> @@ -263,6 +572,18 @@ <argument index="1" name="idx" type="int" /> <argument index="2" name="text" type="String" /> <description> + Sets the text of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + </description> + </method> + <method name="global_menu_set_item_tooltip"> + <return type="void" /> + <argument index="0" name="menu_root" type="String" /> + <argument index="1" name="idx" type="int" /> + <argument index="2" name="tooltip" type="String" /> + <description> + Sets the [String] tooltip of the item at the specified index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. </description> </method> <method name="has_feature" qualifiers="const"> diff --git a/doc/classes/FontData.xml b/doc/classes/FontData.xml index 9344a1fe80..313e3e31fc 100644 --- a/doc/classes/FontData.xml +++ b/doc/classes/FontData.xml @@ -3,7 +3,7 @@ <brief_description> Font source data and prerendered glyph cache, imported from dynamic or bitmap font. Supported font formats: - - Dynamic font importer: TrueType (.ttf), OpenType (.otf), WOFF (.woff), Type 1 (.pfb, .pfm). + - Dynamic font importer: TrueType (.ttf), OpenType (.otf), WOFF (.woff), WOFF2 (.woff2), Type 1 (.pfb, .pfm). - Bitmap font importer: AngelCode BMFont (.fnt, .font), text and binary (version 3) format variants. - Monospace image font importer: All supported image formats. </brief_description> @@ -318,7 +318,7 @@ <return type="int" enum="Error" /> <argument index="0" name="path" type="String" /> <description> - Loads a TrueType (.ttf), OpenType (.otf), WOFF (.woff) or Type 1 (.pfb, .pfm) dynamic font from file [code]path[/code]. + Loads a TrueType (.ttf), OpenType (.otf), WOFF (.woff), WOFF2 (.woff2) or Type 1 (.pfb, .pfm) dynamic font from file [code]path[/code]. [b]Warning:[/b] This method should only be used in the editor or in cases when you need to load external fonts at run-time, such as fonts located at the [code]user://[/code] directory. </description> </method> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index a57101b62d..d09f3a2b0d 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -53,7 +53,8 @@ <method name="_init" qualifiers="virtual"> <return type="void" /> <description> - Called when the object is initialized. + Called when the object is initialized in memory. Can be defined to take in parameters, that are passed in when constructing. + [b]Note:[/b] If [method _init] is defined with required parameters, then explicit construction is the only valid means of creating an Object of the class. If any other means (such as [method PackedScene.instantiate]) is used, then initialization will fail. </description> </method> <method name="_notification" qualifiers="virtual"> |