diff options
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/GraphEdit.xml | 37 | ||||
-rw-r--r-- | doc/classes/HTTPRequest.xml | 18 | ||||
-rw-r--r-- | doc/classes/Node.xml | 2 | ||||
-rw-r--r-- | doc/classes/OS.xml | 65 | ||||
-rw-r--r-- | doc/classes/Script.xml | 1 | ||||
-rw-r--r-- | doc/classes/String.xml | 11 | ||||
-rw-r--r-- | doc/classes/VisualShaderNodeTextureUniform.xml | 32 |
7 files changed, 159 insertions, 7 deletions
diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index 76b255e273..c432410d3b 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -18,6 +18,43 @@ Virtual method which can be overridden to customize how connections are drawn. </description> </method> + <method name="_is_in_input_hotzone" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="graph_node" type="Object" /> + <argument index="1" name="slot_index" type="int" /> + <argument index="2" name="mouse_position" type="Vector2" /> + <description> + Returns whether the [code]mouse_position[/code] is in the input hot zone. + By default, a hot zone is a [Rect2] positioned such that its center is at [code]graph_node[/code].[method GraphNode.get_connection_input_position]([code]slot_index[/code]) (For output's case, call [method GraphNode.get_connection_output_position] instead). The hot zone's width is twice the Theme Property [code]port_grab_distance_horizontal[/code], and its height is twice the [code]port_grab_distance_vertical[/code]. + Below is a sample code to help get started: + [codeblock] + func _is_in_input_hotzone(graph_node, slot_index, mouse_position): + var slot_size : Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical")) + var slot_pos : Vector2 = graph_node.get_position() + graph_node.get_connection_input_position(slot_index) - slot_size / 2 + var rect = Rect2(slot_pos, slot_size) + + return rect.has_point(mouse_position) + [/codeblock] + </description> + </method> + <method name="_is_in_output_hotzone" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="graph_node" type="Object" /> + <argument index="1" name="slot_index" type="int" /> + <argument index="2" name="mouse_position" type="Vector2" /> + <description> + Returns whether the [code]mouse_position[/code] is in the output hot zone. For more information on hot zones, see [method _is_in_input_hotzone]. + Below is a sample code to help get started: + [codeblock] + func _is_in_output_hotzone(graph_node, slot_index, mouse_position): + var slot_size : Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical")) + var slot_pos : Vector2 = graph_node.get_position() + graph_node.get_connection_output_position(slot_index) - slot_size / 2 + var rect = Rect2(slot_pos, slot_size) + + return rect.has_point(mouse_position) + [/codeblock] + </description> + </method> <method name="add_valid_connection_type"> <return type="void" /> <argument index="0" name="from_type" type="int" /> diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index aaaf863c69..c92f751c60 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -208,6 +208,24 @@ Returns [constant OK] if request is successfully created. (Does not imply that the server has responded), [constant ERR_UNCONFIGURED] if not in the tree, [constant ERR_BUSY] if still processing previous request, [constant ERR_INVALID_PARAMETER] if given string is not a valid URL format, or [constant ERR_CANT_CONNECT] if not using thread and the [HTTPClient] cannot connect to host. </description> </method> + <method name="set_http_proxy"> + <return type="void" /> + <argument index="0" name="host" type="String" /> + <argument index="1" name="port" type="int" /> + <description> + Sets the proxy server for HTTP requests. + The proxy server is unset if [code]host[/code] is empty or [code]port[/code] is -1. + </description> + </method> + <method name="set_https_proxy"> + <return type="void" /> + <argument index="0" name="host" type="String" /> + <argument index="1" name="port" type="int" /> + <description> + Sets the proxy server for HTTPS requests. + The proxy server is unset if [code]host[/code] is empty or [code]port[/code] is -1. + </description> + </method> </methods> <members> <member name="accept_gzip" type="bool" setter="set_accept_gzip" getter="is_accepting_gzip" default="true"> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 22ebbb87f3..753492ad34 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -186,7 +186,7 @@ <argument index="1" name="recursive" type="bool" default="true" /> <argument index="2" name="owned" type="bool" default="true" /> <description> - Finds a descendant of this node whose name matches [code]mask[/code] as in [method String.match] (i.e. case-sensitive, but [code]"*"[/code] matches zero or more characters and [code]"?"[/code] matches any single character except [code]"."[/code]). + Finds a descendant of this node whose name matches [code]mask[/code] as in [method String.match] (i.e. case-sensitive, but [code]"*"[/code] matches zero or more characters and [code]"?"[/code] matches any single character except [code]"."[/code]). Returns [code]null[/code] if no matching [Node] is found. [b]Note:[/b] It does not match against the full path, just against individual node names. If [code]owned[/code] is [code]true[/code], this method only finds nodes whose owner is this node. This is especially important for scenes instantiated through a script, because those scenes don't have an owner. [b]Note:[/b] As this method walks through all the descendants of the node, it is the slowest way to get a reference to another node. Whenever possible, consider using [method get_node] instead. To avoid using [method find_node] too often, consider caching the node reference into a variable. diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index a5bd8e2768..ffc02f09a9 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -270,7 +270,60 @@ <method name="get_name" qualifiers="const"> <return type="String" /> <description> - Returns the name of the host OS. Possible values are: [code]"Android"[/code], [code]"iOS"[/code], [code]"HTML5"[/code], [code]"macOS"[/code], [code]"Server"[/code], [code]"Windows"[/code], [code]"UWP"[/code], [code]"X11"[/code]. + Returns the name of the host OS. + On Windows, this is [code]"Windows"[/code] or [code]"UWP"[/code] (Universal Windows Platform) if exported thereon. + On macOS, this is [code]"macOS"[/code]. + On Linux-based operating systems, this is [code]"Linux"[/code]. + On BSD-based operating systems, this is [code]"FreeBSD"[/code], [code]"NetBSD"[/code], [code]"OpenBSD"[/code], or [code]"BSD"[/code] as a fallback. + On Android, this is [code]"Android"[/code]. + On iOS, this is [code]"iOS"[/code]. + On the web, this is [code]"HTML5"[/code]. + [b]Note:[/b] Custom builds of the engine may support additional platforms, such as consoles, yielding other return values. + [codeblocks] + [gdscript] + match OS.get_name(): + "Windows", "UWP": + print("Windows") + "macOS": + print("macOS") + "Linux", "FreeBSD", "NetBSD", "OpenBSD", "BSD": + print("Linux/BSD") + "Android": + print("Android") + "iOS": + print("iOS") + "HTML5": + print("Web") + [/gdscript] + [csharp] + switch (OS.GetName()) + { + case "Windows": + case "UWP": + GD.Print("Windows"); + break; + case "macOS": + GD.Print("macOS"); + break; + case "Linux": + case "FreeBSD": + case "NetBSD": + case "OpenBSD" + case "BSD": + GD.Print("Linux/BSD"); + break; + case "Android": + GD.Print("Android"); + break; + case "iOS": + GD.Print("iOS"); + break; + case "HTML5": + GD.Print("Web"); + break; + } + [/csharp] + [/codeblocks] </description> </method> <method name="get_process_id" qualifiers="const"> @@ -327,11 +380,13 @@ <return type="String" /> <description> Returns the absolute directory path where user data is written ([code]user://[/code]). - On Linux, this is [code]~/.local/share/godot/app_userdata/[project_name][/code], or [code]~/.local/share/[custom_name][/code] if [code]use_custom_user_dir[/code] is set. + On Windows, this is [code]%AppData%\Godot\app_userdata\[project_name][/code], or [code]%AppData%\[custom_name][/code] if [code]use_custom_user_dir[/code] is set. [code]%AppData%[/code] expands to [code]%UserProfile%\AppData\Roaming[/code]. On macOS, this is [code]~/Library/Application Support/Godot/app_userdata/[project_name][/code], or [code]~/Library/Application Support/[custom_name][/code] if [code]use_custom_user_dir[/code] is set. - On Windows, this is [code]%APPDATA%\Godot\app_userdata\[project_name][/code], or [code]%APPDATA%\[custom_name][/code] if [code]use_custom_user_dir[/code] is set. [code]%APPDATA%[/code] expands to [code]%USERPROFILE%\AppData\Roaming[/code]. - If the project name is empty, [code]user://[/code] falls back to [code]res://[/code]. - Not to be confused with [method get_data_dir], which returns the [i]global[/i] (non-project-specific) user data directory. + On Linux and BSD, this is [code]~/.local/share/godot/app_userdata/[project_name][/code], or [code]~/.local/share/[custom_name][/code] if [code]use_custom_user_dir[/code] is set. + On Android and iOS, this is a sandboxed directory in either internal or external storage, depending on the user's configuration. + On the web, this is a virtual directory managed by the browser. + If the project name is empty, [code][project_name][/code] falls back to [code][unnamed project][/code]. + Not to be confused with [method get_data_dir], which returns the [i]global[/i] (non-project-specific) user home directory. </description> </method> <method name="has_environment" qualifiers="const"> diff --git a/doc/classes/Script.xml b/doc/classes/Script.xml index ab88bdaa73..4174e1afeb 100644 --- a/doc/classes/Script.xml +++ b/doc/classes/Script.xml @@ -5,6 +5,7 @@ </brief_description> <description> A class stored as a resource. A script extends the functionality of all objects that instance it. + This is the base class for all scripts and should not be used directly. Trying to create a new script with this class will result in an error. The [code]new[/code] method of a script subclass creates a new instance. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes. </description> <tutorials> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index ce902c1216..cd6fc10931 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -124,7 +124,7 @@ <method name="dedent" qualifiers="const"> <return type="String" /> <description> - Returns a copy of the string with indentation (leading tabs and spaces) removed. + Returns a copy of the string with indentation (leading tabs and spaces) removed. See also [method indent] to add indentation. </description> </method> <method name="ends_with" qualifiers="const"> @@ -243,6 +243,15 @@ <description> </description> </method> + <method name="indent" qualifiers="const"> + <return type="String" /> + <argument index="0" name="prefix" type="String" /> + <description> + Returns a copy of the string with lines indented with [code]prefix[/code]. + For example, the string can be indented with two tabs using [code]"\t\t"[/code], or four spaces using [code]" "[/code]. The prefix can be any string so it can also be used to comment out strings with e.g. [code]"# "[/code]. See also [method dedent] to remove indentation. + [b]Note:[/b] Empty lines are kept empty. + </description> + </method> <method name="insert" qualifiers="const"> <return type="String" /> <argument index="0" name="position" type="int" /> diff --git a/doc/classes/VisualShaderNodeTextureUniform.xml b/doc/classes/VisualShaderNodeTextureUniform.xml index c2e66ccb96..8da4325564 100644 --- a/doc/classes/VisualShaderNodeTextureUniform.xml +++ b/doc/classes/VisualShaderNodeTextureUniform.xml @@ -12,6 +12,12 @@ <member name="color_default" type="int" setter="set_color_default" getter="get_color_default" enum="VisualShaderNodeTextureUniform.ColorDefault" default="0"> Sets the default color if no texture is assigned to the uniform. </member> + <member name="texture_filter" type="int" setter="set_texture_filter" getter="get_texture_filter" enum="VisualShaderNodeTextureUniform.TextureFilter" default="0"> + Sets the texture filtering mode. See [enum TextureFilter] for options. + </member> + <member name="texture_repeat" type="int" setter="set_texture_repeat" getter="get_texture_repeat" enum="VisualShaderNodeTextureUniform.TextureRepeat" default="0"> + Sets the texture repeating mode. See [enum TextureRepeat] for options. + </member> <member name="texture_type" type="int" setter="set_texture_type" getter="get_texture_type" enum="VisualShaderNodeTextureUniform.TextureType" default="0"> Defines the type of data provided by the source texture. See [enum TextureType] for options. </member> @@ -41,5 +47,31 @@ <constant name="COLOR_DEFAULT_MAX" value="2" enum="ColorDefault"> Represents the size of the [enum ColorDefault] enum. </constant> + <constant name="FILTER_DEFAULT" value="0" enum="TextureFilter"> + </constant> + <constant name="FILTER_NEAREST" value="1" enum="TextureFilter"> + </constant> + <constant name="FILTER_LINEAR" value="2" enum="TextureFilter"> + </constant> + <constant name="FILTER_NEAREST_MIPMAP" value="3" enum="TextureFilter"> + </constant> + <constant name="FILTER_LINEAR_MIPMAP" value="4" enum="TextureFilter"> + </constant> + <constant name="FILTER_NEAREST_MIPMAP_ANISOTROPIC" value="5" enum="TextureFilter"> + </constant> + <constant name="FILTER_LINEAR_MIPMAP_ANISOTROPIC" value="6" enum="TextureFilter"> + </constant> + <constant name="FILTER_MAX" value="7" enum="TextureFilter"> + Represents the size of the [enum TextureFilter] enum. + </constant> + <constant name="REPEAT_DEFAULT" value="0" enum="TextureRepeat"> + </constant> + <constant name="REPEAT_ENABLED" value="1" enum="TextureRepeat"> + </constant> + <constant name="REPEAT_DISABLED" value="2" enum="TextureRepeat"> + </constant> + <constant name="REPEAT_MAX" value="3" enum="TextureRepeat"> + Represents the size of the [enum TextureRepeat] enum. + </constant> </constants> </class> |