diff options
Diffstat (limited to 'doc/base')
-rw-r--r-- | doc/base/classes.xml | 267 |
1 files changed, 156 insertions, 111 deletions
diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 3e1a77c120..b8156133de 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<doc version="2.1.alpha.custom_build" name="Engine Types"> +<doc version="2.1.beta.custom_build" name="Engine Types"> <class name="@GDScript" category="Core"> <brief_description> Built-in GDScript functions. @@ -6687,24 +6687,18 @@ This node is intended to be a simple helper get get things going quickly and it may happen often that more functionality is desired to change how the camera works. To make your own custom camera node, simply inherit from [Node2D] and change the transform of the canvas by calling get_viewport().set_canvas_transform(m) in [Viewport]. </description> <methods> - <method name="clear_current"> - <description> - </description> - </method> - <method name="force_update_scroll"> + <method name="align"> <description> - Force the camera to update scroll immediately. + Align the camera to the tracked node </description> </method> - <method name="reset_smoothing"> + <method name="clear_current"> <description> - Set the camera's position immediately to its current smoothing destination. - This has no effect if smoothing is disabled. </description> </method> - <method name="align"> + <method name="force_update_scroll"> <description> - Align the camera to the tracked node + Force the camera to update scroll immediately. </description> </method> <method name="get_anchor_mode" qualifiers="const"> @@ -6811,6 +6805,12 @@ Make this the current 2D camera for the scene (viewport and layer), in case there's many cameras in the scene. </description> </method> + <method name="reset_smoothing"> + <description> + Set the camera's position immediately to its current smoothing destination. + This has no effect if smoothing is disabled. + </description> + </method> <method name="set_anchor_mode"> <argument index="0" name="anchor_mode" type="int"> </argument> @@ -7281,24 +7281,21 @@ Return true if this CanvasItem is visible. It may be invisible because itself or a parent canvas item is hidden. </description> </method> - <method name="make_input_local" qualifiers="const"> - <return type="InputEvent"> + <method name="make_canvas_pos_local" qualifiers="const"> + <return type="Vector2"> </return> - <argument index="0" name="event" type="InputEvent"> + <argument index="0" name="screen_point" type="Vector2"> </argument> <description> - Takes a global input event and convert to this item's coordinate system. </description> </method> - <method name="make_screen_coord_local" qualifiers="const"> - <return type="Vector2"> + <method name="make_input_local" qualifiers="const"> + <return type="InputEvent"> </return> - <argument index="0" name="screen_point" type="Vector2"> + <argument index="0" name="event" type="InputEvent"> </argument> <description> - Take a 2d screen point and convert to 2D local coords relative to this Canvas - item. If this CanvasItem is the root of a Scene, its essentially the - world coords for that scene. + Takes a global input event and convert to this item's coordinate system. </description> </method> <method name="set_as_toplevel"> @@ -8663,7 +8660,7 @@ <return type="bool"> </return> <description> - Returns whether this color picker is in raw mode or not, raw mode will allow the color R, G, B component values to go beyond 1, you have to consider that the max value for color components is 1, going beyond that value will not have effect in the color, but can be used for special operations that require it (like tinting without darkening or rendering sprites in HDR). + Returns whether this color picker is in raw mode or not, raw mode will allow the color R, G, B component values to go beyond 1, you have to consider that the max value for color components is 1, going beyond that value will not have effect in the color, but can be used for special operations that require it (like tinting without darkening or rendering sprites in HDR). </description> </method> <method name="set_color"> @@ -8684,7 +8681,7 @@ <argument index="0" name="mode" type="bool"> </argument> <description> - Set whether this color picker is using raw mode or not, see [method is_raw_mode]. + Set whether this color picker is using raw mode or not, see [method is_raw_mode]. </description> </method> </methods> @@ -11773,6 +11770,10 @@ Add an unscaled billboard for visualization. Call this function during [method redraw]. </description> </method> + <method name="clear"> + <description> + </description> + </method> <method name="commit_handle" qualifiers="virtual"> <argument index="0" name="index" type="int"> </argument> @@ -12999,11 +13000,6 @@ Return the font descent (number of pixels below the baseline). </description> </method> - <method name="update_changes"> - <description> - After editing a font (changing size, ascent, char rects, etc.). Call this function to propagate changes to controls that might use it. - </description> - </method> <method name="get_height" qualifiers="const"> <return type="float"> </return> @@ -13026,6 +13022,11 @@ <description> </description> </method> + <method name="update_changes"> + <description> + After editing a font (changing size, ascent, char rects, etc.). Call this function to propagate changes to controls that might use it. + </description> + </method> </methods> <constants> </constants> @@ -15799,7 +15800,7 @@ <return type="Array"> </return> <description> - Returns an [Array] containing the device IDs of all currently connected joysticks. + Returns an [Array] containing the device IDs of all currently connected joysticks. </description> </method> <method name="get_gyroscope"> @@ -15881,7 +15882,7 @@ <return type="Vector2"> </return> <description> - Returns the mouse speed. + Returns the mouse speed for the last time the cursor was moved, and this until the next frame where the mouse moves. This means that even if the mouse is not moving, this function will still return the value of the last motion. </description> </method> <method name="is_action_pressed"> @@ -18301,6 +18302,12 @@ Return the restricted number of characters to display. Returns -1 if unrestricted. </description> </method> + <method name="get_visible_line_count" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="has_autowrap" qualifiers="const"> <return type="bool"> </return> @@ -21440,66 +21447,78 @@ </class> <class name="Node" inherits="Object" category="Core"> <brief_description> - Base class for all the "Scene" elements. + Base class for all the [i]scene[/i] elements. </brief_description> <description> - Nodes can be set as children of other nodes, resulting in a tree arrangement. Any tree of nodes is called a "Scene". - Scenes can be saved to disk, and then instanced into other scenes. This allows for very high flexibility in the architecture and data model of the projects. - [SceneTree] contains the "active" tree of nodes, and a node becomes active (receiving NOTIFICATION_ENTER_SCENE) when added to that tree. - A node can contain any number of nodes as a children (but there is only one tree root) with the requirement that no two children with the same name can exist. - Nodes can, optionally, be added to groups. This makes it easy to reach a number of nodes from the code (for example an "enemies" group). - Nodes can be set to "process" state, so they constantly receive a callback requesting them to process (do anything). Normal processing ([method _process]) happens as fast as possible and is dependent on the frame rate, so the processing time delta is variable. Fixed processing ([method _fixed_process]) happens a fixed amount of times per second (by default 60) and is useful to link itself to the physics. - Nodes can also process input events. When set, the [method _input] function will be called with every input that the program receives. Since this is usually too overkill (unless used for simple projects), an [method _unhandled_input] function is called when the input was not handled by anyone else (usually, GUI [Control] nodes). - To keep track of the scene hierarchy (specially when instancing scenes into scenes) an "owner" can be set to a node. This keeps track of who instanced what. This is mostly useful when writing editors and tools, though. - Finally, when a node is freed, it will free all its children nodes too. + Nodes are the base bricks with which Godot games are developed. They can be set as children of other nodes, resulting in a tree arrangement. A given node can contain any number of nodes as children (but there is only one scene tree root node) with the requirement that all siblings (direct children of a node) should have unique names. + Any tree of nodes is called a [i]scene[/i]. Scenes can be saved to the disk and then instanced into other scenes. This allows for very high flexibility in the architecture and data model of the projects. Nodes can optionally be added to groups. This makes it easy to reach a number of nodes from the code (for example an "enemies" group) to perform grouped actions. + [b]Scene tree:[/b] The [SceneTree] contains the active tree of nodes. When a node is added to the scene tree, it receives the NOTIFICATION_ENTER_TREE notification and its [method _enter_tree] callback is triggered. Children nodes are always added [i]after[/i] their parent node, i.e. the [method _enter_tree] callback of a parent node will be triggered before its child's. + Once all nodes have been added in the scene tree, they receive the NOTIFICATION_READY notification and their respective [method _ready] callbacks are triggered. For groups of nodes, the [method _ready] callback is called in reverse order, from the children up to the parent nodes. + It means that when adding a scene to the scene tree, the following order will be used for the callbacks: [method _enter_tree] of the parent, [method _enter_tree] of the children, [method _ready] of the children and finally [method _ready] of the parent (and that recursively for the whole scene). + [b]Processing:[/b] Nodes can be set to the "process" state, so that they receive a callback on each frame requesting them to process (do something). Normal processing (callback [method _process], toggled with [method set_process]) happens as fast as possible and is dependent on the frame rate, so the processing time [i]delta[/i] is variable. Fixed processing (callback [method _fixed_process], toggled with [method set_fixed_process]) happens a fixed amount of times per second (by default 60) and is useful to link itself to the physics. + Nodes can also process input events. When set, the [method _input] function will be called for each input that the program receives. In many cases, this can be overkill (unless used for simple projects), and the [method _unhandled_input] function might be preferred; it is called when the input event was not handled by anyone else (typically, GUI [Control] nodes), ensuring that the node only receives the events that were meant for it. + To keep track of the scene hierarchy (especially when instancing scenes into other scenes), an "owner" can be set for the node with [method set_owner]. This keeps track of who instanced what. This is mostly useful when writing editors and tools, though. + Finally, when a node is freed with [method free] or [method queue_free], it will also free all its children. </description> <methods> <method name="_enter_tree" qualifiers="virtual"> <description> + Called when the node enters the [SceneTree] (e.g. upon instancing, scene changing or after calling [method add_child] in a script). If the node has children, its [method _enter_tree] callback will be called first, and then that of the children. + Corresponds to the NOTIFICATION_ENTER_TREE notification in [method Object._notification]. </description> </method> <method name="_exit_tree" qualifiers="virtual"> <description> + Called when the node leaves the [SceneTree] (e.g. upon freeing, scene changing or after calling [method remove_child] in a script). If the node has children, its [method _exit_tree] callback will be called last, after all its children have left the tree. + Corresponds to the NOTIFICATION_EXIT_TREE notification in [method Object._notification]. </description> </method> <method name="_fixed_process" qualifiers="virtual"> <argument index="0" name="delta" type="float"> </argument> <description> - Called for fixed processing (synced to the physics). + Called during the fixed processing step of the main loop. Fixed processing means that the frame rate is synced to the physics, i.e. the [code]delta[/code] variable should be constant. + It is only called if fixed processing has been enabled with [method set_fixed_process]. + Corresponds to the NOTIFICATION_FIXED_PROCESS notification in [method Object._notification]. </description> </method> <method name="_input" qualifiers="virtual"> <argument index="0" name="event" type="InputEvent"> </argument> <description> - Called when any input happens (also must enable with [method set_process_input] or the property). + Called for every input event. + It has to be enabled with [method set_process_input] or the corresponding property in the inspector. </description> </method> <method name="_process" qualifiers="virtual"> <argument index="0" name="delta" type="float"> </argument> <description> - Called for processing. This is called every frame, with the delta time from the previous frame. + Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the [code]delta[/code] time since the previous frame is not constant. + It is only called if processing has been enabled with [method set_process]. + Corresponds to the NOTIFICATION_PROCESS notification in [method Object._notification]. </description> </method> <method name="_ready" qualifiers="virtual"> <description> - Called when ready (entered scene and children entered too). + Called when the node is "ready", i.e. when both the node and its children have entered the scene tree. If the node has children, their [method _ready] callback gets triggered first, and the node will receive the ready notification only afterwards. + Corresponds to the NOTIFICATION_READY notification in [method Object._notification]. </description> </method> <method name="_unhandled_input" qualifiers="virtual"> <argument index="0" name="event" type="InputEvent"> </argument> <description> - Called when any input happens that was not handled by something else (also must enable with [method set_process_unhandled_input] or the property). + Called for every input event that has not already been handled by another node. + It has to be enabled with [method set_process_unhandled_input] or the corresponding property in the inspector. </description> </method> <method name="_unhandled_key_input" qualifiers="virtual"> <argument index="0" name="key_event" type="InputEvent"> </argument> <description> - Called when any key input happens that was not handled by something else. + Called for every [i]key[/i] input event that has not already been handled by another node. + It has to be enabled with [method set_process_unhandled_key_input] or the corresponding property in the inspector. </description> </method> <method name="add_child"> @@ -21509,7 +21528,7 @@ </argument> <description> Add a child [Node]. Nodes can have as many children as they want, but every child must have a unique name. Children nodes are automatically deleted when the parent node is deleted, so deleting a whole scene is performed by deleting its topmost node. - The optional boolean argument enforces creating child node with human-readable names, based on the name of node being instanced instead of its type only. + The optional boolean argument enforces creating child nodes with human-readable names, based on the name of the node being instanced instead of its type only. </description> </method> <method name="add_to_group"> @@ -21518,14 +21537,14 @@ <argument index="1" name="persistent" type="bool" default="false"> </argument> <description> - Add a node to a group. Groups are helpers to name and organize group of nodes, like for example: "Enemies", "Collectables", etc. A [Node] can be in any number of groups. Nodes can be assigned a group at any time, but will not be added to it until they are inside the scene tree (see [method is_inside_tree]). + Add a node to a group. Groups are helpers to name and organize a subset of nodes, like for example "enemies" or "collectables". A [Node] can be in any number of groups. Nodes can be assigned a group at any time, but will not be added to it until they are inside the scene tree (see [method is_inside_tree]). </description> </method> <method name="can_process" qualifiers="const"> <return type="bool"> </return> <description> - Return true if the node can process. + Return true if the node can process, i.e. whether its pause mode allows processing while the scene tree is paused (see [method set_pause_mode]). Always returns true if the scene tree is not paused, and false if the node is not in the tree. FIXME: Why FAIL_COND? </description> </method> <method name="duplicate" qualifiers="const"> @@ -21534,6 +21553,7 @@ <argument index="0" name="use_instancing" type="bool" default="false"> </argument> <description> + Duplicate the node, returning a new [Node]. If [code]use_instancing[/code] is true, the duplicated node will be a new instance of the original [PackedScene], if not it will be an independent node. The duplicated node has the same group assignments and signals as the original one. </description> </method> <method name="find_node" qualifiers="const"> @@ -21555,54 +21575,56 @@ <argument index="0" name="idx" type="int"> </argument> <description> - Return a children node by it's index (see [method get_child_count]). This method is often used for iterating all children of a node. + Return a child node by its index (see [method get_child_count]). This method is often used for iterating all children of a node. </description> </method> <method name="get_child_count" qualifiers="const"> <return type="int"> </return> <description> - Return the amount of children nodes. + Return the amount of child nodes. </description> </method> <method name="get_children" qualifiers="const"> <return type="Array"> </return> <description> + Return an array of references ([Node]) to the child nodes. </description> </method> <method name="get_filename" qualifiers="const"> <return type="String"> </return> <description> - Return a filename that may be containedA node can contained by the node. When a scene is instanced from a file, it topmost node contains the filename from where it was loaded (see [method set_filename]). + Return a filename that may be contained by the node. When a scene is instanced from a file, it topmost node contains the filename from where it was loaded (see [method set_filename]). </description> </method> <method name="get_fixed_process_delta_time" qualifiers="const"> <return type="float"> </return> <description> - Return the time elapsed since the last fixed frame. This is always the same in fixed processing unless the frames per second is changed in [OS]. + Return the time elapsed since the last fixed frame (see [method _fixed_process]). This is always the same in fixed processing unless the frames per second is changed in [OS]. </description> </method> <method name="get_groups" qualifiers="const"> <return type="Array"> </return> <description> + Return an array listing the groups that the node is part of. </description> </method> <method name="get_index" qualifiers="const"> <return type="int"> </return> <description> - Get the node index in the parent (assuming it has a parent). + Get the node index, i.e. its position among the siblings of its parent. </description> </method> <method name="get_name" qualifiers="const"> <return type="String"> </return> <description> - Return the name of the [Node]. Name is be unique within parent. + Return the name of the node. This name is unique among the siblings (other child nodes from the same parent). </description> </method> <method name="get_node" qualifiers="const"> @@ -21611,17 +21633,18 @@ <argument index="0" name="path" type="NodePath"> </argument> <description> - Fetch a node. NodePath must be valid (or else error will occur) and can be either the path to child node, a relative path (from the current node to another node), or an absolute path to a node. - Note: fetching absolute paths only works when the node is inside the scene tree (see [method is_inside_tree]). Examples. Assume your current node is Character and following tree: + Fetch a node. The [NodePath] must be valid (or else an error will be raised) and can be either the path to child node, a relative path (from the current node to another node), or an absolute path to a node. + Note: fetching absolute paths only works when the node is inside the scene tree (see [method is_inside_tree]). + [i]Example:[/i] Assume your current node is Character and the following tree: [codeblock] - root/ - root/Character - root/Character/Sword - root/Character/Backpack/Dagger - root/MyGame - root/Swamp/Alligator - root/Swamp/Mosquito - root/Swamp/Goblin + /root + /root/Character + /root/Character/Sword + /root/Character/Backpack/Dagger + /root/MyGame + /root/Swamp/Alligator + /root/Swamp/Mosquito + /root/Swamp/Goblin [/codeblock] Possible paths are: [codeblock] @@ -21651,7 +21674,7 @@ <return type="Node"> </return> <description> - Return the parent [Node] of the current [Node], or an empty Object if the node lacks a parent. + Return the parent node of the current node, or an empty [Node] if the node lacks a parent. </description> </method> <method name="get_path" qualifiers="const"> @@ -21738,12 +21761,6 @@ <description> </description> </method> - <method name="is_displayed_folded" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> <method name="is_fixed_processing" qualifiers="const"> <return type="bool"> </return> @@ -21869,12 +21886,6 @@ <description> </description> </method> - <method name="set_display_folded"> - <argument index="0" name="fold" type="bool"> - </argument> - <description> - </description> - </method> <method name="set_filename"> <argument index="0" name="filename" type="String"> </argument> @@ -22426,6 +22437,12 @@ Return the total amount of dynamic memory used (only works in debug). </description> </method> + <method name="get_engine_version" qualifiers="const"> + <return type="Dictionary"> + </return> + <description> + </description> + </method> <method name="get_environment" qualifiers="const"> <return type="String"> </return> @@ -22472,6 +22489,12 @@ Return the amount of fixed iterations per second (for fixed process and physics). </description> </method> + <method name="get_latin_keyboard_variant" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> <method name="get_locale" qualifiers="const"> <return type="String"> </return> @@ -31637,7 +31660,7 @@ <return type="String"> </return> <description> - Returns the raw text, stripping out the formatting information. + Returns the raw text, stripping out the formatting information. </description> </method> <method name="get_total_character_count" qualifiers="const"> @@ -32883,6 +32906,12 @@ Return the sample from the library matching the given text ID. Return null if the sample is not found. </description> </method> + <method name="get_sample_list" qualifiers="const"> + <return type="Array"> + </return> + <description> + </description> + </method> <method name="has_sample" qualifiers="const"> <return type="bool"> </return> @@ -39241,6 +39270,13 @@ Return the line the editing cursor is at. </description> </method> + <method name="cursor_is_block_mode" qualifiers="const"> + <return type="bool"> + </return> + <description> + Gets whether the text editor caret is in block mode. + </description> + </method> <method name="cursor_set_blink_enabled"> <argument index="0" name="enable" type="bool"> </argument> @@ -39262,13 +39298,6 @@ Set the text editor caret to block mode. </description> </method> - <method name="cursor_is_block_mode" qualifiers="const"> - <return type="bool"> - </return> - <description> - Gets whether the text editor caret is in block mode. - </description> - </method> <method name="cursor_set_column"> <argument index="0" name="column" type="int"> </argument> @@ -39367,6 +39396,13 @@ Insert a given text at the cursor position. </description> </method> + <method name="is_highlight_all_occurrences_enabled" qualifiers="const"> + <return type="bool"> + </return> + <description> + Returns true if highlight all occurrences is enabled. + </description> + </method> <method name="is_selection_active" qualifiers="const"> <return type="bool"> </return> @@ -39374,6 +39410,13 @@ Return true if the selection is active. </description> </method> + <method name="is_show_line_numbers_enabled" qualifiers="const"> + <return type="bool"> + </return> + <description> + Returns true if line numbers are enabled. + </description> + </method> <method name="is_syntax_coloring_enabled" qualifiers="const"> <return type="bool"> </return> @@ -39437,6 +39480,13 @@ Set a custom background color. A background color with alpha==0 disables this. </description> </method> + <method name="set_highlight_all_occurrences"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + Set to enable highlighting all occurrences of the current selection. + </description> + </method> <method name="set_max_chars"> <argument index="0" name="amount" type="int"> </argument> @@ -39451,13 +39501,6 @@ Set the text editor as read-only. Text can be displayed but not edited. </description> </method> - <method name="set_symbol_color"> - <argument index="0" name="color" type="Color"> - </argument> - <description> - Set the color for symbols. - </description> - </method> <method name="set_show_line_numbers"> <argument index="0" name="enable" type="bool"> </argument> @@ -39465,25 +39508,11 @@ Set to enable showing line numbers. </description> </method> - <method name="is_show_line_numbers_enabled" qualifiers="const"> - <return type="bool"> - </return> - <description> - Returns true if line numbers are enabled. - </description> - </method> - <method name="set_highlight_all_occurrences"> - <argument index="0" name="enable" type="bool"> + <method name="set_symbol_color"> + <argument index="0" name="color" type="Color"> </argument> <description> - Set to enable highlighting all occurrences of the current selection. - </description> - </method> - <method name="is_highlight_all_occurrences_enabled" qualifiers="const"> - <return type="bool"> - </return> - <description> - Returns true if highlight all occurrences is enabled. + Set the color for symbols. </description> </method> <method name="set_syntax_coloring"> @@ -39515,6 +39544,8 @@ </methods> <signals> <signal name="breakpoint_toggled"> + <argument index="0" name="row" type="int"> + </argument> <description> Emitted when a breakpoint is placed via the breakpoint gutter. </description> @@ -40754,6 +40785,8 @@ <constant name="TILE_ORIGIN_CENTER" value="1"> Tile origin at its center. </constant> + <constant name="TILE_ORIGIN_BOTTOM_LEFT" value="2"> + </constant> </constants> </class> <class name="TileSet" inherits="Resource" category="Core"> @@ -42152,6 +42185,16 @@ <description> </description> </method> + <method name="set_button"> + <argument index="0" name="column" type="int"> + </argument> + <argument index="1" name="button_idx" type="int"> + </argument> + <argument index="2" name="button" type="Texture"> + </argument> + <description> + </description> + </method> <method name="set_cell_mode"> <argument index="0" name="column" type="int"> </argument> @@ -45006,6 +45049,8 @@ </argument> <argument index="2" name="arg2" type="int"> </argument> + <argument index="3" name="arg3" type="Rect2"> + </argument> <description> </description> </method> |