diff options
Diffstat (limited to 'doc/base/classes.xml')
-rw-r--r-- | doc/base/classes.xml | 261 |
1 files changed, 203 insertions, 58 deletions
diff --git a/doc/base/classes.xml b/doc/base/classes.xml index df1d0262ac..b49c23f117 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -2519,6 +2519,11 @@ Emitted when frame is changed. </description> </signal> + <signal name="finished"> + <description> + Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted everytime the last frame is drawn, before looping. + </description> + </signal> </signals> <constants> </constants> @@ -4656,6 +4661,20 @@ Remove the first occurrence of a value from the array. </description> </method> + <method name="front"> + <return type="Variant"> + </return> + <description> + Returns the first element of the array if the array is not empty (size>0). + </description> + </method> + <method name="back"> + <return type="Variant"> + </return> + <description> + Returns the last element of the array if the array is not empty (size>0). + </description> + </method> <method name="find"> <return type="int"> </return> @@ -5459,18 +5478,6 @@ <constants> </constants> </class> -<class name="AudioStreamSpeex" inherits="AudioStream" category="Core"> - <brief_description> - Speex audio stream driver. - </brief_description> - <description> - Speex audio stream driver. Speex is very useful for compressed speech. It allows loading a very large amount of speech in memory at little IO/latency cost. - </description> - <methods> - </methods> - <constants> - </constants> -</class> <class name="BackBufferCopy" inherits="Node2D" category="Core"> <brief_description> Copies a region of the screen (or the whole screen) to a buffer so it can be accessed with the texscreen() shader instruction. @@ -11813,7 +11820,7 @@ <argument index="1" name="canvas" type="Control"> </argument> <description> - This function is called every time the 2D canvas editor draws (which overlays over the edited scene). Drawing over the supplied control will draw over the edited scene. To convert from control coordinates to edited scene coordinates (including zoom and offset), a transform is also provided. If you require this control to be redraw, call [method update_canvas](). + This function is called every time the 2D canvas editor draws (which overlays over the edited scene). Drawing over the supplied control will draw over the edited scene. To convert from control coordinates to edited scene coordinates (including zoom and offset), a transform is also provided. If you require this control to be redraw, call [method update_canvas]. </description> </method> <method name="forward_spatial_input_event" qualifiers="virtual"> @@ -11857,6 +11864,13 @@ Get the main editor control. Use this as a parent for main screens. </description> </method> + <method name="edit_resource"> + <argument index="0" name="p_resource" type="Resource"> + </argument> + <description> + Tells the editor to handle the edit of the given resource. Ex: If you pass a Script as a argument, the editor will open the scriptEditor. + </description> + </method> <method name="get_name" qualifiers="virtual"> <return type="String"> </return> @@ -12010,7 +12024,7 @@ </method> <method name="update_canvas"> <description> - Updates the control used to draw the edited scene over the 2D canvas. This is used together with [method forward_canvas_input_event](). + Updates the control used to draw the edited scene over the 2D canvas. This is used together with [method forward_canvas_input_event]. </description> </method> </methods> @@ -15538,7 +15552,7 @@ <return type="int"> </return> <description> - Returns a status string like STATUS_REQUESTING. Need to call [method poll] in order to get status updates. + Returns a STATUS_* enum constant. Need to call [method poll] in order to get status updates. </description> </method> <method name="has_response" qualifiers="const"> @@ -16080,8 +16094,10 @@ </return> <argument index="0" name="host" type="String"> </argument> + <argument index="1" name="ip_type" type="int" default="IP.TYPE_ANY"> + </argument> <description> - Resolve a given hostname, blocking. Resolved hostname is returned as an IP. + Resolve a given hostname, blocking. Resolved hostname is returned as an IPv4 or IPv6 depending on "ip_type". </description> </method> <method name="resolve_hostname_queue_item"> @@ -16089,8 +16105,10 @@ </return> <argument index="0" name="host" type="String"> </argument> + <argument index="1" name="ip_type" type="int" default="IP.TYPE_ANY"> + </argument> <description> - Create a queue item for resolving a given hostname. The queue ID is returned, or RESOLVER_INVALID_ID on error. + Create a queue item for resolving a given hostname to an IPv4 or IPv6 depending on "ip_type". The queue ID is returned, or RESOLVER_INVALID_ID on error. </description> </method> </methods> @@ -18031,7 +18049,7 @@ <argument index="1" name="action" type="String"> </argument> <description> - Return whether the given event is part of an existing action. + Return whether the given event is part of an existing action. This method ignores keyboard modifiers if the given [InputEvent] is not pressed (for proper release detection). See [method action_has_event] if you don't want this behavior. </description> </method> <method name="get_action_from_id" qualifiers="const"> @@ -20310,6 +20328,9 @@ <constant name="UNDERLINE_MODE_ON_HOVER" value="1"> The LinkButton will show an underline at the bottom of its text when the mouse cursor is over it. </constant> + <constant name="UNDERLINE_MODE_NEVER" value="2"> + The LinkButton will never show an underline at the bottom of its text. + </constant> </constants> <theme_items> <theme_item name="font" type="Font"> @@ -22274,8 +22295,10 @@ </class> <class name="NetworkedMultiplayerENet" inherits="NetworkedMultiplayerPeer" category="Core"> <brief_description> + PacketPeer implementation using the ENet library. </brief_description> <description> + A connection (or a listening server) that should be passed to [method SceneTree.set_network_peer]. Socket events can be handled by connecting to [SceneTree] signals. </description> <methods> <method name="close_connection"> @@ -22630,6 +22653,7 @@ 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. + [b]Networking with nodes:[/b] After connecting to a server (or making one, see [NetworkedMultiplayerENet]) it is possible to use the built-in RPC (remote procedure call) system to easily communicate over the network. By calling [method rpc] with a method name, it will be called locally, and in all connected peers (peers = clients and the server that accepts connections), with behaviour varying depending on the network mode ([method set_network_mode]) on the receiving peer. To identify which [Node] receives the RPC call Godot will use it's [NodePath] (make sure node names are the same on all peers). </description> <methods> <method name="_enter_tree" qualifiers="virtual"> @@ -23067,6 +23091,7 @@ <argument index="0" name="method" type="String"> </argument> <description> + Send a remote procedure call request to all peers on the network (and locally), optionally sending additional data as arguments. Call request will be received by nodes with the same [NodePath]. </description> </method> <method name="rpc_config"> @@ -23075,6 +23100,7 @@ <argument index="1" name="mode" type="int"> </argument> <description> + Change the method's RPC mode (one of RPC_MODE_* constants). </description> </method> <method name="rpc_id" qualifiers="vararg"> @@ -23083,12 +23109,14 @@ <argument index="1" name="method" type="String"> </argument> <description> + Send a [method rpc] to a specific peer identified by [i]peer_id[/i]. </description> </method> <method name="rpc_unreliable" qualifiers="vararg"> <argument index="0" name="method" type="String"> </argument> <description> + Send a [method rpc] using an unreliable protocol. </description> </method> <method name="rpc_unreliable_id" qualifiers="vararg"> @@ -23097,6 +23125,7 @@ <argument index="1" name="method" type="String"> </argument> <description> + Send a [method rpc] to a specific peer identified by [i]peer_id[/i] using an unreliable protocol. </description> </method> <method name="rset"> @@ -23105,6 +23134,7 @@ <argument index="1" name="value" type="Variant"> </argument> <description> + Remotely change property's value on other peers (and locally). </description> </method> <method name="rset_config"> @@ -23113,6 +23143,7 @@ <argument index="1" name="mode" type="int"> </argument> <description> + Change the property's RPC mode (one of RPC_MODE_* constants). </description> </method> <method name="rset_id"> @@ -23123,6 +23154,7 @@ <argument index="2" name="value" type="Variant"> </argument> <description> + Remotely change property's value on a specific peer identified by [i]peer_id[/i]. </description> </method> <method name="rset_unreliable"> @@ -23131,6 +23163,7 @@ <argument index="1" name="value" type="Variant"> </argument> <description> + Remotely change property's value on other peers (and locally) using an unreliable protocol. </description> </method> <method name="rset_unreliable_id"> @@ -23141,6 +23174,7 @@ <argument index="2" name="value" type="Variant"> </argument> <description> + Remotely change property's value on a specific peer identified by [i]peer_id[/i] using an unreliable protocol. </description> </method> <method name="set_display_folded"> @@ -23174,6 +23208,7 @@ <argument index="0" name="mode" type="int"> </argument> <description> + Change the networking mode of the [Node], where [i]mode[/i] is one of the constants NETWORK_MODE_*. Master nodes will only call gdscript methods defined as [i]master func[/i] if a RPC call is received (slave nodes will only call [i]slave func[/i]; both will call [i]remote func[/i] if the call is not local, and [i]sync func[/i] in any case). Inherit mode looks at the parent node to determine the value (root node depends on the [SceneTree] having a networking peer set with [method SceneTree.set_network_peer]) </description> </method> <method name="set_owner"> @@ -23869,7 +23904,7 @@ <return type="String"> </return> <description> - Return the name of the host OS. Possible values are: "Android", "BlackBerry 10", "Flash", "Haiku", "iOS", "HTML5", "OSX", "Server", "Windows", "WinRT", "X11" + Return the name of the host OS. Possible values are: "Android", "BlackBerry 10", "Flash", "Haiku", "iOS", "HTML5", "OSX", "Server", "Windows", "UWP", "X11" </description> </method> <method name="get_process_ID" qualifiers="const"> @@ -24143,7 +24178,7 @@ Return true if the window is resizable. </description> </method> - <method name="is_vsnc_enabled" qualifiers="const"> + <method name="is_vsync_enabled" qualifiers="const"> <return type="bool"> </return> <description> @@ -25355,7 +25390,7 @@ <argument index="1" name="recv_buf_size" type="int" default="65536"> </argument> <description> - Make this [PacketPeerUDP] listen on the "port" using a buffer size "recv_buf_size". Listens on all available adresses. + Make this [PacketPeerUDP] listen on the "port" with a buffer size "recv_buf_size". Listens on all available addresses. </description> </method> <method name="set_send_address"> @@ -25366,7 +25401,7 @@ <argument index="1" name="port" type="int"> </argument> <description> - Set the destination address and port for sending packets and variables, a hostname will be resolved if valid. + Set the destination address and port for sending packets and variables, a hostname will be resolved using if valid. </description> </method> <method name="wait"> @@ -26265,7 +26300,7 @@ </methods> <constants> <constant name="PARAM_DIRECTION" value="0"> - Direction in radians at which the particles will be launched, Notice that when the direction is set to 0 the particles will be launched to the negative + Direction in degrees at which the particles will be launched, Notice that when the direction is set to 0 the particles will be launched to the negative </constant> <constant name="PARAM_SPREAD" value="1"> </constant> @@ -26279,7 +26314,7 @@ Velocity at which the particles will orbit around the emitter center </constant> <constant name="PARAM_GRAVITY_DIRECTION" value="5"> - Direction in radians at which the particles will be attracted + Direction in degrees at which the particles will be attracted </constant> <constant name="PARAM_GRAVITY_STRENGTH" value="6"> Strength of the gravitation attraction for each particle @@ -30901,6 +30936,13 @@ Clear the popup menu, in effect removing all items. </description> </method> + <method name="is_hide_on_item_selection"> + <return type="bool"> + </return> + <description> + Returns a boolean that indicates whether or not the PopupMenu will hide on item selection. + </description> + </method> <method name="get_item_ID" qualifiers="const"> <return type="int"> </return> @@ -31020,6 +31062,13 @@ Removes the item at index "idx" from the menu. Note that the indexes of items after the removed item are going to be shifted by one. </description> </method> + <method name="set_hide_on_item_selection"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + Sets whether or not the PopupMenu will hide on item selection. + </description> + </method> <method name="set_item_ID"> <argument index="0" name="idx" type="int"> </argument> @@ -31869,6 +31918,8 @@ RayCast can ignore some objects by adding them to the exception list via [code]add_exception[/code], setting proper filtering with layers, or by filtering object types with type masks. Only enabled raycasts will be able to query the space and report collisions! + + RayCast calculates intersection every fixed frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between fixed frames (or during the same frame) use [method force_raycast_update] after adjusting the raycast. </description> <methods> <method name="add_exception"> @@ -31889,6 +31940,11 @@ Removes all collision exception for this ray. </description> </method> + <method name="force_raycast_update"> + <description> + Updates the collision information in case if this object's properties changed during the current frame (for example position, rotation or the cast_point). Note, [code]set_enabled[/code] is not required for this to work. + </description> + </method> <method name="get_cast_to" qualifiers="const"> <return type="Vector3"> </return> @@ -32007,6 +32063,8 @@ RayCast2D can ignore some objects by adding them to the exception list via [code]add_exception[/code], setting proper filtering with layers, or by filtering object types with type masks. Only enabled raycasts will be able to query the space and report collisions! + + RayCast2D calculates intersection every fixed frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between fixed frames (or during the same frame) use [method force_raycast_update] after adjusting the raycast. </description> <methods> <method name="add_exception"> @@ -32027,6 +32085,11 @@ Removes all collision exception for this ray. </description> </method> + <method name="force_raycast_update"> + <description> + Updates the collision information in case if this object's properties changed during the current frame (for example position, rotation or the cast_point). Note, [code]set_enabled[/code] is not required for this to work. + </description> + </method> <method name="get_cast_to" qualifiers="const"> <return type="Vector2"> </return> @@ -32498,6 +32561,7 @@ would be read as [code]"(?:\\.|[^"])*"[/code] Currently supported features: * Capturing [code]()[/code] and non-capturing [code](?:)[/code] groups + * Named capturing groups [code](?P<name>)[/code] * Any character [code].[/code] * Shorthand character classes [code]\w \W \s \S \d \D[/code] * User-defined character classes such as [code][A-Za-z][/code] @@ -32506,7 +32570,7 @@ * Lazy (non-greedy) quantifiers [code]*?[/code] * Beginning [code]^[/code] and end [code]$[/code] anchors * Alternation [code]|[/code] - * Backreferences [code]\1[/code] and [code]\g{1}[/code] + * Backreferences [code]\1[/code], [code]\g{1}[/code], and [code]\g<name>[/code] * POSIX character classes [code][[:alnum:]][/code] * Lookahead [code](?=)[/code], [code](?!)[/code] and lookbehind [code](?<=)[/code], [code](?<!)[/code] * ASCII [code]\xFF[/code] and Unicode [code]\uFFFF[/code] code points (in a style similar to Python) @@ -32515,7 +32579,7 @@ <methods> <method name="clear"> <description> - This method resets the state of the object, as it was freshly created. Namely, it unassigns the regular expression of this object, and forgets all captures made by the last [method find]. + This method resets the state of the object, as it was freshly created. Namely, it unassigns the regular expression of this object. </description> </method> <method name="compile"> @@ -32523,15 +32587,41 @@ </return> <argument index="0" name="pattern" type="String"> </argument> - <argument index="1" name="capture" type="int" default="9"> - </argument> <description> - Compiles and assign the regular expression pattern to use. The limit on the number of capturing groups can be specified or made unlimited if negative. + Compiles and assign the regular expression pattern to use. </description> </method> - <method name="find" qualifiers="const"> + <method name="get_group_count" qualifiers="const"> <return type="int"> </return> + <description> + Returns the number of numeric capturing groups. + </description> + </method> + <method name="get_names" qualifiers="const"> + <return type="Array"> + </return> + <description> + Returns an array of names of named capturing groups. + </description> + </method> + <method name="get_pattern" qualifiers="const"> + <return type="String"> + </return> + <description> + Returns the expression used to compile the code. + </description> + </method> + <method name="is_valid" qualifiers="const"> + <return type="bool"> + </return> + <description> + Returns whether this object has a valid regular expression assigned. + </description> + </method> + <method name="search" qualifiers="const"> + <return type="Object"> + </return> <argument index="0" name="text" type="String"> </argument> <argument index="1" name="start" type="int" default="0"> @@ -32539,45 +32629,98 @@ <argument index="2" name="end" type="int" default="-1"> </argument> <description> - This method tries to find the pattern within the string, and returns the position where it was found. It also stores any capturing group (see [method get_capture]) for further retrieval. + Searches the text for the compiled pattern. Returns a [RegExMatch] container of the first matching reult if found, otherwise null. The region to search within can be specified without modifying where the start and end anchor would be. </description> </method> - <method name="get_capture" qualifiers="const"> + <method name="sub" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="capture" type="int"> + <argument index="0" name="text" type="String"> + </argument> + <argument index="1" name="replacement" type="String"> + </argument> + <argument index="2" name="all" type="bool" default="false"> + </argument> + <argument index="3" name="start" type="int" default="0"> + </argument> + <argument index="4" name="end" type="int" default="-1"> </argument> <description> - Returns a captured group. A captured group is the part of a string that matches a part of the pattern delimited by parentheses (unless they are non-capturing parentheses [i](?:)[/i]). + Searches the text for the compiled pattern and replaces it with the specified string. Escapes and backreferences such as [code]\1[/code] and [code]\g<name>[/code] expanded and resolved. By default only the first instance is replaced but it can be changed for all instances (global replacement). The region to search within can be specified without modifying where the start and end anchor would be. </description> </method> - <method name="get_capture_count" qualifiers="const"> - <return type="int"> + </methods> + <constants> + </constants> +</class> +<class name="RegExMatch" inherits="Reference" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="expand" qualifiers="const"> + <return type="String"> </return> + <argument index="0" name="template" type="String"> + </argument> <description> - Returns the number of capturing groups. A captured group is the part of a string that matches a part of the pattern delimited by parentheses (unless they are non-capturing parentheses [i](?:)[/i]). + Using results from the search, returns the specified string with escapes and backreferences such as [code]\1[/code] and [code]\g<name>[/code] expanded and resolved. </description> </method> - <method name="get_capture_start" qualifiers="const"> + <method name="get_end" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="capture" type="int"> + <argument index="0" name="name" type="Variant" default="0"> </argument> <description> + Returns the end position of the match in the string. An interger can be specified for numeric groups or a string for named groups. Returns -1 if that group wasn't found or doesn't exist. Defaults to 0 (whole pattern). </description> </method> - <method name="get_captures" qualifiers="const"> - <return type="StringArray"> + <method name="get_group_array" qualifiers="const"> + <return type="Array"> </return> <description> - Return a list of all the captures made by the regular expression. + Returns an array of the results of the numeric groups. </description> </method> - <method name="is_valid" qualifiers="const"> - <return type="bool"> + <method name="get_group_count" qualifiers="const"> + <return type="int"> </return> <description> - Returns whether this object has a valid regular expression assigned. + Returns the number of numeric capturing groups. + </description> + </method> + <method name="get_name_dict" qualifiers="const"> + <return type="Dictionary"> + </return> + <description> + Returns a dictionary containing the named capturing groups and their results. + </description> + </method> + <method name="get_names" qualifiers="const"> + <return type="Array"> + </return> + <description> + Returns an array of names of named capturing groups. + </description> + </method> + <method name="get_start" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="name" type="Variant" default="0"> + </argument> + <description> + Returns the starting position of the match in the string. An interger can be specified for numeric groups or a string for named groups. Returns -1 if that group wasn't found or doesn't exist. Defaults to 0 (whole pattern). + </description> + </method> + <method name="get_string" qualifiers="const"> + <return type="String"> + </return> + <argument index="0" name="name" type="Variant" default="0"> + </argument> + <description> + Returns the result of the match in the string. An interger can be specified for numeric groups or a string for named groups. Returns -1 if that group wasn't found or doesn't exist. Defaults to 0 (whole pattern). </description> </method> </methods> @@ -33394,7 +33537,7 @@ <return type="Array"> </return> <description> - Return a list of the bodies colliding with this one. + Return a list of the bodies colliding with this one. By default, number of max contacts reported is at 0 , see [method set_max_contacts_reported] to increase it. </description> </method> <method name="get_friction" qualifiers="const"> @@ -33755,7 +33898,7 @@ <return type="Array"> </return> <description> - Return a list of the bodies colliding with this one. + Return a list of the bodies colliding with this one. By default, number of max contacts reported is at 0 , see [method set_max_contacts_reported] to increase it. You must also enable contact monitor, see [method set_contact_monitor] </description> </method> <method name="get_continuous_collision_detection_mode" qualifiers="const"> @@ -35273,6 +35416,7 @@ <return type="bool"> </return> <description> + Returns true if this SceneTree's [NetworkedMultiplayerPeer] is in server mode (listening for connections). </description> </method> <method name="is_paused" qualifiers="const"> @@ -35369,6 +35513,7 @@ <argument index="0" name="peer" type="NetworkedMultiplayerPeer"> </argument> <description> + Set the peer object to handle the RPC system (effectively enabling networking). Depending on the peer itself, the SceneTree will become a network server (check with [method is_network_server()]) and will set root node's network mode to master (see NETWORK_MODE_* constants in [Node]), or it will become a regular peer with root node set to slave. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to SceneTree's signals. </description> </method> <method name="set_pause"> @@ -39081,7 +39226,7 @@ <argument index="1" name="port" type="int"> </argument> <description> - Connect to the specified IP:port pair. Returns [OK] on success or [FAILED] on failure. + Connect to the specified host:port pair. A hostname will be resolved if valid. Returns [OK] on success or [FAILED] on failure. </description> </method> <method name="disconnect"> @@ -40407,7 +40552,7 @@ <argument index="1" name="accepted_hosts" type="StringArray" default="StringArray([])"> </argument> <description> - Listen on a port, alternatively give a white-list of accepted hosts. + Listen on a port using protocol, alternatively give a white-list of accepted hosts. </description> </method> <method name="stop"> @@ -44206,10 +44351,10 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="key" type="String"> + <argument index="1" name="key" type="String" default=""""> </argument> <description> - Stop animating and completely remove a tween, given its object and property/method pair. + Stop animating and completely remove a tween, given its object and property/method pair. Passing empty String as key will remove all tweens for given object. </description> </method> <method name="remove_all"> @@ -44224,10 +44369,10 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="key" type="String"> + <argument index="1" name="key" type="String" default=""""> </argument> <description> - Resets a tween to the initial value (the one given, not the one before the tween), given its object and property/method pair. + Resets a tween to the initial value (the one given, not the one before the tween), given its object and property/method pair. Passing empty String as key will reset all tweens for given object. </description> </method> <method name="reset_all"> @@ -44242,10 +44387,10 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="key" type="String"> + <argument index="1" name="key" type="String" default=""""> </argument> <description> - Continue animating a stopped tween, given its object and property/method pair. + Continue animating a stopped tween, given its object and property/method pair. Passing empty String as key will resume all tweens for given object. </description> </method> <method name="resume_all"> @@ -44304,10 +44449,10 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="key" type="String"> + <argument index="1" name="key" type="String" default=""""> </argument> <description> - Stop animating a tween, given its object and property/method pair. + Stop animating a tween, given its object and property/method pair. Passing empty String as key will stop all tweens for given object. </description> </method> <method name="stop_all"> @@ -46119,7 +46264,7 @@ do_property]. <argument index="0" name="to_pos" type="Vector2"> </argument> <description> - Wrap the mouse to a position, relative to the viewport. + Warp the mouse to a position, relative to the viewport. </description> </method> </methods> |