id
stringlengths
6
6
text
stringlengths
20
17.2k
title
stringclasses
1 value
123665
<methods> <method name="add_property_info"> <return type="void" /> <param index="0" name="hint" type="Dictionary" /> <description> Adds a custom property info to a property. The dictionary must contain: - [code]"name"[/code]: [String] (the property's name) - [code]"type"[/code]: [int] (see [enum Variant.Type]) - optionally [code]"hint"[/code]: [int] (see [enum PropertyHint]) and [code]"hint_string"[/code]: [String] [codeblocks] [gdscript] ProjectSettings.set("category/property_name", 0) var property_info = { "name": "category/property_name", "type": TYPE_INT, "hint": PROPERTY_HINT_ENUM, "hint_string": "one,two,three" } ProjectSettings.add_property_info(property_info) [/gdscript] [csharp] ProjectSettings.Singleton.Set("category/property_name", 0); var propertyInfo = new Godot.Collections.Dictionary { {"name", "category/propertyName"}, {"type", (int)Variant.Type.Int}, {"hint", (int)PropertyHint.Enum}, {"hint_string", "one,two,three"}, }; ProjectSettings.AddPropertyInfo(propertyInfo); [/csharp] [/codeblocks] </description> </method> <method name="clear"> <return type="void" /> <param index="0" name="name" type="String" /> <description> Clears the whole configuration (not recommended, may break things). </description> </method> <method name="get_global_class_list"> <return type="Dictionary[]" /> <description> Returns an [Array] of registered global classes. Each global class is represented as a [Dictionary] that contains the following entries: - [code]base[/code] is a name of the base class; - [code]class[/code] is a name of the registered global class; - [code]icon[/code] is a path to a custom icon of the global class, if it has any; - [code]language[/code] is a name of a programming language in which the global class is written; - [code]path[/code] is a path to a file containing the global class. [b]Note:[/b] Both the script and the icon paths are local to the project filesystem, i.e. they start with [code]res://[/code]. </description> </method> <method name="get_order" qualifiers="const"> <return type="int" /> <param index="0" name="name" type="String" /> <description> Returns the order of a configuration value (influences when saved to the config file). </description> </method> <method name="get_setting" qualifiers="const"> <return type="Variant" /> <param index="0" name="name" type="String" /> <param index="1" name="default_value" type="Variant" default="null" /> <description> Returns the value of the setting identified by [param name]. If the setting doesn't exist and [param default_value] is specified, the value of [param default_value] is returned. Otherwise, [code]null[/code] is returned. [codeblocks] [gdscript] print(ProjectSettings.get_setting("application/config/name")) print(ProjectSettings.get_setting("application/config/custom_description", "No description specified.")) [/gdscript] [csharp] GD.Print(ProjectSettings.GetSetting("application/config/name")); GD.Print(ProjectSettings.GetSetting("application/config/custom_description", "No description specified.")); [/csharp] [/codeblocks] [b]Note:[/b] This method doesn't take potential feature overrides into account automatically. Use [method get_setting_with_override] to handle seamlessly. </description> </method> <method name="get_setting_with_override" qualifiers="const"> <return type="Variant" /> <param index="0" name="name" type="StringName" /> <description> Similar to [method get_setting], but applies feature tag overrides if any exists and is valid. [b]Example:[/b] If the setting override [code]"application/config/name.windows"[/code] exists, and the following code is executed on a [i]Windows[/i] operating system, the overridden setting is printed instead: [codeblocks] [gdscript] print(ProjectSettings.get_setting_with_override("application/config/name")) [/gdscript] [csharp] GD.Print(ProjectSettings.GetSettingWithOverride("application/config/name")); [/csharp] [/codeblocks] </description> </method> <method name="globalize_path" qualifiers="const"> <return type="String" /> <param index="0" name="path" type="String" /> <description> Returns the absolute, native OS path corresponding to the localized [param path] (starting with [code]res://[/code] or [code]user://[/code]). The returned path will vary depending on the operating system and user preferences. See [url=$DOCS_URL/tutorials/io/data_paths.html]File paths in Godot projects[/url] to see what those paths convert to. See also [method localize_path]. [b]Note:[/b] [method globalize_path] with [code]res://[/code] will not work in an exported project. Instead, prepend the executable's base directory to the path when running from an exported project: [codeblock] var path = "" if OS.has_feature("editor"): # Running from an editor binary. # `path` will contain the absolute path to `hello.txt` located in the project root. path = ProjectSettings.globalize_path("res://hello.txt") else: # Running from an exported project. # `path` will contain the absolute path to `hello.txt` next to the executable. # This is *not* identical to using `ProjectSettings.globalize_path()` with a `res://` path, # but is close enough in spirit. path = OS.get_executable_path().get_base_dir().path_join("hello.txt") [/codeblock] </description> </method> <method name="has_setting" qualifiers="const"> <return type="bool" /> <param index="0" name="name" type="String" /> <description> Returns [code]true[/code] if a configuration value is present. </description> </method> <method name="load_resource_pack"> <return type="bool" /> <param index="0" name="pack" type="String" /> <param index="1" name="replace_files" type="bool" default="true" /> <param index="2" name="offset" type="int" default="0" /> <description> Loads the contents of the .pck or .zip file specified by [param pack] into the resource filesystem ([code]res://[/code]). Returns [code]true[/code] on success. [b]Note:[/b] If a file from [param pack] shares the same path as a file already in the resource filesystem, any attempts to load that file will use the file from [param pack] unless [param replace_files] is set to [code]false[/code]. [b]Note:[/b] The optional [param offset] parameter can be used to specify the offset in bytes to the start of the resource pack. This is only supported for .pck files. </description> </method> <method name="localize_path" qualifiers="const"> <return type="String" /> <param index="0" name="path" type="String" /> <description> Returns the localized path (starting with [code]res://[/code]) corresponding to the absolute, native OS [param path]. See also [method globalize_path]. </description> </method>
123666
<method name="save"> <return type="int" enum="Error" /> <description> Saves the configuration to the [code]project.godot[/code] file. [b]Note:[/b] This method is intended to be used by editor plugins, as modified [ProjectSettings] can't be loaded back in the running app. If you want to change project settings in exported projects, use [method save_custom] to save [code]override.cfg[/code] file. </description> </method> <method name="save_custom"> <return type="int" enum="Error" /> <param index="0" name="file" type="String" /> <description> Saves the configuration to a custom file. The file extension must be [code].godot[/code] (to save in text-based [ConfigFile] format) or [code].binary[/code] (to save in binary format). You can also save [code]override.cfg[/code] file, which is also text, but can be used in exported projects unlike other formats. </description> </method> <method name="set_as_basic"> <return type="void" /> <param index="0" name="name" type="String" /> <param index="1" name="basic" type="bool" /> <description> Defines if the specified setting is considered basic or advanced. Basic settings will always be shown in the project settings. Advanced settings will only be shown if the user enables the "Advanced Settings" option. </description> </method> <method name="set_as_internal"> <return type="void" /> <param index="0" name="name" type="String" /> <param index="1" name="internal" type="bool" /> <description> Defines if the specified setting is considered internal. An internal setting won't show up in the Project Settings dialog. This is mostly useful for addons that need to store their own internal settings without exposing them directly to the user. </description> </method> <method name="set_initial_value"> <return type="void" /> <param index="0" name="name" type="String" /> <param index="1" name="value" type="Variant" /> <description> Sets the specified setting's initial value. This is the value the setting reverts to. </description> </method> <method name="set_order"> <return type="void" /> <param index="0" name="name" type="String" /> <param index="1" name="position" type="int" /> <description> Sets the order of a configuration value (influences when saved to the config file). </description> </method> <method name="set_restart_if_changed"> <return type="void" /> <param index="0" name="name" type="String" /> <param index="1" name="restart" type="bool" /> <description> Sets whether a setting requires restarting the editor to properly take effect. [b]Note:[/b] This is just a hint to display to the user that the editor must be restarted for changes to take effect. Enabling [method set_restart_if_changed] does [i]not[/i] delay the setting being set when changed. </description> </method> <method name="set_setting"> <return type="void" /> <param index="0" name="name" type="String" /> <param index="1" name="value" type="Variant" /> <description> Sets the value of a setting. [codeblocks] [gdscript] ProjectSettings.set_setting("application/config/name", "Example") [/gdscript] [csharp] ProjectSettings.SetSetting("application/config/name", "Example"); [/csharp] [/codeblocks] This can also be used to erase custom project settings. To do this change the setting value to [code]null[/code]. </description> </method> </methods>
123673
<member name="debug/shader_language/warnings/magic_position_write" type="bool" setter="" getter="" default="true"> When set to [code]true[/code], produces a warning when the shader contains [code]POSITION = vec4(vertex,[/code] as this was very common code written in Godot 4.2 and earlier that was paired with a QuadMesh to produce a full screen post processes pass. With the switch to reversed z in 4.3, this trick no longer works, as it implicitly relied on the [code]VERTEX.z[/code] being 0. </member> <member name="debug/shader_language/warnings/treat_warnings_as_errors" type="bool" setter="" getter="" default="false"> When set to [code]true[/code], warnings are treated as errors. </member> <member name="debug/shader_language/warnings/unused_constant" type="bool" setter="" getter="" default="true"> When set to [code]true[/code], produces a warning when a constant is never used. </member> <member name="debug/shader_language/warnings/unused_function" type="bool" setter="" getter="" default="true"> When set to [code]true[/code], produces a warning when a function is never used. </member> <member name="debug/shader_language/warnings/unused_local_variable" type="bool" setter="" getter="" default="true"> When set to [code]true[/code], produces a warning when a local variable is never used. </member> <member name="debug/shader_language/warnings/unused_struct" type="bool" setter="" getter="" default="true"> When set to [code]true[/code], produces a warning when a struct is never used. </member> <member name="debug/shader_language/warnings/unused_uniform" type="bool" setter="" getter="" default="true"> When set to [code]true[/code], produces a warning when a uniform is never used. </member> <member name="debug/shader_language/warnings/unused_varying" type="bool" setter="" getter="" default="true"> When set to [code]true[/code], produces a warning when a varying is never used. </member> <member name="debug/shapes/avoidance/agents_radius_color" type="Color" setter="" getter="" default="Color(1, 1, 0, 0.25)"> Color of the avoidance agents radius, visible when "Visible Avoidance" is enabled in the Debug menu. </member> <member name="debug/shapes/avoidance/enable_agents_radius" type="bool" setter="" getter="" default="true"> If enabled, displays avoidance agents radius when "Visible Avoidance" is enabled in the Debug menu. </member> <member name="debug/shapes/avoidance/enable_obstacles_radius" type="bool" setter="" getter="" default="true"> If enabled, displays avoidance obstacles radius when "Visible Avoidance" is enabled in the Debug menu. </member> <member name="debug/shapes/avoidance/enable_obstacles_static" type="bool" setter="" getter="" default="true"> If enabled, displays static avoidance obstacles when "Visible Avoidance" is enabled in the Debug menu. </member> <member name="debug/shapes/avoidance/obstacles_radius_color" type="Color" setter="" getter="" default="Color(1, 0.5, 0, 0.25)"> Color of the avoidance obstacles radius, visible when "Visible Avoidance" is enabled in the Debug menu. </member> <member name="debug/shapes/avoidance/obstacles_static_edge_pushin_color" type="Color" setter="" getter="" default="Color(1, 0, 0, 1)"> Color of the static avoidance obstacles edges when their vertices are winded in order to push agents in, visible when "Visible Avoidance" is enabled in the Debug menu. </member> <member name="debug/shapes/avoidance/obstacles_static_edge_pushout_color" type="Color" setter="" getter="" default="Color(1, 1, 0, 1)"> Color of the static avoidance obstacles edges when their vertices are winded in order to push agents out, visible when "Visible Avoidance" is enabled in the Debug menu. </member> <member name="debug/shapes/avoidance/obstacles_static_face_pushin_color" type="Color" setter="" getter="" default="Color(1, 0, 0, 0)"> Color of the static avoidance obstacles faces when their vertices are winded in order to push agents in, visible when "Visible Avoidance" is enabled in the Debug menu. </member> <member name="debug/shapes/avoidance/obstacles_static_face_pushout_color" type="Color" setter="" getter="" default="Color(1, 1, 0, 0.5)"> Color of the static avoidance obstacles faces when their vertices are winded in order to push agents out, visible when "Visible Avoidance" is enabled in the Debug menu. </member> <member name="debug/shapes/collision/contact_color" type="Color" setter="" getter="" default="Color(1, 0.2, 0.1, 0.8)"> Color of the contact points between collision shapes, visible when "Visible Collision Shapes" is enabled in the Debug menu. </member> <member name="debug/shapes/collision/draw_2d_outlines" type="bool" setter="" getter="" default="true"> Sets whether 2D physics will display collision outlines in game when "Visible Collision Shapes" is enabled in the Debug menu. </member> <member name="debug/shapes/collision/max_contacts_displayed" type="int" setter="" getter="" default="10000"> Maximum number of contact points between collision shapes to display when "Visible Collision Shapes" is enabled in the Debug menu. </member> <member name="debug/shapes/collision/shape_color" type="Color" setter="" getter="" default="Color(0, 0.6, 0.7, 0.42)"> Color of the collision shapes, visible when "Visible Collision Shapes" is enabled in the Debug menu. </member> <member name="debug/shapes/navigation/agent_path_color" type="Color" setter="" getter="" default="Color(1, 0, 0, 1)"> Color to display enabled navigation agent paths when an agent has debug enabled. </member> <member name="debug/shapes/navigation/agent_path_point_size" type="float" setter="" getter="" default="4.0"> Rasterized size (pixel) used to render navigation agent path points when an agent has debug enabled. </member> <member name="debug/shapes/navigation/edge_connection_color" type="Color" setter="" getter="" default="Color(1, 0, 1, 1)"> Color to display edge connections between navigation regions, visible when "Visible Navigation" is enabled in the Debug menu. </member> <member name="debug/shapes/navigation/enable_agent_paths" type="bool" setter="" getter="" default="true"> If enabled, displays navigation agent paths when an agent has debug enabled. </member> <member name="debug/shapes/navigation/enable_agent_paths_xray" type="bool" setter="" getter="" default="true"> If enabled, displays navigation agent paths through geometry when an agent has debug enabled. </member> <member name="debug/shapes/navigation/enable_edge_connections" type="bool" setter="" getter="" default="true"> If enabled, displays edge connections between navigation regions when "Visible Navigation" is enabled in the Debug menu. </member> <member name="debug/shapes/navigation/enable_edge_connections_xray" type="bool" setter="" getter="" default="true"> If enabled, displays edge connections between navigation regions through geometry when "Visible Navigation" is enabled in the Debug menu. </member> <member name="debug/shapes/navigation/enable_edge_lines" type="bool" setter="" getter="" default="true"> If enabled, displays navigation mesh polygon edges when "Visible Navigation" is enabled in the Debug menu. </member> <member name="debug/shapes/navigation/enable_edge_lines_xray" type="bool" setter="" getter="" default="true"> If enabled, displays navigation mesh polygon edges through geometry when "Visible Navigation" is enabled in the Debug menu. </member>
123675
member name="display/window/size/borderless" type="bool" setter="" getter="" default="false"> Forces the main window to be borderless. [b]Note:[/b] This setting is ignored on iOS, Android, and Web. </member> <member name="display/window/size/extend_to_title" type="bool" setter="" getter="" default="false"> Main window content is expanded to the full size of the window. Unlike a borderless window, the frame is left intact and can be used to resize the window, and the title bar is transparent, but has minimize/maximize/close buttons. [b]Note:[/b] This setting is implemented only on macOS. </member> <member name="display/window/size/initial_position" type="Vector2i" setter="" getter="" default="Vector2i(0, 0)"> Main window initial position (in virtual desktop coordinates), this setting is used only if [member display/window/size/initial_position_type] is set to "Absolute" ([code]0[/code]). [b]Note:[/b] This setting only affects the exported project, or when the project is run from the command line. In the editor, the value of [member EditorSettings.run/window_placement/rect_custom_position] is used instead. </member> <member name="display/window/size/initial_position_type" type="int" setter="" getter="" default="1"> Main window initial position. [code]0[/code] - "Absolute", [member display/window/size/initial_position] is used to set window position. [code]1[/code] - "Primary Screen Center". [code]2[/code] - "Other Screen Center", [member display/window/size/initial_screen] is used to set the screen. [b]Note:[/b] This setting only affects the exported project, or when the project is run from the command line. In the editor, the value of [member EditorSettings.run/window_placement/rect] is used instead. </member> <member name="display/window/size/initial_screen" type="int" setter="" getter="" default="0"> Main window initial screen, this setting is used only if [member display/window/size/initial_position_type] is set to "Other Screen Center" ([code]2[/code]). [b]Note:[/b] This setting only affects the exported project, or when the project is run from the command line. In the editor, the value of [member EditorSettings.run/window_placement/screen] is used instead. </member> <member name="display/window/size/mode" type="int" setter="" getter="" default="0"> Main window mode. See [enum DisplayServer.WindowMode] for possible values and how each mode behaves. </member> <member name="display/window/size/no_focus" type="bool" setter="" getter="" default="false"> Main window can't be focused. No-focus window will ignore all input, except mouse clicks. </member> <member name="display/window/size/resizable" type="bool" setter="" getter="" default="true"> If [code]true[/code], allows the window to be resizable by default. [b]Note:[/b] This property is only read when the project starts. To change whether the window is resizable at runtime, set [member Window.unresizable] instead on the root Window, which can be retrieved using [code]get_viewport().get_window()[/code]. [member Window.unresizable] takes the opposite value of this setting. [b]Note:[/b] Certain window managers can be configured to ignore the non-resizable status of a window. Do not rely on this setting as a guarantee that the window will [i]never[/i] be resizable. [b]Note:[/b] This setting is ignored on iOS. </member> <member name="display/window/size/sharp_corners" type="bool" setter="" getter="" default="false"> If [code]true[/code], the main window uses sharp corners by default. [b]Note:[/b] This property is implemented only on Windows (11). </member> <member name="display/window/size/transparent" type="bool" setter="" getter="" default="false"> If [code]true[/code], enables a window manager hint that the main window background [i]can[/i] be transparent. This does not make the background actually transparent. For the background to be transparent, the root viewport must also be made transparent by enabling [member rendering/viewport/transparent_background]. [b]Note:[/b] To use a transparent splash screen, set [member application/boot_splash/bg_color] to [code]Color(0, 0, 0, 0)[/code]. [b]Note:[/b] This setting has no effect if [member display/window/per_pixel_transparency/allowed] is set to [code]false[/code]. </member> <member name="display/window/size/viewport_height" type="int" setter="" getter="" default="648"> Sets the game's main viewport height. On desktop platforms, this is also the initial window height, represented by an indigo-colored rectangle in the 2D editor. Stretch mode settings also use this as a reference when using the [code]canvas_items[/code] or [code]viewport[/code] stretch modes. See also [member display/window/size/viewport_width], [member display/window/size/window_width_override] and [member display/window/size/window_height_override]. </member> <member name="display/window/size/viewport_width" type="int" setter="" getter="" default="1152"> Sets the game's main viewport width. On desktop platforms, this is also the initial window width, represented by an indigo-colored rectangle in the 2D editor. Stretch mode settings also use this as a reference when using the [code]canvas_items[/code] or [code]viewport[/code] stretch modes. See also [member display/window/size/viewport_height], [member display/window/size/window_width_override] and [member display/window/size/window_height_override]. </member> <member name="display/window/size/window_height_override" type="int" setter="" getter="" default="0"> On desktop platforms, overrides the game's initial window height. See also [member display/window/size/window_width_override], [member display/window/size/viewport_width] and [member display/window/size/viewport_height]. [b]Note:[/b] By default, or when set to [code]0[/code], the initial window height is the [member display/window/size/viewport_height]. This setting is ignored on iOS, Android, and Web. </member> <member name="display/window/size/window_width_override" type="int" setter="" getter="" default="0"> On desktop platforms, overrides the game's initial window width. See also [member display/window/size/window_height_override], [member display/window/size/viewport_width] and [member display/window/size/viewport_height]. [b]Note:[/b] By default, or when set to [code]0[/code], the initial window width is the [member display/window/size/viewport_width]. This setting is ignored on iOS, Android, and Web. </member> <member name="display/window/stretch/aspect" type="String" setter="" getter="" default="&quot;keep&quot;"> </member> <member name="display/window/stretch/mode" type="String" setter="" getter="" default="&quot;disabled&quot;"> Defines how the base size is stretched to fit the resolution of the window or screen. [b]"disabled"[/b]: No stretching happens. One unit in the scene corresponds to one pixel on the screen. In this mode, [member display/window/stretch/aspect] has no effect. Recommended for non-game applications. [b]"canvas_items"[/b]: The base size specified in width and height in the project settings is stretched to cover the whole screen (taking [member display/window/stretch/aspect] into account). This means that everything is rendered directly at the target resolution. 3D is unaffected, while in 2D, there is no longer a 1:1 correspondence between sprite pixels and screen pixels, which may result in scaling artifacts. Recommended for most games that don't use a pixel art aesthetic, although it is possible to use this stretch mode for pixel art games too (especially in 3D). [b]"viewport"[/b]: The size of the root [Viewport] is set precisely to the base size specified in the Project Settings' Display section. The scene is rendered to this viewport first. Finally, this viewport is scaled to fit the screen (taking [member display/window/stretch/aspect] into account). Recommended for games that use a pixel art aesthetic. </member> <
123676
member name="display/window/stretch/scale" type="float" setter="" getter="" default="1.0"> The scale factor multiplier to use for 2D elements. This multiplies the final scale factor determined by [member display/window/stretch/mode]. If using the [b]Disabled[/b] stretch mode, this scale factor is applied as-is. This can be adjusted to make the UI easier to read on certain displays. </member> <member name="display/window/stretch/scale_mode" type="String" setter="" getter="" default="&quot;fractional&quot;"> The policy to use to determine the final scale factor for 2D elements. This affects how [member display/window/stretch/scale] is applied, in addition to the automatic scale factor determined by [member display/window/stretch/mode]. [b]"fractional"[/b]: The scale factor will not be modified. [b]"integer"[/b]: The scale factor will be floored to an integer value, which means that the screen size will always be an integer multiple of the base viewport size. This provides a crisp pixel art appearance. [b]Note:[/b] When using integer scaling with a stretch mode, resizing the window to be smaller than the base viewport size will clip the contents. Consider preventing that by setting [member Window.min_size] to the same value as the base viewport size defined in [member display/window/size/viewport_width] and [member display/window/size/viewport_height]. </member> <member name="display/window/subwindows/embed_subwindows" type="bool" setter="" getter="" default="true"> If [code]true[/code], subwindows are embedded in the main window (this is also called single-window mode). Single-window mode can be faster as it does not need to create a separate window for every popup and tooltip, which can be a slow operation depending on the operating system and rendering method in use. If [code]false[/code], subwindows are created as separate windows (this is also called multi-window mode). This allows them to be moved outside the main window and use native operating system window decorations. This is equivalent to [member EditorSettings.interface/editor/single_window_mode] in the editor, except the setting's value is inverted. </member> <member name="display/window/vsync/vsync_mode" type="int" setter="" getter="" default="1"> Sets the V-Sync mode for the main game window. The editor's own V-Sync mode can be set using [member EditorSettings.interface/editor/vsync_mode]. See [enum DisplayServer.VSyncMode] for possible values and how they affect the behavior of your application. Depending on the platform and rendering method, the engine will fall back to [b]Enabled[/b] if the desired mode is not supported. V-Sync can be disabled on the command line using the [code]--disable-vsync[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]. [b]Note:[/b] The [b]Adaptive[/b] and [b]Mailbox[/b] V-Sync modes are only supported in the Forward+ and Mobile rendering methods, not Compatibility. [b]Note:[/b] This property is only read when the project starts. To change the V-Sync mode at runtime, call [method DisplayServer.window_set_vsync_mode] instead. </member> <member name="dotnet/project/assembly_name" type="String" setter="" getter="" default="&quot;&quot;"> Name of the .NET assembly. This name is used as the name of the [code].csproj[/code] and [code].sln[/code] files. By default, it's set to the name of the project ([member application/config/name]) allowing to change it in the future without affecting the .NET assembly. </member> <member name="dotnet/project/assembly_reload_attempts" type="int" setter="" getter="" default="3"> Number of times to attempt assembly reloading after rebuilding .NET assemblies. Effectively also the timeout in seconds to wait for unloading of script assemblies to finish. </member> <member name="dotnet/project/solution_directory" type="String" setter="" getter="" default="&quot;&quot;"> Directory that contains the [code].sln[/code] file. By default, the [code].sln[/code] files is in the root of the project directory, next to the [code]project.godot[/code] and [code].csproj[/code] files. Changing this value allows setting up a multi-project scenario where there are multiple [code].csproj[/code]. Keep in mind that the Godot project is considered one of the C# projects in the workspace and it's root directory should contain the [code]project.godot[/code] and [code].csproj[/code] next to each other. </member> <member name="editor/export/convert_text_resources_to_binary" type="bool" setter="" getter="" default="true"> If [code]true[/code], text resource ([code]tres[/code]) and text scene ([code]tscn[/code]) files are converted to their corresponding binary format on export. This decreases file sizes and speeds up loading slightly. [b]Note:[/b] Because a resource's file extension may change in an exported project, it is heavily recommended to use [method @GDScript.load] or [ResourceLoader] instead of [FileAccess] to load resources dynamically. [b]Note:[/b] The project settings file ([code]project.godot[/code]) will always be converted to binary on export, regardless of this setting. </member> <member name="editor/import/atlas_max_width" type="int" setter="" getter="" default="2048"> The maximum width to use when importing textures as an atlas. The value will be rounded to the nearest power of two when used. Use this to prevent imported textures from growing too large in the other direction. </member> <member name="editor/import/reimport_missing_imported_files" type="bool" setter="" getter="" default="true"> </member> <member name="editor/import/use_multiple_threads" type="bool" setter="" getter="" default="true"> If [code]true[/code] importing of resources is run on multiple threads. </member> <member name="editor/movie_writer/disable_vsync" type="bool" setter="" getter="" default="false"> If [code]true[/code], requests V-Sync to be disabled when writing a movie (similar to setting [member display/window/vsync/vsync_mode] to [b]Disabled[/b]). This can speed up video writing if the hardware is fast enough to render, encode and save the video at a framerate higher than the monitor's refresh rate. [b]Note:[/b] [member editor/movie_writer/disable_vsync] has no effect if the operating system or graphics driver forces V-Sync with no way for applications to disable it. </member> <member name="editor/movie_writer/fps" type="int" setter="" getter="" default="60"> The number of frames per second to record in the video when writing a movie. Simulation speed will adjust to always match the specified framerate, which means the engine will appear to run slower at higher [member editor/movie_writer/fps] values. Certain FPS values will require you to adjust [member editor/movie_writer/mix_rate] to prevent audio from desynchronizing over time. This can be specified manually on the command line using the [code]--fixed-fps &lt;fps&gt;[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]. </member> <member name="editor/movie_writer/mix_rate" type="int" setter="" getter="" default="48000"> The audio mix rate to use in the recorded audio when writing a movie (in Hz). This can be different from [member audio/driver/mix_rate], but this value must be divisible by [member editor/movie_writer/fps] to prevent audio from desynchronizing over time. </member> <member name="editor/movie_writer/mjpeg_quality" type="float" setter="" getter="" default="0.75"> The JPEG quality to use when writing a video to an AVI file, between [code]0.01[/code] and [code]1.0[/code] (inclusive). Higher [code]quality[/code] values result in better-looking output at the cost of larger file sizes. Recommended [code]quality[/code] values are between [code]0.75[/code] and [code]0.9[/code]. Even at quality [code]1.0[/code], JPEG compression remains lossy. [b]Note:[/b] This does not affect the audio quality or writing PNG image sequences. </member> <
123694
member name="rendering/2d/snap/snap_2d_transforms_to_pixel" type="bool" setter="" getter="" default="false"> If [code]true[/code], [CanvasItem] nodes will internally snap to full pixels. Useful for low-resolution pixel art games. Their position can still be sub-pixel, but the decimals will not have effect as the position is rounded. This can lead to a crisper appearance at the cost of less smooth movement, especially when [Camera2D] smoothing is enabled. [b]Note:[/b] This property is only read when the project starts. To toggle 2D transform snapping at runtime, use [method RenderingServer.viewport_set_snap_2d_transforms_to_pixel] on the root [Viewport] instead. [b]Note:[/b] [Control] nodes are snapped to the nearest pixel by default. This is controlled by [member gui/common/snap_controls_to_pixels]. [b]Note:[/b] It is not recommended to use this setting together with [member rendering/2d/snap/snap_2d_vertices_to_pixel], as movement may appear even less smooth. Prefer only enabling this setting instead. </member> <member name="rendering/2d/snap/snap_2d_vertices_to_pixel" type="bool" setter="" getter="" default="false"> If [code]true[/code], vertices of [CanvasItem] nodes will snap to full pixels. Useful for low-resolution pixel art games. Only affects the final vertex positions, not the transforms. This can lead to a crisper appearance at the cost of less smooth movement, especially when [Camera2D] smoothing is enabled. [b]Note:[/b] This property is only read when the project starts. To toggle 2D vertex snapping at runtime, use [method RenderingServer.viewport_set_snap_2d_vertices_to_pixel] on the root [Viewport] instead. [b]Note:[/b] [Control] nodes are snapped to the nearest pixel by default. This is controlled by [member gui/common/snap_controls_to_pixels]. [b]Note:[/b] It is not recommended to use this setting together with [member rendering/2d/snap/snap_2d_transforms_to_pixel], as movement may appear even less smooth. Prefer only enabling that setting instead. </member> <member name="rendering/anti_aliasing/quality/msaa_2d" type="int" setter="" getter="" default="0"> Sets the number of multisample antialiasing (MSAA) samples to use for 2D/Canvas rendering (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware, especially integrated graphics due to their limited memory bandwidth. This has no effect on shader-induced aliasing or texture aliasing. [b]Note:[/b] MSAA is only supported in the Forward+ and Mobile rendering methods, not Compatibility. [b]Note:[/b] This property is only read when the project starts. To set the number of 2D MSAA samples at runtime, set [member Viewport.msaa_2d] or use [method RenderingServer.viewport_set_msaa_2d]. </member> <member name="rendering/anti_aliasing/quality/msaa_3d" type="int" setter="" getter="" default="0"> Sets the number of multisample antialiasing (MSAA) samples to use for 3D rendering (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware, especially integrated graphics due to their limited memory bandwidth. See also [member rendering/scaling_3d/mode] for supersampling, which provides higher quality but is much more expensive. This has no effect on shader-induced aliasing or texture aliasing. [b]Note:[/b] This property is only read when the project starts. To set the number of 3D MSAA samples at runtime, set [member Viewport.msaa_3d] or use [method RenderingServer.viewport_set_msaa_3d]. </member> <member name="rendering/anti_aliasing/quality/screen_space_aa" type="int" setter="" getter="" default="0"> Sets the screen-space antialiasing mode for the default screen [Viewport]. Screen-space antialiasing works by selectively blurring edges in a post-process shader. It differs from MSAA which takes multiple coverage samples while rendering objects. Screen-space AA methods are typically faster than MSAA and will smooth out specular aliasing, but tend to make scenes appear blurry. The blurriness is partially counteracted by automatically using a negative mipmap LOD bias (see [member rendering/textures/default_filters/texture_mipmap_bias]). Another way to combat specular aliasing is to enable [member rendering/anti_aliasing/screen_space_roughness_limiter/enabled]. [b]Note:[/b] Screen-space antialiasing is only supported in the Forward+ and Mobile rendering methods, not Compatibility. [b]Note:[/b] This property is only read when the project starts. To set the screen-space antialiasing mode at runtime, set [member Viewport.screen_space_aa] on the root [Viewport] instead, or use [method RenderingServer.viewport_set_screen_space_aa]. </member> <member name="rendering/anti_aliasing/quality/use_debanding" type="bool" setter="" getter="" default="false"> If [code]true[/code], uses a fast post-processing filter to make banding significantly less visible in 3D. 2D rendering is [i]not[/i] affected by debanding unless the [member Environment.background_mode] is [constant Environment.BG_CANVAS]. In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger. [b]Note:[/b] This property is only read when the project starts. To set debanding at runtime, set [member Viewport.use_debanding] on the root [Viewport] instead, or use [method RenderingServer.viewport_set_use_debanding]. </member> <member name="rendering/anti_aliasing/quality/use_taa" type="bool" setter="" getter="" default="false"> Enables temporal antialiasing for the default screen [Viewport]. TAA works by jittering the camera and accumulating the images of the last rendered frames, motion vector rendering is used to account for camera and object motion. Enabling TAA can make the image blurrier, which is partially counteracted by automatically using a negative mipmap LOD bias (see [member rendering/textures/default_filters/texture_mipmap_bias]). [b]Note:[/b] The implementation is not complete yet. Some visual instances such as particles and skinned meshes may show ghosting artifacts in motion. [b]Note:[/b] TAA is only supported in the Forward+ rendering method, not Mobile or Compatibility. [b]Note:[/b] This property is only read when the project starts. To set TAA at runtime, set [member Viewport.use_taa] on the root [Viewport] instead, or use [method RenderingServer.viewport_set_use_taa]. </member> <member name="rendering/anti_aliasing/screen_space_roughness_limiter/amount" type="float" setter="" getter="" default="0.25"> [b]Note:[/b] This property is only read when the project starts. To control the screen-space roughness limiter at runtime, call [method RenderingServer.screen_space_roughness_limiter_set_active] instead. </member> <member name="rendering/anti_aliasing/screen_space_roughness_limiter/enabled" type="bool" setter="" getter="" default="true"> If [code]true[/code], enables a spatial filter to limit roughness in areas with high-frequency detail. This can help reduce specular aliasing to an extent, though not as much as enabling [member rendering/anti_aliasing/quality/use_taa]. This filter has a small performance cost, so consider disabling it if it doesn't benefit your scene noticeably. [b]Note:[/b] The screen-space roughness limiter is only supported in the Forward+ and Mobile rendering methods, not Compatibility. [b]Note:[/b] This property is only read when the project starts. To control the screen-space roughness limiter at runtime, call [method RenderingServer.screen_space_roughness_limiter_set_active] instead. </member> <
123731
<?xml version="1.0" encoding="UTF-8" ?> <class name="CanvasLayer" inherits="Node" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A node used for independent rendering of objects within a 2D scene. </brief_description> <description> [CanvasItem]-derived nodes that are direct or indirect children of a [CanvasLayer] will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index [code]0[/code], so a [CanvasLayer] with index [code]-1[/code] will be drawn below, and a [CanvasLayer] with index [code]1[/code] will be drawn above. This order will hold regardless of the [member CanvasItem.z_index] of the nodes within each layer. [CanvasLayer]s can be hidden and they can also optionally follow the viewport. This makes them useful for HUDs like health bar overlays (on layers [code]1[/code] and higher) or backgrounds (on layers [code]-1[/code] and lower). [b]Note:[/b] Embedded [Window]s are placed on layer [code]1024[/code]. [CanvasItem]s on layers [code]1025[/code] and higher appear in front of embedded windows. [b]Note:[/b] Each [CanvasLayer] is drawn on one specific [Viewport] and cannot be shared between multiple [Viewport]s, see [member custom_viewport]. When using multiple [Viewport]s, for example in a split-screen game, you need create an individual [CanvasLayer] for each [Viewport] you want it to be drawn on. </description> <tutorials> <link title="Viewport and canvas transforms">$DOCS_URL/tutorials/2d/2d_transforms.html</link> <link title="Canvas layers">$DOCS_URL/tutorials/2d/canvas_layers.html</link> <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> </tutorials> <methods> <method name="get_canvas" qualifiers="const"> <return type="RID" /> <description> Returns the RID of the canvas used by this layer. </description> </method> <method name="get_final_transform" qualifiers="const"> <return type="Transform2D" /> <description> Returns the transform from the [CanvasLayer]s coordinate system to the [Viewport]s coordinate system. </description> </method> <method name="hide"> <return type="void" /> <description> Hides any [CanvasItem] under this [CanvasLayer]. This is equivalent to setting [member visible] to [code]false[/code]. </description> </method> <method name="show"> <return type="void" /> <description> Shows any [CanvasItem] under this [CanvasLayer]. This is equivalent to setting [member visible] to [code]true[/code]. </description> </method> </methods> <members> <member name="custom_viewport" type="Node" setter="set_custom_viewport" getter="get_custom_viewport"> The custom [Viewport] node assigned to the [CanvasLayer]. If [code]null[/code], uses the default viewport instead. </member> <member name="follow_viewport_enabled" type="bool" setter="set_follow_viewport" getter="is_following_viewport" default="false"> If enabled, the [CanvasLayer] will use the viewport's transform, so it will move when camera moves instead of being anchored in a fixed position on the screen. Together with [member follow_viewport_scale] it can be used for a pseudo 3D effect. </member> <member name="follow_viewport_scale" type="float" setter="set_follow_viewport_scale" getter="get_follow_viewport_scale" default="1.0"> Scales the layer when using [member follow_viewport_enabled]. Layers moving into the foreground should have increasing scales, while layers moving into the background should have decreasing scales. </member> <member name="layer" type="int" setter="set_layer" getter="get_layer" default="1"> Layer index for draw order. Lower values are drawn behind higher values. [b]Note:[/b] If multiple CanvasLayers have the same layer index, [CanvasItem] children of one CanvasLayer are drawn behind the [CanvasItem] children of the other CanvasLayer. Which CanvasLayer is drawn in front is non-deterministic. </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The layer's base offset. </member> <member name="rotation" type="float" setter="set_rotation" getter="get_rotation" default="0.0"> The layer's rotation in radians. </member> <member name="scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2(1, 1)"> The layer's scale. </member> <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D(1, 0, 0, 1, 0, 0)"> The layer's transform. </member> <member name="visible" type="bool" setter="set_visible" getter="is_visible" default="true"> If [code]false[/code], any [CanvasItem] under this [CanvasLayer] will be hidden. Unlike [member CanvasItem.visible], visibility of a [CanvasLayer] isn't propagated to underlying layers. </member> </members> <signals> <signal name="visibility_changed"> <description> Emitted when visibility of the layer is changed. See [member visible]. </description> </signal> </signals> </class>
123745
<?xml version="1.0" encoding="UTF-8" ?> <class name="NodePath" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A pre-parsed scene tree path. </brief_description> <description> The [NodePath] built-in [Variant] type represents a path to a node or property in a hierarchy of nodes. It is designed to be efficiently passed into many built-in methods (such as [method Node.get_node], [method Object.set_indexed], [method Tween.tween_property], etc.) without a hard dependence on the node or property they point to. A node path is represented as a [String] composed of slash-separated ([code]/[/code]) node names and colon-separated ([code]:[/code]) property names (also called "subnames"). Similar to a filesystem path, [code]".."[/code] and [code]"."[/code] are special node names. They refer to the parent node and the current node, respectively. The following examples are paths relative to the current node: [codeblock] ^"A" # Points to the direct child A. ^"A/B" # Points to A's child B. ^"." # Points to the current node. ^".." # Points to the parent node. ^"../C" # Points to the sibling node C. ^"../.." # Points to the grandparent node. [/codeblock] A leading slash means the path is absolute, and begins from the [SceneTree]: [codeblock] ^"/root" # Points to the SceneTree's root Window. ^"/root/Title" # May point to the main scene's root node named "Title". ^"/root/Global" # May point to an autoloaded node or scene named "Global". [/codeblock] Despite their name, node paths may also point to a property: [codeblock] ^":position" # Points to this object's position. ^":position:x" # Points to this object's position in the x axis. ^"Camera3D:rotation:y" # Points to the child Camera3D and its y rotation. ^"/root:size:x" # Points to the root Window and its width. [/codeblock] In some situations, it's possible to omit the leading [code]:[/code] when pointing to an object's property. As an example, this is the case with [method Object.set_indexed] and [method Tween.tween_property], as those methods call [method NodePath.get_as_property_path] under the hood. However, it's generally recommended to keep the [code]:[/code] prefix. Node paths cannot check whether they are valid and may point to nodes or properties that do not exist. Their meaning depends entirely on the context in which they're used. You usually do not have to worry about the [NodePath] type, as strings are automatically converted to the type when necessary. There are still times when defining node paths is useful. For example, exported [NodePath] properties allow you to easily select any node within the currently edited scene. They are also automatically updated when moving, renaming or deleting nodes in the scene tree editor. See also [annotation @GDScript.@export_node_path]. See also [StringName], which is a similar type designed for optimized strings. [b]Note:[/b] In a boolean context, a [NodePath] will evaluate to [code]false[/code] if it is empty ([code]NodePath("")[/code]). Otherwise, a [NodePath] will always evaluate to [code]true[/code]. </description> <tutorials> <link title="2D Role Playing Game (RPG) Demo">https://godotengine.org/asset-library/asset/2729</link> </tutorials> <constructors> <constructor name="NodePath"> <return type="NodePath" /> <description> Constructs an empty [NodePath]. </description> </constructor> <constructor name="NodePath"> <return type="NodePath" /> <param index="0" name="from" type="NodePath" /> <description> Constructs a [NodePath] as a copy of the given [NodePath]. </description> </constructor> <constructor name="NodePath"> <return type="NodePath" /> <param index="0" name="from" type="String" /> <description> Constructs a [NodePath] from a [String]. The created path is absolute if prefixed with a slash (see [method is_absolute]). The "subnames" optionally included after the path to the target node can point to properties, and can also be nested. Examples of strings that could be node paths: [codeblock] # Points to the Sprite2D node. "Level/RigidBody2D/Sprite2D" # Points to the Sprite2D node and its "texture" resource. # get_node() would retrieve the Sprite2D, while get_node_and_resource() # would retrieve both the Sprite2D node and the "texture" resource. "Level/RigidBody2D/Sprite2D:texture" # Points to the Sprite2D node and its "position" property. "Level/RigidBody2D/Sprite2D:position" # Points to the Sprite2D node and the "x" component of its "position" property. "Level/RigidBody2D/Sprite2D:position:x" # Points to the RigidBody2D node as an absolute path beginning from the SceneTree. "/root/Level/RigidBody2D" [/codeblock] [b]Note:[/b] In GDScript, it's also possible to convert a constant string into a node path by prefixing it with [code]^[/code]. [code]^"path/to/node"[/code] is equivalent to [code]NodePath("path/to/node")[/code]. </description> </constructor> </constructors>
123757
<?xml version="1.0" encoding="UTF-8" ?> <class name="Container" inherits="Control" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Base class for all GUI containers. </brief_description> <description> Base class for all GUI containers. A [Container] automatically arranges its child controls in a certain way. This class can be inherited to make custom container types. </description> <tutorials> <link title="Using Containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> </tutorials> <methods> <method name="_get_allowed_size_flags_horizontal" qualifiers="virtual const"> <return type="PackedInt32Array" /> <description> Implement to return a list of allowed horizontal [enum Control.SizeFlags] for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the Inspector dock. [b]Note:[/b] Having no size flags is equal to having [constant Control.SIZE_SHRINK_BEGIN]. As such, this value is always implicitly allowed. </description> </method> <method name="_get_allowed_size_flags_vertical" qualifiers="virtual const"> <return type="PackedInt32Array" /> <description> Implement to return a list of allowed vertical [enum Control.SizeFlags] for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the Inspector dock. [b]Note:[/b] Having no size flags is equal to having [constant Control.SIZE_SHRINK_BEGIN]. As such, this value is always implicitly allowed. </description> </method> <method name="fit_child_in_rect"> <return type="void" /> <param index="0" name="child" type="Control" /> <param index="1" name="rect" type="Rect2" /> <description> Fit a child control in a given rect. This is mainly a helper for creating custom container classes. </description> </method> <method name="queue_sort"> <return type="void" /> <description> Queue resort of the contained children. This is called automatically anyway, but can be called upon request. </description> </method> </methods> <members> <member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" overrides="Control" enum="Control.MouseFilter" default="1" /> </members> <signals> <signal name="pre_sort_children"> <description> Emitted when children are going to be sorted. </description> </signal> <signal name="sort_children"> <description> Emitted when sorting the children is needed. </description> </signal> </signals> <constants> <constant name="NOTIFICATION_PRE_SORT_CHILDREN" value="50"> Notification just before children are going to be sorted, in case there's something to process beforehand. </constant> <constant name="NOTIFICATION_SORT_CHILDREN" value="51"> Notification for when sorting the children, it must be obeyed immediately. </constant> </constants> </class>
123771
<?xml version="1.0" encoding="UTF-8" ?> <class name="ImageTexture" inherits="Texture2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A [Texture2D] based on an [Image]. </brief_description> <description> A [Texture2D] based on an [Image]. For an image to be displayed, an [ImageTexture] has to be created from it using the [method create_from_image] method: [codeblock] var image = Image.load_from_file("res://icon.svg") var texture = ImageTexture.create_from_image(image) $Sprite2D.texture = texture [/codeblock] This way, textures can be created at run-time by loading images both from within the editor and externally. [b]Warning:[/b] Prefer to load imported textures with [method @GDScript.load] over loading them from within the filesystem dynamically with [method Image.load], as it may not work in exported projects: [codeblock] var texture = load("res://icon.svg") $Sprite2D.texture = texture [/codeblock] This is because images have to be imported as a [CompressedTexture2D] first to be loaded with [method @GDScript.load]. If you'd still like to load an image file just like any other [Resource], import it as an [Image] resource instead, and then load it normally using the [method @GDScript.load] method. [b]Note:[/b] The image can be retrieved from an imported texture using the [method Texture2D.get_image] method, which returns a copy of the image: [codeblock] var texture = load("res://icon.svg") var image: Image = texture.get_image() [/codeblock] An [ImageTexture] is not meant to be operated from within the editor interface directly, and is mostly useful for rendering images on screen dynamically via code. If you need to generate images procedurally from within the editor, consider saving and importing images as custom texture resources implementing a new [EditorImportPlugin]. [b]Note:[/b] The maximum texture size is 16384×16384 pixels due to graphics hardware limitations. </description> <tutorials> <link title="Importing images">$DOCS_URL/tutorials/assets_pipeline/importing_images.html</link> </tutorials> <methods> <method name="create_from_image" qualifiers="static"> <return type="ImageTexture" /> <param index="0" name="image" type="Image" /> <description> Creates a new [ImageTexture] and initializes it by allocating and setting the data from an [Image]. </description> </method> <method name="get_format" qualifiers="const"> <return type="int" enum="Image.Format" /> <description> Returns the format of the texture, one of [enum Image.Format]. </description> </method> <method name="set_image"> <return type="void" /> <param index="0" name="image" type="Image" /> <description> Replaces the texture's data with a new [Image]. This will re-allocate new memory for the texture. If you want to update the image, but don't need to change its parameters (format, size), use [method update] instead for better performance. </description> </method> <method name="set_size_override"> <return type="void" /> <param index="0" name="size" type="Vector2i" /> <description> Resizes the texture to the specified dimensions. </description> </method> <method name="update"> <return type="void" /> <param index="0" name="image" type="Image" /> <description> Replaces the texture's data with a new [Image]. [b]Note:[/b] The texture has to be created using [method create_from_image] or initialized first with the [method set_image] method before it can be updated. The new image dimensions, format, and mipmaps configuration should match the existing texture's image configuration. Use this method over [method set_image] if you need to update the texture frequently, which is faster than allocating additional memory for a new texture each time. </description> </method> </methods> <members> <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> </members> </class>
123779
<?xml version="1.0" encoding="UTF-8" ?> <class name="SeparationRayShape3D" inherits="Shape3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A 3D ray shape used for physics collision that tries to separate itself from any collider. </brief_description> <description> A 3D ray shape, intended for use in physics. Usually used to provide a shape for a [CollisionShape3D]. When a [SeparationRayShape3D] collides with an object, it tries to separate itself from it by moving its endpoint to the collision point. For example, a [SeparationRayShape3D] next to a character can allow it to instantly move up when touching stairs. </description> <tutorials> </tutorials> <members> <member name="length" type="float" setter="set_length" getter="get_length" default="1.0"> The ray's length. </member> <member name="slide_on_slope" type="bool" setter="set_slide_on_slope" getter="get_slide_on_slope" default="false"> If [code]false[/code] (default), the shape always separates and returns a normal along its own direction. If [code]true[/code], the shape can return the correct normal and separate in any direction, allowing sliding motion on slopes. </member> </members> </class>
123789
<brief_description> Texture for 2D and 3D. </brief_description> <description> A texture works by registering an image in the video hardware, which then can be used in 3D models or 2D [Sprite2D] or GUI [Control]. Textures are often created by loading them from a file. See [method @GDScript.load]. [Texture2D] is a base for other resources. It cannot be used directly. [b]Note:[/b] The maximum texture size is 16384×16384 pixels due to graphics hardware limitations. Larger textures may fail to import. </description> <tutorials> </tutorials> <methods> <method name="_draw" qualifiers="virtual const"> <return type="void" /> <param index="0" name="to_canvas_item" type="RID" /> <param index="1" name="pos" type="Vector2" /> <param index="2" name="modulate" type="Color" /> <param index="3" name="transpose" type="bool" /> <description> Called when the entire [Texture2D] is requested to be drawn over a [CanvasItem], with the top-left offset specified in [param pos]. [param modulate] specifies a multiplier for the colors being drawn, while [param transpose] specifies whether drawing should be performed in column-major order instead of row-major order (resulting in 90-degree clockwise rotation). [b]Note:[/b] This is only used in 2D rendering, not 3D. </description> </method> <method name="_draw_rect" qualifiers="virtual const"> <return type="void" /> <param index="0" name="to_canvas_item" type="RID" /> <param index="1" name="rect" type="Rect2" /> <param index="2" name="tile" type="bool" /> <param index="3" name="modulate" type="Color" /> <param index="4" name="transpose" type="bool" /> <description> Called when the [Texture2D] is requested to be drawn onto [CanvasItem]'s specified [param rect]. [param modulate] specifies a multiplier for the colors being drawn, while [param transpose] specifies whether drawing should be performed in column-major order instead of row-major order (resulting in 90-degree clockwise rotation). [b]Note:[/b] This is only used in 2D rendering, not 3D. </description> </method> <method name="_draw_rect_region" qualifiers="virtual const"> <return type="void" /> <param index="0" name="to_canvas_item" type="RID" /> <param index="1" name="rect" type="Rect2" /> <param index="2" name="src_rect" type="Rect2" /> <param index="3" name="modulate" type="Color" /> <param index="4" name="transpose" type="bool" /> <param index="5" name="clip_uv" type="bool" /> <description> Called when a part of the [Texture2D] specified by [param src_rect]'s coordinates is requested to be drawn onto [CanvasItem]'s specified [param rect]. [param modulate] specifies a multiplier for the colors being drawn, while [param transpose] specifies whether drawing should be performed in column-major order instead of row-major order (resulting in 90-degree clockwise rotation). [b]Note:[/b] This is only used in 2D rendering, not 3D. </description> </method> <method name="_get_height" qualifiers="virtual const"> <return type="int" /> <description> Called when the [Texture2D]'s height is queried. </description> </method> <method name="_get_width" qualifiers="virtual const"> <return type="int" /> <description> Called when the [Texture2D]'s width is queried. </description> </method> <method name="_has_alpha" qualifiers="virtual const"> <return type="bool" /> <description> Called when the presence of an alpha channel in the [Texture2D] is queried. </description> </method> <method name="_is_pixel_opaque" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="x" type="int" /> <param index="1" name="y" type="int" /> <description> Called when a pixel's opaque state in the [Texture2D] is queried at the specified [code](x, y)[/code] position. </description> </method> <method name="create_placeholder" qualifiers="const"> <return type="Resource" /> <description> Creates a placeholder version of this resource ([PlaceholderTexture2D]). </description> </method> <method name="draw" qualifiers="const"> <return type="void" /> <param index="0" name="canvas_item" type="RID" /> <param index="1" name="position" type="Vector2" /> <param index="2" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> <param index="3" name="transpose" type="bool" default="false" /> <description> Draws the texture using a [CanvasItem] with the [RenderingServer] API at the specified [param position]. </description> </method> <method name="draw_rect" qualifiers="const"> <return type="void" /> <param index="0" name="canvas_item" type="RID" /> <param index="1" name="rect" type="Rect2" /> <param index="2" name="tile" type="bool" /> <param index="3" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> <param index="4" name="transpose" type="bool" default="false" /> <description> Draws the texture using a [CanvasItem] with the [RenderingServer] API. </description> </method> <method name="draw_rect_region" qualifiers="const"> <return type="void" /> <param index="0" name="canvas_item" type="RID" /> <param index="1" name="rect" type="Rect2" /> <param index="2" name="src_rect" type="Rect2" /> <param index="3" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> <param index="4" name="transpose" type="bool" default="false" /> <param index="5" name="clip_uv" type="bool" default="true" /> <description> Draws a part of the texture using a [CanvasItem] with the [RenderingServer] API. </description> </method> <method name="get_height" qualifiers="const"> <return type="int" /> <description> Returns the texture height in pixels. </description> </method> <method name="get_image" qualifiers="const"> <return type="Image" /> <description> Returns an [Image] that is a copy of data from this [Texture2D] (a new [Image] is created each time). [Image]s can be accessed and manipulated directly. [b]Note:[/b] This will return [code]null[/code] if this [Texture2D] is invalid. [b]Note:[/b] This will fetch the texture data from the GPU, which might cause performance problems when overused. </description> </method> <method name="get_size" qualifiers="const"> <return type="Vector2" /> <description> Returns the texture size in pixels. </description> </method> <method name="get_width" qualifiers="const"> <return type="int" /> <description> Returns the texture width in pixels. </description> </method> <method name="has_alpha" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if this [Texture2D] has an alpha channel. </description> </method> </methods> <
123791
<?xml version="1.0" encoding="UTF-8" ?> <class name="PackedByteArray" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A packed array of bytes. </brief_description> <description> An array specifically designed to hold bytes. Packs data tightly, so it saves memory for large array sizes. [PackedByteArray] also provides methods to encode/decode various types to/from bytes. The way values are encoded is an implementation detail and shouldn't be relied upon when interacting with external apps. [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. The returned packed array of these are a copies, and changing it will [i]not[/i] affect the original value. To update a built-in property you need to modify the returned array, and then assign it to the property again. </description> <tutorials> </tutorials> <constructors> <constructor name="PackedByteArray"> <return type="PackedByteArray" /> <description> Constructs an empty [PackedByteArray]. </description> </constructor> <constructor name="PackedByteArray"> <return type="PackedByteArray" /> <param index="0" name="from" type="PackedByteArray" /> <description> Constructs a [PackedByteArray] as a copy of the given [PackedByteArray]. </description> </constructor> <constructor name="PackedByteArray"> <return type="PackedByteArray" /> <param index="0" name="from" type="Array" /> <description> Constructs a new [PackedByteArray]. Optionally, you can pass in a generic [Array] that will be converted. </description> </constructor> </constructors>
123794
<method name="fill"> <return type="void" /> <param index="0" name="value" type="int" /> <description> Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> <method name="find" qualifiers="const"> <return type="int" /> <param index="0" name="value" type="int" /> <param index="1" name="from" type="int" default="0" /> <description> Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. </description> </method> <method name="get" qualifiers="const"> <return type="int" /> <param index="0" name="index" type="int" /> <description> Returns the byte at the given [param index] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]). </description> </method> <method name="get_string_from_ascii" qualifiers="const"> <return type="String" /> <description> Converts ASCII/Latin-1 encoded array to [String]. Fast alternative to [method get_string_from_utf8] if the content is ASCII/Latin-1 only. Unlike the UTF-8 function this function maps every byte to a character in the array. Multibyte sequences will not be interpreted correctly. For parsing user input always use [method get_string_from_utf8]. This is the inverse of [method String.to_ascii_buffer]. </description> </method> <method name="get_string_from_utf8" qualifiers="const"> <return type="String" /> <description> Converts UTF-8 encoded array to [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. Returns empty string if source array is not valid UTF-8 string. This is the inverse of [method String.to_utf8_buffer]. </description> </method> <method name="get_string_from_utf16" qualifiers="const"> <return type="String" /> <description> Converts UTF-16 encoded array to [String]. If the BOM is missing, system endianness is assumed. Returns empty string if source array is not valid UTF-16 string. This is the inverse of [method String.to_utf16_buffer]. </description> </method> <method name="get_string_from_utf32" qualifiers="const"> <return type="String" /> <description> Converts UTF-32 encoded array to [String]. System endianness is assumed. Returns empty string if source array is not valid UTF-32 string. This is the inverse of [method String.to_utf32_buffer]. </description> </method> <method name="get_string_from_wchar" qualifiers="const"> <return type="String" /> <description> Converts wide character ([code]wchar_t[/code], UTF-16 on Windows, UTF-32 on other platforms) encoded array to [String]. Returns empty string if source array is not valid wide string. This is the inverse of [method String.to_wchar_buffer]. </description> </method> <method name="has" qualifiers="const"> <return type="bool" /> <param index="0" name="value" type="int" /> <description> Returns [code]true[/code] if the array contains [param value]. </description> </method> <method name="has_encoded_var" qualifiers="const"> <return type="bool" /> <param index="0" name="byte_offset" type="int" /> <param index="1" name="allow_objects" type="bool" default="false" /> <description> Returns [code]true[/code] if a valid [Variant] value can be decoded at the [param byte_offset]. Returns [code]false[/code] otherwise or when the value is [Object]-derived and [param allow_objects] is [code]false[/code]. </description> </method> <method name="hex_encode" qualifiers="const"> <return type="String" /> <description> Returns a hexadecimal representation of this array as a [String]. [codeblocks] [gdscript] var array = PackedByteArray([11, 46, 255]) print(array.hex_encode()) # Prints: 0b2eff [/gdscript] [csharp] var array = new byte[] {11, 46, 255}; GD.Print(array.HexEncode()); // Prints: 0b2eff [/csharp] [/codeblocks] </description> </method> <method name="insert"> <return type="int" /> <param index="0" name="at_index" type="int" /> <param index="1" name="value" type="int" /> <description> Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). </description> </method> <method name="is_empty" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the array is empty. </description> </method> <method name="push_back"> <return type="bool" /> <param index="0" name="value" type="int" /> <description> Appends an element at the end of the array. </description> </method> <method name="remove_at"> <return type="void" /> <param index="0" name="index" type="int" /> <description> Removes an element from the array by index. </description> </method> <method name="resize"> <return type="int" /> <param index="0" name="new_size" type="int" /> <description> Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. Calling [method resize] once and assigning the new values is faster than adding new elements one by one. </description> </method> <method name="reverse"> <return type="void" /> <description> Reverses the order of the elements in the array. </description> </method> <method name="rfind" qualifiers="const"> <return type="int" /> <param index="0" name="value" type="int" /> <param index="1" name="from" type="int" default="-1" /> <description> Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. </description> </method> <method name="set"> <return type="void" /> <param index="0" name="index" type="int" /> <param index="1" name="value" type="int" /> <description> Changes the byte at the given index. </description> </method> <method name="size" qualifiers="const"> <return type="int" /> <description> Returns the number of elements in the array. </description> </method>
123798
<method name="get_singleton" qualifiers="const"> <return type="Object" /> <param index="0" name="name" type="StringName" /> <description> Returns the global singleton with the given [param name], or [code]null[/code] if it does not exist. Often used for plugins. See also [method has_singleton] and [method get_singleton_list]. [b]Note:[/b] Global singletons are not the same as autoloaded nodes, which are configurable in the project settings. </description> </method> <method name="get_singleton_list" qualifiers="const"> <return type="PackedStringArray" /> <description> Returns a list of names of all available global singletons. See also [method get_singleton]. </description> </method> <method name="get_version_info" qualifiers="const"> <return type="Dictionary" /> <description> Returns the current engine version information as a [Dictionary] containing the following entries: - [code]major[/code] - Major version number as an int; - [code]minor[/code] - Minor version number as an int; - [code]patch[/code] - Patch version number as an int; - [code]hex[/code] - Full version encoded as a hexadecimal int with one byte (2 hex digits) per number (see example below); - [code]status[/code] - Status (such as "beta", "rc1", "rc2", "stable", etc.) as a String; - [code]build[/code] - Build name (e.g. "custom_build") as a String; - [code]hash[/code] - Full Git commit hash as a String; - [code]timestamp[/code] - Holds the Git commit date UNIX timestamp in seconds as an int, or [code]0[/code] if unavailable; - [code]string[/code] - [code]major[/code], [code]minor[/code], [code]patch[/code], [code]status[/code], and [code]build[/code] in a single String. The [code]hex[/code] value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be [code]0x03010C[/code]. [b]Note:[/b] The [code]hex[/code] value is still an [int] internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for quick version comparisons from code: [codeblocks] [gdscript] if Engine.get_version_info().hex &gt;= 0x040100: pass # Do things specific to version 4.1 or later. else: pass # Do things specific to versions before 4.1. [/gdscript] [csharp] if ((int)Engine.GetVersionInfo()["hex"] &gt;= 0x040100) { // Do things specific to version 4.1 or later. } else { // Do things specific to versions before 4.1. } [/csharp] [/codeblocks] </description> </method> <method name="get_write_movie_path" qualifiers="const"> <return type="String" /> <description> Returns the path to the [MovieWriter]'s output file, or an empty string if the engine wasn't started in Movie Maker mode. The default path can be changed in [member ProjectSettings.editor/movie_writer/movie_file]. </description> </method> <method name="has_singleton" qualifiers="const"> <return type="bool" /> <param index="0" name="name" type="StringName" /> <description> Returns [code]true[/code] if a singleton with the given [param name] exists in the global scope. See also [method get_singleton]. [codeblocks] [gdscript] print(Engine.has_singleton("OS")) # Prints true print(Engine.has_singleton("Engine")) # Prints true print(Engine.has_singleton("AudioServer")) # Prints true print(Engine.has_singleton("Unknown")) # Prints false [/gdscript] [csharp] GD.Print(Engine.HasSingleton("OS")); // Prints true GD.Print(Engine.HasSingleton("Engine")); // Prints true GD.Print(Engine.HasSingleton("AudioServer")); // Prints true GD.Print(Engine.HasSingleton("Unknown")); // Prints false [/csharp] [/codeblocks] [b]Note:[/b] Global singletons are not the same as autoloaded nodes, which are configurable in the project settings. </description> </method> <method name="is_editor_hint" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the script is currently running inside the editor, otherwise returns [code]false[/code]. This is useful for [code]@tool[/code] scripts to conditionally draw editor helpers, or prevent accidentally running "game" code that would affect the scene state while in the editor: [codeblocks] [gdscript] if Engine.is_editor_hint(): draw_gizmos() else: simulate_physics() [/gdscript] [csharp] if (Engine.IsEditorHint()) DrawGizmos(); else SimulatePhysics(); [/csharp] [/codeblocks] See [url=$DOCS_URL/tutorials/plugins/running_code_in_the_editor.html]Running code in the editor[/url] in the documentation for more information. [b]Note:[/b] To detect whether the script is running on an editor [i]build[/i] (such as when pressing [kbd]F5[/kbd]), use [method OS.has_feature] with the [code]"editor"[/code] argument instead. [code]OS.has_feature("editor")[/code] evaluate to [code]true[/code] both when the script is running in the editor and when running the project from the editor, but returns [code]false[/code] when run from an exported project. </description> </method> <method name="is_in_physics_frame" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the engine is inside the fixed physics process step of the main loop. [codeblock] func _enter_tree(): # Depending on when the node is added to the tree, # prints either "true" or "false". print(Engine.is_in_physics_frame()) func _process(delta): print(Engine.is_in_physics_frame()) # Prints false func _physics_process(delta): print(Engine.is_in_physics_frame()) # Prints true [/codeblock] </description> </method> <method name="register_script_language"> <return type="int" enum="Error" /> <param index="0" name="language" type="ScriptLanguage" /> <description> Registers a [ScriptLanguage] instance to be available with [code]ScriptServer[/code]. Returns: - [constant OK] on success; - [constant ERR_UNAVAILABLE] if [code]ScriptServer[/code] has reached the limit and cannot register any new language; - [constant ERR_ALREADY_EXISTS] if [code]ScriptServer[/code] already contains a language with similar extension/name/type. </description> </method> <method name="register_singleton"> <return type="void" /> <param index="0" name="name" type="StringName" /> <param index="1" name="instance" type="Object" /> <description> Registers the given [Object] [param instance] as a singleton, available globally under [param name]. Useful for plugins. </description> </method> <method name="unregister_script_language"> <return type="int" enum="Error" /> <param index="0" name="language" type="ScriptLanguage" /> <description> Unregisters the [ScriptLanguage] instance from [code]ScriptServer[/code]. Returns: - [constant OK] on success; - [constant ERR_DOES_NOT_EXIST] if the language is not registered in [code]ScriptServer[/code]. </description> </method>
123804
<?xml version="1.0" encoding="UTF-8" ?> <class name="Camera3D" inherits="Node3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Camera node, displays from a point of view. </brief_description> <description> [Camera3D] is a special node that displays what is visible from its current location. Cameras register themselves in the nearest [Viewport] node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the camera will register in the global viewport. In other words, a camera just provides 3D display capabilities to a [Viewport], and, without one, a scene registered in that [Viewport] (or higher viewports) can't be displayed. </description> <tutorials> <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials>
123806
<method name="unproject_position" qualifiers="const"> <return type="Vector2" /> <param index="0" name="world_point" type="Vector3" /> <description> Returns the 2D coordinate in the [Viewport] rectangle that maps to the given 3D point in world space. [b]Note:[/b] When using this to position GUI elements over a 3D viewport, use [method is_position_behind] to prevent them from appearing if the 3D point is behind the camera: [codeblock] # This code block is part of a script that inherits from Node3D. # `control` is a reference to a node inheriting from Control. control.visible = not get_viewport().get_camera_3d().is_position_behind(global_transform.origin) control.position = get_viewport().get_camera_3d().unproject_position(global_transform.origin) [/codeblock] </description> </method> </methods> <members> <member name="attributes" type="CameraAttributes" setter="set_attributes" getter="get_attributes"> The [CameraAttributes] to use for this camera. </member> <member name="compositor" type="Compositor" setter="set_compositor" getter="get_compositor"> The [Compositor] to use for this camera. </member> <member name="cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="1048575"> The culling mask that describes which [member VisualInstance3D.layers] are rendered by this camera. By default, all 20 user-visible layers are rendered. [b]Note:[/b] Since the [member cull_mask] allows for 32 layers to be stored in total, there are an additional 12 layers that are only used internally by the engine and aren't exposed in the editor. Setting [member cull_mask] using a script allows you to toggle those reserved layers, which can be useful for editor plugins. To adjust [member cull_mask] more easily using a script, use [method get_cull_mask_value] and [method set_cull_mask_value]. [b]Note:[/b] [VoxelGI], SDFGI and [LightmapGI] will always take all layers into account to determine what contributes to global illumination. If this is an issue, set [member GeometryInstance3D.gi_mode] to [constant GeometryInstance3D.GI_MODE_DISABLED] for meshes and [member Light3D.light_bake_mode] to [constant Light3D.BAKE_DISABLED] for lights to exclude them from global illumination. </member> <member name="current" type="bool" setter="set_current" getter="is_current" default="false"> If [code]true[/code], the ancestor [Viewport] is currently using this camera. If multiple cameras are in the scene, one will always be made current. For example, if two [Camera3D] nodes are present in the scene and only one is current, setting one camera's [member current] to [code]false[/code] will cause the other camera to be made current. </member> <member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" enum="Camera3D.DopplerTracking" default="0"> If not [constant DOPPLER_TRACKING_DISABLED], this camera will simulate the [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] for objects changed in particular [code]_process[/code] methods. See [enum DopplerTracking] for possible values. </member> <member name="environment" type="Environment" setter="set_environment" getter="get_environment"> The [Environment] to use for this camera. </member> <member name="far" type="float" setter="set_far" getter="get_far" default="4000.0"> The distance to the far culling boundary for this camera relative to its local Z axis. Higher values allow the camera to see further away, while decreasing [member far] can improve performance if it results in objects being partially or fully culled. </member> <member name="fov" type="float" setter="set_fov" getter="get_fov" default="75.0"> The camera's field of view angle (in degrees). Only applicable in perspective mode. Since [member keep_aspect] locks one axis, [member fov] sets the other axis' field of view angle. For reference, the default vertical field of view value ([code]75.0[/code]) is equivalent to a horizontal FOV of: - ~91.31 degrees in a 4:3 viewport - ~101.67 degrees in a 16:10 viewport - ~107.51 degrees in a 16:9 viewport - ~121.63 degrees in a 21:9 viewport </member> <member name="frustum_offset" type="Vector2" setter="set_frustum_offset" getter="get_frustum_offset" default="Vector2(0, 0)"> The camera's frustum offset. This can be changed from the default to create "tilted frustum" effects such as [url=https://zdoom.org/wiki/Y-shearing]Y-shearing[/url]. [b]Note:[/b] Only effective if [member projection] is [constant PROJECTION_FRUSTUM]. </member> <member name="h_offset" type="float" setter="set_h_offset" getter="get_h_offset" default="0.0"> The horizontal (X) offset of the camera viewport. </member> <member name="keep_aspect" type="int" setter="set_keep_aspect_mode" getter="get_keep_aspect_mode" enum="Camera3D.KeepAspect" default="1"> The axis to lock during [member fov]/[member size] adjustments. Can be either [constant KEEP_WIDTH] or [constant KEEP_HEIGHT]. </member> <member name="near" type="float" setter="set_near" getter="get_near" default="0.05"> The distance to the near culling boundary for this camera relative to its local Z axis. Lower values allow the camera to see objects more up close to its origin, at the cost of lower precision across the [i]entire[/i] range. Values lower than the default can lead to increased Z-fighting. </member> <member name="projection" type="int" setter="set_projection" getter="get_projection" enum="Camera3D.ProjectionType" default="0"> The camera's projection mode. In [constant PROJECTION_PERSPECTIVE] mode, objects' Z distance from the camera's local space scales their perceived size. </member> <member name="size" type="float" setter="set_size" getter="get_size" default="1.0"> The camera's size in meters measured as the diameter of the width or height, depending on [member keep_aspect]. Only applicable in orthogonal and frustum modes. </member> <member name="v_offset" type="float" setter="set_v_offset" getter="get_v_offset" default="0.0"> The vertical (Y) offset of the camera viewport. </member> </members>
123807
<constants> <constant name="PROJECTION_PERSPECTIVE" value="0" enum="ProjectionType"> Perspective projection. Objects on the screen becomes smaller when they are far away. </constant> <constant name="PROJECTION_ORTHOGONAL" value="1" enum="ProjectionType"> Orthogonal projection, also known as orthographic projection. Objects remain the same size on the screen no matter how far away they are. </constant> <constant name="PROJECTION_FRUSTUM" value="2" enum="ProjectionType"> Frustum projection. This mode allows adjusting [member frustum_offset] to create "tilted frustum" effects. </constant> <constant name="KEEP_WIDTH" value="0" enum="KeepAspect"> Preserves the horizontal aspect ratio; also known as Vert- scaling. This is usually the best option for projects running in portrait mode, as taller aspect ratios will benefit from a wider vertical FOV. </constant> <constant name="KEEP_HEIGHT" value="1" enum="KeepAspect"> Preserves the vertical aspect ratio; also known as Hor+ scaling. This is usually the best option for projects running in landscape mode, as wider aspect ratios will automatically benefit from a wider horizontal FOV. </constant> <constant name="DOPPLER_TRACKING_DISABLED" value="0" enum="DopplerTracking"> Disables [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] simulation (default). </constant> <constant name="DOPPLER_TRACKING_IDLE_STEP" value="1" enum="DopplerTracking"> Simulate [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] by tracking positions of objects that are changed in [code]_process[/code]. Changes in the relative velocity of this camera compared to those objects affect how audio is perceived (changing the audio's [member AudioStreamPlayer3D.pitch_scale]). </constant> <constant name="DOPPLER_TRACKING_PHYSICS_STEP" value="2" enum="DopplerTracking"> Simulate [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] by tracking positions of objects that are changed in [code]_physics_process[/code]. Changes in the relative velocity of this camera compared to those objects affect how audio is perceived (changing the audio's [member AudioStreamPlayer3D.pitch_scale]). </constant> </constants> </class>
123831
<?xml version="1.0" encoding="UTF-8" ?> <class name="Callable" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A built-in type representing a method or a standalone function. </brief_description> <description> [Callable] is a built-in [Variant] type that represents a function. It can either be a method within an [Object] instance, or a custom callable used for different purposes (see [method is_custom]). Like all [Variant] types, it can be stored in variables and passed to other functions. It is most commonly used for signal callbacks. [codeblocks] [gdscript] func print_args(arg1, arg2, arg3 = ""): prints(arg1, arg2, arg3) func test(): var callable = Callable(self, "print_args") callable.call("hello", "world") # Prints "hello world ". callable.call(Vector2.UP, 42, callable) # Prints "(0, -1) 42 Node(node.gd)::print_args". callable.call("invalid") # Invalid call, should have at least 2 arguments. [/gdscript] [csharp] // Default parameter values are not supported. public void PrintArgs(Variant arg1, Variant arg2, Variant arg3 = default) { GD.PrintS(arg1, arg2, arg3); } public void Test() { // Invalid calls fail silently. Callable callable = new Callable(this, MethodName.PrintArgs); callable.Call("hello", "world"); // Default parameter values are not supported, should have 3 arguments. callable.Call(Vector2.Up, 42, callable); // Prints "(0, -1) 42 Node(Node.cs)::PrintArgs". callable.Call("invalid"); // Invalid call, should have 3 arguments. } [/csharp] [/codeblocks] In GDScript, it's possible to create lambda functions within a method. Lambda functions are custom callables that are not associated with an [Object] instance. Optionally, lambda functions can also be named. The name will be displayed in the debugger, or when calling [method get_method]. [codeblock] func _init(): var my_lambda = func (message): print(message) # Prints Hello everyone! my_lambda.call("Hello everyone!") # Prints "Attack!", when the button_pressed signal is emitted. button_pressed.connect(func(): print("Attack!")) [/codeblock] In GDScript, you can access methods and global functions as [Callable]s: [codeblock] tween.tween_callback(node.queue_free) # Object methods. tween.tween_callback(array.clear) # Methods of built-in types. tween.tween_callback(print.bind("Test")) # Global functions. [/codeblock] [b]Note:[/b] [Dictionary] does not support the above due to ambiguity with keys. [codeblock] var dictionary = {"hello": "world"} # This will not work, `clear` is treated as a key. tween.tween_callback(dictionary.clear) # This will work. tween.tween_callback(Callable.create(dictionary, "clear")) [/codeblock] </description> <tutorials> </tutorials> <constructors> <constructor name="Callable"> <return type="Callable" /> <description> Constructs an empty [Callable], with no object nor method bound. </description> </constructor> <constructor name="Callable"> <return type="Callable" /> <param index="0" name="from" type="Callable" /> <description> Constructs a [Callable] as a copy of the given [Callable]. </description> </constructor> <constructor name="Callable"> <return type="Callable" /> <param index="0" name="object" type="Object" /> <param index="1" name="method" type="StringName" /> <description> Creates a new [Callable] for the method named [param method] in the specified [param object]. [b]Note:[/b] For methods of built-in [Variant] types, use [method create] instead. </description> </constructor> </constructors>
123832
<methods> <method name="bind" qualifiers="vararg const"> <return type="Callable" /> <description> Returns a copy of this [Callable] with one or more arguments bound. When called, the bound arguments are passed [i]after[/i] the arguments supplied by [method call]. See also [method unbind]. [b]Note:[/b] When this method is chained with other similar methods, the order in which the argument list is modified is read from right to left. </description> </method> <method name="bindv"> <return type="Callable" /> <param index="0" name="arguments" type="Array" /> <description> Returns a copy of this [Callable] with one or more arguments bound, reading them from an array. When called, the bound arguments are passed [i]after[/i] the arguments supplied by [method call]. See also [method unbind]. [b]Note:[/b] When this method is chained with other similar methods, the order in which the argument list is modified is read from right to left. </description> </method> <method name="call" qualifiers="vararg const"> <return type="Variant" /> <description> Calls the method represented by this [Callable]. Arguments can be passed and should match the method's signature. </description> </method> <method name="call_deferred" qualifiers="vararg const"> <return type="void" /> <description> Calls the method represented by this [Callable] in deferred mode, i.e. at the end of the current frame. Arguments can be passed and should match the method's signature. [codeblocks] [gdscript] func _ready(): grab_focus.call_deferred() [/gdscript] [csharp] public override void _Ready() { Callable.From(GrabFocus).CallDeferred(); } [/csharp] [/codeblocks] [b]Note:[/b] Deferred calls are processed at idle time. Idle time happens mainly at the end of process and physics frames. In it, deferred calls will be run until there are none left, which means you can defer calls from other deferred calls and they'll still be run in the current idle time cycle. This means you should not call a method deferred from itself (or from a method called by it), as this causes infinite recursion the same way as if you had called the method directly. See also [method Object.call_deferred]. </description> </method> <method name="callv" qualifiers="const"> <return type="Variant" /> <param index="0" name="arguments" type="Array" /> <description> Calls the method represented by this [Callable]. Unlike [method call], this method expects all arguments to be contained inside the [param arguments] [Array]. </description> </method> <method name="create" qualifiers="static"> <return type="Callable" /> <param index="0" name="variant" type="Variant" /> <param index="1" name="method" type="StringName" /> <description> Creates a new [Callable] for the method named [param method] in the specified [param variant]. To represent a method of a built-in [Variant] type, a custom callable is used (see [method is_custom]). If [param variant] is [Object], then a standard callable will be created instead. [b]Note:[/b] This method is always necessary for the [Dictionary] type, as property syntax is used to access its entries. You may also use this method when [param variant]'s type is not known in advance (for polymorphism). </description> </method> <method name="get_argument_count" qualifiers="const"> <return type="int" /> <description> Returns the total number of arguments this [Callable] should take, including optional arguments. This means that any arguments bound with [method bind] are [i]subtracted[/i] from the result, and any arguments unbound with [method unbind] are [i]added[/i] to the result. </description> </method> <method name="get_bound_arguments" qualifiers="const"> <return type="Array" /> <description> Return the bound arguments (as long as [method get_bound_arguments_count] is greater than zero), or empty (if [method get_bound_arguments_count] is less than or equal to zero). </description> </method> <method name="get_bound_arguments_count" qualifiers="const"> <return type="int" /> <description> Returns the total amount of arguments bound (or unbound) via successive [method bind] or [method unbind] calls. If the amount of arguments unbound is greater than the ones bound, this function returns a value less than zero. </description> </method> <method name="get_method" qualifiers="const"> <return type="StringName" /> <description> Returns the name of the method represented by this [Callable]. If the callable is a GDScript lambda function, returns the function's name or [code]"&lt;anonymous lambda&gt;"[/code]. </description> </method> <method name="get_object" qualifiers="const"> <return type="Object" /> <description> Returns the object on which this [Callable] is called. </description> </method> <method name="get_object_id" qualifiers="const"> <return type="int" /> <description> Returns the ID of this [Callable]'s object (see [method Object.get_instance_id]). </description> </method> <method name="hash" qualifiers="const"> <return type="int" /> <description> Returns the 32-bit hash value of this [Callable]'s object. [b]Note:[/b] [Callable]s with equal content will always produce identical hash values. However, the reverse is not true. Returning identical hash values does [i]not[/i] imply the callables are equal, because different callables can have identical hash values due to hash collisions. The engine uses a 32-bit hash algorithm for [method hash]. </description> </method> <method name="is_custom" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if this [Callable] is a custom callable. Custom callables are used: - for binding/unbinding arguments (see [method bind] and [method unbind]); - for representing methods of built-in [Variant] types (see [method create]); - for representing global, lambda, and RPC functions in GDScript; - for other purposes in the core, GDExtension, and C#. </description> </method> <method name="is_null" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if this [Callable] has no target to call the method on. Equivalent to [code]callable == Callable()[/code]. [b]Note:[/b] This is [i]not[/i] the same as [code]not is_valid()[/code] and using [code]not is_null()[/code] will [i]not[/i] guarantee that this callable can be called. Use [method is_valid] instead. </description> </method> <method name="is_standard" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if this [Callable] is a standard callable. This method is the opposite of [method is_custom]. Returns [code]false[/code] if this callable is a lambda function. </description> </method> <method name="is_valid" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the callable's object exists and has a valid method name assigned, or is a custom callable. </description> </method>
123833
<method name="rpc" qualifiers="vararg const"> <return type="void" /> <description> Perform an RPC (Remote Procedure Call) on all connected peers. This is used for multiplayer and is normally not available, unless the function being called has been marked as [i]RPC[/i] (using [annotation @GDScript.@rpc] or [method Node.rpc_config]). Calling this method on unsupported functions will result in an error. See [method Node.rpc]. </description> </method> <method name="rpc_id" qualifiers="vararg const"> <return type="void" /> <param index="0" name="peer_id" type="int" /> <description> Perform an RPC (Remote Procedure Call) on a specific peer ID (see multiplayer documentation for reference). This is used for multiplayer and is normally not available unless the function being called has been marked as [i]RPC[/i] (using [annotation @GDScript.@rpc] or [method Node.rpc_config]). Calling this method on unsupported functions will result in an error. See [method Node.rpc_id]. </description> </method> <method name="unbind" qualifiers="const"> <return type="Callable" /> <param index="0" name="argcount" type="int" /> <description> Returns a copy of this [Callable] with a number of arguments unbound. In other words, when the new callable is called the last few arguments supplied by the user are ignored, according to [param argcount]. The remaining arguments are passed to the callable. This allows to use the original callable in a context that attempts to pass more arguments than this callable can handle, e.g. a signal with a fixed number of arguments. See also [method bind]. [b]Note:[/b] When this method is chained with other similar methods, the order in which the argument list is modified is read from right to left. [codeblock] func _ready(): foo.unbind(1).call(1, 2) # Calls foo(1). foo.bind(3, 4).unbind(1).call(1, 2) # Calls foo(1, 3, 4), note that it does not change the arguments from bind. [/codeblock] </description> </method> </methods> <operators> <operator name="operator !="> <return type="bool" /> <param index="0" name="right" type="Callable" /> <description> Returns [code]true[/code] if both [Callable]s invoke different targets. </description> </operator> <operator name="operator =="> <return type="bool" /> <param index="0" name="right" type="Callable" /> <description> Returns [code]true[/code] if both [Callable]s invoke the same custom target. </description> </operator> </operators> </class>
123843
<?xml version="1.0" encoding="UTF-8" ?> <class name="StreamPeerTCP" inherits="StreamPeer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A stream peer that handles TCP connections. </brief_description> <description> A stream peer that handles TCP connections. This object can be used to connect to TCP servers, or also is returned by a TCP server. [b]Note:[/b] When exporting to Android, make sure to enable the [code]INTERNET[/code] permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android. </description> <tutorials> </tutorials> <methods> <method name="bind"> <return type="int" enum="Error" /> <param index="0" name="port" type="int" /> <param index="1" name="host" type="String" default="&quot;*&quot;" /> <description> Opens the TCP socket, and binds it to the specified local address. This method is generally not needed, and only used to force the subsequent call to [method connect_to_host] to use the specified [param host] and [param port] as source address. This can be desired in some NAT punchthrough techniques, or when forcing the source network interface. </description> </method> <method name="connect_to_host"> <return type="int" enum="Error" /> <param index="0" name="host" type="String" /> <param index="1" name="port" type="int" /> <description> Connects to the specified [code]host:port[/code] pair. A hostname will be resolved if valid. Returns [constant OK] on success. </description> </method> <method name="disconnect_from_host"> <return type="void" /> <description> Disconnects from host. </description> </method> <method name="get_connected_host" qualifiers="const"> <return type="String" /> <description> Returns the IP of this peer. </description> </method> <method name="get_connected_port" qualifiers="const"> <return type="int" /> <description> Returns the port of this peer. </description> </method> <method name="get_local_port" qualifiers="const"> <return type="int" /> <description> Returns the local port to which this peer is bound. </description> </method> <method name="get_status" qualifiers="const"> <return type="int" enum="StreamPeerTCP.Status" /> <description> Returns the status of the connection, see [enum Status]. </description> </method> <method name="poll"> <return type="int" enum="Error" /> <description> Poll the socket, updating its state. See [method get_status]. </description> </method> <method name="set_no_delay"> <return type="void" /> <param index="0" name="enabled" type="bool" /> <description> If [param enabled] is [code]true[/code], packets will be sent immediately. If [param enabled] is [code]false[/code] (the default), packet transfers will be delayed and combined using [url=https://en.wikipedia.org/wiki/Nagle%27s_algorithm]Nagle's algorithm[/url]. [b]Note:[/b] It's recommended to leave this disabled for applications that send large packets or need to transfer a lot of data, as enabling this can decrease the total available bandwidth. </description> </method> </methods> <constants> <constant name="STATUS_NONE" value="0" enum="Status"> The initial status of the [StreamPeerTCP]. This is also the status after disconnecting. </constant> <constant name="STATUS_CONNECTING" value="1" enum="Status"> A status representing a [StreamPeerTCP] that is connecting to a host. </constant> <constant name="STATUS_CONNECTED" value="2" enum="Status"> A status representing a [StreamPeerTCP] that is connected to a host. </constant> <constant name="STATUS_ERROR" value="3" enum="Status"> A status representing a [StreamPeerTCP] in error state. </constant> </constants> </class>
123855
<?xml version="1.0" encoding="UTF-8" ?> <class name="WorldBoundaryShape2D" inherits="Shape2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A 2D world boundary (half-plane) shape used for physics collision. </brief_description> <description> A 2D world boundary shape, intended for use in physics. [WorldBoundaryShape2D] works like an infinite straight line that forces all physics bodies to stay above it. The line's normal determines which direction is considered as "above" and in the editor, the smaller line over it represents this direction. It can for example be used for endless flat floors. </description> <tutorials> </tutorials> <members> <member name="distance" type="float" setter="set_distance" getter="get_distance" default="0.0"> The distance from the origin to the line, expressed in terms of [member normal] (according to its direction and magnitude). Actual absolute distance from the origin to the line can be calculated as [code]abs(distance) / normal.length()[/code]. In the scalar equation of the line [code]ax + by = d[/code], this is [code]d[/code], while the [code](a, b)[/code] coordinates are represented by the [member normal] property. </member> <member name="normal" type="Vector2" setter="set_normal" getter="get_normal" default="Vector2(0, -1)"> The line's normal, typically a unit vector. Its direction indicates the non-colliding half-plane. Can be of any length but zero. Defaults to [constant Vector2.UP]. </member> </members> </class>
123857
<?xml version="1.0" encoding="UTF-8" ?> <class name="PhysicsTestMotionResult2D" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Describes the motion and collision result from [method PhysicsServer2D.body_test_motion]. </brief_description> <description> Describes the motion and collision result from [method PhysicsServer2D.body_test_motion]. </description> <tutorials> </tutorials> <methods> <method name="get_collider" qualifiers="const"> <return type="Object" /> <description> Returns the colliding body's attached [Object], if a collision occurred. </description> </method> <method name="get_collider_id" qualifiers="const"> <return type="int" /> <description> Returns the unique instance ID of the colliding body's attached [Object], if a collision occurred. See [method Object.get_instance_id]. </description> </method> <method name="get_collider_rid" qualifiers="const"> <return type="RID" /> <description> Returns the colliding body's [RID] used by the [PhysicsServer2D], if a collision occurred. </description> </method> <method name="get_collider_shape" qualifiers="const"> <return type="int" /> <description> Returns the colliding body's shape index, if a collision occurred. See [CollisionObject2D]. </description> </method> <method name="get_collider_velocity" qualifiers="const"> <return type="Vector2" /> <description> Returns the colliding body's velocity, if a collision occurred. </description> </method> <method name="get_collision_depth" qualifiers="const"> <return type="float" /> <description> Returns the length of overlap along the collision normal, if a collision occurred. </description> </method> <method name="get_collision_local_shape" qualifiers="const"> <return type="int" /> <description> Returns the moving object's colliding shape, if a collision occurred. </description> </method> <method name="get_collision_normal" qualifiers="const"> <return type="Vector2" /> <description> Returns the colliding body's shape's normal at the point of collision, if a collision occurred. </description> </method> <method name="get_collision_point" qualifiers="const"> <return type="Vector2" /> <description> Returns the point of collision in global coordinates, if a collision occurred. </description> </method> <method name="get_collision_safe_fraction" qualifiers="const"> <return type="float" /> <description> Returns the maximum fraction of the motion that can occur without a collision, between [code]0[/code] and [code]1[/code]. </description> </method> <method name="get_collision_unsafe_fraction" qualifiers="const"> <return type="float" /> <description> Returns the minimum fraction of the motion needed to collide, if a collision occurred, between [code]0[/code] and [code]1[/code]. </description> </method> <method name="get_remainder" qualifiers="const"> <return type="Vector2" /> <description> Returns the moving object's remaining movement vector. </description> </method> <method name="get_travel" qualifiers="const"> <return type="Vector2" /> <description> Returns the moving object's travel before collision. </description> </method> </methods> </class>
123860
<?xml version="1.0" encoding="UTF-8" ?> <class name="Camera2D" inherits="Node2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Camera node for 2D scenes. </brief_description> <description> Camera node for 2D scenes. It forces the screen (current layer) to scroll following this node. This makes it easier (and faster) to program scrollable scenes than manually changing the position of [CanvasItem]-based nodes. Cameras register themselves in the nearest [Viewport] node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the camera will register in the global viewport. This node is intended to be a simple helper to get things going quickly, but more functionality may be desired to change how the camera works. To make your own custom camera node, inherit it from [Node2D] and change the transform of the canvas by setting [member Viewport.canvas_transform] in [Viewport] (you can obtain the current [Viewport] by using [method Node.get_viewport]). Note that the [Camera2D] node's [code]position[/code] doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use [method get_screen_center_position] to get the real position. </description> <tutorials> <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/2727</link> <link title="2D Isometric Demo">https://godotengine.org/asset-library/asset/2718</link> </tutorials> <methods> <method name="align"> <return type="void" /> <description> Aligns the camera to the tracked node. </description> </method> <method name="force_update_scroll"> <return type="void" /> <description> Forces the camera to update scroll immediately. </description> </method> <method name="get_drag_margin" qualifiers="const"> <return type="float" /> <param index="0" name="margin" type="int" enum="Side" /> <description> Returns the specified [enum Side]'s margin. See also [member drag_bottom_margin], [member drag_top_margin], [member drag_left_margin], and [member drag_right_margin]. </description> </method> <method name="get_limit" qualifiers="const"> <return type="int" /> <param index="0" name="margin" type="int" enum="Side" /> <description> Returns the camera limit for the specified [enum Side]. See also [member limit_bottom], [member limit_top], [member limit_left], and [member limit_right]. </description> </method> <method name="get_screen_center_position" qualifiers="const"> <return type="Vector2" /> <description> Returns the center of the screen from this camera's point of view, in global coordinates. [b]Note:[/b] The exact targeted position of the camera may be different. See [method get_target_position]. </description> </method> <method name="get_target_position" qualifiers="const"> <return type="Vector2" /> <description> Returns this camera's target position, in global coordinates. [b]Note:[/b] The returned value is not the same as [member Node2D.global_position], as it is affected by the drag properties. It is also not the same as the current position if [member position_smoothing_enabled] is [code]true[/code] (see [method get_screen_center_position]). </description> </method> <method name="is_current" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if this [Camera2D] is the active camera (see [method Viewport.get_camera_2d]). </description> </method> <method name="make_current"> <return type="void" /> <description> Forces this [Camera2D] to become the current active one. [member enabled] must be [code]true[/code]. </description> </method> <method name="reset_smoothing"> <return type="void" /> <description> Sets the camera's position immediately to its current smoothing destination. This method has no effect if [member position_smoothing_enabled] is [code]false[/code]. </description> </method> <method name="set_drag_margin"> <return type="void" /> <param index="0" name="margin" type="int" enum="Side" /> <param index="1" name="drag_margin" type="float" /> <description> Sets the specified [enum Side]'s margin. See also [member drag_bottom_margin], [member drag_top_margin], [member drag_left_margin], and [member drag_right_margin]. </description> </method> <method name="set_limit"> <return type="void" /> <param index="0" name="margin" type="int" enum="Side" /> <param index="1" name="limit" type="int" /> <description> Sets the camera limit for the specified [enum Side]. See also [member limit_bottom], [member limit_top], [member limit_left], and [member limit_right]. </description> </method> </methods>
123861
<members> <member name="anchor_mode" type="int" setter="set_anchor_mode" getter="get_anchor_mode" enum="Camera2D.AnchorMode" default="1"> The Camera2D's anchor point. See [enum AnchorMode] constants. </member> <member name="custom_viewport" type="Node" setter="set_custom_viewport" getter="get_custom_viewport"> The custom [Viewport] node attached to the [Camera2D]. If [code]null[/code] or not a [Viewport], uses the default viewport instead. </member> <member name="drag_bottom_margin" type="float" setter="set_drag_margin" getter="get_drag_margin" default="0.2"> Bottom margin needed to drag the camera. A value of [code]1[/code] makes the camera move only when reaching the bottom edge of the screen. </member> <member name="drag_horizontal_enabled" type="bool" setter="set_drag_horizontal_enabled" getter="is_drag_horizontal_enabled" default="false"> If [code]true[/code], the camera only moves when reaching the horizontal (left and right) drag margins. If [code]false[/code], the camera moves horizontally regardless of margins. </member> <member name="drag_horizontal_offset" type="float" setter="set_drag_horizontal_offset" getter="get_drag_horizontal_offset" default="0.0"> The relative horizontal drag offset of the camera between the right ([code]-1[/code]) and left ([code]1[/code]) drag margins. [b]Note:[/b] Used to set the initial horizontal drag offset; determine the current offset; or force the current offset. It's not automatically updated when [member drag_horizontal_enabled] is [code]true[/code] or the drag margins are changed. </member> <member name="drag_left_margin" type="float" setter="set_drag_margin" getter="get_drag_margin" default="0.2"> Left margin needed to drag the camera. A value of [code]1[/code] makes the camera move only when reaching the left edge of the screen. </member> <member name="drag_right_margin" type="float" setter="set_drag_margin" getter="get_drag_margin" default="0.2"> Right margin needed to drag the camera. A value of [code]1[/code] makes the camera move only when reaching the right edge of the screen. </member> <member name="drag_top_margin" type="float" setter="set_drag_margin" getter="get_drag_margin" default="0.2"> Top margin needed to drag the camera. A value of [code]1[/code] makes the camera move only when reaching the top edge of the screen. </member> <member name="drag_vertical_enabled" type="bool" setter="set_drag_vertical_enabled" getter="is_drag_vertical_enabled" default="false"> If [code]true[/code], the camera only moves when reaching the vertical (top and bottom) drag margins. If [code]false[/code], the camera moves vertically regardless of the drag margins. </member> <member name="drag_vertical_offset" type="float" setter="set_drag_vertical_offset" getter="get_drag_vertical_offset" default="0.0"> The relative vertical drag offset of the camera between the bottom ([code]-1[/code]) and top ([code]1[/code]) drag margins. [b]Note:[/b] Used to set the initial vertical drag offset; determine the current offset; or force the current offset. It's not automatically updated when [member drag_vertical_enabled] is [code]true[/code] or the drag margins are changed. </member> <member name="editor_draw_drag_margin" type="bool" setter="set_margin_drawing_enabled" getter="is_margin_drawing_enabled" default="false"> If [code]true[/code], draws the camera's drag margin rectangle in the editor. </member> <member name="editor_draw_limits" type="bool" setter="set_limit_drawing_enabled" getter="is_limit_drawing_enabled" default="false"> If [code]true[/code], draws the camera's limits rectangle in the editor. </member> <member name="editor_draw_screen" type="bool" setter="set_screen_drawing_enabled" getter="is_screen_drawing_enabled" default="true"> If [code]true[/code], draws the camera's screen rectangle in the editor. </member> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true"> Controls whether the camera can be active or not. If [code]true[/code], the [Camera2D] will become the main camera when it enters the scene tree and there is no active camera currently (see [method Viewport.get_camera_2d]). When the camera is currently active and [member enabled] is set to [code]false[/code], the next enabled [Camera2D] in the scene tree will become active. </member> <member name="ignore_rotation" type="bool" setter="set_ignore_rotation" getter="is_ignoring_rotation" default="true"> If [code]true[/code], the camera's rendered view is not affected by its [member Node2D.rotation] and [member Node2D.global_rotation]. </member> <member name="limit_bottom" type="int" setter="set_limit" getter="get_limit" default="10000000"> Bottom scroll limit in pixels. The camera stops moving when reaching this value, but [member offset] can push the view past the limit. </member> <member name="limit_left" type="int" setter="set_limit" getter="get_limit" default="-10000000"> Left scroll limit in pixels. The camera stops moving when reaching this value, but [member offset] can push the view past the limit. </member> <member name="limit_right" type="int" setter="set_limit" getter="get_limit" default="10000000"> Right scroll limit in pixels. The camera stops moving when reaching this value, but [member offset] can push the view past the limit. </member> <member name="limit_smoothed" type="bool" setter="set_limit_smoothing_enabled" getter="is_limit_smoothing_enabled" default="false"> If [code]true[/code], the camera smoothly stops when reaches its limits. This property has no effect if [member position_smoothing_enabled] is [code]false[/code]. [b]Note:[/b] To immediately update the camera's position to be within limits without smoothing, even with this setting enabled, invoke [method reset_smoothing]. </member> <member name="limit_top" type="int" setter="set_limit" getter="get_limit" default="-10000000"> Top scroll limit in pixels. The camera stops moving when reaching this value, but [member offset] can push the view past the limit. </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The camera's relative offset. Useful for looking around or camera shake animations. The offsetted camera can go past the limits defined in [member limit_top], [member limit_bottom], [member limit_left] and [member limit_right]. </member> <member name="position_smoothing_enabled" type="bool" setter="set_position_smoothing_enabled" getter="is_position_smoothing_enabled" default="false"> If [code]true[/code], the camera's view smoothly moves towards its target position at [member position_smoothing_speed]. </member> <member name="position_smoothing_speed" type="float" setter="set_position_smoothing_speed" getter="get_position_smoothing_speed" default="5.0"> Speed in pixels per second of the camera's smoothing effect when [member position_smoothing_enabled] is [code]true[/code]. </member> <member name="process_callback" type="int" setter="set_process_callback" getter="get_process_callback" enum="Camera2D.Camera2DProcessCallback" default="1"> The camera's process callback. See [enum Camera2DProcessCallback]. </member> <member name="rotation_smoothing_enabled" type="bool" setter="set_rotation_smoothing_enabled" getter="is_rotation_smoothing_enabled" default="false"> If [code]true[/code], the camera's view smoothly rotates, via asymptotic smoothing, to align with its target rotation at [member rotation_smoothing_speed]. [b]Note:[/b] This property has no effect if [member ignore_rotation] is [code]true[/code]. </member>
123862
<member name="rotation_smoothing_speed" type="float" setter="set_rotation_smoothing_speed" getter="get_rotation_smoothing_speed" default="5.0"> The angular, asymptotic speed of the camera's rotation smoothing effect when [member rotation_smoothing_enabled] is [code]true[/code]. </member> <member name="zoom" type="Vector2" setter="set_zoom" getter="get_zoom" default="Vector2(1, 1)"> The camera's zoom. A zoom of [code]Vector(2, 2)[/code] doubles the size seen in the viewport. A zoom of [code]Vector(0.5, 0.5)[/code] halves the size seen in the viewport. [b]Note:[/b] [member FontFile.oversampling] does [i]not[/i] take [Camera2D] zoom into account. This means that zooming in/out will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated unless the font is part of a [CanvasLayer] that makes it ignore camera zoom. To ensure text remains crisp regardless of zoom, you can enable MSDF font rendering by enabling [member ProjectSettings.gui/theme/default_font_multichannel_signed_distance_field] (applies to the default project font only), or enabling [b]Multichannel Signed Distance Field[/b] in the import options of a DynamicFont for custom fonts. On system fonts, [member SystemFont.multichannel_signed_distance_field] can be enabled in the inspector. </member> </members> <constants> <constant name="ANCHOR_MODE_FIXED_TOP_LEFT" value="0" enum="AnchorMode"> The camera's position is fixed so that the top-left corner is always at the origin. </constant> <constant name="ANCHOR_MODE_DRAG_CENTER" value="1" enum="AnchorMode"> The camera's position takes into account vertical/horizontal offsets and the screen size. </constant> <constant name="CAMERA2D_PROCESS_PHYSICS" value="0" enum="Camera2DProcessCallback"> The camera updates during physics frames (see [constant Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). </constant> <constant name="CAMERA2D_PROCESS_IDLE" value="1" enum="Camera2DProcessCallback"> The camera updates during process frames (see [constant Node.NOTIFICATION_INTERNAL_PROCESS]). </constant> </constants> </class>
123875
<methods> <method name="get_date_dict_from_system" qualifiers="const"> <return type="Dictionary" /> <param index="0" name="utc" type="bool" default="false" /> <description> Returns the current date as a dictionary of keys: [code]year[/code], [code]month[/code], [code]day[/code], and [code]weekday[/code]. The returned values are in the system's local time when [param utc] is [code]false[/code], otherwise they are in UTC. </description> </method> <method name="get_date_dict_from_unix_time" qualifiers="const"> <return type="Dictionary" /> <param index="0" name="unix_time_val" type="int" /> <description> Converts the given Unix timestamp to a dictionary of keys: [code]year[/code], [code]month[/code], [code]day[/code], and [code]weekday[/code]. </description> </method> <method name="get_date_string_from_system" qualifiers="const"> <return type="String" /> <param index="0" name="utc" type="bool" default="false" /> <description> Returns the current date as an ISO 8601 date string (YYYY-MM-DD). The returned values are in the system's local time when [param utc] is [code]false[/code], otherwise they are in UTC. </description> </method> <method name="get_date_string_from_unix_time" qualifiers="const"> <return type="String" /> <param index="0" name="unix_time_val" type="int" /> <description> Converts the given Unix timestamp to an ISO 8601 date string (YYYY-MM-DD). </description> </method> <method name="get_datetime_dict_from_datetime_string" qualifiers="const"> <return type="Dictionary" /> <param index="0" name="datetime" type="String" /> <param index="1" name="weekday" type="bool" /> <description> Converts the given ISO 8601 date and time string (YYYY-MM-DDTHH:MM:SS) to a dictionary of keys: [code]year[/code], [code]month[/code], [code]day[/code], [code skip-lint]weekday[/code], [code]hour[/code], [code]minute[/code], and [code]second[/code]. If [param weekday] is [code]false[/code], then the [code skip-lint]weekday[/code] entry is excluded (the calculation is relatively expensive). [b]Note:[/b] Any decimal fraction in the time string will be ignored silently. </description> </method> <method name="get_datetime_dict_from_system" qualifiers="const"> <return type="Dictionary" /> <param index="0" name="utc" type="bool" default="false" /> <description> Returns the current date as a dictionary of keys: [code]year[/code], [code]month[/code], [code]day[/code], [code]weekday[/code], [code]hour[/code], [code]minute[/code], [code]second[/code], and [code]dst[/code] (Daylight Savings Time). </description> </method> <method name="get_datetime_dict_from_unix_time" qualifiers="const"> <return type="Dictionary" /> <param index="0" name="unix_time_val" type="int" /> <description> Converts the given Unix timestamp to a dictionary of keys: [code]year[/code], [code]month[/code], [code]day[/code], [code]weekday[/code], [code]hour[/code], [code]minute[/code], and [code]second[/code]. The returned Dictionary's values will be the same as the [method get_datetime_dict_from_system] if the Unix timestamp is the current time, with the exception of Daylight Savings Time as it cannot be determined from the epoch. </description> </method> <method name="get_datetime_string_from_datetime_dict" qualifiers="const"> <return type="String" /> <param index="0" name="datetime" type="Dictionary" /> <param index="1" name="use_space" type="bool" /> <description> Converts the given dictionary of keys to an ISO 8601 date and time string (YYYY-MM-DDTHH:MM:SS). The given dictionary can be populated with the following keys: [code]year[/code], [code]month[/code], [code]day[/code], [code]hour[/code], [code]minute[/code], and [code]second[/code]. Any other entries (including [code]dst[/code]) are ignored. If the dictionary is empty, [code]0[/code] is returned. If some keys are omitted, they default to the equivalent values for the Unix epoch timestamp 0 (1970-01-01 at 00:00:00). If [param use_space] is [code]true[/code], the date and time bits are separated by an empty space character instead of the letter T. </description> </method> <method name="get_datetime_string_from_system" qualifiers="const"> <return type="String" /> <param index="0" name="utc" type="bool" default="false" /> <param index="1" name="use_space" type="bool" default="false" /> <description> Returns the current date and time as an ISO 8601 date and time string (YYYY-MM-DDTHH:MM:SS). The returned values are in the system's local time when [param utc] is [code]false[/code], otherwise they are in UTC. If [param use_space] is [code]true[/code], the date and time bits are separated by an empty space character instead of the letter T. </description> </method> <method name="get_datetime_string_from_unix_time" qualifiers="const"> <return type="String" /> <param index="0" name="unix_time_val" type="int" /> <param index="1" name="use_space" type="bool" default="false" /> <description> Converts the given Unix timestamp to an ISO 8601 date and time string (YYYY-MM-DDTHH:MM:SS). If [param use_space] is [code]true[/code], the date and time bits are separated by an empty space character instead of the letter T. </description> </method> <method name="get_offset_string_from_offset_minutes" qualifiers="const"> <return type="String" /> <param index="0" name="offset_minutes" type="int" /> <description> Converts the given timezone offset in minutes to a timezone offset string. For example, -480 returns "-08:00", 345 returns "+05:45", and 0 returns "+00:00". </description> </method> <method name="get_ticks_msec" qualifiers="const"> <return type="int" /> <description> Returns the amount of time passed in milliseconds since the engine started. Will always be positive or 0 and uses a 64-bit value (it will wrap after roughly 500 million years). </description> </method> <method name="get_ticks_usec" qualifiers="const"> <return type="int" /> <description> Returns the amount of time passed in microseconds since the engine started. Will always be positive or 0 and uses a 64-bit value (it will wrap after roughly half a million years). </description> </method> <method name="get_time_dict_from_system" qualifiers="const"> <return type="Dictionary" /> <param index="0" name="utc" type="bool" default="false" /> <description> Returns the current time as a dictionary of keys: [code]hour[/code], [code]minute[/code], and [code]second[/code]. The returned values are in the system's local time when [param utc] is [code]false[/code], otherwise they are in UTC. </description> </method>
123903
<?xml version="1.0" encoding="UTF-8" ?> <class name="CollisionPolygon2D" inherits="Node2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A node that provides a polygon shape to a [CollisionObject2D] parent. </brief_description> <description> A node that provides a polygon shape to a [CollisionObject2D] parent and allows to edit it. The polygon can be concave or convex. This can give a detection shape to an [Area2D], turn [PhysicsBody2D] into a solid object, or give a hollow shape to a [StaticBody2D]. [b]Warning:[/b] A non-uniformly scaled [CollisionShape2D] will likely not behave as expected. Make sure to keep its scale the same on all axes and adjust its shape resource instead. </description> <tutorials> </tutorials> <members> <member name="build_mode" type="int" setter="set_build_mode" getter="get_build_mode" enum="CollisionPolygon2D.BuildMode" default="0"> Collision build mode. Use one of the [enum BuildMode] constants. </member> <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" default="false" keywords="enabled"> If [code]true[/code], no collisions will be detected. </member> <member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled" default="false"> If [code]true[/code], only edges that face up, relative to [CollisionPolygon2D]'s rotation, will collide with other objects. [b]Note:[/b] This property has no effect if this [CollisionPolygon2D] is a child of an [Area2D] node. </member> <member name="one_way_collision_margin" type="float" setter="set_one_way_collision_margin" getter="get_one_way_collision_margin" default="1.0"> The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the polygon at a high velocity. </member> <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array()"> The polygon's list of vertices. Each point will be connected to the next, and the final point will be connected to the first. [b]Note:[/b] The returned vertices are in the local coordinate space of the given [CollisionPolygon2D]. </member> </members> <constants> <constant name="BUILD_SOLIDS" value="0" enum="BuildMode"> Collisions will include the polygon and its contained area. In this mode the node has the same effect as several [ConvexPolygonShape2D] nodes, one for each convex shape in the convex decomposition of the polygon (but without the overhead of multiple nodes). </constant> <constant name="BUILD_SEGMENTS" value="1" enum="BuildMode"> Collisions will only include the polygon edges. In this mode the node has the same effect as a single [ConcavePolygonShape2D] made of segments, with the restriction that each segment (after the first one) starts where the previous one ends, and the last one ends where the first one starts (forming a closed but hollow polygon). </constant> </constants> </class>
123908
<methods> <method name="assign"> <return type="void" /> <param index="0" name="dictionary" type="Dictionary" /> <description> Assigns elements of another [param dictionary] into the dictionary. Resizes the dictionary to match [param dictionary]. Performs type conversions if the dictionary is typed. </description> </method> <method name="clear"> <return type="void" /> <description> Clears the dictionary, removing all entries from it. </description> </method> <method name="duplicate" qualifiers="const"> <return type="Dictionary" /> <param index="0" name="deep" type="bool" default="false" /> <description> Creates and returns a new copy of the dictionary. If [param deep] is [code]true[/code], inner [Dictionary] and [Array] keys and values are also copied, recursively. </description> </method> <method name="erase"> <return type="bool" /> <param index="0" name="key" type="Variant" /> <description> Removes the dictionary entry by key, if it exists. Returns [code]true[/code] if the given [param key] existed in the dictionary, otherwise [code]false[/code]. [b]Note:[/b] Do not erase entries while iterating over the dictionary. You can iterate over the [method keys] array instead. </description> </method> <method name="find_key" qualifiers="const"> <return type="Variant" /> <param index="0" name="value" type="Variant" /> <description> Finds and returns the first key whose associated value is equal to [param value], or [code]null[/code] if it is not found. [b]Note:[/b] [code]null[/code] is also a valid key. If inside the dictionary, [method find_key] may give misleading results. </description> </method> <method name="get" qualifiers="const"> <return type="Variant" /> <param index="0" name="key" type="Variant" /> <param index="1" name="default" type="Variant" default="null" /> <description> Returns the corresponding value for the given [param key] in the dictionary. If the [param key] does not exist, returns [param default], or [code]null[/code] if the parameter is omitted. </description> </method> <method name="get_or_add"> <return type="Variant" /> <param index="0" name="key" type="Variant" /> <param index="1" name="default" type="Variant" default="null" /> <description> Gets a value and ensures the key is set. If the [param key] exists in the dictionary, this behaves like [method get]. Otherwise, the [param default] value is inserted into the dictionary and returned. </description> </method> <method name="get_typed_key_builtin" qualifiers="const"> <return type="int" /> <description> Returns the built-in [Variant] type of the typed dictionary's keys as a [enum Variant.Type] constant. If the keys are not typed, returns [constant TYPE_NIL]. See also [method is_typed_key]. </description> </method> <method name="get_typed_key_class_name" qualifiers="const"> <return type="StringName" /> <description> Returns the [b]built-in[/b] class name of the typed dictionary's keys, if the built-in [Variant] type is [constant TYPE_OBJECT]. Otherwise, returns an empty [StringName]. See also [method is_typed_key] and [method Object.get_class]. </description> </method> <method name="get_typed_key_script" qualifiers="const"> <return type="Variant" /> <description> Returns the [Script] instance associated with this typed dictionary's keys, or [code]null[/code] if it does not exist. See also [method is_typed_key]. </description> </method> <method name="get_typed_value_builtin" qualifiers="const"> <return type="int" /> <description> Returns the built-in [Variant] type of the typed dictionary's values as a [enum Variant.Type] constant. If the values are not typed, returns [constant TYPE_NIL]. See also [method is_typed_value]. </description> </method> <method name="get_typed_value_class_name" qualifiers="const"> <return type="StringName" /> <description> Returns the [b]built-in[/b] class name of the typed dictionary's values, if the built-in [Variant] type is [constant TYPE_OBJECT]. Otherwise, returns an empty [StringName]. See also [method is_typed_value] and [method Object.get_class]. </description> </method> <method name="get_typed_value_script" qualifiers="const"> <return type="Variant" /> <description> Returns the [Script] instance associated with this typed dictionary's values, or [code]null[/code] if it does not exist. See also [method is_typed_value]. </description> </method> <method name="has" qualifiers="const"> <return type="bool" /> <param index="0" name="key" type="Variant" /> <description> Returns [code]true[/code] if the dictionary contains an entry with the given [param key]. [codeblocks] [gdscript] var my_dict = { "Godot" : 4, 210 : null, } print(my_dict.has("Godot")) # Prints true print(my_dict.has(210)) # Prints true print(my_dict.has(4)) # Prints false [/gdscript] [csharp] var myDict = new Godot.Collections.Dictionary { { "Godot", 4 }, { 210, default }, }; GD.Print(myDict.ContainsKey("Godot")); // Prints true GD.Print(myDict.ContainsKey(210)); // Prints true GD.Print(myDict.ContainsKey(4)); // Prints false [/csharp] [/codeblocks] In GDScript, this is equivalent to the [code]in[/code] operator: [codeblock] if "Godot" in {"Godot": 4}: print("The key is here!") # Will be printed. [/codeblock] [b]Note:[/b] This method returns [code]true[/code] as long as the [param key] exists, even if its corresponding value is [code]null[/code]. </description> </method> <method name="has_all" qualifiers="const"> <return type="bool" /> <param index="0" name="keys" type="Array" /> <description> Returns [code]true[/code] if the dictionary contains all keys in the given [param keys] array. [codeblock] var data = {"width" : 10, "height" : 20} data.has_all(["height", "width"]) # Returns true [/codeblock] </description> </method>
123913
<?xml version="1.0" encoding="UTF-8" ?> <class name="VBoxContainer" inherits="BoxContainer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A container that arranges its child controls vertically. </brief_description> <description> A variant of [BoxContainer] that can only arrange its child controls vertically. Child controls are rearranged automatically when their minimum size changes. </description> <tutorials> <link title="Using Containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> </class>
123917
<signals> <signal name="request_completed"> <param index="0" name="result" type="int" /> <param index="1" name="response_code" type="int" /> <param index="2" name="headers" type="PackedStringArray" /> <param index="3" name="body" type="PackedByteArray" /> <description> Emitted when a request is completed. </description> </signal> </signals> <constants> <constant name="RESULT_SUCCESS" value="0" enum="Result"> Request successful. </constant> <constant name="RESULT_CHUNKED_BODY_SIZE_MISMATCH" value="1" enum="Result"> Request failed due to a mismatch between the expected and actual chunked body size during transfer. Possible causes include network errors, server misconfiguration, or issues with chunked encoding. </constant> <constant name="RESULT_CANT_CONNECT" value="2" enum="Result"> Request failed while connecting. </constant> <constant name="RESULT_CANT_RESOLVE" value="3" enum="Result"> Request failed while resolving. </constant> <constant name="RESULT_CONNECTION_ERROR" value="4" enum="Result"> Request failed due to connection (read/write) error. </constant> <constant name="RESULT_TLS_HANDSHAKE_ERROR" value="5" enum="Result"> Request failed on TLS handshake. </constant> <constant name="RESULT_NO_RESPONSE" value="6" enum="Result"> Request does not have a response (yet). </constant> <constant name="RESULT_BODY_SIZE_LIMIT_EXCEEDED" value="7" enum="Result"> Request exceeded its maximum size limit, see [member body_size_limit]. </constant> <constant name="RESULT_BODY_DECOMPRESS_FAILED" value="8" enum="Result"> Request failed due to an error while decompressing the response body. Possible causes include unsupported or incorrect compression format, corrupted data, or incomplete transfer. </constant> <constant name="RESULT_REQUEST_FAILED" value="9" enum="Result"> Request failed (currently unused). </constant> <constant name="RESULT_DOWNLOAD_FILE_CANT_OPEN" value="10" enum="Result"> HTTPRequest couldn't open the download file. </constant> <constant name="RESULT_DOWNLOAD_FILE_WRITE_ERROR" value="11" enum="Result"> HTTPRequest couldn't write to the download file. </constant> <constant name="RESULT_REDIRECT_LIMIT_REACHED" value="12" enum="Result"> Request reached its maximum redirect limit, see [member max_redirects]. </constant> <constant name="RESULT_TIMEOUT" value="13" enum="Result"> Request failed due to a timeout. If you expect requests to take a long time, try increasing the value of [member timeout] or setting it to [code]0.0[/code] to remove the timeout completely. </constant> </constants> </class>
123922
<?xml version="1.0" encoding="UTF-8" ?> <class name="AnimationNodeBlendSpace2D" inherits="AnimationRootNode" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A set of [AnimationRootNode]s placed on 2D coordinates, crossfading between the three adjacent ones. Used by [AnimationTree]. </brief_description> <description> A resource used by [AnimationNodeBlendTree]. [AnimationNodeBlendSpace2D] represents a virtual 2D space on which [AnimationRootNode]s are placed. Outputs the linear blend of the three adjacent animations using a [Vector2] weight. Adjacent in this context means the three [AnimationRootNode]s making up the triangle that contains the current value. You can add vertices to the blend space with [method add_blend_point] and automatically triangulate it by setting [member auto_triangles] to [code]true[/code]. Otherwise, use [method add_triangle] and [method remove_triangle] to triangulate the blend space by hand. </description> <tutorials> <link title="Using AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials> <methods> <method name="add_blend_point"> <return type="void" /> <param index="0" name="node" type="AnimationRootNode" /> <param index="1" name="pos" type="Vector2" /> <param index="2" name="at_index" type="int" default="-1" /> <description> Adds a new point that represents a [param node] at the position set by [param pos]. You can insert it at a specific index using the [param at_index] argument. If you use the default value for [param at_index], the point is inserted at the end of the blend points array. </description> </method> <method name="add_triangle"> <return type="void" /> <param index="0" name="x" type="int" /> <param index="1" name="y" type="int" /> <param index="2" name="z" type="int" /> <param index="3" name="at_index" type="int" default="-1" /> <description> Creates a new triangle using three points [param x], [param y], and [param z]. Triangles can overlap. You can insert the triangle at a specific index using the [param at_index] argument. If you use the default value for [param at_index], the point is inserted at the end of the blend points array. </description> </method> <method name="get_blend_point_count" qualifiers="const"> <return type="int" /> <description> Returns the number of points in the blend space. </description> </method> <method name="get_blend_point_node" qualifiers="const"> <return type="AnimationRootNode" /> <param index="0" name="point" type="int" /> <description> Returns the [AnimationRootNode] referenced by the point at index [param point]. </description> </method> <method name="get_blend_point_position" qualifiers="const"> <return type="Vector2" /> <param index="0" name="point" type="int" /> <description> Returns the position of the point at index [param point]. </description> </method> <method name="get_triangle_count" qualifiers="const"> <return type="int" /> <description> Returns the number of triangles in the blend space. </description> </method> <method name="get_triangle_point"> <return type="int" /> <param index="0" name="triangle" type="int" /> <param index="1" name="point" type="int" /> <description> Returns the position of the point at index [param point] in the triangle of index [param triangle]. </description> </method> <method name="remove_blend_point"> <return type="void" /> <param index="0" name="point" type="int" /> <description> Removes the point at index [param point] from the blend space. </description> </method> <method name="remove_triangle"> <return type="void" /> <param index="0" name="triangle" type="int" /> <description> Removes the triangle at index [param triangle] from the blend space. </description> </method> <method name="set_blend_point_node"> <return type="void" /> <param index="0" name="point" type="int" /> <param index="1" name="node" type="AnimationRootNode" /> <description> Changes the [AnimationNode] referenced by the point at index [param point]. </description> </method> <method name="set_blend_point_position"> <return type="void" /> <param index="0" name="point" type="int" /> <param index="1" name="pos" type="Vector2" /> <description> Updates the position of the point at index [param point] in the blend space. </description> </method> </methods> <members> <member name="auto_triangles" type="bool" setter="set_auto_triangles" getter="get_auto_triangles" default="true"> If [code]true[/code], the blend space is triangulated automatically. The mesh updates every time you add or remove points with [method add_blend_point] and [method remove_blend_point]. </member> <member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="AnimationNodeBlendSpace2D.BlendMode" default="0"> Controls the interpolation between animations. See [enum BlendMode] constants. </member> <member name="max_space" type="Vector2" setter="set_max_space" getter="get_max_space" default="Vector2(1, 1)"> The blend space's X and Y axes' upper limit for the points' position. See [method add_blend_point]. </member> <member name="min_space" type="Vector2" setter="set_min_space" getter="get_min_space" default="Vector2(-1, -1)"> The blend space's X and Y axes' lower limit for the points' position. See [method add_blend_point]. </member> <member name="snap" type="Vector2" setter="set_snap" getter="get_snap" default="Vector2(0.1, 0.1)"> Position increment to snap to when moving a point. </member> <member name="sync" type="bool" setter="set_use_sync" getter="is_using_sync" default="false"> If [code]false[/code], the blended animations' frame are stopped when the blend value is [code]0[/code]. If [code]true[/code], forcing the blended animations to advance frame. </member> <member name="x_label" type="String" setter="set_x_label" getter="get_x_label" default="&quot;x&quot;"> Name of the blend space's X axis. </member> <member name="y_label" type="String" setter="set_y_label" getter="get_y_label" default="&quot;y&quot;"> Name of the blend space's Y axis. </member> </members> <signals> <signal name="triangles_updated"> <description> Emitted every time the blend space's triangles are created, removed, or when one of their vertices changes position. </description> </signal> </signals> <constants> <constant name="BLEND_MODE_INTERPOLATED" value="0" enum="BlendMode"> The interpolation between animations is linear. </constant> <constant name="BLEND_MODE_DISCRETE" value="1" enum="BlendMode"> The blend space plays the animation of the animation node which blending position is closest to. Useful for frame-by-frame 2D animations. </constant> <constant name="BLEND_MODE_DISCRETE_CARRY" value="2" enum="BlendMode"> Similar to [constant BLEND_MODE_DISCRETE], but starts the new animation at the last animation's playback position. </constant> </constants> </class>
123928
<methods> <method name="add_gizmo"> <return type="void" /> <param index="0" name="gizmo" type="Node3DGizmo" /> <description> Attach an editor gizmo to this [Node3D]. [b]Note:[/b] The gizmo object would typically be an instance of [EditorNode3DGizmo], but the argument type is kept generic to avoid creating a dependency on editor classes in [Node3D]. </description> </method> <method name="clear_gizmos"> <return type="void" /> <description> Clear all gizmos attached to this [Node3D]. </description> </method> <method name="clear_subgizmo_selection"> <return type="void" /> <description> Clears subgizmo selection for this node in the editor. Useful when subgizmo IDs become invalid after a property change. </description> </method> <method name="force_update_transform"> <return type="void" /> <description> Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations. </description> </method> <method name="get_gizmos" qualifiers="const"> <return type="Node3DGizmo[]" /> <description> Returns all the gizmos attached to this [Node3D]. </description> </method> <method name="get_global_transform_interpolated"> <return type="Transform3D" /> <description> When using physics interpolation, there will be circumstances in which you want to know the interpolated (displayed) transform of a node rather than the standard transform (which may only be accurate to the most recent physics tick). This is particularly important for frame-based operations that take place in [method Node._process], rather than [method Node._physics_process]. Examples include [Camera3D]s focusing on a node, or finding where to fire lasers from on a frame rather than physics tick. [b]Note:[/b] This function creates an interpolation pump on the [Node3D] the first time it is called, which can respond to physics interpolation resets. If you get problems with "streaking" when initially following a [Node3D], be sure to call [method get_global_transform_interpolated] at least once [i]before[/i] resetting the [Node3D] physics interpolation. </description> </method> <method name="get_parent_node_3d" qualifiers="const"> <return type="Node3D" /> <description> Returns the parent [Node3D], or [code]null[/code] if no parent exists, the parent is not of type [Node3D], or [member top_level] is [code]true[/code]. [b]Note:[/b] Calling this method is not equivalent to [code]get_parent() as Node3D[/code], which does not take [member top_level] into account. </description> </method> <method name="get_world_3d" qualifiers="const"> <return type="World3D" /> <description> Returns the current [World3D] resource this [Node3D] node is registered to. </description> </method> <method name="global_rotate"> <return type="void" /> <param index="0" name="axis" type="Vector3" /> <param index="1" name="angle" type="float" /> <description> Rotates the global (world) transformation around axis, a unit [Vector3], by specified angle in radians. The rotation axis is in global coordinate system. </description> </method> <method name="global_scale"> <return type="void" /> <param index="0" name="scale" type="Vector3" /> <description> Scales the global (world) transformation by the given [Vector3] scale factors. </description> </method> <method name="global_translate"> <return type="void" /> <param index="0" name="offset" type="Vector3" /> <description> Moves the global (world) transformation by [Vector3] offset. The offset is in global coordinate system. </description> </method> <method name="hide"> <return type="void" /> <description> Disables rendering of this node. Changes [member visible] to [code]false[/code]. </description> </method> <method name="is_local_transform_notification_enabled" qualifiers="const"> <return type="bool" /> <description> Returns whether node notifies about its local transformation changes. [Node3D] will not propagate this by default. </description> </method> <method name="is_scale_disabled" qualifiers="const"> <return type="bool" /> <description> Returns whether this node uses a scale of [code](1, 1, 1)[/code] or its local transformation scale. </description> </method> <method name="is_transform_notification_enabled" qualifiers="const"> <return type="bool" /> <description> Returns whether the node notifies about its global and local transformation changes. [Node3D] will not propagate this by default. </description> </method> <method name="is_visible_in_tree" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree. </description> </method> <method name="look_at"> <return type="void" /> <param index="0" name="target" type="Vector3" /> <param index="1" name="up" type="Vector3" default="Vector3(0, 1, 0)" /> <param index="2" name="use_model_front" type="bool" default="false" /> <description> Rotates the node so that the local forward axis (-Z, [constant Vector3.FORWARD]) points toward the [param target] position. The local up axis (+Y) points as close to the [param up] vector as possible while staying perpendicular to the local forward axis. The resulting transform is orthogonal, and the scale is preserved. Non-uniform scaling may not work correctly. The [param target] position cannot be the same as the node's position, the [param up] vector cannot be zero, and the direction from the node's position to the [param target] vector cannot be parallel to the [param up] vector. Operations take place in global space, which means that the node must be in the scene tree. If [param use_model_front] is [code]true[/code], the +Z axis (asset front) is treated as forward (implies +X is left) and points toward the [param target] position. By default, the -Z axis (camera forward) is treated as forward (implies +X is right). </description> </method> <method name="look_at_from_position"> <return type="void" /> <param index="0" name="position" type="Vector3" /> <param index="1" name="target" type="Vector3" /> <param index="2" name="up" type="Vector3" default="Vector3(0, 1, 0)" /> <param index="3" name="use_model_front" type="bool" default="false" /> <description> Moves the node to the specified [param position], and then rotates the node to point toward the [param target] as per [method look_at]. Operations take place in global space. </description> </method> <method name="orthonormalize"> <return type="void" /> <description> Resets this node's transformations (like scale, skew and taper) preserving its rotation and translation by performing Gram-Schmidt orthonormalization on this node's [Transform3D]. </description> </method>
123930
<members> <member name="basis" type="Basis" setter="set_basis" getter="get_basis"> Basis of the [member transform] property. Represents the rotation, scale, and shear of this node. </member> <member name="global_basis" type="Basis" setter="set_global_basis" getter="get_global_basis"> Global basis of this node. This is equivalent to [code]global_transform.basis[/code]. </member> <member name="global_position" type="Vector3" setter="set_global_position" getter="get_global_position"> Global position of this node. This is equivalent to [code]global_transform.origin[/code]. </member> <member name="global_rotation" type="Vector3" setter="set_global_rotation" getter="get_global_rotation"> Rotation part of the global transformation in radians, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). [b]Note:[/b] In the mathematical sense, rotation is a matrix and not a vector. The three Euler angles, which are the three independent parameters of the Euler-angle parametrization of the rotation matrix, are stored in a [Vector3] data structure not because the rotation is a vector, but only because [Vector3] exists as a convenient data-structure to store 3 floating-point numbers. Therefore, applying affine operations on the rotation "vector" is not meaningful. </member> <member name="global_rotation_degrees" type="Vector3" setter="set_global_rotation_degrees" getter="get_global_rotation_degrees"> Helper property to access [member global_rotation] in degrees instead of radians. </member> <member name="global_transform" type="Transform3D" setter="set_global_transform" getter="get_global_transform"> World3D space (global) [Transform3D] of this node. </member> <member name="position" type="Vector3" setter="set_position" getter="get_position" default="Vector3(0, 0, 0)"> Local position or translation of this node relative to the parent. This is equivalent to [code]transform.origin[/code]. </member> <member name="quaternion" type="Quaternion" setter="set_quaternion" getter="get_quaternion"> Access to the node rotation as a [Quaternion]. This property is ideal for tweening complex rotations. </member> <member name="rotation" type="Vector3" setter="set_rotation" getter="get_rotation" default="Vector3(0, 0, 0)"> Rotation part of the local transformation in radians, specified in terms of Euler angles. The angles construct a rotation in the order specified by the [member rotation_order] property. [b]Note:[/b] In the mathematical sense, rotation is a matrix and not a vector. The three Euler angles, which are the three independent parameters of the Euler-angle parametrization of the rotation matrix, are stored in a [Vector3] data structure not because the rotation is a vector, but only because [Vector3] exists as a convenient data-structure to store 3 floating-point numbers. Therefore, applying affine operations on the rotation "vector" is not meaningful. [b]Note:[/b] This property is edited in the inspector in degrees. If you want to use degrees in a script, use [member rotation_degrees]. </member> <member name="rotation_degrees" type="Vector3" setter="set_rotation_degrees" getter="get_rotation_degrees"> Helper property to access [member rotation] in degrees instead of radians. </member> <member name="rotation_edit_mode" type="int" setter="set_rotation_edit_mode" getter="get_rotation_edit_mode" enum="Node3D.RotationEditMode" default="0"> Specify how rotation (and scale) will be presented in the editor. </member> <member name="rotation_order" type="int" setter="set_rotation_order" getter="get_rotation_order" enum="EulerOrder" default="2"> Specify the axis rotation order of the [member rotation] property. The final orientation is constructed by rotating the Euler angles in the order specified by this property. </member> <member name="scale" type="Vector3" setter="set_scale" getter="get_scale" default="Vector3(1, 1, 1)"> Scale part of the local transformation. [b]Note:[/b] Mixed negative scales in 3D are not decomposable from the transformation matrix. Due to the way scale is represented with transformation matrices in Godot, the scale values will either be all positive or all negative. [b]Note:[/b] Not all nodes are visually scaled by the [member scale] property. For example, [Light3D]s are not visually affected by [member scale]. </member> <member name="top_level" type="bool" setter="set_as_top_level" getter="is_set_as_top_level" default="false"> If [code]true[/code], the node will not inherit its transformations from its parent. Node transformations are only in global space. </member> <member name="transform" type="Transform3D" setter="set_transform" getter="get_transform" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> Local space [Transform3D] of this node, with respect to the parent node. </member> <member name="visibility_parent" type="NodePath" setter="set_visibility_parent" getter="get_visibility_parent" default="NodePath(&quot;&quot;)"> Defines the visibility range parent for this node and its subtree. The visibility parent must be a GeometryInstance3D. Any visual instance will only be visible if the visibility parent (and all of its visibility ancestors) is hidden by being closer to the camera than its own [member GeometryInstance3D.visibility_range_begin]. Nodes hidden via the [member Node3D.visible] property are essentially removed from the visibility dependency tree, so dependent instances will not take the hidden node or its ancestors into account. </member> <member name="visible" type="bool" setter="set_visible" getter="is_visible" default="true"> If [code]true[/code], this node is drawn. The node is only visible if all of its ancestors are visible as well (in other words, [method is_visible_in_tree] must return [code]true[/code]). </member> </members> <signals> <signal name="visibility_changed"> <description> Emitted when node visibility changes. </description> </signal> </signals> <constants> <constant name="NOTIFICATION_TRANSFORM_CHANGED" value="2000"> [Node3D] nodes receive this notification when their global transform changes. This means that either the current or a parent node changed its transform. In order for [constant NOTIFICATION_TRANSFORM_CHANGED] to work, users first need to ask for it, with [method set_notify_transform]. The notification is also sent if the node is in the editor context and it has at least one valid gizmo. </constant> <constant name="NOTIFICATION_ENTER_WORLD" value="41"> [Node3D] nodes receive this notification when they are registered to new [World3D] resource. </constant> <constant name="NOTIFICATION_EXIT_WORLD" value="42"> [Node3D] nodes receive this notification when they are unregistered from current [World3D] resource. </constant> <constant name="NOTIFICATION_VISIBILITY_CHANGED" value="43"> [Node3D] nodes receive this notification when their visibility changes. </constant> <constant name="NOTIFICATION_LOCAL_TRANSFORM_CHANGED" value="44"> [Node3D] nodes receive this notification when their local transform changes. This is not received when the transform of a parent node is changed. In order for [constant NOTIFICATION_LOCAL_TRANSFORM_CHANGED] to work, users first need to ask for it, with [method set_notify_local_transform]. </constant> <constant name="ROTATION_EDIT_MODE_EULER" value="0" enum="RotationEditMode"> The rotation is edited using [Vector3] Euler angles. </constant> <constant name="ROTATION_EDIT_MODE_QUATERNION" value="1" enum="RotationEditMode"> The rotation is edited using a [Quaternion]. </constant> <constant name="ROTATION_EDIT_MODE_BASIS" value="2" enum="RotationEditMode"> The rotation is edited using a [Basis]. In this mode, [member scale] can't be edited separately. </constant> </constants> </class>
123937
<?xml version="1.0" encoding="UTF-8" ?> <class name="ConfigFile" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Helper class to handle INI-style files. </brief_description> <description> This helper class can be used to store [Variant] values on the filesystem using INI-style formatting. The stored values are identified by a section and a key: [codeblock lang=text] [section] some_key=42 string_example="Hello World3D!" a_vector=Vector3(1, 0, 2) [/codeblock] The stored data can be saved to or parsed from a file, though ConfigFile objects can also be used directly without accessing the filesystem. The following example shows how to create a simple [ConfigFile] and save it on disc: [codeblocks] [gdscript] # Create new ConfigFile object. var config = ConfigFile.new() # Store some values. config.set_value("Player1", "player_name", "Steve") config.set_value("Player1", "best_score", 10) config.set_value("Player2", "player_name", "V3geta") config.set_value("Player2", "best_score", 9001) # Save it to a file (overwrite if already exists). config.save("user://scores.cfg") [/gdscript] [csharp] // Create new ConfigFile object. var config = new ConfigFile(); // Store some values. config.SetValue("Player1", "player_name", "Steve"); config.SetValue("Player1", "best_score", 10); config.SetValue("Player2", "player_name", "V3geta"); config.SetValue("Player2", "best_score", 9001); // Save it to a file (overwrite if already exists). config.Save("user://scores.cfg"); [/csharp] [/codeblocks] This example shows how the above file could be loaded: [codeblocks] [gdscript] var score_data = {} var config = ConfigFile.new() # Load data from a file. var err = config.load("user://scores.cfg") # If the file didn't load, ignore it. if err != OK: return # Iterate over all sections. for player in config.get_sections(): # Fetch the data for each section. var player_name = config.get_value(player, "player_name") var player_score = config.get_value(player, "best_score") score_data[player_name] = player_score [/gdscript] [csharp] var score_data = new Godot.Collections.Dictionary(); var config = new ConfigFile(); // Load data from a file. Error err = config.Load("user://scores.cfg"); // If the file didn't load, ignore it. if (err != Error.Ok) { return; } // Iterate over all sections. foreach (String player in config.GetSections()) { // Fetch the data for each section. var player_name = (String)config.GetValue(player, "player_name"); var player_score = (int)config.GetValue(player, "best_score"); score_data[player_name] = player_score; } [/csharp] [/codeblocks] Any operation that mutates the ConfigFile such as [method set_value], [method clear], or [method erase_section], only changes what is loaded in memory. If you want to write the change to a file, you have to save the changes with [method save], [method save_encrypted], or [method save_encrypted_pass]. Keep in mind that section and property names can't contain spaces. Anything after a space will be ignored on save and on load. ConfigFiles can also contain manually written comment lines starting with a semicolon ([code];[/code]). Those lines will be ignored when parsing the file. Note that comments will be lost when saving the ConfigFile. This can still be useful for dedicated server configuration files, which are typically never overwritten without explicit user action. [b]Note:[/b] The file extension given to a ConfigFile does not have any impact on its formatting or behavior. By convention, the [code].cfg[/code] extension is used here, but any other extension such as [code].ini[/code] is also valid. Since neither [code].cfg[/code] nor [code].ini[/code] are standardized, Godot's ConfigFile formatting may differ from files written by other programs. </description> <tutorials> </tutorials>
123953
<?xml version="1.0" encoding="UTF-8" ?> <class name="JSON" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Helper class for creating and parsing JSON data. </brief_description> <description> The [JSON] class enables all data types to be converted to and from a JSON string. This is useful for serializing data, e.g. to save to a file or send over the network. [method stringify] is used to convert any data type into a JSON string. [method parse] is used to convert any existing JSON data into a [Variant] that can be used within Godot. If successfully parsed, use [member data] to retrieve the [Variant], and use [method @GlobalScope.typeof] to check if the Variant's type is what you expect. JSON Objects are converted into a [Dictionary], but JSON data can be used to store [Array]s, numbers, [String]s and even just a boolean. [codeblock] var data_to_send = ["a", "b", "c"] var json_string = JSON.stringify(data_to_send) # Save data # ... # Retrieve data var json = JSON.new() var error = json.parse(json_string) if error == OK: var data_received = json.data if typeof(data_received) == TYPE_ARRAY: print(data_received) # Prints array else: print("Unexpected data") else: print("JSON Parse Error: ", json.get_error_message(), " in ", json_string, " at line ", json.get_error_line()) [/codeblock] Alternatively, you can parse strings using the static [method parse_string] method, but it doesn't handle errors. [codeblock] var data = JSON.parse_string(json_string) # Returns null if parsing failed. [/codeblock] [b]Note:[/b] Both parse methods do not fully comply with the JSON specification: - Trailing commas in arrays or objects are ignored, instead of causing a parser error. - New line and tab characters are accepted in string literals, and are treated like their corresponding escape sequences [code]\n[/code] and [code]\t[/code]. - Numbers are parsed using [method String.to_float] which is generally more lax than the JSON specification. - Certain errors, such as invalid Unicode sequences, do not cause a parser error. Instead, the string is cleaned up and an error is logged to the console. </description> <tutorials> </tutorials> <methods> <method name="from_native" qualifiers="static"> <return type="Variant" /> <param index="0" name="variant" type="Variant" /> <param index="1" name="allow_classes" type="bool" default="false" /> <param index="2" name="allow_scripts" type="bool" default="false" /> <description> Converts a native engine type to a JSON-compliant dictionary. By default, classes and scripts are ignored for security reasons, unless [param allow_classes] or [param allow_scripts] are specified. </description> </method> <method name="get_error_line" qualifiers="const"> <return type="int" /> <description> Returns [code]0[/code] if the last call to [method parse] was successful, or the line number where the parse failed. </description> </method> <method name="get_error_message" qualifiers="const"> <return type="String" /> <description> Returns an empty string if the last call to [method parse] was successful, or the error message if it failed. </description> </method> <method name="get_parsed_text" qualifiers="const"> <return type="String" /> <description> Return the text parsed by [method parse] (requires passing [code]keep_text[/code] to [method parse]). </description> </method> <method name="parse"> <return type="int" enum="Error" /> <param index="0" name="json_text" type="String" /> <param index="1" name="keep_text" type="bool" default="false" /> <description> Attempts to parse the [param json_text] provided. Returns an [enum Error]. If the parse was successful, it returns [constant OK] and the result can be retrieved using [member data]. If unsuccessful, use [method get_error_line] and [method get_error_message] to identify the source of the failure. Non-static variant of [method parse_string], if you want custom error handling. The optional [param keep_text] argument instructs the parser to keep a copy of the original text. This text can be obtained later by using the [method get_parsed_text] function and is used when saving the resource (instead of generating new text from [member data]). </description> </method> <method name="parse_string" qualifiers="static"> <return type="Variant" /> <param index="0" name="json_string" type="String" /> <description> Attempts to parse the [param json_string] provided and returns the parsed data. Returns [code]null[/code] if parse failed. </description> </method> <method name="stringify" qualifiers="static"> <return type="String" /> <param index="0" name="data" type="Variant" /> <param index="1" name="indent" type="String" default="&quot;&quot;" /> <param index="2" name="sort_keys" type="bool" default="true" /> <param index="3" name="full_precision" type="bool" default="false" /> <description> Converts a [Variant] var to JSON text and returns the result. Useful for serializing data to store or send over the network. [b]Note:[/b] The JSON specification does not define integer or float types, but only a [i]number[/i] type. Therefore, converting a Variant to JSON text will convert all numerical values to [float] types. [b]Note:[/b] If [param full_precision] is [code]true[/code], when stringifying floats, the unreliable digits are stringified in addition to the reliable digits to guarantee exact decoding. The [param indent] parameter controls if and how something is indented; its contents will be used where there should be an indent in the output. Even spaces like [code]" "[/code] will work. [code]\t[/code] and [code]\n[/code] can also be used for a tab indent, or to make a newline for each indent respectively. [b]Example output:[/b] [codeblock] ## JSON.stringify(my_dictionary) {"name":"my_dictionary","version":"1.0.0","entities":[{"name":"entity_0","value":"value_0"},{"name":"entity_1","value":"value_1"}]} ## JSON.stringify(my_dictionary, "\t") { "name": "my_dictionary", "version": "1.0.0", "entities": [ { "name": "entity_0", "value": "value_0" }, { "name": "entity_1", "value": "value_1" } ] } ## JSON.stringify(my_dictionary, "...") { ..."name": "my_dictionary", ..."version": "1.0.0", ..."entities": [ ......{ ........."name": "entity_0", ........."value": "value_0" ......}, ......{ ........."name": "entity_1", ........."value": "value_1" ......} ...] } [/codeblock] </description> </method> <method name="to_native" qualifiers="static"> <return type="Variant" /> <param index="0" name="json" type="Variant" /> <param index="1" name="allow_classes" type="bool" default="false" /> <param index="2" name="allow_scripts" type="bool" default="false" /> <description> Converts a JSON-compliant dictionary that was created with [method from_native] back to native engine types. By default, classes and scripts are ignored for security reasons, unless [param allow_classes] or [param allow_scripts] are specified. </description> </method> </methods> <members> <member name="data" type="Variant" setter="set_data" getter="get_data" default="null"> Contains the parsed JSON data in [Variant] form. </member> </members> </class>
123988
<methods> <method name="close"> <return type="void" /> <description> Closes the currently opened file and prevents subsequent read/write operations. Use [method flush] to persist the data to disk without closing the file. [b]Note:[/b] [FileAccess] will automatically close when it's freed, which happens when it goes out of scope or when it gets assigned with [code]null[/code]. In C# the reference must be disposed after we are done using it, this can be done with the [code]using[/code] statement or calling the [code]Dispose[/code] method directly. </description> </method> <method name="eof_reached" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the file cursor has already read past the end of the file. [b]Note:[/b] [code]eof_reached() == false[/code] cannot be used to check whether there is more data available. To loop while there is more data available, use: [codeblocks] [gdscript] while file.get_position() &lt; file.get_length(): # Read data [/gdscript] [csharp] while (file.GetPosition() &lt; file.GetLength()) { // Read data } [/csharp] [/codeblocks] </description> </method> <method name="file_exists" qualifiers="static"> <return type="bool" /> <param index="0" name="path" type="String" /> <description> Returns [code]true[/code] if the file exists in the given path. [b]Note:[/b] Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. See [method ResourceLoader.exists] for an alternative approach that takes resource remapping into account. For a non-static, relative equivalent, use [method DirAccess.file_exists]. </description> </method> <method name="flush"> <return type="void" /> <description> Writes the file's buffer to disk. Flushing is automatically performed when the file is closed. This means you don't need to call [method flush] manually before closing a file. Still, calling [method flush] can be used to ensure the data is safe even if the project crashes instead of being closed gracefully. [b]Note:[/b] Only call [method flush] when you actually need it. Otherwise, it will decrease performance due to constant disk writes. </description> </method> <method name="get_8" qualifiers="const"> <return type="int" /> <description> Returns the next 8 bits from the file as an integer. See [method store_8] for details on what values can be stored and retrieved this way. </description> </method> <method name="get_16" qualifiers="const"> <return type="int" /> <description> Returns the next 16 bits from the file as an integer. See [method store_16] for details on what values can be stored and retrieved this way. </description> </method> <method name="get_32" qualifiers="const"> <return type="int" /> <description> Returns the next 32 bits from the file as an integer. See [method store_32] for details on what values can be stored and retrieved this way. </description> </method> <method name="get_64" qualifiers="const"> <return type="int" /> <description> Returns the next 64 bits from the file as an integer. See [method store_64] for details on what values can be stored and retrieved this way. </description> </method> <method name="get_as_text" qualifiers="const"> <return type="String" /> <param index="0" name="skip_cr" type="bool" default="false" /> <description> Returns the whole file as a [String]. Text is interpreted as being UTF-8 encoded. If [param skip_cr] is [code]true[/code], carriage return characters ([code]\r[/code], CR) will be ignored when parsing the UTF-8, so that only line feed characters ([code]\n[/code], LF) represent a new line (Unix convention). </description> </method> <method name="get_buffer" qualifiers="const"> <return type="PackedByteArray" /> <param index="0" name="length" type="int" /> <description> Returns next [param length] bytes of the file as a [PackedByteArray]. </description> </method> <method name="get_csv_line" qualifiers="const"> <return type="PackedStringArray" /> <param index="0" name="delim" type="String" default="&quot;,&quot;" /> <description> Returns the next value of the file in CSV (Comma-Separated Values) format. You can pass a different delimiter [param delim] to use other than the default [code]","[/code] (comma). This delimiter must be one-character long, and cannot be a double quotation mark. Text is interpreted as being UTF-8 encoded. Text values must be enclosed in double quotes if they include the delimiter character. Double quotes within a text value can be escaped by doubling their occurrence. For example, the following CSV lines are valid and will be properly parsed as two strings each: [codeblock lang=text] Alice,"Hello, Bob!" Bob,Alice! What a surprise! Alice,"I thought you'd reply with ""Hello, world""." [/codeblock] Note how the second line can omit the enclosing quotes as it does not include the delimiter. However it [i]could[/i] very well use quotes, it was only written without for demonstration purposes. The third line must use [code]""[/code] for each quotation mark that needs to be interpreted as such instead of the end of a text value. </description> </method> <method name="get_double" qualifiers="const"> <return type="float" /> <description> Returns the next 64 bits from the file as a floating-point number. </description> </method> <method name="get_error" qualifiers="const"> <return type="int" enum="Error" /> <description> Returns the last error that happened when trying to perform operations. Compare with the [code]ERR_FILE_*[/code] constants from [enum Error]. </description> </method> <method name="get_file_as_bytes" qualifiers="static"> <return type="PackedByteArray" /> <param index="0" name="path" type="String" /> <description> Returns the whole [param path] file contents as a [PackedByteArray] without any decoding. Returns an empty [PackedByteArray] if an error occurred while opening the file. You can use [method get_open_error] to check the error that occurred. </description> </method> <method name="get_file_as_string" qualifiers="static"> <return type="String" /> <param index="0" name="path" type="String" /> <description> Returns the whole [param path] file contents as a [String]. Text is interpreted as being UTF-8 encoded. Returns an empty [String] if an error occurred while opening the file. You can use [method get_open_error] to check the error that occurred. </description> </method> <method name="get_float" qualifiers="const"> <return type="float" /> <description> Returns the next 32 bits from the file as a floating-point number. </description> </method> <method name="get_hidden_attribute" qualifiers="static"> <return type="bool" /> <param index="0" name="file" type="String" /> <description> Returns [code]true[/code], if file [code]hidden[/code] attribute is set. [b]Note:[/b] This method is implemented on iOS, BSD, macOS, and Windows. </description> </method>
124006
<?xml version="1.0" encoding="UTF-8" ?> <class name="AnimatedSprite2D" inherits="Node2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Sprite node that contains multiple textures as frames to play for animation. </brief_description> <description> [AnimatedSprite2D] is similar to the [Sprite2D] node, except it carries multiple textures as animation frames. Animations are created using a [SpriteFrames] resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The [SpriteFrames] resource can be configured in the editor via the SpriteFrames bottom panel. </description> <tutorials> <link title="2D Sprite animation">$DOCS_URL/tutorials/2d/2d_sprite_animation.html</link> <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> </tutorials> <methods> <method name="get_playing_speed" qualifiers="const"> <return type="float" /> <description> Returns the actual playing speed of current animation or [code]0[/code] if not playing. This speed is the [member speed_scale] property multiplied by [code]custom_speed[/code] argument specified when calling the [method play] method. Returns a negative value if the current animation is playing backwards. </description> </method> <method name="is_playing" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if an animation is currently playing (even if [member speed_scale] and/or [code]custom_speed[/code] are [code]0[/code]). </description> </method> <method name="pause"> <return type="void" /> <description> Pauses the currently playing animation. The [member frame] and [member frame_progress] will be kept and calling [method play] or [method play_backwards] without arguments will resume the animation from the current playback position. See also [method stop]. </description> </method> <method name="play"> <return type="void" /> <param index="0" name="name" type="StringName" default="&amp;&quot;&quot;" /> <param index="1" name="custom_speed" type="float" default="1.0" /> <param index="2" name="from_end" type="bool" default="false" /> <description> Plays the animation with key [param name]. If [param custom_speed] is negative and [param from_end] is [code]true[/code], the animation will play backwards (which is equivalent to calling [method play_backwards]). If this method is called with that same animation [param name], or with no [param name] parameter, the assigned animation will resume playing if it was paused. </description> </method> <method name="play_backwards"> <return type="void" /> <param index="0" name="name" type="StringName" default="&amp;&quot;&quot;" /> <description> Plays the animation with key [param name] in reverse. This method is a shorthand for [method play] with [code]custom_speed = -1.0[/code] and [code]from_end = true[/code], so see its description for more information. </description> </method> <method name="set_frame_and_progress"> <return type="void" /> <param index="0" name="frame" type="int" /> <param index="1" name="progress" type="float" /> <description> Sets [member frame] the [member frame_progress] to the given values. Unlike setting [member frame], this method does not reset the [member frame_progress] to [code]0.0[/code] implicitly. [b]Example:[/b] Change the animation while keeping the same [member frame] and [member frame_progress]. [codeblocks] [gdscript] var current_frame = animated_sprite.get_frame() var current_progress = animated_sprite.get_frame_progress() animated_sprite.play("walk_another_skin") animated_sprite.set_frame_and_progress(current_frame, current_progress) [/gdscript] [/codeblocks] </description> </method> <method name="stop"> <return type="void" /> <description> Stops the currently playing animation. The animation position is reset to [code]0[/code] and the [code]custom_speed[/code] is reset to [code]1.0[/code]. See also [method pause]. </description> </method> </methods> <members> <member name="animation" type="StringName" setter="set_animation" getter="get_animation" default="&amp;&quot;default&quot;"> The current animation from the [member sprite_frames] resource. If this value is changed, the [member frame] counter and the [member frame_progress] are reset. </member> <member name="autoplay" type="String" setter="set_autoplay" getter="get_autoplay" default="&quot;&quot;"> The key of the animation to play when the scene loads. </member> <member name="centered" type="bool" setter="set_centered" getter="is_centered" default="true"> If [code]true[/code], texture will be centered. [b]Note:[/b] For games with a pixel art aesthetic, textures may appear deformed when centered. This is caused by their position being between pixels. To prevent this, set this property to [code]false[/code], or consider enabling [member ProjectSettings.rendering/2d/snap/snap_2d_vertices_to_pixel] and [member ProjectSettings.rendering/2d/snap/snap_2d_transforms_to_pixel]. </member> <member name="flip_h" type="bool" setter="set_flip_h" getter="is_flipped_h" default="false"> If [code]true[/code], texture is flipped horizontally. </member> <member name="flip_v" type="bool" setter="set_flip_v" getter="is_flipped_v" default="false"> If [code]true[/code], texture is flipped vertically. </member> <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0"> The displayed animation frame's index. Setting this property also resets [member frame_progress]. If this is not desired, use [method set_frame_and_progress]. </member> <member name="frame_progress" type="float" setter="set_frame_progress" getter="get_frame_progress" default="0.0"> The progress value between [code]0.0[/code] and [code]1.0[/code] until the current frame transitions to the next frame. If the animation is playing backwards, the value transitions from [code]1.0[/code] to [code]0.0[/code]. </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The texture's drawing offset. </member> <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0"> The speed scaling ratio. For example, if this value is [code]1[/code], then the animation plays at normal speed. If it's [code]0.5[/code], then it plays at half speed. If it's [code]2[/code], then it plays at double speed. If set to a negative value, the animation is played in reverse. If set to [code]0[/code], the animation will not advance. </member> <member name="sprite_frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames"> The [SpriteFrames] resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the [SpriteFrames] resource. </member> </members>
124035
<?xml version="1.0" encoding="UTF-8" ?> <class name="KinematicCollision2D" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Holds collision data from the movement of a [PhysicsBody2D]. </brief_description> <description> Holds collision data from the movement of a [PhysicsBody2D], usually from [method PhysicsBody2D.move_and_collide]. When a [PhysicsBody2D] is moved, it stops if it detects a collision with another body. If a collision is detected, a [KinematicCollision2D] object is returned. The collision data includes the colliding object, the remaining motion, and the collision position. This data can be used to determine a custom response to the collision. </description> <tutorials> </tutorials> <methods> <method name="get_angle" qualifiers="const"> <return type="float" /> <param index="0" name="up_direction" type="Vector2" default="Vector2(0, -1)" /> <description> Returns the collision angle according to [param up_direction], which is [constant Vector2.UP] by default. This value is always positive. </description> </method> <method name="get_collider" qualifiers="const"> <return type="Object" /> <description> Returns the colliding body's attached [Object]. </description> </method> <method name="get_collider_id" qualifiers="const"> <return type="int" /> <description> Returns the unique instance ID of the colliding body's attached [Object]. See [method Object.get_instance_id]. </description> </method> <method name="get_collider_rid" qualifiers="const"> <return type="RID" /> <description> Returns the colliding body's [RID] used by the [PhysicsServer2D]. </description> </method> <method name="get_collider_shape" qualifiers="const"> <return type="Object" /> <description> Returns the colliding body's shape. </description> </method> <method name="get_collider_shape_index" qualifiers="const"> <return type="int" /> <description> Returns the colliding body's shape index. See [CollisionObject2D]. </description> </method> <method name="get_collider_velocity" qualifiers="const"> <return type="Vector2" /> <description> Returns the colliding body's velocity. </description> </method> <method name="get_depth" qualifiers="const"> <return type="float" /> <description> Returns the colliding body's length of overlap along the collision normal. </description> </method> <method name="get_local_shape" qualifiers="const"> <return type="Object" /> <description> Returns the moving object's colliding shape. </description> </method> <method name="get_normal" qualifiers="const"> <return type="Vector2" /> <description> Returns the colliding body's shape's normal at the point of collision. </description> </method> <method name="get_position" qualifiers="const"> <return type="Vector2" /> <description> Returns the point of collision in global coordinates. </description> </method> <method name="get_remainder" qualifiers="const"> <return type="Vector2" /> <description> Returns the moving object's remaining movement vector. </description> </method> <method name="get_travel" qualifiers="const"> <return type="Vector2" /> <description> Returns the moving object's travel before collision. </description> </method> </methods> </class>
124039
<?xml version="1.0" encoding="UTF-8" ?> <class name="Signal" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A built-in type representing a signal of an [Object]. </brief_description> <description> [Signal] is a built-in [Variant] type that represents a signal of an [Object] instance. Like all [Variant] types, it can be stored in variables and passed to functions. Signals allow all connected [Callable]s (and by extension their respective objects) to listen and react to events, without directly referencing one another. This keeps the code flexible and easier to manage. You can check whether an [Object] has a given signal name using [method Object.has_signal]. In GDScript, signals can be declared with the [code]signal[/code] keyword. In C#, you may use the [code][Signal][/code] attribute on a delegate. [codeblocks] [gdscript] signal attacked # Additional arguments may be declared. # These arguments must be passed when the signal is emitted. signal item_dropped(item_name, amount) [/gdscript] [csharp] [Signal] delegate void AttackedEventHandler(); // Additional arguments may be declared. // These arguments must be passed when the signal is emitted. [Signal] delegate void ItemDroppedEventHandler(string itemName, int amount); [/csharp] [/codeblocks] </description> <tutorials> <link title="Using Signals">$DOCS_URL/getting_started/step_by_step/signals.html</link> <link title="GDScript Basics">$DOCS_URL/tutorials/scripting/gdscript/gdscript_basics.html#signals</link> </tutorials> <constructors> <constructor name="Signal"> <return type="Signal" /> <description> Constructs an empty [Signal] with no object nor signal name bound. </description> </constructor> <constructor name="Signal"> <return type="Signal" /> <param index="0" name="from" type="Signal" /> <description> Constructs a [Signal] as a copy of the given [Signal]. </description> </constructor> <constructor name="Signal"> <return type="Signal" /> <param index="0" name="object" type="Object" /> <param index="1" name="signal" type="StringName" /> <description> Creates a [Signal] object referencing a signal named [param signal] in the specified [param object]. </description> </constructor> </constructors> <methods> <method name="connect"> <return type="int" /> <param index="0" name="callable" type="Callable" /> <param index="1" name="flags" type="int" default="0" /> <description> Connects this signal to the specified [param callable]. Optional [param flags] can be also added to configure the connection's behavior (see [enum Object.ConnectFlags] constants). You can provide additional arguments to the connected [param callable] by using [method Callable.bind]. A signal can only be connected once to the same [Callable]. If the signal is already connected, returns [constant ERR_INVALID_PARAMETER] and pushes an error message, unless the signal is connected with [constant Object.CONNECT_REFERENCE_COUNTED]. To prevent this, use [method is_connected] first to check for existing connections. [codeblock] for button in $Buttons.get_children(): button.pressed.connect(_on_pressed.bind(button)) func _on_pressed(button): print(button.name, " was pressed") [/codeblock] </description> </method> <method name="disconnect"> <return type="void" /> <param index="0" name="callable" type="Callable" /> <description> Disconnects this signal from the specified [Callable]. If the connection does not exist, generates an error. Use [method is_connected] to make sure that the connection exists. </description> </method> <method name="emit" qualifiers="vararg const"> <return type="void" /> <description> Emits this signal. All [Callable]s connected to this signal will be triggered. This method supports a variable number of arguments, so parameters can be passed as a comma separated list. </description> </method> <method name="get_connections" qualifiers="const"> <return type="Array" /> <description> Returns an [Array] of connections for this signal. Each connection is represented as a [Dictionary] that contains three entries: - [code]signal[/code] is a reference to this signal; - [code]callable[/code] is a reference to the connected [Callable]; - [code]flags[/code] is a combination of [enum Object.ConnectFlags]. </description> </method> <method name="get_name" qualifiers="const"> <return type="StringName" /> <description> Returns the name of this signal. </description> </method> <method name="get_object" qualifiers="const"> <return type="Object" /> <description> Returns the object emitting this signal. </description> </method> <method name="get_object_id" qualifiers="const"> <return type="int" /> <description> Returns the ID of the object emitting this signal (see [method Object.get_instance_id]). </description> </method> <method name="has_connections" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if any [Callable] is connected to this signal. </description> </method> <method name="is_connected" qualifiers="const"> <return type="bool" /> <param index="0" name="callable" type="Callable" /> <description> Returns [code]true[/code] if the specified [Callable] is connected to this signal. </description> </method> <method name="is_null" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if this [Signal] has no object and the signal name is empty. Equivalent to [code]signal == Signal()[/code]. </description> </method> </methods> <operators> <operator name="operator !="> <return type="bool" /> <param index="0" name="right" type="Signal" /> <description> Returns [code]true[/code] if the signals do not share the same object and name. </description> </operator> <operator name="operator =="> <return type="bool" /> <param index="0" name="right" type="Signal" /> <description> Returns [code]true[/code] if both signals share the same object and name. </description> </operator> </operators> </class>
124044
<?xml version="1.0" encoding="UTF-8" ?> <class name="Area2D" inherits="CollisionObject2D" keywords="trigger" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A region of 2D space that detects other [CollisionObject2D]s entering or exiting it. </brief_description> <description> [Area2D] is a region of 2D space defined by one or multiple [CollisionShape2D] or [CollisionPolygon2D] child nodes. It detects when other [CollisionObject2D]s enter or exit it, and it also keeps track of which collision objects haven't exited it yet (i.e. which one are overlapping it). This node can also locally alter or override physics parameters (gravity, damping) and route audio to custom audio buses. [b]Note:[/b] Areas and bodies created with [PhysicsServer2D] might not interact as expected with [Area2D]s, and might not emit signals or track objects correctly. </description> <tutorials> <link title="Using Area2D">$DOCS_URL/tutorials/physics/using_area_2d.html</link> <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> <link title="2D Pong Demo">https://godotengine.org/asset-library/asset/2728</link> <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/2727</link> </tutorials> <methods> <method name="get_overlapping_areas" qualifiers="const"> <return type="Area2D[]" /> <description> Returns a list of intersecting [Area2D]s. The overlapping area's [member CollisionObject2D.collision_layer] must be part of this area's [member CollisionObject2D.collision_mask] in order to be detected. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. </description> </method> <method name="get_overlapping_bodies" qualifiers="const"> <return type="Node2D[]" /> <description> Returns a list of intersecting [PhysicsBody2D]s and [TileMap]s. The overlapping body's [member CollisionObject2D.collision_layer] must be part of this area's [member CollisionObject2D.collision_mask] in order to be detected. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. </description> </method> <method name="has_overlapping_areas" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if intersecting any [Area2D]s, otherwise returns [code]false[/code]. The overlapping area's [member CollisionObject2D.collision_layer] must be part of this area's [member CollisionObject2D.collision_mask] in order to be detected. For performance reasons (collisions are all processed at the same time) the list of overlapping areas is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. </description> </method> <method name="has_overlapping_bodies" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if intersecting any [PhysicsBody2D]s or [TileMap]s, otherwise returns [code]false[/code]. The overlapping body's [member CollisionObject2D.collision_layer] must be part of this area's [member CollisionObject2D.collision_mask] in order to be detected. For performance reasons (collisions are all processed at the same time) the list of overlapping bodies is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. </description> </method> <method name="overlaps_area" qualifiers="const"> <return type="bool" /> <param index="0" name="area" type="Node" /> <description> Returns [code]true[/code] if the given [Area2D] intersects or overlaps this [Area2D], [code]false[/code] otherwise. [b]Note:[/b] The result of this test is not immediate after moving objects. For performance, the list of overlaps is updated once per frame and before the physics step. Consider using signals instead. </description> </method> <method name="overlaps_body" qualifiers="const"> <return type="bool" /> <param index="0" name="body" type="Node" /> <description> Returns [code]true[/code] if the given physics body intersects or overlaps this [Area2D], [code]false[/code] otherwise. [b]Note:[/b] The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead. The [param body] argument can either be a [PhysicsBody2D] or a [TileMap] instance. While TileMaps are not physics bodies themselves, they register their tiles with collision shapes as a virtual physics body. </description> </method> </methods>
124046
gnals> <signal name="area_entered"> <param index="0" name="area" type="Area2D" /> <description> Emitted when the received [param area] enters this area. Requires [member monitoring] to be set to [code]true[/code]. </description> </signal> <signal name="area_exited"> <param index="0" name="area" type="Area2D" /> <description> Emitted when the received [param area] exits this area. Requires [member monitoring] to be set to [code]true[/code]. </description> </signal> <signal name="area_shape_entered"> <param index="0" name="area_rid" type="RID" /> <param index="1" name="area" type="Area2D" /> <param index="2" name="area_shape_index" type="int" /> <param index="3" name="local_shape_index" type="int" /> <description> Emitted when a [Shape2D] of the received [param area] enters a shape of this area. Requires [member monitoring] to be set to [code]true[/code]. [param local_shape_index] and [param area_shape_index] contain indices of the interacting shapes from this area and the other area, respectively. [param area_rid] contains the [RID] of the other area. These values can be used with the [PhysicsServer2D]. [b]Example of getting the[/b] [CollisionShape2D] [b]node from the shape index:[/b] [codeblocks] [gdscript] var other_shape_owner = area.shape_find_owner(area_shape_index) var other_shape_node = area.shape_owner_get_owner(other_shape_owner) var local_shape_owner = shape_find_owner(local_shape_index) var local_shape_node = shape_owner_get_owner(local_shape_owner) [/gdscript] [/codeblocks] </description> </signal> <signal name="area_shape_exited"> <param index="0" name="area_rid" type="RID" /> <param index="1" name="area" type="Area2D" /> <param index="2" name="area_shape_index" type="int" /> <param index="3" name="local_shape_index" type="int" /> <description> Emitted when a [Shape2D] of the received [param area] exits a shape of this area. Requires [member monitoring] to be set to [code]true[/code]. See also [signal area_shape_entered]. </description> </signal> <signal name="body_entered"> <param index="0" name="body" type="Node2D" /> <description> Emitted when the received [param body] enters this area. [param body] can be a [PhysicsBody2D] or a [TileMap]. [TileMap]s are detected if their [TileSet] has collision shapes configured. Requires [member monitoring] to be set to [code]true[/code]. </description> </signal> <signal name="body_exited"> <param index="0" name="body" type="Node2D" /> <description> Emitted when the received [param body] exits this area. [param body] can be a [PhysicsBody2D] or a [TileMap]. [TileMap]s are detected if their [TileSet] has collision shapes configured. Requires [member monitoring] to be set to [code]true[/code]. </description> </signal> <signal name="body_shape_entered"> <param index="0" name="body_rid" type="RID" /> <param index="1" name="body" type="Node2D" /> <param index="2" name="body_shape_index" type="int" /> <param index="3" name="local_shape_index" type="int" /> <description> Emitted when a [Shape2D] of the received [param body] enters a shape of this area. [param body] can be a [PhysicsBody2D] or a [TileMap]. [TileMap]s are detected if their [TileSet] has collision shapes configured. Requires [member monitoring] to be set to [code]true[/code]. [param local_shape_index] and [param body_shape_index] contain indices of the interacting shapes from this area and the interacting body, respectively. [param body_rid] contains the [RID] of the body. These values can be used with the [PhysicsServer2D]. [b]Example of getting the[/b] [CollisionShape2D] [b]node from the shape index:[/b] [codeblocks] [gdscript] var body_shape_owner = body.shape_find_owner(body_shape_index) var body_shape_node = body.shape_owner_get_owner(body_shape_owner) var local_shape_owner = shape_find_owner(local_shape_index) var local_shape_node = shape_owner_get_owner(local_shape_owner) [/gdscript] [/codeblocks] </description> </signal> <signal name="body_shape_exited"> <param index="0" name="body_rid" type="RID" /> <param index="1" name="body" type="Node2D" /> <param index="2" name="body_shape_index" type="int" /> <param index="3" name="local_shape_index" type="int" /> <description> Emitted when a [Shape2D] of the received [param body] exits a shape of this area. [param body] can be a [PhysicsBody2D] or a [TileMap]. [TileMap]s are detected if their [TileSet] has collision shapes configured. Requires [member monitoring] to be set to [code]true[/code]. See also [signal body_shape_entered]. </description> </signal> </signals> <constants> <constant name="SPACE_OVERRIDE_DISABLED" value="0" enum="SpaceOverride"> This area does not affect gravity/damping. </constant> <constant name="SPACE_OVERRIDE_COMBINE" value="1" enum="SpaceOverride"> This area adds its gravity/damping values to whatever has been calculated so far (in [member priority] order). </constant> <constant name="SPACE_OVERRIDE_COMBINE_REPLACE" value="2" enum="SpaceOverride"> This area adds its gravity/damping values to whatever has been calculated so far (in [member priority] order), ignoring any lower priority areas. </constant> <constant name="SPACE_OVERRIDE_REPLACE" value="3" enum="SpaceOverride"> This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas. </constant> <constant name="SPACE_OVERRIDE_REPLACE_COMBINE" value="4" enum="SpaceOverride"> This area replaces any gravity/damping calculated so far (in [member priority] order), but keeps calculating the rest of the areas. </constant> </constants> </class>
124051
<?xml version="1.0" encoding="UTF-8" ?> <class name="Control" inherits="CanvasItem" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Base class for all GUI controls. Adapts its position and size based on its parent control. </brief_description> <description> Base class for all UI-related nodes. [Control] features a bounding rectangle that defines its extents, an anchor position relative to its parent control or the current viewport, and offsets relative to the anchor. The offsets update automatically when the node, any of its parents, or the screen size change. For more information on Godot's UI system, anchors, offsets, and containers, see the related tutorials in the manual. To build flexible UIs, you'll need a mix of UI elements that inherit from [Control] and [Container] nodes. [b]User Interface nodes and input[/b] Godot propagates input events via viewports. Each [Viewport] is responsible for propagating [InputEvent]s to their child nodes. As the [member SceneTree.root] is a [Window], this already happens automatically for all UI elements in your game. Input events are propagated through the [SceneTree] from the root node to all child nodes by calling [method Node._input]. For UI elements specifically, it makes more sense to override the virtual method [method _gui_input], which filters out unrelated input events, such as by checking z-order, [member mouse_filter], focus, or if the event was inside of the control's bounding box. Call [method accept_event] so no other node receives the event. Once you accept an input, it becomes handled so [method Node._unhandled_input] will not process it. Only one [Control] node can be in focus. Only the node in focus will receive events. To get the focus, call [method grab_focus]. [Control] nodes lose focus when another node grabs it, or if you hide the node in focus. Sets [member mouse_filter] to [constant MOUSE_FILTER_IGNORE] to tell a [Control] node to ignore mouse or touch events. You'll need it if you place an icon on top of a button. [Theme] resources change the Control's appearance. If you change the [Theme] on a [Control] node, it affects all of its children. To override some of the theme's parameters, call one of the [code]add_theme_*_override[/code] methods, like [method add_theme_font_override]. You can override the theme with the Inspector. [b]Note:[/b] Theme items are [i]not[/i] [Object] properties. This means you can't access their values using [method Object.get] and [method Object.set]. Instead, use the [code]get_theme_*[/code] and [code]add_theme_*_override[/code] methods provided by this class. </description> <tutorials> <link title="GUI documentation index">$DOCS_URL/tutorials/ui/index.html</link> <link title="Custom drawing in 2D">$DOCS_URL/tutorials/2d/custom_drawing_in_2d.html</link> <link title="Control node gallery">$DOCS_URL/tutorials/ui/control_node_gallery.html</link> <link title="Multiple resolutions">$DOCS_URL/tutorials/rendering/multiple_resolutions.html</link> <link title="All GUI Demos">https://github.com/godotengine/godot-demo-projects/tree/master/gui</link> </tutorials>
124052
<methods> <method name="_can_drop_data" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="at_position" type="Vector2" /> <param index="1" name="data" type="Variant" /> <description> Godot calls this method to test if [param data] from a control's [method _get_drag_data] can be dropped at [param at_position]. [param at_position] is local to this control. This method should only be used to test the data. Process the data in [method _drop_data]. [codeblocks] [gdscript] func _can_drop_data(position, data): # Check position if it is relevant to you # Otherwise, just check data return typeof(data) == TYPE_DICTIONARY and data.has("expected") [/gdscript] [csharp] public override bool _CanDropData(Vector2 atPosition, Variant data) { // Check position if it is relevant to you // Otherwise, just check data return data.VariantType == Variant.Type.Dictionary &amp;&amp; data.AsGodotDictionary().ContainsKey("expected"); } [/csharp] [/codeblocks] </description> </method> <method name="_drop_data" qualifiers="virtual"> <return type="void" /> <param index="0" name="at_position" type="Vector2" /> <param index="1" name="data" type="Variant" /> <description> Godot calls this method to pass you the [param data] from a control's [method _get_drag_data] result. Godot first calls [method _can_drop_data] to test if [param data] is allowed to drop at [param at_position] where [param at_position] is local to this control. [codeblocks] [gdscript] func _can_drop_data(position, data): return typeof(data) == TYPE_DICTIONARY and data.has("color") func _drop_data(position, data): var color = data["color"] [/gdscript] [csharp] public override bool _CanDropData(Vector2 atPosition, Variant data) { return data.VariantType == Variant.Type.Dictionary &amp;&amp; data.AsGodotDictionary().ContainsKey("color"); } public override void _DropData(Vector2 atPosition, Variant data) { Color color = data.AsGodotDictionary()["color"].AsColor(); } [/csharp] [/codeblocks] </description> </method> <method name="_get_drag_data" qualifiers="virtual"> <return type="Variant" /> <param index="0" name="at_position" type="Vector2" /> <description> Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns [code]null[/code] if there is no data to drag. Controls that want to receive drop data should implement [method _can_drop_data] and [method _drop_data]. [param at_position] is local to this control. Drag may be forced with [method force_drag]. A preview that will follow the mouse that should represent the data can be set with [method set_drag_preview]. A good time to set the preview is in this method. [codeblocks] [gdscript] func _get_drag_data(position): var mydata = make_data() # This is your custom method generating the drag data. set_drag_preview(make_preview(mydata)) # This is your custom method generating the preview of the drag data. return mydata [/gdscript] [csharp] public override Variant _GetDragData(Vector2 atPosition) { var myData = MakeData(); // This is your custom method generating the drag data. SetDragPreview(MakePreview(myData)); // This is your custom method generating the preview of the drag data. return myData; } [/csharp] [/codeblocks] </description> </method> <method name="_get_minimum_size" qualifiers="virtual const"> <return type="Vector2" /> <description> Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to [member custom_minimum_size] for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately). If not overridden, defaults to [constant Vector2.ZERO]. [b]Note:[/b] This method will not be called when the script is attached to a [Control] node that already overrides its minimum size (e.g. [Label], [Button], [PanelContainer] etc.). It can only be used with most basic GUI nodes, like [Control], [Container], [Panel] etc. </description> </method> <method name="_get_tooltip" qualifiers="virtual const"> <return type="String" /> <param index="0" name="at_position" type="Vector2" /> <description> Virtual method to be implemented by the user. Returns the tooltip text for the position [param at_position] in control's local coordinates, which will typically appear when the cursor is resting over this control. See [method get_tooltip]. [b]Note:[/b] If this method returns an empty [String], no tooltip is displayed. </description> </method> <method name="_gui_input" qualifiers="virtual"> <return type="void" /> <param index="0" name="event" type="InputEvent" /> <description> Virtual method to be implemented by the user. Use this method to process and accept inputs on UI elements. See [method accept_event]. [b]Example usage for clicking a control:[/b] [codeblocks] [gdscript] func _gui_input(event): if event is InputEventMouseButton: if event.button_index == MOUSE_BUTTON_LEFT and event.pressed: print("I've been clicked D:") [/gdscript] [csharp] public override void _GuiInput(InputEvent @event) { if (@event is InputEventMouseButton mb) { if (mb.ButtonIndex == MouseButton.Left &amp;&amp; mb.Pressed) { GD.Print("I've been clicked D:"); } } } [/csharp] [/codeblocks] The event won't trigger if: * clicking outside the control (see [method _has_point]); * control has [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE]; * control is obstructed by another [Control] on top of it, which doesn't have [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE]; * control's parent has [member mouse_filter] set to [constant MOUSE_FILTER_STOP] or has accepted the event; * it happens outside the parent's rectangle and the parent has either [member clip_contents] enabled. [b]Note:[/b] Event position is relative to the control origin. </description> </method> <method name="_has_point" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="point" type="Vector2" /> <description> Virtual method to be implemented by the user. Returns whether the given [param point] is inside this control. If not overridden, default behavior is checking if the point is within control's Rect. [b]Note:[/b] If you want to check if a point is inside the control, you can use [code]Rect2(Vector2.ZERO, size).has_point(point)[/code]. </description> </method>
124055
<method name="get_rect" qualifiers="const"> <return type="Rect2" /> <description> Returns the position and size of the control in the coordinate system of the containing node. See [member position], [member scale] and [member size]. [b]Note:[/b] If [member rotation] is not the default rotation, the resulting size is not meaningful. [b]Note:[/b] Setting [member Viewport.gui_snap_controls_to_pixels] to [code]true[/code] can lead to rounding inaccuracies between the displayed control and the returned [Rect2]. </description> </method> <method name="get_screen_position" qualifiers="const"> <return type="Vector2" /> <description> Returns the position of this [Control] in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins. Equals to [member global_position] if the window is embedded (see [member Viewport.gui_embed_subwindows]). [b]Example usage for showing a popup:[/b] [codeblock] popup_menu.position = get_screen_position() + get_local_mouse_position() popup_menu.reset_size() popup_menu.popup() [/codeblock] </description> </method> <method name="get_theme_color" qualifiers="const"> <return type="Color" /> <param index="0" name="name" type="StringName" /> <param index="1" name="theme_type" type="StringName" default="&amp;&quot;&quot;" /> <description> Returns a [Color] from the first matching [Theme] in the tree if that [Theme] has a color item with the specified [param name] and [param theme_type]. If [param theme_type] is omitted the class name of the current control is used as the type, or [member theme_type_variation] if it is defined. If the type is a class name its parent classes are also checked, in order of inheritance. If the type is a variation its base types are checked, in order of dependency, then the control's class name and its parent classes are checked. For the current control its local overrides are considered first (see [method add_theme_color_override]), then its assigned [member theme]. After the current control, each parent control and its assigned [member theme] are considered; controls without a [member theme] assigned are skipped. If no matching [Theme] is found in the tree, the custom project [Theme] (see [member ProjectSettings.gui/theme/custom]) and the default [Theme] are used (see [ThemeDB]). [codeblocks] [gdscript] func _ready(): # Get the font color defined for the current Control's class, if it exists. modulate = get_theme_color("font_color") # Get the font color defined for the Button class. modulate = get_theme_color("font_color", "Button") [/gdscript] [csharp] public override void _Ready() { // Get the font color defined for the current Control's class, if it exists. Modulate = GetThemeColor("font_color"); // Get the font color defined for the Button class. Modulate = GetThemeColor("font_color", "Button"); } [/csharp] [/codeblocks] </description> </method> <method name="get_theme_constant" qualifiers="const"> <return type="int" /> <param index="0" name="name" type="StringName" /> <param index="1" name="theme_type" type="StringName" default="&amp;&quot;&quot;" /> <description> Returns a constant from the first matching [Theme] in the tree if that [Theme] has a constant item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details. </description> </method> <method name="get_theme_default_base_scale" qualifiers="const"> <return type="float" /> <description> Returns the default base scale value from the first matching [Theme] in the tree if that [Theme] has a valid [member Theme.default_base_scale] value. See [method get_theme_color] for details. </description> </method> <method name="get_theme_default_font" qualifiers="const"> <return type="Font" /> <description> Returns the default font from the first matching [Theme] in the tree if that [Theme] has a valid [member Theme.default_font] value. See [method get_theme_color] for details. </description> </method> <method name="get_theme_default_font_size" qualifiers="const"> <return type="int" /> <description> Returns the default font size value from the first matching [Theme] in the tree if that [Theme] has a valid [member Theme.default_font_size] value. See [method get_theme_color] for details. </description> </method> <method name="get_theme_font" qualifiers="const"> <return type="Font" /> <param index="0" name="name" type="StringName" /> <param index="1" name="theme_type" type="StringName" default="&amp;&quot;&quot;" /> <description> Returns a [Font] from the first matching [Theme] in the tree if that [Theme] has a font item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details. </description> </method> <method name="get_theme_font_size" qualifiers="const"> <return type="int" /> <param index="0" name="name" type="StringName" /> <param index="1" name="theme_type" type="StringName" default="&amp;&quot;&quot;" /> <description> Returns a font size from the first matching [Theme] in the tree if that [Theme] has a font size item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details. </description> </method> <method name="get_theme_icon" qualifiers="const"> <return type="Texture2D" /> <param index="0" name="name" type="StringName" /> <param index="1" name="theme_type" type="StringName" default="&amp;&quot;&quot;" /> <description> Returns an icon from the first matching [Theme] in the tree if that [Theme] has an icon item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details. </description> </method> <method name="get_theme_stylebox" qualifiers="const"> <return type="StyleBox" /> <param index="0" name="name" type="StringName" /> <param index="1" name="theme_type" type="StringName" default="&amp;&quot;&quot;" /> <description> Returns a [StyleBox] from the first matching [Theme] in the tree if that [Theme] has a stylebox item with the specified [param name] and [param theme_type]. See [method get_theme_color] for details. </description> </method> <method name="get_tooltip" qualifiers="const"> <return type="String" /> <param index="0" name="at_position" type="Vector2" default="Vector2(0, 0)" /> <description> Returns the tooltip text for the position [param at_position] in control's local coordinates, which will typically appear when the cursor is resting over this control. By default, it returns [member tooltip_text]. This method can be overridden to customize its behavior. See [method _get_tooltip]. [b]Note:[/b] If this method returns an empty [String], no tooltip is displayed. </description> </method>
124057
<method name="remove_theme_color_override"> <return type="void" /> <param index="0" name="name" type="StringName" /> <description> Removes a local override for a theme [Color] with the specified [param name] previously added by [method add_theme_color_override] or via the Inspector dock. </description> </method> <method name="remove_theme_constant_override"> <return type="void" /> <param index="0" name="name" type="StringName" /> <description> Removes a local override for a theme constant with the specified [param name] previously added by [method add_theme_constant_override] or via the Inspector dock. </description> </method> <method name="remove_theme_font_override"> <return type="void" /> <param index="0" name="name" type="StringName" /> <description> Removes a local override for a theme [Font] with the specified [param name] previously added by [method add_theme_font_override] or via the Inspector dock. </description> </method> <method name="remove_theme_font_size_override"> <return type="void" /> <param index="0" name="name" type="StringName" /> <description> Removes a local override for a theme font size with the specified [param name] previously added by [method add_theme_font_size_override] or via the Inspector dock. </description> </method> <method name="remove_theme_icon_override"> <return type="void" /> <param index="0" name="name" type="StringName" /> <description> Removes a local override for a theme icon with the specified [param name] previously added by [method add_theme_icon_override] or via the Inspector dock. </description> </method> <method name="remove_theme_stylebox_override"> <return type="void" /> <param index="0" name="name" type="StringName" /> <description> Removes a local override for a theme [StyleBox] with the specified [param name] previously added by [method add_theme_stylebox_override] or via the Inspector dock. </description> </method> <method name="reset_size"> <return type="void" /> <description> Resets the size to [method get_combined_minimum_size]. This is equivalent to calling [code]set_size(Vector2())[/code] (or any size below the minimum). </description> </method> <method name="set_anchor"> <return type="void" /> <param index="0" name="side" type="int" enum="Side" /> <param index="1" name="anchor" type="float" /> <param index="2" name="keep_offset" type="bool" default="false" /> <param index="3" name="push_opposite_anchor" type="bool" default="true" /> <description> Sets the anchor for the specified [enum Side] to [param anchor]. A setter method for [member anchor_bottom], [member anchor_left], [member anchor_right] and [member anchor_top]. If [param keep_offset] is [code]true[/code], offsets aren't updated after this operation. If [param push_opposite_anchor] is [code]true[/code] and the opposite anchor overlaps this anchor, the opposite one will have its value overridden. For example, when setting left anchor to 1 and the right anchor has value of 0.5, the right anchor will also get value of 1. If [param push_opposite_anchor] was [code]false[/code], the left anchor would get value 0.5. </description> </method> <method name="set_anchor_and_offset"> <return type="void" /> <param index="0" name="side" type="int" enum="Side" /> <param index="1" name="anchor" type="float" /> <param index="2" name="offset" type="float" /> <param index="3" name="push_opposite_anchor" type="bool" default="false" /> <description> Works the same as [method set_anchor], but instead of [code]keep_offset[/code] argument and automatic update of offset, it allows to set the offset yourself (see [method set_offset]). </description> </method> <method name="set_anchors_and_offsets_preset"> <return type="void" /> <param index="0" name="preset" type="int" enum="Control.LayoutPreset" /> <param index="1" name="resize_mode" type="int" enum="Control.LayoutPresetMode" default="0" /> <param index="2" name="margin" type="int" default="0" /> <description> Sets both anchor preset and offset preset. See [method set_anchors_preset] and [method set_offsets_preset]. </description> </method> <method name="set_anchors_preset"> <return type="void" /> <param index="0" name="preset" type="int" enum="Control.LayoutPreset" /> <param index="1" name="keep_offsets" type="bool" default="false" /> <description> Sets the anchors to a [param preset] from [enum Control.LayoutPreset] enum. This is the code equivalent to using the Layout menu in the 2D editor. If [param keep_offsets] is [code]true[/code], control's position will also be updated. </description> </method> <method name="set_begin"> <return type="void" /> <param index="0" name="position" type="Vector2" /> <description> Sets [member offset_left] and [member offset_top] at the same time. Equivalent of changing [member position]. </description> </method> <method name="set_drag_forwarding"> <return type="void" /> <param index="0" name="drag_func" type="Callable" /> <param index="1" name="can_drop_func" type="Callable" /> <param index="2" name="drop_func" type="Callable" /> <description> Forwards the handling of this control's [method _get_drag_data], [method _can_drop_data] and [method _drop_data] virtual functions to delegate callables. For each argument, if not empty, the delegate callable is used, otherwise the local (virtual) function is used. The function format for each callable should be exactly the same as the virtual functions described above. </description> </method> <method name="set_drag_preview"> <return type="void" /> <param index="0" name="control" type="Control" /> <description> Shows the given control at the mouse pointer. A good time to call this method is in [method _get_drag_data]. The control must not be in the scene tree. You should not free the control, and you should not keep a reference to the control beyond the duration of the drag. It will be deleted automatically after the drag has ended. [codeblocks] [gdscript] @export var color = Color(1, 0, 0, 1) func _get_drag_data(position): # Use a control that is not in the tree var cpb = ColorPickerButton.new() cpb.color = color cpb.size = Vector2(50, 50) set_drag_preview(cpb) return color [/gdscript] [csharp] [Export] private Color _color = new Color(1, 0, 0, 1); public override Variant _GetDragData(Vector2 atPosition) { // Use a control that is not in the tree var cpb = new ColorPickerButton(); cpb.Color = _color; cpb.Size = new Vector2(50, 50); SetDragPreview(cpb); return _color; } [/csharp] [/codeblocks] </description> </method>
124058
<method name="set_end"> <return type="void" /> <param index="0" name="position" type="Vector2" /> <description> Sets [member offset_right] and [member offset_bottom] at the same time. </description> </method> <method name="set_focus_neighbor"> <return type="void" /> <param index="0" name="side" type="int" enum="Side" /> <param index="1" name="neighbor" type="NodePath" /> <description> Sets the focus neighbor for the specified [enum Side] to the [Control] at [param neighbor] node path. A setter method for [member focus_neighbor_bottom], [member focus_neighbor_left], [member focus_neighbor_right] and [member focus_neighbor_top]. </description> </method> <method name="set_global_position"> <return type="void" /> <param index="0" name="position" type="Vector2" /> <param index="1" name="keep_offsets" type="bool" default="false" /> <description> Sets the [member global_position] to given [param position]. If [param keep_offsets] is [code]true[/code], control's anchors will be updated instead of offsets. </description> </method> <method name="set_offset"> <return type="void" /> <param index="0" name="side" type="int" enum="Side" /> <param index="1" name="offset" type="float" /> <description> Sets the offset for the specified [enum Side] to [param offset]. A setter method for [member offset_bottom], [member offset_left], [member offset_right] and [member offset_top]. </description> </method> <method name="set_offsets_preset"> <return type="void" /> <param index="0" name="preset" type="int" enum="Control.LayoutPreset" /> <param index="1" name="resize_mode" type="int" enum="Control.LayoutPresetMode" default="0" /> <param index="2" name="margin" type="int" default="0" /> <description> Sets the offsets to a [param preset] from [enum Control.LayoutPreset] enum. This is the code equivalent to using the Layout menu in the 2D editor. Use parameter [param resize_mode] with constants from [enum Control.LayoutPresetMode] to better determine the resulting size of the [Control]. Constant size will be ignored if used with presets that change size, e.g. [constant PRESET_LEFT_WIDE]. Use parameter [param margin] to determine the gap between the [Control] and the edges. </description> </method> <method name="set_position"> <return type="void" /> <param index="0" name="position" type="Vector2" /> <param index="1" name="keep_offsets" type="bool" default="false" /> <description> Sets the [member position] to given [param position]. If [param keep_offsets] is [code]true[/code], control's anchors will be updated instead of offsets. </description> </method> <method name="set_size"> <return type="void" /> <param index="0" name="size" type="Vector2" /> <param index="1" name="keep_offsets" type="bool" default="false" /> <description> Sets the size (see [member size]). If [param keep_offsets] is [code]true[/code], control's anchors will be updated instead of offsets. </description> </method> <method name="update_minimum_size"> <return type="void" /> <description> Invalidates the size cache in this node and in parent nodes up to top level. Intended to be used with [method get_minimum_size] when the return value is changed. Setting [member custom_minimum_size] directly calls this method automatically. </description> </method> <method name="warp_mouse"> <return type="void" /> <param index="0" name="position" type="Vector2" /> <description> Moves the mouse cursor to [param position], relative to [member position] of this [Control]. [b]Note:[/b] [method warp_mouse] is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web. </description> </method> </methods>
124059
<members> <member name="anchor_bottom" type="float" setter="_set_anchor" getter="get_anchor" default="0.0"> Anchors the bottom edge of the node to the origin, the center, or the end of its parent control. It changes how the bottom offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. </member> <member name="anchor_left" type="float" setter="_set_anchor" getter="get_anchor" default="0.0"> Anchors the left edge of the node to the origin, the center or the end of its parent control. It changes how the left offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. </member> <member name="anchor_right" type="float" setter="_set_anchor" getter="get_anchor" default="0.0"> Anchors the right edge of the node to the origin, the center or the end of its parent control. It changes how the right offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. </member> <member name="anchor_top" type="float" setter="_set_anchor" getter="get_anchor" default="0.0"> Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. </member> <member name="auto_translate" type="bool" setter="set_auto_translate" getter="is_auto_translating" deprecated="Use [member Node.auto_translate_mode] instead."> Toggles if any text should automatically change to its translated version depending on the current locale. </member> <member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" default="false"> Enables whether rendering of [CanvasItem] based children should be clipped to this control's rectangle. If [code]true[/code], parts of a child which would be visibly outside of this control's rectangle will not be rendered and won't receive input. </member> <member name="custom_minimum_size" type="Vector2" setter="set_custom_minimum_size" getter="get_custom_minimum_size" default="Vector2(0, 0)"> The minimum size of the node's bounding rectangle. If you set it to a value greater than [code](0, 0)[/code], the node's bounding rectangle will always have at least this size. Note that [Control] nodes have their internal minimum size returned by [method get_minimum_size]. It depends on the control's contents, like text, textures, or style boxes. The actual minimum size is the maximum value of this property and the internal minimum size (see [method get_combined_minimum_size]). </member> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode" default="0"> The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard, gamepad, and mouse signals. </member> <member name="focus_neighbor_bottom" type="NodePath" setter="set_focus_neighbor" getter="get_focus_neighbor" default="NodePath(&quot;&quot;)" keywords="focus_neighbour_bottom"> Tells Godot which node it should give focus to if the user presses the down arrow on the keyboard or down on a gamepad by default. You can change the key by editing the [member ProjectSettings.input/ui_down] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one. </member> <member name="focus_neighbor_left" type="NodePath" setter="set_focus_neighbor" getter="get_focus_neighbor" default="NodePath(&quot;&quot;)" keywords="focus_neighbour_left"> Tells Godot which node it should give focus to if the user presses the left arrow on the keyboard or left on a gamepad by default. You can change the key by editing the [member ProjectSettings.input/ui_left] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the left of this one. </member> <member name="focus_neighbor_right" type="NodePath" setter="set_focus_neighbor" getter="get_focus_neighbor" default="NodePath(&quot;&quot;)" keywords="focus_neighbour_right"> Tells Godot which node it should give focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the [member ProjectSettings.input/ui_right] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the right of this one. </member> <member name="focus_neighbor_top" type="NodePath" setter="set_focus_neighbor" getter="get_focus_neighbor" default="NodePath(&quot;&quot;)" keywords="focus_neighbour_top"> Tells Godot which node it should give focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the [member ProjectSettings.input/ui_up] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the top of this one. </member> <member name="focus_next" type="NodePath" setter="set_focus_next" getter="get_focus_next" default="NodePath(&quot;&quot;)"> Tells Godot which node it should give focus to if the user presses [kbd]Tab[/kbd] on a keyboard by default. You can change the key by editing the [member ProjectSettings.input/ui_focus_next] input action. If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree. </member> <member name="focus_previous" type="NodePath" setter="set_focus_previous" getter="get_focus_previous" default="NodePath(&quot;&quot;)"> Tells Godot which node it should give focus to if the user presses [kbd]Shift + Tab[/kbd] on a keyboard by default. You can change the key by editing the [member ProjectSettings.input/ui_focus_prev] input action. If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree. </member> <member name="global_position" type="Vector2" setter="_set_global_position" getter="get_global_position"> The node's global position, relative to the world (usually to the [CanvasLayer]). </member> <member name="grow_horizontal" type="int" setter="set_h_grow_direction" getter="get_h_grow_direction" enum="Control.GrowDirection" default="1"> Controls the direction on the horizontal axis in which the control should grow if its horizontal minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size. </member> <member name="grow_vertical" type="int" setter="set_v_grow_direction" getter="get_v_grow_direction" enum="Control.GrowDirection" default="1"> Controls the direction on the vertical axis in which the control should grow if its vertical minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size. </member> <member name="layout_direction" type="int" setter="set_layout_direction" getter="get_layout_direction" enum="Control.LayoutDirection" default="0"> Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew). </member> <member name="localize_numeral_system" type="bool" setter="set_localize_numeral_system" getter="is_localizing_numeral_system" default="true"> If [code]true[/code], automatically converts code line numbers, list indices, [SpinBox] and [ProgressBar] values from the Western Arabic (0..9) to the numeral systems used in current locale. [b]Note:[/b] Numbers within the text are not automatically converted, it can be done manually, using [method TextServer.format_number]. </member>
124060
<member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" enum="Control.CursorShape" default="0"> The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors. [b]Note:[/b] On Linux, shapes may vary depending on the cursor theme of the system. </member> <member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" enum="Control.MouseFilter" default="0"> Controls whether the control will be able to receive mouse button input events through [method _gui_input] and how these events should be handled. Also controls whether the control can receive the [signal mouse_entered], and [signal mouse_exited] signals. See the constants to learn what each does. </member> <member name="mouse_force_pass_scroll_events" type="bool" setter="set_force_pass_scroll_events" getter="is_force_pass_scroll_events" default="true"> When enabled, scroll wheel events processed by [method _gui_input] will be passed to the parent control even if [member mouse_filter] is set to [constant MOUSE_FILTER_STOP]. As it defaults to true, this allows nested scrollable containers to work out of the box. You should disable it on the root of your UI if you do not want scroll events to go to the [method Node._unhandled_input] processing. </member> <member name="offset_bottom" type="float" setter="set_offset" getter="get_offset" default="0.0"> Distance between the node's bottom edge and its parent control, based on [member anchor_bottom]. Offsets are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Offsets update automatically when you move or resize the node. </member> <member name="offset_left" type="float" setter="set_offset" getter="get_offset" default="0.0"> Distance between the node's left edge and its parent control, based on [member anchor_left]. Offsets are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Offsets update automatically when you move or resize the node. </member> <member name="offset_right" type="float" setter="set_offset" getter="get_offset" default="0.0"> Distance between the node's right edge and its parent control, based on [member anchor_right]. Offsets are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Offsets update automatically when you move or resize the node. </member> <member name="offset_top" type="float" setter="set_offset" getter="get_offset" default="0.0"> Distance between the node's top edge and its parent control, based on [member anchor_top]. Offsets are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Offsets update automatically when you move or resize the node. </member> <member name="physics_interpolation_mode" type="int" setter="set_physics_interpolation_mode" getter="get_physics_interpolation_mode" overrides="Node" enum="Node.PhysicsInterpolationMode" default="2" /> <member name="pivot_offset" type="Vector2" setter="set_pivot_offset" getter="get_pivot_offset" default="Vector2(0, 0)"> By default, the node's pivot is its top-left corner. When you change its [member rotation] or [member scale], it will rotate or scale around this pivot. Set this property to [member size] / 2 to pivot around the Control's center. </member> <member name="position" type="Vector2" setter="_set_position" getter="get_position" default="Vector2(0, 0)"> The node's position, relative to its containing node. It corresponds to the rectangle's top-left corner. The property is not affected by [member pivot_offset]. </member> <member name="rotation" type="float" setter="set_rotation" getter="get_rotation" default="0.0"> The node's rotation around its pivot, in radians. See [member pivot_offset] to change the pivot's position. [b]Note:[/b] This property is edited in the inspector in degrees. If you want to use degrees in a script, use [member rotation_degrees]. </member> <member name="rotation_degrees" type="float" setter="set_rotation_degrees" getter="get_rotation_degrees"> Helper property to access [member rotation] in degrees instead of radians. </member> <member name="scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2(1, 1)"> The node's scale, relative to its [member size]. Change this property to scale the node around its [member pivot_offset]. The Control's [member tooltip_text] will also scale according to this value. [b]Note:[/b] This property is mainly intended to be used for animation purposes. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually. [b]Note:[/b] [member FontFile.oversampling] does [i]not[/i] take [Control] [member scale] into account. This means that scaling up/down will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated. To ensure text remains crisp regardless of scale, you can enable MSDF font rendering by enabling [member ProjectSettings.gui/theme/default_font_multichannel_signed_distance_field] (applies to the default project font only), or enabling [b]Multichannel Signed Distance Field[/b] in the import options of a DynamicFont for custom fonts. On system fonts, [member SystemFont.multichannel_signed_distance_field] can be enabled in the inspector. [b]Note:[/b] If the Control node is a child of a [Container] node, the scale will be reset to [code]Vector2(1, 1)[/code] when the scene is instantiated. To set the Control's scale when it's instantiated, wait for one frame using [code]await get_tree().process_frame[/code] then set its [member scale] property. </member> <member name="shortcut_context" type="Node" setter="set_shortcut_context" getter="get_shortcut_context"> The [Node] which must be a parent of the focused [Control] for the shortcut to be activated. If [code]null[/code], the shortcut can be activated when any control is focused (a global shortcut). This allows shortcuts to be accepted only when the user has a certain area of the GUI focused. </member> <member name="size" type="Vector2" setter="_set_size" getter="get_size" default="Vector2(0, 0)"> The size of the node's bounding rectangle, in the node's coordinate system. [Container] nodes update this property automatically. </member> <member name="size_flags_horizontal" type="int" setter="set_h_size_flags" getter="get_h_size_flags" enum="Control.SizeFlags" is_bitfield="true" default="1"> Tells the parent [Container] nodes how they should resize and place the node on the X axis. Use a combination of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does. </member> <member name="size_flags_stretch_ratio" type="float" setter="set_stretch_ratio" getter="get_stretch_ratio" default="1.0"> If the node and at least one of its neighbors uses the [constant SIZE_EXPAND] size flag, the parent [Container] will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbor a ratio of 1, this node will take two thirds of the available space. </member> <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" enum="Control.SizeFlags" is_bitfield="true" default="1"> Tells the parent [Container] nodes how they should resize and place the node on the Y axis. Use a combination of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does. </member>
124062
<constants> <constant name="FOCUS_NONE" value="0" enum="FocusMode"> The node cannot grab focus. Use with [member focus_mode]. </constant> <constant name="FOCUS_CLICK" value="1" enum="FocusMode"> The node can only grab focus on mouse clicks. Use with [member focus_mode]. </constant> <constant name="FOCUS_ALL" value="2" enum="FocusMode"> The node can grab focus on mouse click, using the arrows and the Tab keys on the keyboard, or using the D-pad buttons on a gamepad. Use with [member focus_mode]. </constant> <constant name="NOTIFICATION_RESIZED" value="40"> Sent when the node changes size. Use [member size] to get the new size. </constant> <constant name="NOTIFICATION_MOUSE_ENTER" value="41"> Sent when the mouse cursor enters the control's (or any child control's) visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not. [b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control receives the notification. See also [constant NOTIFICATION_MOUSE_ENTER_SELF]. </constant> <constant name="NOTIFICATION_MOUSE_EXIT" value="42"> Sent when the mouse cursor leaves the control's (and all child control's) visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not. [b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control receives the notification. See also [constant NOTIFICATION_MOUSE_EXIT_SELF]. </constant> <constant name="NOTIFICATION_MOUSE_ENTER_SELF" value="60" experimental="The reason this notification is sent may change in the future."> Sent when the mouse cursor enters the control's visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not. [b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control receives the notification. See also [constant NOTIFICATION_MOUSE_ENTER]. </constant> <constant name="NOTIFICATION_MOUSE_EXIT_SELF" value="61" experimental="The reason this notification is sent may change in the future."> Sent when the mouse cursor leaves the control's visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not. [b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control receives the notification. See also [constant NOTIFICATION_MOUSE_EXIT]. </constant> <constant name="NOTIFICATION_FOCUS_ENTER" value="43"> Sent when the node grabs focus. </constant> <constant name="NOTIFICATION_FOCUS_EXIT" value="44"> Sent when the node loses focus. </constant> <constant name="NOTIFICATION_THEME_CHANGED" value="45"> Sent when the node needs to refresh its theme items. This happens in one of the following cases: - The [member theme] property is changed on this node or any of its ancestors. - The [member theme_type_variation] property is changed on this node. - One of the node's theme property overrides is changed. - The node enters the scene tree. [b]Note:[/b] As an optimization, this notification won't be sent from changes that occur while this node is outside of the scene tree. Instead, all of the theme item updates can be applied at once when the node enters the scene tree. [b]Note:[/b] This notification is received alongside [constant Node.NOTIFICATION_ENTER_TREE], so if you are instantiating a scene, the child nodes will not be initialized yet. You can use it to setup theming for this node, child nodes created from script, or if you want to access child nodes added in the editor, make sure the node is ready using [method Node.is_node_ready]. [codeblock] func _notification(what): if what == NOTIFICATION_THEME_CHANGED: if not is_node_ready(): await ready # Wait until ready signal. $Label.add_theme_color_override("font_color", Color.YELLOW) [/codeblock] </constant> <constant name="NOTIFICATION_SCROLL_BEGIN" value="47"> Sent when this node is inside a [ScrollContainer] which has begun being scrolled when dragging the scrollable area [i]with a touch event[/i]. This notification is [i]not[/i] sent when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events. [b]Note:[/b] This signal is only emitted on Android or iOS, or on desktop/web platforms when [member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse] is enabled. </constant> <constant name="NOTIFICATION_SCROLL_END" value="48"> Sent when this node is inside a [ScrollContainer] which has stopped being scrolled when dragging the scrollable area [i]with a touch event[/i]. This notification is [i]not[/i] sent when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events. [b]Note:[/b] This signal is only emitted on Android or iOS, or on desktop/web platforms when [member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse] is enabled. </constant> <constant name="NOTIFICATION_LAYOUT_DIRECTION_CHANGED" value="49"> Sent when control layout direction is changed. </constant> <constant name="CURSOR_ARROW" value="0" enum="CursorShape"> Show the system's arrow mouse cursor when the user hovers the node. Use with [member mouse_default_cursor_shape]. </constant> <constant name="CURSOR_IBEAM" value="1" enum="CursorShape"> Show the system's I-beam mouse cursor when the user hovers the node. The I-beam pointer has a shape similar to "I". It tells the user they can highlight or insert text. </constant> <constant name="CURSOR_POINTING_HAND" value="2" enum="CursorShape"> Show the system's pointing hand mouse cursor when the user hovers the node. </constant> <constant name="CURSOR_CROSS" value="3" enum="CursorShape"> Show the system's cross mouse cursor when the user hovers the node. </constant> <constant name="CURSOR_WAIT" value="4" enum="CursorShape"> Show the system's wait mouse cursor when the user hovers the node. Often an hourglass. </constant> <constant name="CURSOR_BUSY" value="5" enum="CursorShape"> Show the system's busy mouse cursor when the user hovers the node. Often an arrow with a small hourglass. </constant> <constant name="CURSOR_DRAG" value="6" enum="CursorShape"> Show the system's drag mouse cursor, often a closed fist or a cross symbol, when the user hovers the node. It tells the user they're currently dragging an item, like a node in the Scene dock. </constant> <constant name="CURSOR_CAN_DROP" value="7" enum="CursorShape"> Show the system's drop mouse cursor when the user hovers the node. It can be an open hand. It tells the user they can drop an item they're currently grabbing, like a node in the Scene dock. </constant> <constant name="CURSOR_FORBIDDEN" value="8" enum="CursorShape"> Show the system's forbidden mouse cursor when the user hovers the node. Often a crossed circle. </constant> <constant name="CURSOR_VSIZE" value="9" enum="CursorShape"> Show the system's vertical resize mouse cursor when the user hovers the node. A double-headed vertical arrow. It tells the user they can resize the window or the panel vertically. </constant> <constant name="CURSOR_HSIZE" value="10" enum="CursorShape"> Show the system's horizontal resize mouse cursor when the user hovers the node. A double-headed horizontal arrow. It tells the user they can resize the window or the panel horizontally. </constant>
124063
<constant name="CURSOR_BDIAGSIZE" value="11" enum="CursorShape"> Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double-headed arrow that goes from the bottom left to the top right. It tells the user they can resize the window or the panel both horizontally and vertically. </constant> <constant name="CURSOR_FDIAGSIZE" value="12" enum="CursorShape"> Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double-headed arrow that goes from the top left to the bottom right, the opposite of [constant CURSOR_BDIAGSIZE]. It tells the user they can resize the window or the panel both horizontally and vertically. </constant> <constant name="CURSOR_MOVE" value="13" enum="CursorShape"> Show the system's move mouse cursor when the user hovers the node. It shows 2 double-headed arrows at a 90 degree angle. It tells the user they can move a UI element freely. </constant> <constant name="CURSOR_VSPLIT" value="14" enum="CursorShape"> Show the system's vertical split mouse cursor when the user hovers the node. On Windows, it's the same as [constant CURSOR_VSIZE]. </constant> <constant name="CURSOR_HSPLIT" value="15" enum="CursorShape"> Show the system's horizontal split mouse cursor when the user hovers the node. On Windows, it's the same as [constant CURSOR_HSIZE]. </constant> <constant name="CURSOR_HELP" value="16" enum="CursorShape"> Show the system's help mouse cursor when the user hovers the node, a question mark. </constant> <constant name="PRESET_TOP_LEFT" value="0" enum="LayoutPreset"> Snap all 4 anchors to the top-left of the parent control's bounds. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_TOP_RIGHT" value="1" enum="LayoutPreset"> Snap all 4 anchors to the top-right of the parent control's bounds. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_BOTTOM_LEFT" value="2" enum="LayoutPreset"> Snap all 4 anchors to the bottom-left of the parent control's bounds. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_BOTTOM_RIGHT" value="3" enum="LayoutPreset"> Snap all 4 anchors to the bottom-right of the parent control's bounds. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_CENTER_LEFT" value="4" enum="LayoutPreset"> Snap all 4 anchors to the center of the left edge of the parent control's bounds. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_CENTER_TOP" value="5" enum="LayoutPreset"> Snap all 4 anchors to the center of the top edge of the parent control's bounds. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_CENTER_RIGHT" value="6" enum="LayoutPreset"> Snap all 4 anchors to the center of the right edge of the parent control's bounds. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_CENTER_BOTTOM" value="7" enum="LayoutPreset"> Snap all 4 anchors to the center of the bottom edge of the parent control's bounds. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_CENTER" value="8" enum="LayoutPreset"> Snap all 4 anchors to the center of the parent control's bounds. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_LEFT_WIDE" value="9" enum="LayoutPreset"> Snap all 4 anchors to the left edge of the parent control. The left offset becomes relative to the left edge and the top offset relative to the top left corner of the node's parent. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_TOP_WIDE" value="10" enum="LayoutPreset"> Snap all 4 anchors to the top edge of the parent control. The left offset becomes relative to the top left corner, the top offset relative to the top edge, and the right offset relative to the top right corner of the node's parent. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_RIGHT_WIDE" value="11" enum="LayoutPreset"> Snap all 4 anchors to the right edge of the parent control. The right offset becomes relative to the right edge and the top offset relative to the top right corner of the node's parent. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_BOTTOM_WIDE" value="12" enum="LayoutPreset"> Snap all 4 anchors to the bottom edge of the parent control. The left offset becomes relative to the bottom left corner, the bottom offset relative to the bottom edge, and the right offset relative to the bottom right corner of the node's parent. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_VCENTER_WIDE" value="13" enum="LayoutPreset"> Snap all 4 anchors to a vertical line that cuts the parent control in half. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_HCENTER_WIDE" value="14" enum="LayoutPreset"> Snap all 4 anchors to a horizontal line that cuts the parent control in half. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_FULL_RECT" value="15" enum="LayoutPreset"> Snap all 4 anchors to the respective corners of the parent control. Set all 4 offsets to 0 after you applied this preset and the [Control] will fit its parent control. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_MODE_MINSIZE" value="0" enum="LayoutPresetMode"> The control will be resized to its minimum size. </constant> <constant name="PRESET_MODE_KEEP_WIDTH" value="1" enum="LayoutPresetMode"> The control's width will not change. </constant> <constant name="PRESET_MODE_KEEP_HEIGHT" value="2" enum="LayoutPresetMode"> The control's height will not change. </constant> <constant name="PRESET_MODE_KEEP_SIZE" value="3" enum="LayoutPresetMode"> The control's size will not change. </constant> <constant name="SIZE_SHRINK_BEGIN" value="0" enum="SizeFlags" is_bitfield="true"> Tells the parent [Container] to align the node with its start, either the top or the left edge. It is mutually exclusive with [constant SIZE_FILL] and other shrink size flags, but can be used with [constant SIZE_EXPAND] in some containers. Use with [member size_flags_horizontal] and [member size_flags_vertical]. [b]Note:[/b] Setting this flag is equal to not having any size flags. </constant> <constant name="SIZE_FILL" value="1" enum="SizeFlags" is_bitfield="true"> Tells the parent [Container] to expand the bounds of this node to fill all the available space without pushing any other node. It is mutually exclusive with shrink size flags. Use with [member size_flags_horizontal] and [member size_flags_vertical]. </constant> <constant name="SIZE_EXPAND" value="2" enum="SizeFlags" is_bitfield="true"> Tells the parent [Container] to let this node take all the available space on the axis you flag. If multiple neighboring nodes are set to expand, they'll share the space based on their stretch ratio. See [member size_flags_stretch_ratio]. Use with [member size_flags_horizontal] and [member size_flags_vertical]. </constant> <constant name="SIZE_EXPAND_FILL" value="3" enum="SizeFlags" is_bitfield="true"> Sets the node's size flags to both fill and expand. See [constant SIZE_FILL] and [constant SIZE_EXPAND] for more information. </constant>
124064
<constant name="SIZE_SHRINK_CENTER" value="4" enum="SizeFlags" is_bitfield="true"> Tells the parent [Container] to center the node in the available space. It is mutually exclusive with [constant SIZE_FILL] and other shrink size flags, but can be used with [constant SIZE_EXPAND] in some containers. Use with [member size_flags_horizontal] and [member size_flags_vertical]. </constant> <constant name="SIZE_SHRINK_END" value="8" enum="SizeFlags" is_bitfield="true"> Tells the parent [Container] to align the node with its end, either the bottom or the right edge. It is mutually exclusive with [constant SIZE_FILL] and other shrink size flags, but can be used with [constant SIZE_EXPAND] in some containers. Use with [member size_flags_horizontal] and [member size_flags_vertical]. </constant> <constant name="MOUSE_FILTER_STOP" value="0" enum="MouseFilter"> The control will receive mouse movement input events and mouse button input events if clicked on through [method _gui_input]. The control will also receive the [signal mouse_entered] and [signal mouse_exited] signals. These events are automatically marked as handled, and they will not propagate further to other controls. This also results in blocking signals in other controls. </constant> <constant name="MOUSE_FILTER_PASS" value="1" enum="MouseFilter"> The control will receive mouse movement input events and mouse button input events if clicked on through [method _gui_input]. The control will also receive the [signal mouse_entered] and [signal mouse_exited] signals. If this control does not handle the event, the event will propagate up to its parent control if it has one. The event is bubbled up the node hierarchy until it reaches a non-[CanvasItem], a control with [constant MOUSE_FILTER_STOP], or a [CanvasItem] with [member CanvasItem.top_level] enabled. This will allow signals to fire in all controls it reaches. If no control handled it, the event will be passed to [method Node._shortcut_input] for further processing. </constant> <constant name="MOUSE_FILTER_IGNORE" value="2" enum="MouseFilter"> The control will not receive any mouse movement input events nor mouse button input events through [method _gui_input]. The control will also not receive the [signal mouse_entered] nor [signal mouse_exited] signals. This will not block other controls from receiving these events or firing the signals. Ignored events will not be handled automatically. If a child has [constant MOUSE_FILTER_PASS] and an event was passed to this control, the event will further propagate up to the control's parent. [b]Note:[/b] If the control has received [signal mouse_entered] but not [signal mouse_exited], changing the [member mouse_filter] to [constant MOUSE_FILTER_IGNORE] will cause [signal mouse_exited] to be emitted. </constant> <constant name="GROW_DIRECTION_BEGIN" value="0" enum="GrowDirection"> The control will grow to the left or top to make up if its minimum size is changed to be greater than its current size on the respective axis. </constant> <constant name="GROW_DIRECTION_END" value="1" enum="GrowDirection"> The control will grow to the right or bottom to make up if its minimum size is changed to be greater than its current size on the respective axis. </constant> <constant name="GROW_DIRECTION_BOTH" value="2" enum="GrowDirection"> The control will grow in both directions equally to make up if its minimum size is changed to be greater than its current size. </constant> <constant name="ANCHOR_BEGIN" value="0" enum="Anchor"> Snaps one of the 4 anchor's sides to the origin of the node's [code]Rect[/code], in the top left. Use it with one of the [code]anchor_*[/code] member variables, like [member anchor_left]. To change all 4 anchors at once, use [method set_anchors_preset]. </constant> <constant name="ANCHOR_END" value="1" enum="Anchor"> Snaps one of the 4 anchor's sides to the end of the node's [code]Rect[/code], in the bottom right. Use it with one of the [code]anchor_*[/code] member variables, like [member anchor_left]. To change all 4 anchors at once, use [method set_anchors_preset]. </constant> <constant name="LAYOUT_DIRECTION_INHERITED" value="0" enum="LayoutDirection"> Automatic layout direction, determined from the parent control layout direction. </constant> <constant name="LAYOUT_DIRECTION_APPLICATION_LOCALE" value="1" enum="LayoutDirection"> Automatic layout direction, determined from the current locale. </constant> <constant name="LAYOUT_DIRECTION_LTR" value="2" enum="LayoutDirection"> Left-to-right layout direction. </constant> <constant name="LAYOUT_DIRECTION_RTL" value="3" enum="LayoutDirection"> Right-to-left layout direction. </constant> <constant name="LAYOUT_DIRECTION_SYSTEM_LOCALE" value="4" enum="LayoutDirection"> Automatic layout direction, determined from the system locale. </constant> <constant name="LAYOUT_DIRECTION_MAX" value="5" enum="LayoutDirection"> Represents the size of the [enum LayoutDirection] enum. </constant> <constant name="LAYOUT_DIRECTION_LOCALE" value="1" enum="LayoutDirection" deprecated="Use [constant LAYOUT_DIRECTION_APPLICATION_LOCALE] instead."> </constant> <constant name="TEXT_DIRECTION_INHERITED" value="3" enum="TextDirection"> Text writing direction is the same as layout direction. </constant> <constant name="TEXT_DIRECTION_AUTO" value="0" enum="TextDirection"> Automatic text writing direction, determined from the current locale and text content. </constant> <constant name="TEXT_DIRECTION_LTR" value="1" enum="TextDirection"> Left-to-right text writing direction. </constant> <constant name="TEXT_DIRECTION_RTL" value="2" enum="TextDirection"> Right-to-left text writing direction. </constant> </constants> </class>
124084
ethod name="is_inf"> <return type="bool" /> <param index="0" name="x" type="float" /> <description> Returns [code]true[/code] if [param x] is either positive infinity or negative infinity. </description> </method> <method name="is_instance_id_valid"> <return type="bool" /> <param index="0" name="id" type="int" /> <description> Returns [code]true[/code] if the Object that corresponds to [param id] is a valid object (e.g. has not been deleted from memory). All Objects have a unique instance ID. </description> </method> <method name="is_instance_valid"> <return type="bool" /> <param index="0" name="instance" type="Variant" /> <description> Returns [code]true[/code] if [param instance] is a valid Object (e.g. has not been deleted from memory). </description> </method> <method name="is_nan"> <return type="bool" /> <param index="0" name="x" type="float" /> <description> Returns [code]true[/code] if [param x] is a NaN ("Not a Number" or invalid) value. </description> </method> <method name="is_same"> <return type="bool" /> <param index="0" name="a" type="Variant" /> <param index="1" name="b" type="Variant" /> <description> Returns [code]true[/code], for value types, if [param a] and [param b] share the same value. Returns [code]true[/code], for reference types, if the references of [param a] and [param b] are the same. [codeblock] # Vector2 is a value type var vec2_a = Vector2(0, 0) var vec2_b = Vector2(0, 0) var vec2_c = Vector2(1, 1) is_same(vec2_a, vec2_a) # true is_same(vec2_a, vec2_b) # true is_same(vec2_a, vec2_c) # false # Array is a reference type var arr_a = [] var arr_b = [] is_same(arr_a, arr_a) # true is_same(arr_a, arr_b) # false [/codeblock] These are [Variant] value types: [code]null[/code], [bool], [int], [float], [String], [StringName], [Vector2], [Vector2i], [Vector3], [Vector3i], [Vector4], [Vector4i], [Rect2], [Rect2i], [Transform2D], [Transform3D], [Plane], [Quaternion], [AABB], [Basis], [Projection], [Color], [NodePath], [RID], [Callable] and [Signal]. These are [Variant] reference types: [Object], [Dictionary], [Array], [PackedByteArray], [PackedInt32Array], [PackedInt64Array], [PackedFloat32Array], [PackedFloat64Array], [PackedStringArray], [PackedVector2Array], [PackedVector3Array], [PackedVector4Array], and [PackedColorArray]. </description> </method> <method name="is_zero_approx"> <return type="bool" /> <param index="0" name="x" type="float" /> <description> Returns [code]true[/code] if [param x] is zero or almost zero. The comparison is done using a tolerance calculation with a small internal epsilon. This function is faster than using [method is_equal_approx] with one value as zero. </description> </method> <method name="lerp" keywords="interpolate"> <return type="Variant" /> <param index="0" name="from" type="Variant" /> <param index="1" name="to" type="Variant" /> <param index="2" name="weight" type="Variant" /> <description> Linearly interpolates between two values by the factor defined in [param weight]. To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method clampf] to limit [param weight]. Both [param from] and [param to] must be the same type. Supported types: [int], [float], [Vector2], [Vector3], [Vector4], [Color], [Quaternion], [Basis], [Transform2D], [Transform3D]. [codeblock] lerp(0, 4, 0.75) # Returns 3.0 [/codeblock] See also [method inverse_lerp] which performs the reverse of this operation. To perform eased interpolation with [method lerp], combine it with [method ease] or [method smoothstep]. See also [method remap] to map a continuous series of values to another. [b]Note:[/b] For better type safety, use [method lerpf], [method Vector2.lerp], [method Vector3.lerp], [method Vector4.lerp], [method Color.lerp], [method Quaternion.slerp], [method Basis.slerp], [method Transform2D.interpolate_with], or [method Transform3D.interpolate_with]. </description> </method> <method name="lerp_angle" keywords="interpolate"> <return type="float" /> <param index="0" name="from" type="float" /> <param index="1" name="to" type="float" /> <param index="2" name="weight" type="float" /> <description> Linearly interpolates between two angles (in radians) by a [param weight] value between 0.0 and 1.0. Similar to [method lerp], but interpolates correctly when the angles wrap around [constant @GDScript.TAU]. To perform eased interpolation with [method lerp_angle], combine it with [method ease] or [method smoothstep]. [codeblock] extends Sprite var elapsed = 0.0 func _process(delta): var min_angle = deg_to_rad(0.0) var max_angle = deg_to_rad(90.0) rotation = lerp_angle(min_angle, max_angle, elapsed) elapsed += delta [/codeblock] [b]Note:[/b] This function lerps through the shortest path between [param from] and [param to]. However, when these two angles are approximately [code]PI + k * TAU[/code] apart for any integer [code]k[/code], it's not obvious which way they lerp due to floating-point precision errors. For example, [code]lerp_angle(0, PI, weight)[/code] lerps counter-clockwise, while [code]lerp_angle(0, PI + 5 * TAU, weight)[/code] lerps clockwise. </description> </method> <method name="lerpf"> <return type="float" /> <param index="0" name="from" type="float" /> <param index="1" name="to" type="float" /> <param index="2" name="weight" type="float" /> <description> Linearly interpolates between two values by the factor defined in [param weight]. To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method clampf] on the result of this function. [codeblock] lerpf(0, 4, 0.75) # Returns 3.0 [/codeblock] See also [method inverse_lerp] which performs the reverse of this operation. To perform eased interpolation with [method lerp], combine it with [method ease] or [method smoothstep]. </description> </method> <m
124101
me="PROPERTY_HINT_TYPE_STRING" value="23" enum="PropertyHint"> If a property is [String], hints that the property represents a particular type (class). This allows to select a type from the create dialog. The property will store the selected type as a string. If a property is [Array], hints the editor how to show elements. The [code]hint_string[/code] must encode nested types using [code]":"[/code] and [code]"/"[/code]. [codeblocks] [gdscript] # Array of elem_type. hint_string = "%d:" % [elem_type] hint_string = "%d/%d:%s" % [elem_type, elem_hint, elem_hint_string] # Two-dimensional array of elem_type (array of arrays of elem_type). hint_string = "%d:%d:" % [TYPE_ARRAY, elem_type] hint_string = "%d:%d/%d:%s" % [TYPE_ARRAY, elem_type, elem_hint, elem_hint_string] # Three-dimensional array of elem_type (array of arrays of arrays of elem_type). hint_string = "%d:%d:%d:" % [TYPE_ARRAY, TYPE_ARRAY, elem_type] hint_string = "%d:%d:%d/%d:%s" % [TYPE_ARRAY, TYPE_ARRAY, elem_type, elem_hint, elem_hint_string] [/gdscript] [csharp] // Array of elemType. hintString = $"{elemType:D}:"; hintString = $"{elemType:}/{elemHint:D}:{elemHintString}"; // Two-dimensional array of elemType (array of arrays of elemType). hintString = $"{Variant.Type.Array:D}:{elemType:D}:"; hintString = $"{Variant.Type.Array:D}:{elemType:D}/{elemHint:D}:{elemHintString}"; // Three-dimensional array of elemType (array of arrays of arrays of elemType). hintString = $"{Variant.Type.Array:D}:{Variant.Type.Array:D}:{elemType:D}:"; hintString = $"{Variant.Type.Array:D}:{Variant.Type.Array:D}:{elemType:D}/{elemHint:D}:{elemHintString}"; [/csharp] [/codeblocks] [b]Examples:[/b] [codeblocks] [gdscript] hint_string = "%d:" % [TYPE_INT] # Array of integers. hint_string = "%d/%d:1,10,1" % [TYPE_INT, PROPERTY_HINT_RANGE] # Array of integers (in range from 1 to 10). hint_string = "%d/%d:Zero,One,Two" % [TYPE_INT, PROPERTY_HINT_ENUM] # Array of integers (an enum). hint_string = "%d/%d:Zero,One,Three:3,Six:6" % [TYPE_INT, PROPERTY_HINT_ENUM] # Array of integers (an enum). hint_string = "%d/%d:*.png" % [TYPE_STRING, PROPERTY_HINT_FILE] # Array of strings (file paths). hint_string = "%d/%d:Texture2D" % [TYPE_OBJECT, PROPERTY_HINT_RESOURCE_TYPE] # Array of textures. hint_string = "%d:%d:" % [TYPE_ARRAY, TYPE_FLOAT] # Two-dimensional array of floats. hint_string = "%d:%d/%d:" % [TYPE_ARRAY, TYPE_STRING, PROPERTY_HINT_MULTILINE_TEXT] # Two-dimensional array of multiline strings. hint_string = "%d:%d/%d:-1,1,0.1" % [TYPE_ARRAY, TYPE_FLOAT, PROPERTY_HINT_RANGE] # Two-dimensional array of floats (in range from -1 to 1). hint_string = "%d:%d/%d:Texture2D" % [TYPE_ARRAY, TYPE_OBJECT, PROPERTY_HINT_RESOURCE_TYPE] # Two-dimensional array of textures. [/gdscript] [csharp] hintString = $"{Variant.Type.Int:D}/{PropertyHint.Range:D}:1,10,1"; // Array of integers (in range from 1 to 10). hintString = $"{Variant.Type.Int:D}/{PropertyHint.Enum:D}:Zero,One,Two"; // Array of integers (an enum). hintString = $"{Variant.Type.Int:D}/{PropertyHint.Enum:D}:Zero,One,Three:3,Six:6"; // Array of integers (an enum). hintString = $"{Variant.Type.String:D}/{PropertyHint.File:D}:*.png"; // Array of strings (file paths). hintString = $"{Variant.Type.Object:D}/{PropertyHint.ResourceType:D}:Texture2D"; // Array of textures. hintString = $"{Variant.Type.Array:D}:{Variant.Type.Float:D}:"; // Two-dimensional array of floats. hintString = $"{Variant.Type.Array:D}:{Variant.Type.String:D}/{PropertyHint.MultilineText:D}:"; // Two-dimensional array of multiline strings. hintString = $"{Variant.Type.Array:D}:{Variant.Type.Float:D}/{PropertyHint.Range:D}:-1,1,0.1"; // Two-dimensional array of floats (in range from -1 to 1). hintString = $"{Variant.Type.Array:D}:{Variant.Type.Object:D}/{PropertyHint.ResourceType:D}:Texture2D"; // Two-dimensional array of textures. [/csharp] [/codeblocks] [b]Note:[/b] The trailing colon is required for properly detecting built-in types. </constant> <constant name="PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE" value="24" enum="PropertyHint" deprecated="This hint is not used by the engine."> </constant> <constant name="PROPERTY_HINT_OBJECT_TOO_BIG" value="25" enum="PropertyHint"> Hints that an object is too big to be sent via the debugger. </constant> <constant name="PROPERTY_HINT_NODE_PATH_VALID_TYPES" value="26" enum="PropertyHint"> Hints that the hint string specifies valid node types for property of type [NodePath]. </constant> <constant name="PROPERTY_HINT_SAVE_FILE" value="27" enum="PropertyHint"> Hints that a [String] property is a path to a file. Editing it will show a file dialog for picking the path for the file to be saved at. The dialog has access to the project's directory. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. See also [member FileDialog.filters]. </constant> <constant name="PROPERTY_HINT_GLOBAL_SAVE_FILE" value="28" enum="PropertyHint"> Hints that a [String] property is a path to a file. Editing it will show a file dialog for picking the path for the file to be saved at. The dialog has access to the entire filesystem. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. See also [member FileDialog.filters]. </constant> <constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="29" enum="PropertyHint" deprecated="This hint is not used by the engine."> </constant> <constant name="PROPERTY_HINT_INT_IS_POINTER" value="30" enum="PropertyHint"> Hints that an [int] property is a pointer. Used by GDExtension. </constant> <constant name="PROPERTY_HINT_ARRAY_TYPE" value="31" enum="PropertyHint"> Hints that a property is an [Array] with the stored type specified in the hint string. </constant> <constant name="PROPERTY_HINT_DICTIONARY_TYPE" value="38" enum="PropertyHint"> Hints that a property is a [Dictionary] with the stored types specified in the hint string. </constant> <constant name="PROPERTY_HINT_LOCALE_ID" value="32" enum="PropertyHint"> Hints that a string property is a locale code. Editing it will show a locale dialog for picking language and country. </constant> <constant name="PROPERTY_HINT_LOCALIZABLE_STRING" value="33" enum="PropertyHint"> Hints that a dictionary property is string translation map. Dictionary keys are locale codes and, values are translated strings. </constant> <constant name="PROPERTY_HINT_NODE_TYPE" value="34" enum="PropertyHint"> Hints that a property is an instance of a [Node]-derived type, optionally specified via the hint string (e.g. [code]"Node2D"[/code]). Editing it will show a dialog for picking a node from the scene. </constant> <constant name="PROPERTY_HINT_HIDE_QUATERNION_EDIT" value="35" enum="PropertyHint"> Hints that a quaternion property should disable the temporary euler editor. </constant> <constant name="PROPERTY_HINT_PASSWORD" value="36" enum="PropertyHint"> Hints that a string property is a password, and every character is replaced with the secret character. </constant> <constant na
124111
<?xml version="1.0" encoding="UTF-8" ?> <class name="Label" inherits="Control" keywords="text" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A control for displaying plain text. </brief_description> <description> A control for displaying plain text. It gives you control over the horizontal and vertical alignment and can wrap the text inside the node's bounding rectangle. It doesn't support bold, italics, or other rich text formatting. For that, use [RichTextLabel] instead. </description> <tutorials> <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link> </tutorials> <methods> <method name="get_character_bounds" qualifiers="const"> <return type="Rect2" /> <param index="0" name="pos" type="int" /> <description> Returns the bounding rectangle of the character at position [param pos] in the label's local coordinate system. If the character is a non-visual character or [param pos] is outside the valid range, an empty [Rect2] is returned. If the character is a part of a composite grapheme, the bounding rectangle of the whole grapheme is returned. </description> </method> <method name="get_line_count" qualifiers="const"> <return type="int" /> <description> Returns the number of lines of text the Label has. </description> </method> <method name="get_line_height" qualifiers="const"> <return type="int" /> <param index="0" name="line" type="int" default="-1" /> <description> Returns the height of the line [param line]. If [param line] is set to [code]-1[/code], returns the biggest line height. If there are no lines, returns font size in pixels. </description> </method> <method name="get_total_character_count" qualifiers="const"> <return type="int" /> <description> Returns the total number of printable characters in the text (excluding spaces and newlines). </description> </method> <method name="get_visible_line_count" qualifiers="const"> <return type="int" /> <description> Returns the number of lines shown. Useful if the [Label]'s height cannot currently display all lines. </description> </method> </methods>
124115
<?xml version="1.0" encoding="UTF-8" ?> <class name="CharacterBody3D" inherits="PhysicsBody3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A 3D physics body specialized for characters moved by script. </brief_description> <description> [CharacterBody3D] is a specialized class for physics bodies that are meant to be user-controlled. They are not affected by physics at all, but they affect other physics bodies in their path. They are mainly used to provide high-level API to move objects with wall and slope detection ([method move_and_slide] method) in addition to the general collision detection provided by [method PhysicsBody3D.move_and_collide]. This makes it useful for highly configurable physics bodies that must move in specific ways and collide with the world, as is often the case with user-controlled characters. For game objects that don't require complex movement or collision detection, such as moving platforms, [AnimatableBody3D] is simpler to configure. </description> <tutorials> <link title="Kinematic character (2D)">$DOCS_URL/tutorials/physics/kinematic_character_2d.html</link> <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/2739</link> <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> </tutorials>
124116
<methods> <method name="apply_floor_snap"> <return type="void" /> <description> Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when [method is_on_floor] returns [code]true[/code]. </description> </method> <method name="get_floor_angle" qualifiers="const"> <return type="float" /> <param index="0" name="up_direction" type="Vector3" default="Vector3(0, 1, 0)" /> <description> Returns the floor's collision angle at the last collision point according to [param up_direction], which is [constant Vector3.UP] by default. This value is always positive and only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code]. </description> </method> <method name="get_floor_normal" qualifiers="const"> <return type="Vector3" /> <description> Returns the collision normal of the floor at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code]. [b]Warning:[/b] The collision normal is not always the same as the surface normal. </description> </method> <method name="get_last_motion" qualifiers="const"> <return type="Vector3" /> <description> Returns the last motion applied to the [CharacterBody3D] during the last call to [method move_and_slide]. The movement can be split into multiple motions when sliding occurs, and this method return the last one, which is useful to retrieve the current direction of the movement. </description> </method> <method name="get_last_slide_collision"> <return type="KinematicCollision3D" /> <description> Returns a [KinematicCollision3D], which contains information about the latest collision that occurred during the last call to [method move_and_slide]. </description> </method> <method name="get_platform_angular_velocity" qualifiers="const"> <return type="Vector3" /> <description> Returns the angular velocity of the platform at the last collision point. Only valid after calling [method move_and_slide]. </description> </method> <method name="get_platform_velocity" qualifiers="const"> <return type="Vector3" /> <description> Returns the linear velocity of the platform at the last collision point. Only valid after calling [method move_and_slide]. </description> </method> <method name="get_position_delta" qualifiers="const"> <return type="Vector3" /> <description> Returns the travel (position delta) that occurred during the last call to [method move_and_slide]. </description> </method> <method name="get_real_velocity" qualifiers="const"> <return type="Vector3" /> <description> Returns the current real velocity since the last call to [method move_and_slide]. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to [member velocity] which returns the requested velocity. </description> </method> <method name="get_slide_collision"> <return type="KinematicCollision3D" /> <param index="0" name="slide_idx" type="int" /> <description> Returns a [KinematicCollision3D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_collision_count] - 1). </description> </method> <method name="get_slide_collision_count" qualifiers="const"> <return type="int" /> <description> Returns the number of times the body collided and changed direction during the last call to [method move_and_slide]. </description> </method> <method name="get_wall_normal" qualifiers="const"> <return type="Vector3" /> <description> Returns the collision normal of the wall at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_wall] returns [code]true[/code]. [b]Warning:[/b] The collision normal is not always the same as the surface normal. </description> </method> <method name="is_on_ceiling" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the body collided with the ceiling on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "ceiling" or not. </description> </method> <method name="is_on_ceiling_only" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the body collided only with the ceiling on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "ceiling" or not. </description> </method> <method name="is_on_floor" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the body collided with the floor on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "floor" or not. </description> </method> <method name="is_on_floor_only" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the body collided only with the floor on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "floor" or not. </description> </method> <method name="is_on_wall" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the body collided with a wall on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "wall" or not. </description> </method> <method name="is_on_wall_only" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the body collided only with a wall on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "wall" or not. </description> </method> <method name="move_and_slide"> <return type="bool" /> <description> Moves the body based on [member velocity]. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [CharacterBody3D] or [RigidBody3D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. Modifies [member velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for more detailed information about collisions that occurred, use [method get_slide_collision]. When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. Returns [code]true[/code] if the body collided, otherwise, returns [code]false[/code]. </description> </method> </methods>
124117
<members> <member name="floor_block_on_wall" type="bool" setter="set_floor_block_on_wall_enabled" getter="is_floor_block_on_wall_enabled" default="true"> If [code]true[/code], the body will be able to move on the floor only. This option avoids to be able to walk on walls, it will however allow to slide down along them. </member> <member name="floor_constant_speed" type="bool" setter="set_floor_constant_speed_enabled" getter="is_floor_constant_speed_enabled" default="false"> If [code]false[/code] (by default), the body will move faster on downward slopes and slower on upward slopes. If [code]true[/code], the body will always move at the same speed on the ground no matter the slope. Note that you need to use [member floor_snap_length] to stick along a downward slope at constant speed. </member> <member name="floor_max_angle" type="float" setter="set_floor_max_angle" getter="get_floor_max_angle" default="0.785398"> Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. The default value equals 45 degrees. </member> <member name="floor_snap_length" type="float" setter="set_floor_snap_length" getter="get_floor_snap_length" default="0.1"> Sets a snapping distance. When set to a value different from [code]0.0[/code], the body is kept attached to slopes when calling [method move_and_slide]. The snapping vector is determined by the given distance along the opposite direction of the [member up_direction]. As long as the snapping vector is in contact with the ground and the body moves against [member up_direction], the body will remain attached to the surface. Snapping is not applied if the body moves along [member up_direction], meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use [method apply_floor_snap]. </member> <member name="floor_stop_on_slope" type="bool" setter="set_floor_stop_on_slope_enabled" getter="is_floor_stop_on_slope_enabled" default="true"> If [code]true[/code], the body will not slide on slopes when calling [method move_and_slide] when the body is standing still. If [code]false[/code], the body will slide on floor's slopes when [member velocity] applies a downward force. </member> <member name="max_slides" type="int" setter="set_max_slides" getter="get_max_slides" default="6"> Maximum number of times the body can change direction before it stops when calling [method move_and_slide]. </member> <member name="motion_mode" type="int" setter="set_motion_mode" getter="get_motion_mode" enum="CharacterBody3D.MotionMode" default="0"> Sets the motion mode which defines the behavior of [method move_and_slide]. See [enum MotionMode] constants for available modes. </member> <member name="platform_floor_layers" type="int" setter="set_platform_floor_layers" getter="get_platform_floor_layers" default="4294967295"> Collision layers that will be included for detecting floor bodies that will act as moving platforms to be followed by the [CharacterBody3D]. By default, all floor bodies are detected and propagate their velocity. </member> <member name="platform_on_leave" type="int" setter="set_platform_on_leave" getter="get_platform_on_leave" enum="CharacterBody3D.PlatformOnLeave" default="0"> Sets the behavior to apply when you leave a moving platform. By default, to be physically accurate, when you leave the last platform velocity is applied. See [enum PlatformOnLeave] constants for available behavior. </member> <member name="platform_wall_layers" type="int" setter="set_platform_wall_layers" getter="get_platform_wall_layers" default="0"> Collision layers that will be included for detecting wall bodies that will act as moving platforms to be followed by the [CharacterBody3D]. By default, all wall bodies are ignored. </member> <member name="safe_margin" type="float" setter="set_safe_margin" getter="get_safe_margin" default="0.001"> Extra margin used for collision recovery when calling [method move_and_slide]. If the body is at least this close to another body, it will consider them to be colliding and will be pushed away before performing the actual motion. A higher value means it's more flexible for detecting collision, which helps with consistently detecting walls and floors. A lower value forces the collision algorithm to use more exact detection, so it can be used in cases that specifically require precision, e.g at very low scale to avoid visible jittering, or for stability with a stack of character bodies. </member> <member name="slide_on_ceiling" type="bool" setter="set_slide_on_ceiling_enabled" getter="is_slide_on_ceiling_enabled" default="true"> If [code]true[/code], during a jump against the ceiling, the body will slide, if [code]false[/code] it will be stopped and will fall vertically. </member> <member name="up_direction" type="Vector3" setter="set_up_direction" getter="get_up_direction" default="Vector3(0, 1, 0)"> Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [method move_and_slide]. Defaults to [constant Vector3.UP]. As the vector will be normalized it can't be equal to [constant Vector3.ZERO], if you want all collisions to be reported as walls, consider using [constant MOTION_MODE_FLOATING] as [member motion_mode]. </member> <member name="velocity" type="Vector3" setter="set_velocity" getter="get_velocity" default="Vector3(0, 0, 0)"> Current velocity vector (typically meters per second), used and modified during calls to [method move_and_slide]. </member> <member name="wall_min_slide_angle" type="float" setter="set_wall_min_slide_angle" getter="get_wall_min_slide_angle" default="0.261799"> Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The default value equals 15 degrees. When [member motion_mode] is [constant MOTION_MODE_GROUNDED], it only affects movement if [member floor_block_on_wall] is [code]true[/code]. </member> </members> <constants> <constant name="MOTION_MODE_GROUNDED" value="0" enum="MotionMode"> Apply when notions of walls, ceiling and floor are relevant. In this mode the body motion will react to slopes (acceleration/slowdown). This mode is suitable for grounded games like platformers. </constant> <constant name="MOTION_MODE_FLOATING" value="1" enum="MotionMode"> Apply when there is no notion of floor or ceiling. All collisions will be reported as [code]on_wall[/code]. In this mode, when you slide, the speed will always be constant. This mode is suitable for games without ground like space games. </constant> <constant name="PLATFORM_ON_LEAVE_ADD_VELOCITY" value="0" enum="PlatformOnLeave"> Add the last platform velocity to the [member velocity] when you leave a moving platform. </constant> <constant name="PLATFORM_ON_LEAVE_ADD_UPWARD_VELOCITY" value="1" enum="PlatformOnLeave"> Add the last platform velocity to the [member velocity] when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. </constant> <constant name="PLATFORM_ON_LEAVE_DO_NOTHING" value="2" enum="PlatformOnLeave"> Do nothing when leaving a platform. </constant> </constants> </class>
124119
<?xml version="1.0" encoding="UTF-8" ?> <class name="Shape3D" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Abstract base class for 3D shapes used for physics collision. </brief_description> <description> Abstract base class for all 3D shapes, intended for use in physics. [b]Performance:[/b] Primitive shapes, especially [SphereShape3D], are fast to check collisions against. [ConvexPolygonShape3D] and [HeightMapShape3D] are slower, and [ConcavePolygonShape3D] is the slowest. </description> <tutorials> <link title="Physics introduction">$DOCS_URL/tutorials/physics/physics_introduction.html</link> </tutorials> <methods> <method name="get_debug_mesh"> <return type="ArrayMesh" /> <description> Returns the [ArrayMesh] used to draw the debug collision for this [Shape3D]. </description> </method> </methods> <members> <member name="custom_solver_bias" type="float" setter="set_custom_solver_bias" getter="get_custom_solver_bias" default="0.0"> The shape's custom solver bias. Defines how much bodies react to enforce contact separation when this shape is involved. When set to [code]0[/code], the default value from [member ProjectSettings.physics/3d/solver/default_contact_bias] is used. </member> <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.04"> The collision margin for the shape. This is not used in Godot Physics. Collision margins allow collision detection to be more efficient by adding an extra shell around shapes. Collision algorithms are more expensive when objects overlap by more than their margin, so a higher value for margins is better for performance, at the cost of accuracy around edges as it makes them less sharp. </member> </members> </class>
124121
<?xml version="1.0" encoding="UTF-8" ?> <class name="PanelContainer" inherits="Container" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A container that keeps its child controls within the area of a [StyleBox]. </brief_description> <description> A container that keeps its child controls within the area of a [StyleBox]. Useful for giving controls an outline. </description> <tutorials> <link title="Using Containers">$DOCS_URL/tutorials/ui/gui_containers.html</link> <link title="2D Role Playing Game (RPG) Demo">https://godotengine.org/asset-library/asset/2729</link> </tutorials> <members> <member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" overrides="Control" enum="Control.MouseFilter" default="0" /> </members> <theme_items> <theme_item name="panel" data_type="style" type="StyleBox"> The style of [PanelContainer]'s background. </theme_item> </theme_items> </class>
124156
<?xml version="1.0" encoding="UTF-8" ?> <class name="RayCast3D" inherits="Node3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A ray in 3D space, used to find the first [CollisionObject3D] it intersects. </brief_description> <description> A raycast represents a ray from its origin to its [member target_position] that finds the closest [CollisionObject3D] along its path, if it intersects any. [RayCast3D] can ignore some objects by adding them to an exception list, by making its detection reporting ignore [Area3D]s ([member collide_with_areas]) or [PhysicsBody3D]s ([member collide_with_bodies]), or by configuring physics layers. [RayCast3D] calculates intersection every physics frame, and it holds the result until the next physics frame. For an immediate raycast, or if you want to configure a [RayCast3D] multiple times within the same physics frame, use [method force_raycast_update]. To sweep over a region of 3D space, you can approximate the region with multiple [RayCast3D]s or use [ShapeCast3D]. </description> <tutorials> <link title="Ray-casting">$DOCS_URL/tutorials/physics/ray-casting.html</link> <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/2755</link> </tutorials> <methods> <method name="add_exception"> <return type="void" /> <param index="0" name="node" type="CollisionObject3D" /> <description> Adds a collision exception so the ray does not report collisions with the specified [CollisionObject3D] node. </description> </method> <method name="add_exception_rid"> <return type="void" /> <param index="0" name="rid" type="RID" /> <description> Adds a collision exception so the ray does not report collisions with the specified [RID]. </description> </method> <method name="clear_exceptions"> <return type="void" /> <description> Removes all collision exceptions for this ray. </description> </method> <method name="force_raycast_update"> <return type="void" /> <description> Updates the collision information for the ray immediately, without waiting for the next [code]_physics_process[/code] call. Use this method, for example, when the ray or its parent has changed state. [b]Note:[/b] [member enabled] does not need to be [code]true[/code] for this to work. </description> </method> <method name="get_collider" qualifiers="const"> <return type="Object" /> <description> Returns the first object that the ray intersects, or [code]null[/code] if no object is intersecting the ray (i.e. [method is_colliding] returns [code]false[/code]). </description> </method> <method name="get_collider_rid" qualifiers="const"> <return type="RID" /> <description> Returns the [RID] of the first object that the ray intersects, or an empty [RID] if no object is intersecting the ray (i.e. [method is_colliding] returns [code]false[/code]). </description> </method> <method name="get_collider_shape" qualifiers="const"> <return type="int" /> <description> Returns the shape ID of the first object that the ray intersects, or [code]0[/code] if no object is intersecting the ray (i.e. [method is_colliding] returns [code]false[/code]). To get the intersected shape node, for a [CollisionObject3D] target, use: [codeblocks] [gdscript] var target = get_collider() # A CollisionObject3D. var shape_id = get_collider_shape() # The shape index in the collider. var owner_id = target.shape_find_owner(shape_id) # The owner ID in the collider. var shape = target.shape_owner_get_owner(owner_id) [/gdscript] [csharp] var target = (CollisionObject3D)GetCollider(); // A CollisionObject3D. var shapeId = GetColliderShape(); // The shape index in the collider. var ownerId = target.ShapeFindOwner(shapeId); // The owner ID in the collider. var shape = target.ShapeOwnerGetOwner(ownerId); [/csharp] [/codeblocks] </description> </method> <method name="get_collision_face_index" qualifiers="const"> <return type="int" /> <description> Returns the collision object's face index at the collision point, or [code]-1[/code] if the shape intersecting the ray is not a [ConcavePolygonShape3D]. </description> </method> <method name="get_collision_mask_value" qualifiers="const"> <return type="bool" /> <param index="0" name="layer_number" type="int" /> <description> Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [param layer_number] between 1 and 32. </description> </method> <method name="get_collision_normal" qualifiers="const"> <return type="Vector3" /> <description> Returns the normal of the intersecting object's shape at the collision point, or [code]Vector3(0, 0, 0)[/code] if the ray starts inside the shape and [member hit_from_inside] is [code]true[/code]. [b]Note:[/b] Check that [method is_colliding] returns [code]true[/code] before calling this method to ensure the returned normal is valid and up-to-date. </description> </method> <method name="get_collision_point" qualifiers="const"> <return type="Vector3" /> <description> Returns the collision point at which the ray intersects the closest object, in the global coordinate system. If [member hit_from_inside] is [code]true[/code] and the ray starts inside of a collision shape, this function will return the origin point of the ray. [b]Note:[/b] Check that [method is_colliding] returns [code]true[/code] before calling this method to ensure the returned point is valid and up-to-date. </description> </method> <method name="is_colliding" qualifiers="const"> <return type="bool" /> <description> Returns whether any object is intersecting with the ray's vector (considering the vector length). </description> </method> <method name="remove_exception"> <return type="void" /> <param index="0" name="node" type="CollisionObject3D" /> <description> Removes a collision exception so the ray does report collisions with the specified [CollisionObject3D] node. </description> </method> <method name="remove_exception_rid"> <return type="void" /> <param index="0" name="rid" type="RID" /> <description> Removes a collision exception so the ray does report collisions with the specified [RID]. </description> </method> <method name="set_collision_mask_value"> <return type="void" /> <param index="0" name="layer_number" type="int" /> <param index="1" name="value" type="bool" /> <description> Based on [param value], enables or disables the specified layer in the [member collision_mask], given a [param layer_number] between 1 and 32. </description> </method> </methods>
124157
<members> <member name="collide_with_areas" type="bool" setter="set_collide_with_areas" getter="is_collide_with_areas_enabled" default="false"> If [code]true[/code], collisions with [Area3D]s will be reported. </member> <member name="collide_with_bodies" type="bool" setter="set_collide_with_bodies" getter="is_collide_with_bodies_enabled" default="true"> If [code]true[/code], collisions with [PhysicsBody3D]s will be reported. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="debug_shape_custom_color" type="Color" setter="set_debug_shape_custom_color" getter="get_debug_shape_custom_color" default="Color(0, 0, 0, 1)"> The custom color to use to draw the shape in the editor and at run-time if [b]Visible Collision Shapes[/b] is enabled in the [b]Debug[/b] menu. This color will be highlighted at run-time if the [RayCast3D] is colliding with something. If set to [code]Color(0.0, 0.0, 0.0)[/code] (by default), the color set in [member ProjectSettings.debug/shapes/collision/shape_color] is used. </member> <member name="debug_shape_thickness" type="int" setter="set_debug_shape_thickness" getter="get_debug_shape_thickness" default="2"> If set to [code]1[/code], a line is used as the debug shape. Otherwise, a truncated pyramid is drawn to represent the [RayCast3D]. Requires [b]Visible Collision Shapes[/b] to be enabled in the [b]Debug[/b] menu for the debug shape to be visible at run-time. </member> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true"> If [code]true[/code], collisions will be reported. </member> <member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body" default="true"> If [code]true[/code], collisions will be ignored for this RayCast3D's immediate parent. </member> <member name="hit_back_faces" type="bool" setter="set_hit_back_faces" getter="is_hit_back_faces_enabled" default="true"> If [code]true[/code], the ray will hit back faces with concave polygon shapes with back face enabled or heightmap shapes. </member> <member name="hit_from_inside" type="bool" setter="set_hit_from_inside" getter="is_hit_from_inside_enabled" default="false"> If [code]true[/code], the ray will detect a hit when starting inside shapes. In this case the collision normal will be [code]Vector3(0, 0, 0)[/code]. Does not affect shapes with no volume like concave polygon or heightmap. </member> <member name="target_position" type="Vector3" setter="set_target_position" getter="get_target_position" default="Vector3(0, -1, 0)"> The ray's destination point, relative to the RayCast's [code]position[/code]. </member> </members> </class>
124201
<?xml version="1.0" encoding="UTF-8" ?> <class name="VisualShaderNodeFloatParameter" inherits="VisualShaderNodeParameter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A scalar float parameter to be used within the visual shader graph. </brief_description> <description> Translated to [code]uniform float[/code] in the shader language. </description> <tutorials> </tutorials> <members> <member name="default_value" type="float" setter="set_default_value" getter="get_default_value" default="0.0"> A default value to be assigned within the shader. </member> <member name="default_value_enabled" type="bool" setter="set_default_value_enabled" getter="is_default_value_enabled" default="false"> Enables usage of the [member default_value]. </member> <member name="hint" type="int" setter="set_hint" getter="get_hint" enum="VisualShaderNodeFloatParameter.Hint" default="0"> A hint applied to the uniform, which controls the values it can take when set through the Inspector. </member> <member name="max" type="float" setter="set_max" getter="get_max" default="1.0"> Minimum value for range hints. Used if [member hint] is set to [constant HINT_RANGE] or [constant HINT_RANGE_STEP]. </member> <member name="min" type="float" setter="set_min" getter="get_min" default="0.0"> Maximum value for range hints. Used if [member hint] is set to [constant HINT_RANGE] or [constant HINT_RANGE_STEP]. </member> <member name="step" type="float" setter="set_step" getter="get_step" default="0.1"> Step (increment) value for the range hint with step. Used if [member hint] is set to [constant HINT_RANGE_STEP]. </member> </members> <constants> <constant name="HINT_NONE" value="0" enum="Hint"> No hint used. </constant> <constant name="HINT_RANGE" value="1" enum="Hint"> A range hint for scalar value, which limits possible input values between [member min] and [member max]. Translated to [code]hint_range(min, max)[/code] in shader code. </constant> <constant name="HINT_RANGE_STEP" value="2" enum="Hint"> A range hint for scalar value with step, which limits possible input values between [member min] and [member max], with a step (increment) of [member step]). Translated to [code]hint_range(min, max, step)[/code] in shader code. </constant> <constant name="HINT_MAX" value="3" enum="Hint"> Represents the size of the [enum Hint] enum. </constant> </constants> </class>
124231
name="texture_proxy_create" deprecated="ProxyTexture was removed in Godot 4."> <return type="RID" /> <param index="0" name="base" type="RID" /> <description> This method does nothing and always returns an invalid [RID]. </description> </method> <method name="texture_proxy_update" deprecated="ProxyTexture was removed in Godot 4."> <return type="void" /> <param index="0" name="texture" type="RID" /> <param index="1" name="proxy_to" type="RID" /> <description> This method does nothing. </description> </method> <method name="texture_rd_create"> <return type="RID" /> <param index="0" name="rd_texture" type="RID" /> <param index="1" name="layer_type" type="int" enum="RenderingServer.TextureLayeredType" default="0" /> <description> Creates a new texture object based on a texture created directly on the [RenderingDevice]. If the texture contains layers, [param layer_type] is used to define the layer type. </description> </method> <method name="texture_replace"> <return type="void" /> <param index="0" name="texture" type="RID" /> <param index="1" name="by_texture" type="RID" /> <description> Replaces [param texture]'s texture data by the texture specified by the [param by_texture] RID, without changing [param texture]'s RID. </description> </method> <method name="texture_set_force_redraw_if_visible"> <return type="void" /> <param index="0" name="texture" type="RID" /> <param index="1" name="enable" type="bool" /> <description> </description> </method> <method name="texture_set_path"> <return type="void" /> <param index="0" name="texture" type="RID" /> <param index="1" name="path" type="String" /> <description> </description> </method> <method name="texture_set_size_override"> <return type="void" /> <param index="0" name="texture" type="RID" /> <param index="1" name="width" type="int" /> <param index="2" name="height" type="int" /> <description> </description> </method> <method name="viewport_attach_camera"> <return type="void" /> <param index="0" name="viewport" type="RID" /> <param index="1" name="camera" type="RID" /> <description> Sets a viewport's camera. </description> </method> <method name="viewport_attach_canvas"> <return type="void" /> <param index="0" name="viewport" type="RID" /> <param index="1" name="canvas" type="RID" /> <description> Sets a viewport's canvas. </description> </method> <method name="viewport_attach_to_screen"> <return type="void" /> <param index="0" name="viewport" type="RID" /> <param index="1" name="rect" type="Rect2" default="Rect2(0, 0, 0, 0)" /> <param index="2" name="screen" type="int" default="0" /> <description> Copies the viewport to a region of the screen specified by [param rect]. If [method viewport_set_render_direct_to_screen] is [code]true[/code], then the viewport does not use a framebuffer and the contents of the viewport are rendered directly to screen. However, note that the root viewport is drawn last, therefore it will draw over the screen. Accordingly, you must set the root viewport to an area that does not cover the area that you have attached this viewport to. For example, you can set the root viewport to not render at all with the following code: FIXME: The method seems to be non-existent. [codeblocks] [gdscript] func _ready(): get_viewport().set_attach_to_screen_rect(Rect2()) $Viewport.set_attach_to_screen_rect(Rect2(0, 0, 600, 600)) [/gdscript] [/codeblocks] Using this can result in significant optimization, especially on lower-end devices. However, it comes at the cost of having to manage your viewports manually. For further optimization, see [method viewport_set_render_direct_to_screen]. </description> </method> <method name="viewport_create"> <return type="RID" /> <description> Creates an empty viewport and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]viewport_*[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. [b]Note:[/b] The equivalent node is [Viewport]. </description> </method> <method name="viewport_get_measured_render_time_cpu" qualifiers="const"> <return type="float" /> <param index="0" name="viewport" type="RID" /> <description> Returns the CPU time taken to render the last frame in milliseconds. This [i]only[/i] includes time spent in rendering-related operations; scripts' [code]_process[/code] functions and other engine subsystems are not included in this readout. To get a complete readout of CPU time spent to render the scene, sum the render times of all viewports that are drawn every frame plus [method get_frame_setup_time_cpu]. Unlike [method Engine.get_frames_per_second], this method will accurately reflect CPU utilization even if framerate is capped via V-Sync or [member Engine.max_fps]. See also [method viewport_get_measured_render_time_gpu]. [b]Note:[/b] Requires measurements to be enabled on the specified [param viewport] using [method viewport_set_measure_render_time]. Otherwise, this method returns [code]0.0[/code]. </description> </method> <method name="viewport_get_measured_render_time_gpu" qualifiers="const"> <return type="float" /> <param index="0" name="viewport" type="RID" /> <description> Returns the GPU time taken to render the last frame in milliseconds. To get a complete readout of GPU time spent to render the scene, sum the render times of all viewports that are drawn every frame. Unlike [method Engine.get_frames_per_second], this method accurately reflects GPU utilization even if framerate is capped via V-Sync or [member Engine.max_fps]. See also [method viewport_get_measured_render_time_cpu]. [b]Note:[/b] Requires measurements to be enabled on the specified [param viewport] using [method viewport_set_measure_render_time]. Otherwise, this method returns [code]0.0[/code]. [b]Note:[/b] When GPU utilization is low enough during a certain period of time, GPUs will decrease their power state (which in turn decreases core and memory clock speeds). This can cause the reported GPU time to increase if GPU utilization is kept low enough by a framerate cap (compared to what it would be at the GPU's highest power state). Keep this in mind when benchmarking using [method viewport_get_measured_render_time_gpu]. This behavior can be overridden in the graphics driver settings at the cost of higher power usage. </description> </method> <method
124255
<?xml version="1.0" encoding="UTF-8" ?> <class name="RichTextLabel" inherits="Control" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A control for displaying text that can contain different font styles, images, and basic formatting. </brief_description> <description> A control for displaying text that can contain custom fonts, images, and basic formatting. [RichTextLabel] manages these as an internal tag stack. It also adapts itself to given width/heights. [b]Note:[/b] Assignments to [member text] clear the tag stack and reconstruct it from the property's contents. Any edits made to [member text] will erase previous edits made from other manual sources such as [method append_text] and the [code]push_*[/code] / [method pop] methods. [b]Note:[/b] RichTextLabel doesn't support entangled BBCode tags. For example, instead of using [code skip-lint][b]bold[i]bold italic[/b]italic[/i][/code], use [code skip-lint][b]bold[i]bold italic[/i][/b][i]italic[/i][/code]. [b]Note:[/b] [code]push_*/pop_*[/code] functions won't affect BBCode. [b]Note:[/b] Unlike [Label], [RichTextLabel] doesn't have a [i]property[/i] to horizontally align text to the center. Instead, enable [member bbcode_enabled] and surround the text in a [code skip-lint][center][/code] tag as follows: [code skip-lint][center]Example[/center][/code]. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the [member fit_content] property. </description> <tutorials> <link title="BBCode in RichTextLabel">$DOCS_URL/tutorials/ui/bbcode_in_richtextlabel.html</link> <link title="Rich Text Label with BBCode Demo">https://godotengine.org/asset-library/asset/2774</link> <link title="Operating System Testing Demo">https://godotengine.org/asset-library/asset/2789</link> </tutorials>
124276
<method name="draw_style_box"> <return type="void" /> <param index="0" name="style_box" type="StyleBox" /> <param index="1" name="rect" type="Rect2" /> <description> Draws a styled rectangle. </description> </method> <method name="draw_texture"> <return type="void" /> <param index="0" name="texture" type="Texture2D" /> <param index="1" name="position" type="Vector2" /> <param index="2" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> <description> Draws a texture at a given position. </description> </method> <method name="draw_texture_rect"> <return type="void" /> <param index="0" name="texture" type="Texture2D" /> <param index="1" name="rect" type="Rect2" /> <param index="2" name="tile" type="bool" /> <param index="3" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> <param index="4" name="transpose" type="bool" default="false" /> <description> Draws a textured rectangle at a given position, optionally modulated by a color. If [param transpose] is [code]true[/code], the texture will have its X and Y coordinates swapped. See also [method draw_rect] and [method draw_texture_rect_region]. </description> </method> <method name="draw_texture_rect_region"> <return type="void" /> <param index="0" name="texture" type="Texture2D" /> <param index="1" name="rect" type="Rect2" /> <param index="2" name="src_rect" type="Rect2" /> <param index="3" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> <param index="4" name="transpose" type="bool" default="false" /> <param index="5" name="clip_uv" type="bool" default="true" /> <description> Draws a textured rectangle from a texture's region (specified by [param src_rect]) at a given position, optionally modulated by a color. If [param transpose] is [code]true[/code], the texture will have its X and Y coordinates swapped. See also [method draw_texture_rect]. </description> </method> <method name="force_update_transform"> <return type="void" /> <description> Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations. </description> </method> <method name="get_canvas" qualifiers="const"> <return type="RID" /> <description> Returns the [RID] of the [World2D] canvas where this item is in. </description> </method> <method name="get_canvas_item" qualifiers="const"> <return type="RID" /> <description> Returns the canvas item RID used by [RenderingServer] for this item. </description> </method> <method name="get_canvas_layer_node" qualifiers="const"> <return type="CanvasLayer" /> <description> Returns the [CanvasLayer] that contains this node, or [code]null[/code] if the node is not in any [CanvasLayer]. </description> </method> <method name="get_canvas_transform" qualifiers="const"> <return type="Transform2D" /> <description> Returns the transform from the coordinate system of the canvas, this item is in, to the [Viewport]s coordinate system. </description> </method> <method name="get_global_mouse_position" qualifiers="const"> <return type="Vector2" /> <description> Returns the mouse's position in the [CanvasLayer] that this [CanvasItem] is in using the coordinate system of the [CanvasLayer]. [b]Note:[/b] For screen-space coordinates (e.g. when using a non-embedded [Popup]), you can use [method DisplayServer.mouse_get_position]. </description> </method> <method name="get_global_transform" qualifiers="const"> <return type="Transform2D" /> <description> Returns the global transform matrix of this item, i.e. the combined transform up to the topmost [CanvasItem] node. The topmost item is a [CanvasItem] that either has no parent, has non-[CanvasItem] parent or it has [member top_level] enabled. </description> </method> <method name="get_global_transform_with_canvas" qualifiers="const"> <return type="Transform2D" /> <description> Returns the transform from the local coordinate system of this [CanvasItem] to the [Viewport]s coordinate system. </description> </method> <method name="get_local_mouse_position" qualifiers="const"> <return type="Vector2" /> <description> Returns the mouse's position in this [CanvasItem] using the local coordinate system of this [CanvasItem]. </description> </method> <method name="get_screen_transform" qualifiers="const"> <return type="Transform2D" /> <description> Returns the transform of this [CanvasItem] in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins. Equals to [method get_global_transform] if the window is embedded (see [member Viewport.gui_embed_subwindows]). </description> </method> <method name="get_transform" qualifiers="const"> <return type="Transform2D" /> <description> Returns the transform matrix of this item. </description> </method> <method name="get_viewport_rect" qualifiers="const"> <return type="Rect2" /> <description> Returns the viewport's boundaries as a [Rect2]. </description> </method> <method name="get_viewport_transform" qualifiers="const"> <return type="Transform2D" /> <description> Returns the transform from the coordinate system of the canvas, this item is in, to the [Viewport]s embedders coordinate system. </description> </method> <method name="get_visibility_layer_bit" qualifiers="const"> <return type="bool" /> <param index="0" name="layer" type="int" /> <description> Returns an individual bit on the rendering visibility layer. </description> </method> <method name="get_world_2d" qualifiers="const"> <return type="World2D" /> <description> Returns the [World2D] where this item is in. </description> </method> <method name="hide"> <return type="void" /> <description> Hide the [CanvasItem] if it's currently visible. This is equivalent to setting [member visible] to [code]false[/code]. </description> </method> <method name="is_local_transform_notification_enabled" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if local transform notifications are communicated to children. </description> </method> <method name="is_transform_notification_enabled" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if global transform notifications are communicated to children. </description> </method>
124288
<?xml version="1.0" encoding="UTF-8" ?> <class name="SceneTree" inherits="MainLoop" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Manages the game loop via a hierarchy of nodes. </brief_description> <description> As one of the most important classes, the [SceneTree] manages the hierarchy of nodes in a scene, as well as scenes themselves. Nodes can be added, fetched and removed. The whole scene tree (and thus the current scene) can be paused. Scenes can be loaded, switched and reloaded. You can also use the [SceneTree] to organize your nodes into [b]groups[/b]: every node can be added to as many groups as you want to create, e.g. an "enemy" group. You can then iterate these groups or even call methods and set properties on all the nodes belonging to any given group. [SceneTree] is the default [MainLoop] implementation used by the engine, and is thus in charge of the game loop. </description> <tutorials> <link title="SceneTree">$DOCS_URL/tutorials/scripting/scene_tree.html</link> <link title="Multiple resolutions">$DOCS_URL/tutorials/rendering/multiple_resolutions.html</link> </tutorials>
124291
<members> <member name="auto_accept_quit" type="bool" setter="set_auto_accept_quit" getter="is_auto_accept_quit" default="true"> If [code]true[/code], the application automatically accepts quitting requests. For mobile platforms, see [member quit_on_go_back]. </member> <member name="current_scene" type="Node" setter="set_current_scene" getter="get_current_scene"> The root node of the currently loaded main scene, usually as a direct child of [member root]. See also [method change_scene_to_file], [method change_scene_to_packed], and [method reload_current_scene]. [b]Warning:[/b] Setting this property directly may not work as expected, as it does [i]not[/i] add or remove any nodes from this tree. </member> <member name="debug_collisions_hint" type="bool" setter="set_debug_collisions_hint" getter="is_debugging_collisions_hint" default="false"> If [code]true[/code], collision shapes will be visible when running the game from the editor for debugging purposes. [b]Note:[/b] This property is not designed to be changed at run-time. Changing the value of [member debug_collisions_hint] while the project is running will not have the desired effect. </member> <member name="debug_navigation_hint" type="bool" setter="set_debug_navigation_hint" getter="is_debugging_navigation_hint" default="false"> If [code]true[/code], navigation polygons will be visible when running the game from the editor for debugging purposes. [b]Note:[/b] This property is not designed to be changed at run-time. Changing the value of [member debug_navigation_hint] while the project is running will not have the desired effect. </member> <member name="debug_paths_hint" type="bool" setter="set_debug_paths_hint" getter="is_debugging_paths_hint" default="false"> If [code]true[/code], curves from [Path2D] and [Path3D] nodes will be visible when running the game from the editor for debugging purposes. [b]Note:[/b] This property is not designed to be changed at run-time. Changing the value of [member debug_paths_hint] while the project is running will not have the desired effect. </member> <member name="edited_scene_root" type="Node" setter="set_edited_scene_root" getter="get_edited_scene_root"> The root of the scene currently being edited in the editor. This is usually a direct child of [member root]. [b]Note:[/b] This property does nothing in release builds. </member> <member name="multiplayer_poll" type="bool" setter="set_multiplayer_poll_enabled" getter="is_multiplayer_poll_enabled" default="true"> If [code]true[/code] (default value), enables automatic polling of the [MultiplayerAPI] for this SceneTree during [signal process_frame]. If [code]false[/code], you need to manually call [method MultiplayerAPI.poll] to process network packets and deliver RPCs. This allows running RPCs in a different loop (e.g. physics, thread, specific time step) and for manual [Mutex] protection when accessing the [MultiplayerAPI] from threads. </member> <member name="paused" type="bool" setter="set_pause" getter="is_paused" default="false"> If [code]true[/code], the scene tree is considered paused. This causes the following behavior: - 2D and 3D physics will be stopped, as well as collision detection and related signals. - Depending on each node's [member Node.process_mode], their [method Node._process], [method Node._physics_process] and [method Node._input] callback methods may not called anymore. </member> <member name="physics_interpolation" type="bool" setter="set_physics_interpolation_enabled" getter="is_physics_interpolation_enabled" default="false"> If [code]true[/code], the renderer will interpolate the transforms of physics objects between the last two transforms, so that smooth motion is seen even when physics ticks do not coincide with rendered frames. The default value of this property is controlled by [member ProjectSettings.physics/common/physics_interpolation]. </member> <member name="quit_on_go_back" type="bool" setter="set_quit_on_go_back" getter="is_quit_on_go_back" default="true"> If [code]true[/code], the application quits automatically when navigating back (e.g. using the system "Back" button on Android). To handle 'Go Back' button when this option is disabled, use [constant DisplayServer.WINDOW_EVENT_GO_BACK_REQUEST]. </member> <member name="root" type="Window" setter="" getter="get_root"> The tree's root [Window]. This is top-most [Node] of the scene tree, and is always present. An absolute [NodePath] always starts from this node. Children of the root node may include the loaded [member current_scene], as well as any [url=$DOCS_URL/tutorials/scripting/singletons_autoload.html]AutoLoad[/url] configured in the Project Settings. [b]Warning:[/b] Do not delete this node. This will result in unstable behavior, followed by a crash. </member> </members> <signals> <signal name="node_added"> <param index="0" name="node" type="Node" /> <description> Emitted when the [param node] enters this tree. </description> </signal> <signal name="node_configuration_warning_changed"> <param index="0" name="node" type="Node" /> <description> Emitted when the [param node]'s [method Node.update_configuration_warnings] is called. Only emitted in the editor. </description> </signal> <signal name="node_removed"> <param index="0" name="node" type="Node" /> <description> Emitted when the [param node] exits this tree. </description> </signal> <signal name="node_renamed"> <param index="0" name="node" type="Node" /> <description> Emitted when the [param node]'s [member Node.name] is changed. </description> </signal> <signal name="physics_frame"> <description> Emitted immediately before [method Node._physics_process] is called on every node in this tree. </description> </signal> <signal name="process_frame"> <description> Emitted immediately before [method Node._process] is called on every node in this tree. </description> </signal> <signal name="tree_changed"> <description> Emitted any time the tree's hierarchy changes (nodes being moved, renamed, etc.). </description> </signal> <signal name="tree_process_mode_changed"> <description> Emitted when the [member Node.process_mode] of any node inside the tree is changed. Only emitted in the editor, to update the visibility of disabled nodes. </description> </signal> </signals> <constants> <constant name="GROUP_CALL_DEFAULT" value="0" enum="GroupCallFlags"> Call nodes within a group with no special behavior (default). </constant> <constant name="GROUP_CALL_REVERSE" value="1" enum="GroupCallFlags"> Call nodes within a group in reverse tree hierarchy order (all nested children are called before their respective parent nodes). </constant> <constant name="GROUP_CALL_DEFERRED" value="2" enum="GroupCallFlags"> Call nodes within a group at the end of the current frame (can be either process or physics frame), similar to [method Object.call_deferred]. </constant> <constant name="GROUP_CALL_UNIQUE" value="4" enum="GroupCallFlags"> Call nodes within a group only once, even if the call is executed many times in the same frame. Must be combined with [constant GROUP_CALL_DEFERRED] to work. [b]Note:[/b] Different arguments are not taken into account. Therefore, when the same call is executed with different arguments, only the first call will be performed. </constant> </constants> </class>
124305
<method name="add_index"> <return type="void" /> <param index="0" name="index" type="int" /> <description> Adds a vertex to index array if you are using indexed vertices. Does not need to be called before adding vertices. </description> </method> <method name="add_triangle_fan"> <return type="void" /> <param index="0" name="vertices" type="PackedVector3Array" /> <param index="1" name="uvs" type="PackedVector2Array" default="PackedVector2Array()" /> <param index="2" name="colors" type="PackedColorArray" default="PackedColorArray()" /> <param index="3" name="uv2s" type="PackedVector2Array" default="PackedVector2Array()" /> <param index="4" name="normals" type="PackedVector3Array" default="PackedVector3Array()" /> <param index="5" name="tangents" type="Plane[]" default="[]" /> <description> Inserts a triangle fan made of array data into [Mesh] being constructed. Requires the primitive type be set to [constant Mesh.PRIMITIVE_TRIANGLES]. </description> </method> <method name="add_vertex"> <return type="void" /> <param index="0" name="vertex" type="Vector3" /> <description> Specifies the position of current vertex. Should be called after specifying other vertex properties (e.g. Color, UV). </description> </method> <method name="append_from"> <return type="void" /> <param index="0" name="existing" type="Mesh" /> <param index="1" name="surface" type="int" /> <param index="2" name="transform" type="Transform3D" /> <description> Append vertices from a given [Mesh] surface onto the current vertex array with specified [Transform3D]. </description> </method> <method name="begin"> <return type="void" /> <param index="0" name="primitive" type="int" enum="Mesh.PrimitiveType" /> <description> Called before adding any vertices. Takes the primitive type as an argument (e.g. [constant Mesh.PRIMITIVE_TRIANGLES]). </description> </method> <method name="clear"> <return type="void" /> <description> Clear all information passed into the surface tool so far. </description> </method> <method name="commit"> <return type="ArrayMesh" /> <param index="0" name="existing" type="ArrayMesh" default="null" /> <param index="1" name="flags" type="int" default="0" /> <description> Returns a constructed [ArrayMesh] from current information passed in. If an existing [ArrayMesh] is passed in as an argument, will add an extra surface to the existing [ArrayMesh]. [b]FIXME:[/b] Document possible values for [param flags], it changed in 4.0. Likely some combinations of [enum Mesh.ArrayFormat]. </description> </method> <method name="commit_to_arrays"> <return type="Array" /> <description> Commits the data to the same format used by [method ArrayMesh.add_surface_from_arrays], [method ImporterMesh.add_surface], and [method create_from_arrays]. This way you can further process the mesh data using the [ArrayMesh] or [ImporterMesh] APIs. </description> </method> <method name="create_from"> <return type="void" /> <param index="0" name="existing" type="Mesh" /> <param index="1" name="surface" type="int" /> <description> Creates a vertex array from an existing [Mesh]. </description> </method> <method name="create_from_arrays"> <return type="void" /> <param index="0" name="arrays" type="Array" /> <param index="1" name="primitive_type" type="int" enum="Mesh.PrimitiveType" default="3" /> <description> Creates this SurfaceTool from existing vertex arrays such as returned by [method commit_to_arrays], [method Mesh.surface_get_arrays], [method Mesh.surface_get_blend_shape_arrays], [method ImporterMesh.get_surface_arrays], and [method ImporterMesh.get_surface_blend_shape_arrays]. [param primitive_type] controls the type of mesh data, defaulting to [constant Mesh.PRIMITIVE_TRIANGLES]. </description> </method> <method name="create_from_blend_shape"> <return type="void" /> <param index="0" name="existing" type="Mesh" /> <param index="1" name="surface" type="int" /> <param index="2" name="blend_shape" type="String" /> <description> Creates a vertex array from the specified blend shape of an existing [Mesh]. This can be used to extract a specific pose from a blend shape. </description> </method> <method name="deindex"> <return type="void" /> <description> Removes the index array by expanding the vertex array. </description> </method> <method name="generate_lod" deprecated="This method is unused internally, as it does not preserve normals or UVs. Consider using [method ImporterMesh.generate_lods] instead."> <return type="PackedInt32Array" /> <param index="0" name="nd_threshold" type="float" /> <param index="1" name="target_index_count" type="int" default="3" /> <description> Generates an LOD for a given [param nd_threshold] in linear units (square root of quadric error metric), using at most [param target_index_count] indices. </description> </method> <method name="generate_normals"> <return type="void" /> <param index="0" name="flip" type="bool" default="false" /> <description> Generates normals from vertices so you do not have to do it manually. If [param flip] is [code]true[/code], the resulting normals will be inverted. [method generate_normals] should be called [i]after[/i] generating geometry and [i]before[/i] committing the mesh using [method commit] or [method commit_to_arrays]. For correct display of normal-mapped surfaces, you will also have to generate tangents using [method generate_tangents]. [b]Note:[/b] [method generate_normals] only works if the primitive type to be set to [constant Mesh.PRIMITIVE_TRIANGLES]. [b]Note:[/b] [method generate_normals] takes smooth groups into account. To generate smooth normals, set the smooth group to a value greater than or equal to [code]0[/code] using [method set_smooth_group] or leave the smooth group at the default of [code]0[/code]. To generate flat normals, set the smooth group to [code]-1[/code] using [method set_smooth_group] prior to adding vertices. </description> </method> <method name="generate_tangents"> <return type="void" /> <description> Generates a tangent vector for each vertex. Requires that each vertex have UVs and normals set already (see [method generate_normals]). </description> </method> <method name="get_aabb" qualifiers="const"> <return type="AABB" /> <description> Returns the axis-aligned bounding box of the vertex positions. </description> </method> <method name="get_custom_format" qualifiers="const"> <return type="int" enum="SurfaceTool.CustomFormat" /> <param index="0" name="channel_index" type="int" /> <description> Returns the format for custom [param channel_index] (currently up to 4). Returns [constant CUSTOM_MAX] if this custom channel is unused. </description> </method> <method name="get_primitive_type" qualifiers="const"> <return type="int" enum="Mesh.PrimitiveType" /> <description> Returns the type of mesh geometry, such as [constant Mesh.PRIMITIVE_TRIANGLES]. </description> </method>
124315
<method name="get_root_motion_rotation" qualifiers="const"> <return type="Quaternion" /> <description> Retrieve the motion delta of rotation with the [member root_motion_track] as a [Quaternion] that can be used elsewhere. If [member root_motion_track] is not a path to a track of type [constant Animation.TYPE_ROTATION_3D], returns [code]Quaternion(0, 0, 0, 1)[/code]. See also [member root_motion_track] and [RootMotionView]. The most basic example is applying rotation to [CharacterBody3D]: [codeblocks] [gdscript] func _process(delta): if Input.is_action_just_pressed("animate"): state_machine.travel("Animate") set_quaternion(get_quaternion() * animation_tree.get_root_motion_rotation()) [/gdscript] [/codeblocks] </description> </method> <method name="get_root_motion_rotation_accumulator" qualifiers="const"> <return type="Quaternion" /> <description> Retrieve the blended value of the rotation tracks with the [member root_motion_track] as a [Quaternion] that can be used elsewhere. This is necessary to apply the root motion position correctly, taking rotation into account. See also [method get_root_motion_position]. Also, this is useful in cases where you want to respect the initial key values of the animation. For example, if an animation with only one key [code]Quaternion(0, 0, 0, 1)[/code] is played in the previous frame and then an animation with only one key [code]Quaternion(0, 0.707, 0, 0.707)[/code] is played in the next frame, the difference can be calculated as follows: [codeblocks] [gdscript] var prev_root_motion_rotation_accumulator: Quaternion func _process(delta): if Input.is_action_just_pressed("animate"): state_machine.travel("Animate") var current_root_motion_rotation_accumulator: Quaternion = animation_tree.get_root_motion_rotation_accumulator() var difference: Quaternion = prev_root_motion_rotation_accumulator.inverse() * current_root_motion_rotation_accumulator prev_root_motion_rotation_accumulator = current_root_motion_rotation_accumulator transform.basis *= Basis(difference) [/gdscript] [/codeblocks] However, if the animation loops, an unintended discrete change may occur, so this is only useful for some simple use cases. </description> </method> <method name="get_root_motion_scale" qualifiers="const"> <return type="Vector3" /> <description> Retrieve the motion delta of scale with the [member root_motion_track] as a [Vector3] that can be used elsewhere. If [member root_motion_track] is not a path to a track of type [constant Animation.TYPE_SCALE_3D], returns [code]Vector3(0, 0, 0)[/code]. See also [member root_motion_track] and [RootMotionView]. The most basic example is applying scale to [CharacterBody3D]: [codeblocks] [gdscript] var current_scale: Vector3 = Vector3(1, 1, 1) var scale_accum: Vector3 = Vector3(1, 1, 1) func _process(delta): if Input.is_action_just_pressed("animate"): current_scale = get_scale() scale_accum = Vector3(1, 1, 1) state_machine.travel("Animate") scale_accum += animation_tree.get_root_motion_scale() set_scale(current_scale * scale_accum) [/gdscript] [/codeblocks] </description> </method> <method name="get_root_motion_scale_accumulator" qualifiers="const"> <return type="Vector3" /> <description> Retrieve the blended value of the scale tracks with the [member root_motion_track] as a [Vector3] that can be used elsewhere. For example, if an animation with only one key [code]Vector3(1, 1, 1)[/code] is played in the previous frame and then an animation with only one key [code]Vector3(2, 2, 2)[/code] is played in the next frame, the difference can be calculated as follows: [codeblocks] [gdscript] var prev_root_motion_scale_accumulator: Vector3 func _process(delta): if Input.is_action_just_pressed("animate"): state_machine.travel("Animate") var current_root_motion_scale_accumulator: Vector3 = animation_tree.get_root_motion_scale_accumulator() var difference: Vector3 = current_root_motion_scale_accumulator - prev_root_motion_scale_accumulator prev_root_motion_scale_accumulator = current_root_motion_scale_accumulator transform.basis = transform.basis.scaled(difference) [/gdscript] [/codeblocks] However, if the animation loops, an unintended discrete change may occur, so this is only useful for some simple use cases. </description> </method> <method name="has_animation" qualifiers="const"> <return type="bool" /> <param index="0" name="name" type="StringName" /> <description> Returns [code]true[/code] if the [AnimationMixer] stores an [Animation] with key [param name]. </description> </method> <method name="has_animation_library" qualifiers="const"> <return type="bool" /> <param index="0" name="name" type="StringName" /> <description> Returns [code]true[/code] if the [AnimationMixer] stores an [AnimationLibrary] with key [param name]. </description> </method> <method name="remove_animation_library"> <return type="void" /> <param index="0" name="name" type="StringName" /> <description> Removes the [AnimationLibrary] associated with the key [param name]. </description> </method> <method name="rename_animation_library"> <return type="void" /> <param index="0" name="name" type="StringName" /> <param index="1" name="newname" type="StringName" /> <description> Moves the [AnimationLibrary] associated with the key [param name] to the key [param newname]. </description> </method> </methods>
124326
<?xml version="1.0" encoding="UTF-8" ?> <class name="ImmediateMesh" inherits="Mesh" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Mesh optimized for creating geometry manually. </brief_description> <description> A mesh type optimized for creating geometry manually, similar to OpenGL 1.x immediate mode. Here's a sample on how to generate a triangular face: [codeblocks] [gdscript] var mesh = ImmediateMesh.new() mesh.surface_begin(Mesh.PRIMITIVE_TRIANGLES) mesh.surface_add_vertex(Vector3.LEFT) mesh.surface_add_vertex(Vector3.FORWARD) mesh.surface_add_vertex(Vector3.ZERO) mesh.surface_end() [/gdscript] [csharp] var mesh = new ImmediateMesh(); mesh.SurfaceBegin(Mesh.PrimitiveType.Triangles); mesh.SurfaceAddVertex(Vector3.Left); mesh.SurfaceAddVertex(Vector3.Forward); mesh.SurfaceAddVertex(Vector3.Zero); mesh.SurfaceEnd(); [/csharp] [/codeblocks] [b]Note:[/b] Generating complex geometries with [ImmediateMesh] is highly inefficient. Instead, it is designed to generate simple geometry that changes often. </description> <tutorials> <link title="Using ImmediateMesh">$DOCS_URL/tutorials/3d/procedural_geometry/immediatemesh.html</link> </tutorials> <methods> <method name="clear_surfaces"> <return type="void" /> <description> Clear all surfaces. </description> </method> <method name="surface_add_vertex"> <return type="void" /> <param index="0" name="vertex" type="Vector3" /> <description> Add a 3D vertex using the current attributes previously set. </description> </method> <method name="surface_add_vertex_2d"> <return type="void" /> <param index="0" name="vertex" type="Vector2" /> <description> Add a 2D vertex using the current attributes previously set. </description> </method> <method name="surface_begin"> <return type="void" /> <param index="0" name="primitive" type="int" enum="Mesh.PrimitiveType" /> <param index="1" name="material" type="Material" default="null" /> <description> Begin a new surface. </description> </method> <method name="surface_end"> <return type="void" /> <description> End and commit current surface. Note that surface being created will not be visible until this function is called. </description> </method> <method name="surface_set_color"> <return type="void" /> <param index="0" name="color" type="Color" /> <description> Set the color attribute that will be pushed with the next vertex. </description> </method> <method name="surface_set_normal"> <return type="void" /> <param index="0" name="normal" type="Vector3" /> <description> Set the normal attribute that will be pushed with the next vertex. </description> </method> <method name="surface_set_tangent"> <return type="void" /> <param index="0" name="tangent" type="Plane" /> <description> Set the tangent attribute that will be pushed with the next vertex. </description> </method> <method name="surface_set_uv"> <return type="void" /> <param index="0" name="uv" type="Vector2" /> <description> Set the UV attribute that will be pushed with the next vertex. </description> </method> <method name="surface_set_uv2"> <return type="void" /> <param index="0" name="uv2" type="Vector2" /> <description> Set the UV2 attribute that will be pushed with the next vertex. </description> </method> </methods> </class>
124372
<?xml version="1.0" encoding="UTF-8" ?> <class name="Quaternion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A unit quaternion used for representing 3D rotations. </brief_description> <description> The [Quaternion] built-in [Variant] type is a 4D data structure that represents rotation in the form of a [url=https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation]Hamilton convention quaternion[/url]. Compared to the [Basis] type which can store both rotation and scale, quaternions can [i]only[/i] store rotation. A [Quaternion] is composed by 4 floating-point components: [member w], [member x], [member y], and [member z]. These components are very compact in memory, and because of this some operations are more efficient and less likely to cause floating-point errors. Methods such as [method get_angle], [method get_axis], and [method slerp] are faster than their [Basis] counterparts. For a great introduction to quaternions, see [url=https://www.youtube.com/watch?v=d4EgbgTm0Bg]this video by 3Blue1Brown[/url]. You do not need to know the math behind quaternions, as Godot provides several helper methods that handle it for you. These include [method slerp] and [method spherical_cubic_interpolate], as well as the [code]*[/code] operator. [b]Note:[/b] Quaternions must be normalized before being used for rotation (see [method normalized]). [b]Note:[/b] Similarly to [Vector2] and [Vector3], the components of a quaternion use 32-bit precision by default, unlike [float] which is always 64-bit. If double precision is needed, compile the engine with the option [code]precision=double[/code]. </description> <tutorials> <link title="3Blue1Brown&apos;s video on Quaternions">https://www.youtube.com/watch?v=d4EgbgTm0Bg</link> <link title="Online Quaternion Visualization">https://quaternions.online/</link> <link title="Using 3D transforms">$DOCS_URL/tutorials/3d/using_transforms.html#interpolating-with-quaternions</link> <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link> <link title="Advanced Quaternion Visualization">https://iwatake2222.github.io/rotation_master/rotation_master.html</link> </tutorials> <constructors> <constructor name="Quaternion"> <return type="Quaternion" /> <description> Constructs a [Quaternion] identical to the [constant IDENTITY]. </description> </constructor> <constructor name="Quaternion"> <return type="Quaternion" /> <param index="0" name="from" type="Quaternion" /> <description> Constructs a [Quaternion] as a copy of the given [Quaternion]. </description> </constructor> <constructor name="Quaternion"> <return type="Quaternion" /> <param index="0" name="arc_from" type="Vector3" /> <param index="1" name="arc_to" type="Vector3" /> <description> Constructs a [Quaternion] representing the shortest arc between [param arc_from] and [param arc_to]. These can be imagined as two points intersecting a sphere's surface, with a radius of [code]1.0[/code]. </description> </constructor> <constructor name="Quaternion"> <return type="Quaternion" /> <param index="0" name="axis" type="Vector3" /> <param index="1" name="angle" type="float" /> <description> Constructs a [Quaternion] representing rotation around the [param axis] by the given [param angle], in radians. The axis must be a normalized vector. </description> </constructor> <constructor name="Quaternion"> <return type="Quaternion" /> <param index="0" name="from" type="Basis" /> <description> Constructs a [Quaternion] from the given rotation [Basis]. This constructor is faster than [method Basis.get_rotation_quaternion], but the given basis must be [i]orthonormalized[/i] (see [method Basis.orthonormalized]). Otherwise, the constructor fails and returns [constant IDENTITY]. </description> </constructor> <constructor name="Quaternion"> <return type="Quaternion" /> <param index="0" name="x" type="float" /> <param index="1" name="y" type="float" /> <param index="2" name="z" type="float" /> <param index="3" name="w" type="float" /> <description> Constructs a [Quaternion] defined by the given values. [b]Note:[/b] Only normalized quaternions represent rotation; if these values are not normalized, the new [Quaternion] will not be a valid rotation. </description> </constructor> </constructors>
124373
<methods> <method name="angle_to" qualifiers="const"> <return type="float" /> <param index="0" name="to" type="Quaternion" /> <description> Returns the angle between this quaternion and [param to]. This is the magnitude of the angle you would need to rotate by to get from one to the other. [b]Note:[/b] The magnitude of the floating-point error for this method is abnormally high, so methods such as [code]is_zero_approx[/code] will not work reliably. </description> </method> <method name="dot" qualifiers="const"> <return type="float" /> <param index="0" name="with" type="Quaternion" /> <description> Returns the dot product between this quaternion and [param with]. This is equivalent to [code](quat.x * with.x) + (quat.y * with.y) + (quat.z * with.z) + (quat.w * with.w)[/code]. </description> </method> <method name="exp" qualifiers="const"> <return type="Quaternion" /> <description> Returns the exponential of this quaternion. The rotation axis of the result is the normalized rotation axis of this quaternion, the angle of the result is the length of the vector part of this quaternion. </description> </method> <method name="from_euler" qualifiers="static"> <return type="Quaternion" /> <param index="0" name="euler" type="Vector3" /> <description> Constructs a new [Quaternion] from the given [Vector3] of [url=https://en.wikipedia.org/wiki/Euler_angles]Euler angles[/url], in radians. This method always uses the YXZ convention ([constant EULER_ORDER_YXZ]). </description> </method> <method name="get_angle" qualifiers="const"> <return type="float" /> <description> Returns the angle of the rotation represented by this quaternion. [b]Note:[/b] The quaternion must be normalized. </description> </method> <method name="get_axis" qualifiers="const"> <return type="Vector3" /> <description> Returns the rotation axis of the rotation represented by this quaternion. </description> </method> <method name="get_euler" qualifiers="const"> <return type="Vector3" /> <param index="0" name="order" type="int" default="2" /> <description> Returns this quaternion's rotation as a [Vector3] of [url=https://en.wikipedia.org/wiki/Euler_angles]Euler angles[/url], in radians. The order of each consecutive rotation can be changed with [param order] (see [enum EulerOrder] constants). By default, the YXZ convention is used ([constant EULER_ORDER_YXZ]): Z (roll) is calculated first, then X (pitch), and lastly Y (yaw). When using the opposite method [method from_euler], this order is reversed. </description> </method> <method name="inverse" qualifiers="const"> <return type="Quaternion" /> <description> Returns the inverse version of this quaternion, inverting the sign of every component except [member w]. </description> </method> <method name="is_equal_approx" qualifiers="const"> <return type="bool" /> <param index="0" name="to" type="Quaternion" /> <description> Returns [code]true[/code] if this quaternion and [param to] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. </description> </method> <method name="is_finite" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if this quaternion is finite, by calling [method @GlobalScope.is_finite] on each component. </description> </method> <method name="is_normalized" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if this quaternion is normalized. See also [method normalized]. </description> </method> <method name="length" qualifiers="const" keywords="size"> <return type="float" /> <description> Returns this quaternion's length, also called magnitude. </description> </method> <method name="length_squared" qualifiers="const"> <return type="float" /> <description> Returns this quaternion's length, squared. [b]Note:[/b] This method is faster than [method length], so prefer it if you only need to compare quaternion lengths. </description> </method> <method name="log" qualifiers="const"> <return type="Quaternion" /> <description> Returns the logarithm of this quaternion. Multiplies this quaternion's rotation axis by its rotation angle, and stores the result in the returned quaternion's vector part ([member x], [member y], and [member z]). The returned quaternion's real part ([member w]) is always [code]0.0[/code]. </description> </method> <method name="normalized" qualifiers="const"> <return type="Quaternion" /> <description> Returns a copy of this quaternion, normalized so that its length is [code]1.0[/code]. See also [method is_normalized]. </description> </method> <method name="slerp" qualifiers="const" keywords="interpolate"> <return type="Quaternion" /> <param index="0" name="to" type="Quaternion" /> <param index="1" name="weight" type="float" /> <description> Performs a spherical-linear interpolation with the [param to] quaternion, given a [param weight] and returns the result. Both this quaternion and [param to] must be normalized. </description> </method> <method name="slerpni" qualifiers="const"> <return type="Quaternion" /> <param index="0" name="to" type="Quaternion" /> <param index="1" name="weight" type="float" /> <description> Performs a spherical-linear interpolation with the [param to] quaternion, given a [param weight] and returns the result. Unlike [method slerp], this method does not check if the rotation path is smaller than 90 degrees. Both this quaternion and [param to] must be normalized. </description> </method> <method name="spherical_cubic_interpolate" qualifiers="const"> <return type="Quaternion" /> <param index="0" name="b" type="Quaternion" /> <param index="1" name="pre_a" type="Quaternion" /> <param index="2" name="post_b" type="Quaternion" /> <param index="3" name="weight" type="float" /> <description> Performs a spherical cubic interpolation between quaternions [param pre_a], this vector, [param b], and [param post_b], by the given amount [param weight]. </description> </method> <method name="spherical_cubic_interpolate_in_time" qualifiers="const"> <return type="Quaternion" /> <param index="0" name="b" type="Quaternion" /> <param index="1" name="pre_a" type="Quaternion" /> <param index="2" name="post_b" type="Quaternion" /> <param index="3" name="weight" type="float" /> <param index="4" name="b_t" type="float" /> <param index="5" name="pre_a_t" type="float" /> <param index="6" name="post_b_t" type="float" /> <description> Performs a spherical cubic interpolation between quaternions [param pre_a], this vector, [param b], and [param post_b], by the given amount [param weight]. It can perform smoother interpolation than [method spherical_cubic_interpolate] by the time values. </description> </method> </methods>
124374
<members> <member name="w" type="float" setter="" getter="" default="1.0"> W component of the quaternion. This is the "real" part. [b]Note:[/b] Quaternion components should usually not be manipulated directly. </member> <member name="x" type="float" setter="" getter="" default="0.0"> X component of the quaternion. This is the value along the "imaginary" [code]i[/code] axis. [b]Note:[/b] Quaternion components should usually not be manipulated directly. </member> <member name="y" type="float" setter="" getter="" default="0.0"> Y component of the quaternion. This is the value along the "imaginary" [code]j[/code] axis. [b]Note:[/b] Quaternion components should usually not be manipulated directly. </member> <member name="z" type="float" setter="" getter="" default="0.0"> Z component of the quaternion. This is the value along the "imaginary" [code]k[/code] axis. [b]Note:[/b] Quaternion components should usually not be manipulated directly. </member> </members> <constants> <constant name="IDENTITY" value="Quaternion(0, 0, 0, 1)"> The identity quaternion, representing no rotation. This has the same rotation as [constant Basis.IDENTITY]. If a [Vector3] is rotated (multiplied) by this quaternion, it does not change. </constant> </constants> <operators> <operator name="operator !="> <return type="bool" /> <param index="0" name="right" type="Quaternion" /> <description> Returns [code]true[/code] if the components of both quaternions are not exactly equal. [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable. </description> </operator> <operator name="operator *"> <return type="Quaternion" /> <param index="0" name="right" type="Quaternion" /> <description> Composes (multiplies) two quaternions. This rotates the [param right] quaternion (the child) by this quaternion (the parent). </description> </operator> <operator name="operator *"> <return type="Vector3" /> <param index="0" name="right" type="Vector3" /> <description> Rotates (multiplies) the [param right] vector by this quaternion, returning a [Vector3]. </description> </operator> <operator name="operator *"> <return type="Quaternion" /> <param index="0" name="right" type="float" /> <description> Multiplies each component of the [Quaternion] by the right [float] value. This operation is not meaningful on its own, but it can be used as a part of a larger expression. </description> </operator> <operator name="operator *"> <return type="Quaternion" /> <param index="0" name="right" type="int" /> <description> Multiplies each component of the [Quaternion] by the right [int] value. This operation is not meaningful on its own, but it can be used as a part of a larger expression. </description> </operator> <operator name="operator +"> <return type="Quaternion" /> <param index="0" name="right" type="Quaternion" /> <description> Adds each component of the left [Quaternion] to the right [Quaternion]. This operation is not meaningful on its own, but it can be used as a part of a larger expression, such as approximating an intermediate rotation between two nearby rotations. </description> </operator> <operator name="operator -"> <return type="Quaternion" /> <param index="0" name="right" type="Quaternion" /> <description> Subtracts each component of the left [Quaternion] by the right [Quaternion]. This operation is not meaningful on its own, but it can be used as a part of a larger expression. </description> </operator> <operator name="operator /"> <return type="Quaternion" /> <param index="0" name="right" type="float" /> <description> Divides each component of the [Quaternion] by the right [float] value. This operation is not meaningful on its own, but it can be used as a part of a larger expression. </description> </operator> <operator name="operator /"> <return type="Quaternion" /> <param index="0" name="right" type="int" /> <description> Divides each component of the [Quaternion] by the right [int] value. This operation is not meaningful on its own, but it can be used as a part of a larger expression. </description> </operator> <operator name="operator =="> <return type="bool" /> <param index="0" name="right" type="Quaternion" /> <description> Returns [code]true[/code] if the components of both quaternions are exactly equal. [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable. </description> </operator> <operator name="operator []"> <return type="float" /> <param index="0" name="index" type="int" /> <description> Accesses each component of this quaternion by their index. Index [code]0[/code] is the same as [member x], index [code]1[/code] is the same as [member y], index [code]2[/code] is the same as [member z], and index [code]3[/code] is the same as [member w]. </description> </operator> <operator name="operator unary+"> <return type="Quaternion" /> <description> Returns the same value as if the [code]+[/code] was not there. Unary [code]+[/code] does nothing, but sometimes it can make your code more readable. </description> </operator> <operator name="operator unary-"> <return type="Quaternion" /> <description> Returns the negative value of the [Quaternion]. This is the same as multiplying all components by [code]-1[/code]. This operation results in a quaternion that represents the same rotation. </description> </operator> </operators> </class>
124380
<?xml version="1.0" encoding="UTF-8" ?> <class name="CharacterBody2D" inherits="PhysicsBody2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A 2D physics body specialized for characters moved by script. </brief_description> <description> [CharacterBody2D] is a specialized class for physics bodies that are meant to be user-controlled. They are not affected by physics at all, but they affect other physics bodies in their path. They are mainly used to provide high-level API to move objects with wall and slope detection ([method move_and_slide] method) in addition to the general collision detection provided by [method PhysicsBody2D.move_and_collide]. This makes it useful for highly configurable physics bodies that must move in specific ways and collide with the world, as is often the case with user-controlled characters. For game objects that don't require complex movement or collision detection, such as moving platforms, [AnimatableBody2D] is simpler to configure. </description> <tutorials> <link title="Kinematic character (2D)">$DOCS_URL/tutorials/physics/kinematic_character_2d.html</link> <link title="Using CharacterBody2D">$DOCS_URL/tutorials/physics/using_character_body_2d.html</link> <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/2719</link> <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/2727</link> </tutorials>
124381
<methods> <method name="apply_floor_snap"> <return type="void" /> <description> Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when [method is_on_floor] returns [code]true[/code]. </description> </method> <method name="get_floor_angle" qualifiers="const"> <return type="float" /> <param index="0" name="up_direction" type="Vector2" default="Vector2(0, -1)" /> <description> Returns the floor's collision angle at the last collision point according to [param up_direction], which is [constant Vector2.UP] by default. This value is always positive and only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code]. </description> </method> <method name="get_floor_normal" qualifiers="const"> <return type="Vector2" /> <description> Returns the collision normal of the floor at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code]. [b]Warning:[/b] The collision normal is not always the same as the surface normal. </description> </method> <method name="get_last_motion" qualifiers="const"> <return type="Vector2" /> <description> Returns the last motion applied to the [CharacterBody2D] during the last call to [method move_and_slide]. The movement can be split into multiple motions when sliding occurs, and this method return the last one, which is useful to retrieve the current direction of the movement. </description> </method> <method name="get_last_slide_collision"> <return type="KinematicCollision2D" /> <description> Returns a [KinematicCollision2D], which contains information about the latest collision that occurred during the last call to [method move_and_slide]. </description> </method> <method name="get_platform_velocity" qualifiers="const"> <return type="Vector2" /> <description> Returns the linear velocity of the platform at the last collision point. Only valid after calling [method move_and_slide]. </description> </method> <method name="get_position_delta" qualifiers="const"> <return type="Vector2" /> <description> Returns the travel (position delta) that occurred during the last call to [method move_and_slide]. </description> </method> <method name="get_real_velocity" qualifiers="const"> <return type="Vector2" /> <description> Returns the current real velocity since the last call to [method move_and_slide]. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to [member velocity] which returns the requested velocity. </description> </method> <method name="get_slide_collision"> <return type="KinematicCollision2D" /> <param index="0" name="slide_idx" type="int" /> <description> Returns a [KinematicCollision2D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_collision_count] - 1). [b]Example usage:[/b] [codeblocks] [gdscript] for i in get_slide_collision_count(): var collision = get_slide_collision(i) print("Collided with: ", collision.get_collider().name) [/gdscript] [csharp] for (int i = 0; i &lt; GetSlideCollisionCount(); i++) { KinematicCollision2D collision = GetSlideCollision(i); GD.Print("Collided with: ", (collision.GetCollider() as Node).Name); } [/csharp] [/codeblocks] </description> </method> <method name="get_slide_collision_count" qualifiers="const"> <return type="int" /> <description> Returns the number of times the body collided and changed direction during the last call to [method move_and_slide]. </description> </method> <method name="get_wall_normal" qualifiers="const"> <return type="Vector2" /> <description> Returns the collision normal of the wall at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_wall] returns [code]true[/code]. [b]Warning:[/b] The collision normal is not always the same as the surface normal. </description> </method> <method name="is_on_ceiling" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the body collided with the ceiling on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "ceiling" or not. </description> </method> <method name="is_on_ceiling_only" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the body collided only with the ceiling on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "ceiling" or not. </description> </method> <method name="is_on_floor" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the body collided with the floor on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "floor" or not. </description> </method> <method name="is_on_floor_only" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the body collided only with the floor on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "floor" or not. </description> </method> <method name="is_on_wall" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the body collided with a wall on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "wall" or not. </description> </method> <method name="is_on_wall_only" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the body collided only with a wall on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "wall" or not. </description> </method> <method name="move_and_slide"> <return type="bool" /> <description> Moves the body based on [member velocity]. If the body collides with another, it will slide along the other body (by default only on floor) rather than stop immediately. If the other body is a [CharacterBody2D] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. Modifies [member velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for detailed information about collisions that occurred, use [method get_slide_collision]. When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. The general behavior and available properties change according to the [member motion_mode]. Returns [code]true[/code] if the body collided, otherwise, returns [code]false[/code]. </description> </method> </methods>
124382
<members> <member name="floor_block_on_wall" type="bool" setter="set_floor_block_on_wall_enabled" getter="is_floor_block_on_wall_enabled" default="true"> If [code]true[/code], the body will be able to move on the floor only. This option avoids to be able to walk on walls, it will however allow to slide down along them. </member> <member name="floor_constant_speed" type="bool" setter="set_floor_constant_speed_enabled" getter="is_floor_constant_speed_enabled" default="false"> If [code]false[/code] (by default), the body will move faster on downward slopes and slower on upward slopes. If [code]true[/code], the body will always move at the same speed on the ground no matter the slope. Note that you need to use [member floor_snap_length] to stick along a downward slope at constant speed. </member> <member name="floor_max_angle" type="float" setter="set_floor_max_angle" getter="get_floor_max_angle" default="0.785398"> Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. The default value equals 45 degrees. </member> <member name="floor_snap_length" type="float" setter="set_floor_snap_length" getter="get_floor_snap_length" default="1.0"> Sets a snapping distance. When set to a value different from [code]0.0[/code], the body is kept attached to slopes when calling [method move_and_slide]. The snapping vector is determined by the given distance along the opposite direction of the [member up_direction]. As long as the snapping vector is in contact with the ground and the body moves against [member up_direction], the body will remain attached to the surface. Snapping is not applied if the body moves along [member up_direction], meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use [method apply_floor_snap]. </member> <member name="floor_stop_on_slope" type="bool" setter="set_floor_stop_on_slope_enabled" getter="is_floor_stop_on_slope_enabled" default="true"> If [code]true[/code], the body will not slide on slopes when calling [method move_and_slide] when the body is standing still. If [code]false[/code], the body will slide on floor's slopes when [member velocity] applies a downward force. </member> <member name="max_slides" type="int" setter="set_max_slides" getter="get_max_slides" default="4"> Maximum number of times the body can change direction before it stops when calling [method move_and_slide]. </member> <member name="motion_mode" type="int" setter="set_motion_mode" getter="get_motion_mode" enum="CharacterBody2D.MotionMode" default="0"> Sets the motion mode which defines the behavior of [method move_and_slide]. See [enum MotionMode] constants for available modes. </member> <member name="platform_floor_layers" type="int" setter="set_platform_floor_layers" getter="get_platform_floor_layers" default="4294967295"> Collision layers that will be included for detecting floor bodies that will act as moving platforms to be followed by the [CharacterBody2D]. By default, all floor bodies are detected and propagate their velocity. </member> <member name="platform_on_leave" type="int" setter="set_platform_on_leave" getter="get_platform_on_leave" enum="CharacterBody2D.PlatformOnLeave" default="0"> Sets the behavior to apply when you leave a moving platform. By default, to be physically accurate, when you leave the last platform velocity is applied. See [enum PlatformOnLeave] constants for available behavior. </member> <member name="platform_wall_layers" type="int" setter="set_platform_wall_layers" getter="get_platform_wall_layers" default="0"> Collision layers that will be included for detecting wall bodies that will act as moving platforms to be followed by the [CharacterBody2D]. By default, all wall bodies are ignored. </member> <member name="safe_margin" type="float" setter="set_safe_margin" getter="get_safe_margin" default="0.08"> Extra margin used for collision recovery when calling [method move_and_slide]. If the body is at least this close to another body, it will consider them to be colliding and will be pushed away before performing the actual motion. A higher value means it's more flexible for detecting collision, which helps with consistently detecting walls and floors. A lower value forces the collision algorithm to use more exact detection, so it can be used in cases that specifically require precision, e.g at very low scale to avoid visible jittering, or for stability with a stack of character bodies. </member> <member name="slide_on_ceiling" type="bool" setter="set_slide_on_ceiling_enabled" getter="is_slide_on_ceiling_enabled" default="true"> If [code]true[/code], during a jump against the ceiling, the body will slide, if [code]false[/code] it will be stopped and will fall vertically. </member> <member name="up_direction" type="Vector2" setter="set_up_direction" getter="get_up_direction" default="Vector2(0, -1)"> Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [method move_and_slide]. Defaults to [constant Vector2.UP]. As the vector will be normalized it can't be equal to [constant Vector2.ZERO], if you want all collisions to be reported as walls, consider using [constant MOTION_MODE_FLOATING] as [member motion_mode]. </member> <member name="velocity" type="Vector2" setter="set_velocity" getter="get_velocity" default="Vector2(0, 0)"> Current velocity vector in pixels per second, used and modified during calls to [method move_and_slide]. </member> <member name="wall_min_slide_angle" type="float" setter="set_wall_min_slide_angle" getter="get_wall_min_slide_angle" default="0.261799"> Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The default value equals 15 degrees. This property only affects movement when [member motion_mode] is [constant MOTION_MODE_FLOATING]. </member> </members> <constants> <constant name="MOTION_MODE_GROUNDED" value="0" enum="MotionMode"> Apply when notions of walls, ceiling and floor are relevant. In this mode the body motion will react to slopes (acceleration/slowdown). This mode is suitable for sided games like platformers. </constant> <constant name="MOTION_MODE_FLOATING" value="1" enum="MotionMode"> Apply when there is no notion of floor or ceiling. All collisions will be reported as [code]on_wall[/code]. In this mode, when you slide, the speed will always be constant. This mode is suitable for top-down games. </constant> <constant name="PLATFORM_ON_LEAVE_ADD_VELOCITY" value="0" enum="PlatformOnLeave"> Add the last platform velocity to the [member velocity] when you leave a moving platform. </constant> <constant name="PLATFORM_ON_LEAVE_ADD_UPWARD_VELOCITY" value="1" enum="PlatformOnLeave"> Add the last platform velocity to the [member velocity] when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. </constant> <constant name="PLATFORM_ON_LEAVE_DO_NOTHING" value="2" enum="PlatformOnLeave"> Do nothing when leaving a platform. </constant> </constants> </class>
124407
<?xml version="1.0" encoding="UTF-8" ?> <class name="MeshDataTool" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Helper tool to access and edit [Mesh] data. </brief_description> <description> MeshDataTool provides access to individual vertices in a [Mesh]. It allows users to read and edit vertex data of meshes. It also creates an array of faces and edges. To use MeshDataTool, load a mesh with [method create_from_surface]. When you are finished editing the data commit the data to a mesh with [method commit_to_surface]. Below is an example of how MeshDataTool may be used. [codeblocks] [gdscript] var mesh = ArrayMesh.new() mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, BoxMesh.new().get_mesh_arrays()) var mdt = MeshDataTool.new() mdt.create_from_surface(mesh, 0) for i in range(mdt.get_vertex_count()): var vertex = mdt.get_vertex(i) # In this example we extend the mesh by one unit, which results in separated faces as it is flat shaded. vertex += mdt.get_vertex_normal(i) # Save your change. mdt.set_vertex(i, vertex) mesh.clear_surfaces() mdt.commit_to_surface(mesh) var mi = MeshInstance.new() mi.mesh = mesh add_child(mi) [/gdscript] [csharp] var mesh = new ArrayMesh(); mesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, new BoxMesh().GetMeshArrays()); var mdt = new MeshDataTool(); mdt.CreateFromSurface(mesh, 0); for (var i = 0; i &lt; mdt.GetVertexCount(); i++) { Vector3 vertex = mdt.GetVertex(i); // In this example we extend the mesh by one unit, which results in separated faces as it is flat shaded. vertex += mdt.GetVertexNormal(i); // Save your change. mdt.SetVertex(i, vertex); } mesh.ClearSurfaces(); mdt.CommitToSurface(mesh); var mi = new MeshInstance(); mi.Mesh = mesh; AddChild(mi); [/csharp] [/codeblocks] See also [ArrayMesh], [ImmediateMesh] and [SurfaceTool] for procedural geometry generation. [b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes. </description> <tutorials> <link title="Using the MeshDataTool">$DOCS_URL/tutorials/3d/procedural_geometry/meshdatatool.html</link> </tutorials>
124438
<?xml version="1.0" encoding="UTF-8" ?> <class name="Variant" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> The most important data type in Godot. </brief_description> <description> In computer programming, a Variant class is a class that is designed to store a variety of other types. Dynamic programming languages like PHP, Lua, JavaScript and GDScript like to use them to store variables' data on the backend. With these Variants, properties are able to change value types freely. [codeblocks] [gdscript] var foo = 2 # foo is dynamically an integer foo = "Now foo is a string!" foo = RefCounted.new() # foo is an Object var bar: int = 2 # bar is a statically typed integer. # bar = "Uh oh! I can't make statically typed variables become a different type!" [/gdscript] [csharp] // C# is statically typed. Once a variable has a type it cannot be changed. You can use the `var` keyword to let the compiler infer the type automatically. var foo = 2; // Foo is a 32-bit integer (int). Be cautious, integers in GDScript are 64-bit and the direct C# equivalent is `long`. // foo = "foo was and will always be an integer. It cannot be turned into a string!"; var boo = "Boo is a string!"; var ref = new RefCounted(); // var is especially useful when used together with a constructor. // Godot also provides a Variant type that works like a union of all the Variant-compatible types. Variant fooVar = 2; // fooVar is dynamically an integer (stored as a `long` in the Variant type). fooVar = "Now fooVar is a string!"; fooVar = new RefCounted(); // fooVar is a GodotObject. [/csharp] [/codeblocks] Godot tracks all scripting API variables within Variants. Without even realizing it, you use Variants all the time. When a particular language enforces its own rules for keeping data typed, then that language is applying its own custom logic over the base Variant scripting API. - GDScript automatically wrap values in them. It keeps all data in plain Variants by default and then optionally enforces custom static typing rules on variable types. - C# is statically typed, but uses its own implementation of the Variant type in place of Godot's [Variant] class when it needs to represent a dynamic value. C# Variant can be assigned any compatible type implicitly but converting requires an explicit cast. The global [method @GlobalScope.typeof] function returns the enumerated value of the Variant type stored in the current variable (see [enum Variant.Type]). [codeblocks] [gdscript] var foo = 2 match typeof(foo): TYPE_NIL: print("foo is null") TYPE_INT: print("foo is an integer") TYPE_OBJECT: # Note that Objects are their own special category. # To get the name of the underlying Object type, you need the `get_class()` method. print("foo is a(n) %s" % foo.get_class()) # inject the class name into a formatted string. # Note that this does not get the script's `class_name` global identifier. # If the `class_name` is needed, use `foo.get_script().get_global_name()` instead. [/gdscript] [csharp] Variant foo = 2; switch (foo.VariantType) { case Variant.Type.Nil: GD.Print("foo is null"); break; case Variant.Type.Int: GD.Print("foo is an integer"); break; case Variant.Type.Object: // Note that Objects are their own special category. // You can convert a Variant to a GodotObject and use reflection to get its name. GD.Print($"foo is a(n) {foo.AsGodotObject().GetType().Name}"); break; } [/csharp] [/codeblocks] A Variant takes up only 20 bytes and can store almost any engine datatype inside of it. Variants are rarely used to hold information for long periods of time. Instead, they are used mainly for communication, editing, serialization and moving data around. Godot has specifically invested in making its Variant class as flexible as possible; so much so that it is used for a multitude of operations to facilitate communication between all of Godot's systems. A Variant: - Can store almost any datatype. - Can perform operations between many variants. GDScript uses Variant as its atomic/native datatype. - Can be hashed, so it can be compared quickly to other variants. - Can be used to convert safely between datatypes. - Can be used to abstract calling methods and their arguments. Godot exports all its functions through variants. - Can be used to defer calls or move data between threads. - Can be serialized as binary and stored to disk, or transferred via network. - Can be serialized to text and use it for printing values and editable settings. - Can work as an exported property, so the editor can edit it universally. - Can be used for dictionaries, arrays, parsers, etc. [b]Containers (Array and Dictionary):[/b] Both are implemented using variants. A [Dictionary] can match any datatype used as key to any other datatype. An [Array] just holds an array of Variants. Of course, a Variant can also hold a [Dictionary] and an [Array] inside, making it even more flexible. Modifications to a container will modify all references to it. A [Mutex] should be created to lock it if multi-threaded access is desired. </description> <tutorials> <link title="Variant class introduction">$DOCS_URL/contributing/development/core_and_modules/variant_class.html</link> </tutorials> </class>
124445
<?xml version="1.0" encoding="UTF-8" ?> <class name="Area3D" inherits="CollisionObject3D" keywords="trigger" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A region of 3D space that detects other [CollisionObject3D]s entering or exiting it. </brief_description> <description> [Area3D] is a region of 3D space defined by one or multiple [CollisionShape3D] or [CollisionPolygon3D] child nodes. It detects when other [CollisionObject3D]s enter or exit it, and it also keeps track of which collision objects haven't exited it yet (i.e. which one are overlapping it). This node can also locally alter or override physics parameters (gravity, damping) and route audio to custom audio buses. [b]Note:[/b] Areas and bodies created with [PhysicsServer3D] might not interact as expected with [Area3D]s, and might not emit signals or track objects correctly. [b]Warning:[/b] Using a [ConcavePolygonShape3D] inside a [CollisionShape3D] child of this node (created e.g. by using the [b]Create Trimesh Collision Sibling[/b] option in the [b]Mesh[/b] menu that appears when selecting a [MeshInstance3D] node) may give unexpected results, since this collision shape is hollow. If this is not desired, it has to be split into multiple [ConvexPolygonShape3D]s or primitive shapes like [BoxShape3D], or in some cases it may be replaceable by a [CollisionPolygon3D]. </description> <tutorials> <link title="Using Area2D">$DOCS_URL/tutorials/physics/using_area_2d.html</link> <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link> <link title="GUI in 3D Viewport Demo">https://godotengine.org/asset-library/asset/2807</link> </tutorials> <methods> <method name="get_overlapping_areas" qualifiers="const"> <return type="Area3D[]" /> <description> Returns a list of intersecting [Area3D]s. The overlapping area's [member CollisionObject3D.collision_layer] must be part of this area's [member CollisionObject3D.collision_mask] in order to be detected. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. </description> </method> <method name="get_overlapping_bodies" qualifiers="const"> <return type="Node3D[]" /> <description> Returns a list of intersecting [PhysicsBody3D]s and [GridMap]s. The overlapping body's [member CollisionObject3D.collision_layer] must be part of this area's [member CollisionObject3D.collision_mask] in order to be detected. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. </description> </method> <method name="has_overlapping_areas" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if intersecting any [Area3D]s, otherwise returns [code]false[/code]. The overlapping area's [member CollisionObject3D.collision_layer] must be part of this area's [member CollisionObject3D.collision_mask] in order to be detected. For performance reasons (collisions are all processed at the same time) the list of overlapping areas is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. </description> </method> <method name="has_overlapping_bodies" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if intersecting any [PhysicsBody3D]s or [GridMap]s, otherwise returns [code]false[/code]. The overlapping body's [member CollisionObject3D.collision_layer] must be part of this area's [member CollisionObject3D.collision_mask] in order to be detected. For performance reasons (collisions are all processed at the same time) the list of overlapping bodies is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. </description> </method> <method name="overlaps_area" qualifiers="const"> <return type="bool" /> <param index="0" name="area" type="Node" /> <description> Returns [code]true[/code] if the given [Area3D] intersects or overlaps this [Area3D], [code]false[/code] otherwise. [b]Note:[/b] The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead. </description> </method> <method name="overlaps_body" qualifiers="const"> <return type="bool" /> <param index="0" name="body" type="Node" /> <description> Returns [code]true[/code] if the given physics body intersects or overlaps this [Area3D], [code]false[/code] otherwise. [b]Note:[/b] The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead. The [param body] argument can either be a [PhysicsBody3D] or a [GridMap] instance. While GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body. </description> </method> </methods>
124462
<methods> <method name="edit_node"> <return type="void" /> <param index="0" name="node" type="Node" /> <description> Edits the given [Node]. The node will be also selected if it's inside the scene tree. </description> </method> <method name="edit_resource"> <return type="void" /> <param index="0" name="resource" type="Resource" /> <description> Edits the given [Resource]. If the resource is a [Script] you can also edit it with [method edit_script] to specify the line and column position. </description> </method> <method name="edit_script"> <return type="void" /> <param index="0" name="script" type="Script" /> <param index="1" name="line" type="int" default="-1" /> <param index="2" name="column" type="int" default="0" /> <param index="3" name="grab_focus" type="bool" default="true" /> <description> Edits the given [Script]. The line and column on which to open the script can also be specified. The script will be open with the user-configured editor for the script's language which may be an external editor. </description> </method> <method name="get_base_control" qualifiers="const"> <return type="Control" /> <description> Returns the main container of Godot editor's window. For example, you can use it to retrieve the size of the container and place your controls accordingly. [b]Warning:[/b] Removing and freeing this node will render the editor useless and may cause a crash. </description> </method> <method name="get_command_palette" qualifiers="const"> <return type="EditorCommandPalette" /> <description> Returns the editor's [EditorCommandPalette] instance. [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash. </description> </method> <method name="get_current_directory" qualifiers="const"> <return type="String" /> <description> Returns the current directory being viewed in the [FileSystemDock]. If a file is selected, its base directory will be returned using [method String.get_base_dir] instead. </description> </method> <method name="get_current_feature_profile" qualifiers="const"> <return type="String" /> <description> Returns the name of the currently activated feature profile. If the default profile is currently active, an empty string is returned instead. In order to get a reference to the [EditorFeatureProfile], you must load the feature profile using [method EditorFeatureProfile.load_from_file]. [b]Note:[/b] Feature profiles created via the user interface are loaded from the [code]feature_profiles[/code] directory, as a file with the [code].profile[/code] extension. The editor configuration folder can be found by using [method EditorPaths.get_config_dir]. </description> </method> <method name="get_current_path" qualifiers="const"> <return type="String" /> <description> Returns the current path being viewed in the [FileSystemDock]. </description> </method> <method name="get_edited_scene_root" qualifiers="const"> <return type="Node" /> <description> Returns the edited (current) scene's root [Node]. </description> </method> <method name="get_editor_main_screen" qualifiers="const"> <return type="VBoxContainer" /> <description> Returns the editor control responsible for main screen plugins and tools. Use it with plugins that implement [method EditorPlugin._has_main_screen]. [b]Note:[/b] This node is a [VBoxContainer], which means that if you add a [Control] child to it, you need to set the child's [member Control.size_flags_vertical] to [constant Control.SIZE_EXPAND_FILL] to make it use the full available space. [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash. </description> </method> <method name="get_editor_paths" qualifiers="const"> <return type="EditorPaths" /> <description> Returns the [EditorPaths] singleton. </description> </method> <method name="get_editor_scale" qualifiers="const"> <return type="float" /> <description> Returns the actual scale of the editor UI ([code]1.0[/code] being 100% scale). This can be used to adjust position and dimensions of the UI added by plugins. [b]Note:[/b] This value is set via the [code]interface/editor/display_scale[/code] and [code]interface/editor/custom_display_scale[/code] editor settings. Editor must be restarted for changes to be properly applied. </description> </method> <method name="get_editor_settings" qualifiers="const"> <return type="EditorSettings" /> <description> Returns the editor's [EditorSettings] instance. </description> </method> <method name="get_editor_theme" qualifiers="const"> <return type="Theme" /> <description> Returns the editor's [Theme]. [b]Note:[/b] When creating custom editor UI, prefer accessing theme items directly from your GUI nodes using the [code]get_theme_*[/code] methods. </description> </method> <method name="get_editor_undo_redo" qualifiers="const"> <return type="EditorUndoRedoManager" /> <description> Returns the editor's [EditorUndoRedoManager]. </description> </method> <method name="get_editor_viewport_2d" qualifiers="const"> <return type="SubViewport" /> <description> Returns the 2D editor [SubViewport]. It does not have a camera. Instead, the view transforms are done directly and can be accessed with [member Viewport.global_canvas_transform]. </description> </method> <method name="get_editor_viewport_3d" qualifiers="const"> <return type="SubViewport" /> <param index="0" name="idx" type="int" default="0" /> <description> Returns the specified 3D editor [SubViewport], from [code]0[/code] to [code]3[/code]. The viewport can be used to access the active editor cameras with [method Viewport.get_camera_3d]. </description> </method> <method name="get_file_system_dock" qualifiers="const"> <return type="FileSystemDock" /> <description> Returns the editor's [FileSystemDock] instance. [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash. </description> </method> <method name="get_inspector" qualifiers="const"> <return type="EditorInspector" /> <description> Returns the editor's [EditorInspector] instance. [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash. </description> </method> <method name="get_open_scenes" qualifiers="const"> <return type="PackedStringArray" /> <description> Returns an [Array] with the file paths of the currently opened scenes. </description> </method> <method name="get_playing_scene" qualifiers="const"> <return type="String" /> <description> Returns the name of the scene that is being played. If no scene is currently being played, returns an empty string. </description> </method> <method name="get_resource_filesystem" qualifiers="const"> <return type="EditorFileSystem" /> <description> Returns the editor's [EditorFileSystem] instance. </description> </method> <method name="get_resource_previewer" qualifiers="const"> <return type="EditorResourcePreview" /> <description> Returns the editor's [EditorResourcePreview] instance. </description> </method>
124532
<?xml version="1.0" encoding="UTF-8" ?> <class name="PlaneMesh" inherits="PrimitiveMesh" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Class representing a planar [PrimitiveMesh]. </brief_description> <description> Class representing a planar [PrimitiveMesh]. This flat mesh does not have a thickness. By default, this mesh is aligned on the X and Z axes; this default rotation isn't suited for use with billboarded materials. For billboarded materials, change [member orientation] to [constant FACE_Z]. [b]Note:[/b] When using a large textured [PlaneMesh] (e.g. as a floor), you may stumble upon UV jittering issues depending on the camera angle. To solve this, increase [member subdivide_depth] and [member subdivide_width] until you no longer notice UV jittering. </description> <tutorials> </tutorials> <members> <member name="center_offset" type="Vector3" setter="set_center_offset" getter="get_center_offset" default="Vector3(0, 0, 0)"> Offset of the generated plane. Useful for particles. </member> <member name="orientation" type="int" setter="set_orientation" getter="get_orientation" enum="PlaneMesh.Orientation" default="1"> Direction that the [PlaneMesh] is facing. See [enum Orientation] for options. </member> <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2(2, 2)"> Size of the generated plane. </member> <member name="subdivide_depth" type="int" setter="set_subdivide_depth" getter="get_subdivide_depth" default="0"> Number of subdivision along the Z axis. </member> <member name="subdivide_width" type="int" setter="set_subdivide_width" getter="get_subdivide_width" default="0"> Number of subdivision along the X axis. </member> </members> <constants> <constant name="FACE_X" value="0" enum="Orientation"> [PlaneMesh] will face the positive X-axis. </constant> <constant name="FACE_Y" value="1" enum="Orientation"> [PlaneMesh] will face the positive Y-axis. This matches the behavior of the [PlaneMesh] in Godot 3.x. </constant> <constant name="FACE_Z" value="2" enum="Orientation"> [PlaneMesh] will face the positive Z-axis. This matches the behavior of the QuadMesh in Godot 3.x. </constant> </constants> </class>
124533
<?xml version="1.0" encoding="UTF-8" ?> <class name="Node" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Base class for all scene objects. </brief_description> <description> Nodes are Godot's building blocks. They can be assigned as the child of another node, resulting in a tree arrangement. A given node can contain any number of nodes as children with the requirement that all siblings (direct children of a node) should have unique names. A tree of nodes is called a [i]scene[/i]. Scenes can be saved to the disk and then instantiated into other scenes. This allows for very high flexibility in the architecture and data model of Godot projects. [b]Scene tree:[/b] The [SceneTree] contains the active tree of nodes. When a node is added to the scene tree, it receives the [constant NOTIFICATION_ENTER_TREE] notification and its [method _enter_tree] callback is triggered. Child 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 [constant NOTIFICATION_READY] notification and their respective [method _ready] callbacks are triggered. For groups of nodes, the [method _ready] callback is called in reverse order, starting with the children and moving up to the parent nodes. This means that when adding a node 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 (recursively for the entire scene tree). [b]Processing:[/b] Nodes can override 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] (in seconds) is passed as an argument. Physics processing (callback [method _physics_process], toggled with [method set_physics_process]) happens a fixed number of times per second (60 by default) and is useful for code related to the physics engine. Nodes can also process input events. When present, 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 instantiating scenes into other scenes), an "owner" can be set for the node with the [member owner] property. This keeps track of who instantiated what. This is mostly useful when writing editors and tools, though. Finally, when a node is freed with [method Object.free] or [method queue_free], it will also free all its children. [b]Groups:[/b] Nodes can be added to as many groups as you want to be easy to manage, you could create groups like "enemies" or "collectables" for example, depending on your game. See [method add_to_group], [method is_in_group] and [method remove_from_group]. You can then retrieve all nodes in these groups, iterate them and even call methods on groups via the methods on [SceneTree]. [b]Networking with nodes:[/b] After connecting to a server (or making one, see [ENetMultiplayerPeer]), it is possible to use the built-in RPC (remote procedure call) system to 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). To identify which node receives the RPC call, Godot will use its [NodePath] (make sure node names are the same on all peers). Also, take a look at the high-level networking tutorial and corresponding demos. [b]Note:[/b] The [code]script[/code] property is part of the [Object] class, not [Node]. It isn't exposed like most properties but does have a setter and getter (see [method Object.set_script] and [method Object.get_script]). </description> <tutorials> <link title="Nodes and scenes">$DOCS_URL/getting_started/step_by_step/nodes_and_scenes.html</link> <link title="All Demos">https://github.com/godotengine/godot-demo-projects/</link> </tutorials>
124534
<methods> <method name="_enter_tree" qualifiers="virtual"> <return type="void" /> <description> Called when the node enters the [SceneTree] (e.g. upon instantiating, 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 [constant NOTIFICATION_ENTER_TREE] notification in [method Object._notification]. </description> </method> <method name="_exit_tree" qualifiers="virtual"> <return type="void" /> <description> Called when the node is about to leave 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 [constant NOTIFICATION_EXIT_TREE] notification in [method Object._notification] and signal [signal tree_exiting]. To get notified when the node has already left the active tree, connect to the [signal tree_exited]. </description> </method> <method name="_get_configuration_warnings" qualifiers="virtual const"> <return type="PackedStringArray" /> <description> The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a [code]tool[/code] script. Returning an empty array produces no warnings. Call [method update_configuration_warnings] when the warnings need to be updated for this node. [codeblock] @export var energy = 0: set(value): energy = value update_configuration_warnings() func _get_configuration_warnings(): if energy &lt; 0: return ["Energy must be 0 or greater."] else: return [] [/codeblock] </description> </method> <method name="_input" qualifiers="virtual"> <return type="void" /> <param index="0" name="event" type="InputEvent" /> <description> Called when there is an input event. The input event propagates up through the node tree until a node consumes it. It is only called if input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_input]. To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. For gameplay input, [method _unhandled_input] and [method _unhandled_key_input] are usually a better fit as they allow the GUI to intercept the events first. [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). </description> </method> <method name="_physics_process" qualifiers="virtual"> <return type="void" /> <param index="0" name="delta" type="float" /> <description> Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the [param delta] variable should be constant. [param delta] is in seconds. It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_physics_process]. Processing happens in order of [member process_physics_priority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal). Corresponds to the [constant NOTIFICATION_PHYSICS_PROCESS] notification in [method Object._notification]. [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). </description> </method> <method name="_process" qualifiers="virtual"> <return type="void" /> <param index="0" name="delta" type="float" /> <description> Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the [param delta] time since the previous frame is not constant. [param delta] is in seconds. It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process]. Processing happens in order of [member process_priority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal). Corresponds to the [constant NOTIFICATION_PROCESS] notification in [method Object._notification]. [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). </description> </method> <method name="_ready" qualifiers="virtual"> <return type="void" /> <description> 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] callbacks get triggered first, and the parent node will receive the ready notification afterwards. Corresponds to the [constant NOTIFICATION_READY] notification in [method Object._notification]. See also the [code]@onready[/code] annotation for variables. Usually used for initialization. For even earlier initialization, [method Object._init] may be used. See also [method _enter_tree]. [b]Note:[/b] This method may be called only once for each node. After removing a node from the scene tree and adding it again, [method _ready] will [b]not[/b] be called a second time. This can be bypassed by requesting another call with [method request_ready], which may be called anywhere before adding the node again. </description> </method> <method name="_shortcut_input" qualifiers="virtual"> <return type="void" /> <param index="0" name="event" type="InputEvent" /> <description> Called when an [InputEventKey], [InputEventShortcut], or [InputEventJoypadButton] hasn't been consumed by [method _input] or any GUI [Control] item. It is called before [method _unhandled_key_input] and [method _unhandled_input]. The input event propagates up through the node tree until a node consumes it. It is only called if shortcut processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_shortcut_input]. To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. This method can be used to handle shortcuts. For generic GUI events, use [method _input] instead. Gameplay events should usually be handled with either [method _unhandled_input] or [method _unhandled_key_input]. [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan). </description> </method> <method name="_unhandled_input" qualifiers="virtual"> <return type="void" /> <param index="0" name="event" type="InputEvent" /> <description> Called when an [InputEvent] hasn't been consumed by [method _input] or any GUI [Control] item. It is called after [method _shortcut_input] and after [method _unhandled_key_input]. The input event propagates up through the node tree until a node consumes it. It is only called if unhandled input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_input]. To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. For gameplay input, this method is usually a better fit than [method _input], as GUI events need a higher priority. For keyboard shortcuts, consider using [method _shortcut_input] instead, as it is called before this method. Finally, to handle keyboard events, consider using [method _unhandled_key_input] for performance reasons. [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). </description> </method>
124535
<method name="_unhandled_key_input" qualifiers="virtual"> <return type="void" /> <param index="0" name="event" type="InputEvent" /> <description> Called when an [InputEventKey] hasn't been consumed by [method _input] or any GUI [Control] item. It is called after [method _shortcut_input] but before [method _unhandled_input]. The input event propagates up through the node tree until a node consumes it. It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_key_input]. To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. This method can be used to handle Unicode character input with [kbd]Alt[/kbd], [kbd]Alt + Ctrl[/kbd], and [kbd]Alt + Shift[/kbd] modifiers, after shortcuts were handled. For gameplay input, this and [method _unhandled_input] are usually a better fit than [method _input], as GUI events should be handled first. This method also performs better than [method _unhandled_input], since unrelated events such as [InputEventMouseMotion] are automatically filtered. For shortcuts, consider using [method _shortcut_input] instead. [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). </description> </method> <method name="add_child"> <return type="void" /> <param index="0" name="node" type="Node" /> <param index="1" name="force_readable_name" type="bool" default="false" /> <param index="2" name="internal" type="int" enum="Node.InternalMode" default="0" /> <description> Adds a child [param node]. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node. If [param force_readable_name] is [code]true[/code], improves the readability of the added [param node]. If not named, the [param node] is renamed to its type, and if it shares [member name] with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to [code]false[/code], which assigns a dummy name featuring [code]@[/code] in both situations. If [param internal] is different than [constant INTERNAL_MODE_DISABLED], the child will be added as internal node. These nodes are ignored by methods like [method get_children], unless their parameter [code]include_internal[/code] is [code]true[/code]. The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. [ColorPicker]. See [enum InternalMode] for available modes. [b]Note:[/b] If [param node] already has a parent, this method will fail. Use [method remove_child] first to remove [param node] from its current parent. For example: [codeblocks] [gdscript] var child_node = get_child(0) if child_node.get_parent(): child_node.get_parent().remove_child(child_node) add_child(child_node) [/gdscript] [csharp] Node childNode = GetChild(0); if (childNode.GetParent() != null) { childNode.GetParent().RemoveChild(childNode); } AddChild(childNode); [/csharp] [/codeblocks] If you need the child node to be added below a specific node in the list of children, use [method add_sibling] instead of this method. [b]Note:[/b] If you want a child to be persisted to a [PackedScene], you must set [member owner] in addition to calling [method add_child]. This is typically relevant for [url=$DOCS_URL/tutorials/plugins/running_code_in_the_editor.html]tool scripts[/url] and [url=$DOCS_URL/tutorials/plugins/editor/index.html]editor plugins[/url]. If [method add_child] is called without setting [member owner], the newly added [Node] will not be visible in the scene tree, though it will be visible in the 2D/3D view. </description> </method> <method name="add_sibling"> <return type="void" /> <param index="0" name="sibling" type="Node" /> <param index="1" name="force_readable_name" type="bool" default="false" /> <description> Adds a [param sibling] node to this node's parent, and moves the added sibling right below this node. If [param force_readable_name] is [code]true[/code], improves the readability of the added [param sibling]. If not named, the [param sibling] is renamed to its type, and if it shares [member name] with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to [code]false[/code], which assigns a dummy name featuring [code]@[/code] in both situations. Use [method add_child] instead of this method if you don't need the child node to be added below a specific node in the list of children. [b]Note:[/b] If this node is internal, the added sibling will be internal too (see [method add_child]'s [code]internal[/code] parameter). </description> </method> <method name="add_to_group"> <return type="void" /> <param index="0" name="group" type="StringName" /> <param index="1" name="persistent" type="bool" default="false" /> <description> Adds the node to the [param group]. Groups can be helpful to organize a subset of nodes, for example [code]"enemies"[/code] or [code]"collectables"[/code]. See notes in the description, and the group methods in [SceneTree]. If [param persistent] is [code]true[/code], the group will be stored when saved inside a [PackedScene]. All groups created and displayed in the Node dock are persistent. [b]Note:[/b] To improve performance, the order of group names is [i]not[/i] guaranteed and may vary between project runs. Therefore, do not rely on the group order. [b]Note:[/b] [SceneTree]'s group methods will [i]not[/i] work on this node if not inside the tree (see [method is_inside_tree]). </description> </method> <method name="atr" qualifiers="const"> <return type="String" /> <param index="0" name="message" type="String" /> <param index="1" name="context" type="StringName" default="&quot;&quot;" /> <description> Translates a [param message], using the translation catalogs configured in the Project Settings. Further [param context] can be specified to help with the translation. Note that most [Control] nodes automatically translate their strings, so this method is mostly useful for formatted strings or custom drawn text. This method works the same as [method Object.tr], with the addition of respecting the [member auto_translate_mode] state. If [method Object.can_translate_messages] is [code]false[/code], or no translation is available, this method returns the [param message] without changes. See [method Object.set_message_translation]. For detailed examples, see [url=$DOCS_URL/tutorials/i18n/internationalizing_games.html]Internationalizing games[/url]. </description> </method>
124538
<method name="get_node" qualifiers="const"> <return type="Node" /> <param index="0" name="path" type="NodePath" /> <description> Fetches a node. The [NodePath] can either be a relative path (from this node), or an absolute path (from the [member SceneTree.root]) to a node. If [param path] does not point to a valid node, generates an error and returns [code]null[/code]. Attempts to access methods on the return value will result in an [i]"Attempt to call &lt;method&gt; on a null instance."[/i] error. [b]Note:[/b] Fetching by absolute path only works when the node is inside the scene tree (see [method is_inside_tree]). [b]Example:[/b] Assume this method is called from the Character node, inside the following tree: [codeblock lang=text] ┖╴root ┠╴Character (you are here!) ┃ ┠╴Sword ┃ ┖╴Backpack ┃ ┖╴Dagger ┠╴MyGame ┖╴Swamp ┠╴Alligator ┠╴Mosquito ┖╴Goblin [/codeblock] The following calls will return a valid node: [codeblocks] [gdscript] get_node("Sword") get_node("Backpack/Dagger") get_node("../Swamp/Alligator") get_node("/root/MyGame") [/gdscript] [csharp] GetNode("Sword"); GetNode("Backpack/Dagger"); GetNode("../Swamp/Alligator"); GetNode("/root/MyGame"); [/csharp] [/codeblocks] </description> </method> <method name="get_node_and_resource"> <return type="Array" /> <param index="0" name="path" type="NodePath" /> <description> Fetches a node and its most nested resource as specified by the [NodePath]'s subname. Returns an [Array] of size [code]3[/code] where: - Element [code]0[/code] is the [Node], or [code]null[/code] if not found; - Element [code]1[/code] is the subname's last nested [Resource], or [code]null[/code] if not found; - Element [code]2[/code] is the remaining [NodePath], referring to an existing, non-[Resource] property (see [method Object.get_indexed]). [b]Example:[/b] Assume that the child's [member Sprite2D.texture] has been assigned a [AtlasTexture]: [codeblocks] [gdscript] var a = get_node_and_resource("Area2D/Sprite2D") print(a[0].name) # Prints Sprite2D print(a[1]) # Prints &lt;null&gt; print(a[2]) # Prints ^"" var b = get_node_and_resource("Area2D/Sprite2D:texture:atlas") print(b[0].name) # Prints Sprite2D print(b[1].get_class()) # Prints AtlasTexture print(b[2]) # Prints ^"" var c = get_node_and_resource("Area2D/Sprite2D:texture:atlas:region") print(c[0].name) # Prints Sprite2D print(c[1].get_class()) # Prints AtlasTexture print(c[2]) # Prints ^":region" [/gdscript] [csharp] var a = GetNodeAndResource(NodePath("Area2D/Sprite2D")); GD.Print(a[0].Name); // Prints Sprite2D GD.Print(a[1]); // Prints &lt;null&gt; GD.Print(a[2]); // Prints ^" var b = GetNodeAndResource(NodePath("Area2D/Sprite2D:texture:atlas")); GD.Print(b[0].name); // Prints Sprite2D GD.Print(b[1].get_class()); // Prints AtlasTexture GD.Print(b[2]); // Prints ^"" var c = GetNodeAndResource(NodePath("Area2D/Sprite2D:texture:atlas:region")); GD.Print(c[0].name); // Prints Sprite2D GD.Print(c[1].get_class()); // Prints AtlasTexture GD.Print(c[2]); // Prints ^":region" [/csharp] [/codeblocks] </description> </method> <method name="get_node_or_null" qualifiers="const"> <return type="Node" /> <param index="0" name="path" type="NodePath" /> <description> Fetches a node by [NodePath]. Similar to [method get_node], but does not generate an error if [param path] does not point to a valid node. </description> </method> <method name="get_parent" qualifiers="const"> <return type="Node" /> <description> Returns this node's parent node, or [code]null[/code] if the node doesn't have a parent. </description> </method> <method name="get_path" qualifiers="const"> <return type="NodePath" /> <description> Returns the node's absolute path, relative to the [member SceneTree.root]. If the node is not inside the scene tree, this method fails and returns an empty [NodePath]. </description> </method> <method name="get_path_to" qualifiers="const"> <return type="NodePath" /> <param index="0" name="node" type="Node" /> <param index="1" name="use_unique_path" type="bool" default="false" /> <description> Returns the relative [NodePath] from this node to the specified [param node]. Both nodes must be in the same [SceneTree] or scene hierarchy, otherwise this method fails and returns an empty [NodePath]. If [param use_unique_path] is [code]true[/code], returns the shortest path accounting for this node's unique name (see [member unique_name_in_owner]). [b]Note:[/b] If you get a relative path which starts from a unique node, the path may be longer than a normal relative path, due to the addition of the unique node's name. </description> </method> <method name="get_physics_process_delta_time" qualifiers="const"> <return type="float" /> <description> Returns the time elapsed (in seconds) since the last physics callback. This value is identical to [method _physics_process]'s [code]delta[/code] parameter, and is often consistent at run-time, unless [member Engine.physics_ticks_per_second] is changed. See also [constant NOTIFICATION_PHYSICS_PROCESS]. </description> </method> <method name="get_process_delta_time" qualifiers="const"> <return type="float" /> <description> Returns the time elapsed (in seconds) since the last process callback. This value is identical to [method _process]'s [code]delta[/code] parameter, and may vary from frame to frame. See also [constant NOTIFICATION_PROCESS]. </description> </method> <method name="get_rpc_config" qualifiers="const"> <return type="Variant" /> <description> Returns a [Dictionary] mapping method names to their RPC configuration defined for this node using [method rpc_config]. </description> </method> <method name="get_scene_instance_load_placeholder" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if this node is an instance load placeholder. See [InstancePlaceholder] and [method set_scene_instance_load_placeholder]. </description> </method> <method name="get_tree" qualifiers="const"> <return type="SceneTree" /> <description> Returns the [SceneTree] that contains this node. If this node is not inside the tree, generates an error and returns [code]null[/code]. See also [method is_inside_tree]. </description> </method> <method name="get_tree_string"> <return typ
124541
<param index="1" name="keep_groups" type="bool" default="false" /> <description> Replaces this node by the given [param node]. All children of this node are moved to [param node]. If [param keep_groups] is [code]true[/code], the [param node] is added to the same groups that the replaced node is in (see [method add_to_group]). [b]Warning:[/b] The replaced node is removed from the tree, but it is [b]not[/b] deleted. To prevent memory leaks, store a reference to the node in a variable, or use [method Object.free]. </description> </method> <method name="request_ready"> <return type="void" /> <description> Requests [method _ready] to be called again the next time the node enters the tree. Does [b]not[/b] immediately call [method _ready]. [b]Note:[/b] This method only affects the current node. If the node's children also need to request ready, this method needs to be called for each one of them. When the node and its children enter the tree again, the order of [method _ready] callbacks will be the same as normal. </description> </method> <method name="reset_physics_interpolation"> <return type="void" /> <description> When physics interpolation is active, moving a node to a radically different transform (such as placement within a level) can result in a visible glitch as the object is rendered moving from the old to new position over the physics tick. That glitch can be prevented by calling this method, which temporarily disables interpolation until the physics tick is complete. The notification [constant NOTIFICATION_RESET_PHYSICS_INTERPOLATION] will be received by the node and all children recursively. [b]Note:[/b] This function should be called [b]after[/b] moving the node, rather than before. </description> </method> <method name="rpc" qualifiers="vararg"> <return type="int" enum="Error" /> <param index="0" name="method" type="StringName" /> <description> Sends a remote procedure call request for the given [param method] to peers on the network (and locally), sending additional arguments to the method called by the RPC. The call request will only be received by nodes with the same [NodePath], including the exact same [member name]. Behavior depends on the RPC configuration for the given [param method] (see [method rpc_config] and [annotation @GDScript.@rpc]). By default, methods are not exposed to RPCs. May return [constant OK] if the call is successful, [constant ERR_INVALID_PARAMETER] if the arguments passed in the [param method] do not match, [constant ERR_UNCONFIGURED] if the node's [member multiplayer] cannot be fetched (such as when the node is not inside the tree), [constant ERR_CONNECTION_ERROR] if [member multiplayer]'s connection is not available. [b]Note:[/b] You can only safely use RPCs on clients after you received the [signal MultiplayerAPI.connected_to_server] signal from the [MultiplayerAPI]. You also need to keep track of the connection state, either by the [MultiplayerAPI] signals like [signal MultiplayerAPI.server_disconnected] or by checking ([code]get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED[/code]). </description> </method> <method name="rpc_config"> <return type="void" /> <param index="0" name="method" type="StringName" /> <param index="1" name="config" type="Variant" /> <description> Changes the RPC configuration for the given [param method]. [param config] should either be [code]null[/code] to disable the feature (as by default), or a [Dictionary] containing the following entries: - [code]rpc_mode[/code]: see [enum MultiplayerAPI.RPCMode]; - [code]transfer_mode[/code]: see [enum MultiplayerPeer.TransferMode]; - [code]call_local[/code]: if [code]true[/code], the method will also be called locally; - [code]channel[/code]: an [int] representing the channel to send the RPC on. [b]Note:[/b] In GDScript, this method corresponds to the [annotation @GDScript.@rpc] annotation, with various parameters passed ([code]@rpc(any)[/code], [code]@rpc(authority)[/code]...). See also the [url=$DOCS_URL/tutorials/networking/high_level_multiplayer.html]high-level multiplayer[/url] tutorial. </description> </method> <method name="rpc_id" qualifiers="vararg"> <return type="int" enum="Error" /> <param index="0" name="peer_id" type="int" /> <param index="1" name="method" type="StringName" /> <description> Sends a [method rpc] to a specific peer identified by [param peer_id] (see [method MultiplayerPeer.set_target_peer]). May return [constant OK] if the call is successful, [constant ERR_INVALID_PARAMETER] if the arguments passed in the [param method] do not match, [constant ERR_UNCONFIGURED] if the node's [member multiplayer] cannot be fetched (such as when the node is not inside the tree), [constant ERR_CONNECTION_ERROR] if [member multiplayer]'s connection is not available. </description> </method> <method name="set_deferred_thread_group"> <return type="void" /> <param index="0" name="property" type="StringName" /> <param index="1" name="value" type="Variant" /> <description> Similar to [method call_deferred_thread_group], but for setting properties. </description> </method> <method name="set_display_folded"> <return type="void" /> <param index="0" name="fold" type="bool" /> <description> If set to [code]true[/code], the node appears folded in the Scene dock. As a result, all of its children are hidden. This method is intended to be used in editor plugins and tools, but it also works in release builds. See also [method is_displayed_folded]. </description> </method> <method name="set_editable_instance"> <return type="void" /> <param index="0" name="node" type="Node" /> <param index="1" name="is_editable" type="bool" /> <description> Set to [code]true[/code] to allow all nodes owned by [param node] to be available, and editable, in the Scene dock, even if their [member owner] is not the scene root. This method is intended to be used in editor plugins and tools, but it also works in release builds. See also [method is_editable_instance]. </description> </method> <method name="set_multiplayer_authority"> <return type="void" /> <param index="0" name="id" type="int" /> <param index="1" name="recursive" type="bool" default="true" /> <description> Sets the node's multiplayer authority to the peer with the given peer [param id]. The multiplayer authority is the peer that has authority over the node on the network. Defaults to peer ID 1 (the server). Useful in conjunction with [method rpc_config] and the [MultiplayerAPI]. If [param recursive] is [code]true[/code], the given peer is recursively set as the authority for all children of this node. [b]Warning:[/b] This does [b]not[/b] automatically replicate the new authority to other peers. It is the developer's responsibility to do so. You may replicate the new authority's information using [member MultiplayerSpawner.spawn_function], an RPC, or a [MultiplayerSynchronizer]. Furthermore, the parent's authority does [b]not[/b] propagate to newly added children. </description> </method> <method name="set_physics_process"> <return type="void" /> <param index="0" name="enable" type="
124543
_auto_translate_mode" enum="Node.AutoTranslateMode" default="0"> Defines if any text should automatically change to its translated version depending on the current locale (for nodes such as [Label], [RichTextLabel], [Window], etc.). Also decides if the node's strings should be parsed for POT generation. [b]Note:[/b] For the root node, auto translate mode can also be set via [member ProjectSettings.internationalization/rendering/root_node_auto_translate]. </member> <member name="editor_description" type="String" setter="set_editor_description" getter="get_editor_description" default="&quot;&quot;"> An optional description to the node. It will be displayed as a tooltip when hovering over the node in the editor's Scene dock. </member> <member name="multiplayer" type="MultiplayerAPI" setter="" getter="get_multiplayer"> The [MultiplayerAPI] instance associated with this node. See [method SceneTree.get_multiplayer]. [b]Note:[/b] Renaming the node, or moving it in the tree, will not move the [MultiplayerAPI] to the new path, you will have to update this manually. </member> <member name="name" type="StringName" setter="set_name" getter="get_name"> The name of the node. This name must be unique among the siblings (other child nodes from the same parent). When set to an existing sibling's name, the node is automatically renamed. [b]Note:[/b] When changing the name, the following characters will be replaced with an underscore: ([code].[/code] [code]:[/code] [code]@[/code] [code]/[/code] [code]"[/code] [code]%[/code]). In particular, the [code]@[/code] character is reserved for auto-generated names. See also [method String.validate_node_name]. </member> <member name="owner" type="Node" setter="set_owner" getter="get_owner"> The owner of this node. The owner must be an ancestor of this node. When packing the owner node in a [PackedScene], all the nodes it owns are also saved with it. [b]Note:[/b] In the editor, nodes not owned by the scene root are usually not displayed in the Scene dock, and will [b]not[/b] be saved. To prevent this, remember to set the owner after calling [method add_child]. See also (see [member unique_name_in_owner]) </member> <member name="physics_interpolation_mode" type="int" setter="set_physics_interpolation_mode" getter="get_physics_interpolation_mode" enum="Node.PhysicsInterpolationMode" default="0"> Allows enabling or disabling physics interpolation per node, offering a finer grain of control than turning physics interpolation on and off globally. See [member ProjectSettings.physics/common/physics_interpolation] and [member SceneTree.physics_interpolation] for the global setting. [b]Note:[/b] When teleporting a node to a distant position you should temporarily disable interpolation with [method Node.reset_physics_interpolation]. </member> <member name="process_mode" type="int" setter="set_process_mode" getter="get_process_mode" enum="Node.ProcessMode" default="0"> The node's processing behavior (see [enum ProcessMode]). To check if the node can process in its current mode, use [method can_process]. </member> <member name="process_physics_priority" type="int" setter="set_physics_process_priority" getter="get_physics_process_priority" default="0"> Similar to [member process_priority] but for [constant NOTIFICATION_PHYSICS_PROCESS], [method _physics_process], or [constant NOTIFICATION_INTERNAL_PHYSICS_PROCESS]. </member> <member name="process_priority" type="int" setter="set_process_priority" getter="get_process_priority" default="0"> The node's execution order of the process callbacks ([method _process], [constant NOTIFICATION_PROCESS], and [constant NOTIFICATION_INTERNAL_PROCESS]). Nodes whose priority value is [i]lower[/i] call their process callbacks first, regardless of tree order. </member> <member name="process_thread_group" type="int" setter="set_process_thread_group" getter="get_process_thread_group" enum="Node.ProcessThreadGroup" default="0"> Set the process thread group for this node (basically, whether it receives [constant NOTIFICATION_PROCESS], [constant NOTIFICATION_PHYSICS_PROCESS], [method _process] or [method _physics_process] (and the internal versions) on the main thread or in a sub-thread. By default, the thread group is [constant PROCESS_THREAD_GROUP_INHERIT], which means that this node belongs to the same thread group as the parent node. The thread groups means that nodes in a specific thread group will process together, separate to other thread groups (depending on [member process_thread_group_order]). If the value is set is [constant PROCESS_THREAD_GROUP_SUB_THREAD], this thread group will occur on a sub thread (not the main thread), otherwise if set to [constant PROCESS_THREAD_GROUP_MAIN_THREAD] it will process on the main thread. If there is not a parent or grandparent node set to something other than inherit, the node will belong to the [i]default thread group[/i]. This default group will process on the main thread and its group order is 0. During processing in a sub-thread, accessing most functions in nodes outside the thread group is forbidden (and it will result in an error in debug mode). Use [method Object.call_deferred], [method call_thread_safe], [method call_deferred_thread_group] and the likes in order to communicate from the thread groups to the main thread (or to other thread groups). To better understand process thread groups, the idea is that any node set to any other value than [constant PROCESS_THREAD_GROUP_INHERIT] will include any child (and grandchild) nodes set to inherit into its process thread group. This means that the processing of all the nodes in the group will happen together, at the same time as the node including them. </member> <member name="process_thread_group_order" type="int" setter="set_process_thread_group_order" getter="get_process_thread_group_order"> Change the process thread group order. Groups with a lesser order will process before groups with a greater order. This is useful when a large amount of nodes process in sub thread and, afterwards, another group wants to collect their result in the main thread, as an example. </member> <member name="process_thread_messages" type="int" setter="set_process_thread_messages" getter="get_process_thread_messages" enum="Node.ProcessThreadMessages" is_bitfield="true"> Set whether the current thread group will process messages (calls to [method call_deferred_thread_group] on threads), and whether it wants to receive them during regular process or physics process callbacks. </member> <member name="scene_file_path" type="String" setter="set_scene_file_path" getter="get_scene_file_path"> The original scene's file path, if the node has been instantiated from a [PackedScene] file. Only scene root nodes contains this. </member> <member name="unique_name_in_owner" type="bool" setter="set_unique_name_in_owner" getter="is_unique_name_in_owner" default="false"> If [code]true[/code], the node can be accessed from any node sharing the same [member owner] or from the [member owner] itself, with special [code]%Name[/code] syntax in [method get_node]. [b]Note:[/b] If another node with the same [member owner] shares the same [member name] as this node, the other node will no longer be accessible as unique. </member> </members> <signals> <signal name="child_entered_tree"> <param index="0" name="node" type="Node" /> <desc
124544
ription> Emitted when the child [param node] enters the [SceneTree], usually because this node entered the tree (see [signal tree_entered]), or [method add_child] has been called. This signal is emitted [i]after[/i] the child node's own [constant NOTIFICATION_ENTER_TREE] and [signal tree_entered]. </description> </signal> <signal name="child_exiting_tree"> <param index="0" name="node" type="Node" /> <description> Emitted when the child [param node] is about to exit the [SceneTree], usually because this node is exiting the tree (see [signal tree_exiting]), or because the child [param node] is being removed or freed. When this signal is received, the child [param node] is still accessible inside the tree. This signal is emitted [i]after[/i] the child node's own [signal tree_exiting] and [constant NOTIFICATION_EXIT_TREE]. </description> </signal> <signal name="child_order_changed"> <description> Emitted when the list of children is changed. This happens when child nodes are added, moved or removed. </description> </signal> <signal name="editor_description_changed"> <param index="0" name="node" type="Node" /> <description> Emitted when the node's editor description field changed. </description> </signal> <signal name="ready"> <description> Emitted when the node is considered ready, after [method _ready] is called. </description> </signal> <signal name="renamed"> <description> Emitted when the node's [member name] is changed, if the node is inside the tree. </description> </signal> <signal name="replacing_by"> <param index="0" name="node" type="Node" /> <description> Emitted when this node is being replaced by the [param node], see [method replace_by]. This signal is emitted [i]after[/i] [param node] has been added as a child of the original parent node, but [i]before[/i] all original child nodes have been reparented to [param node]. </description> </signal> <signal name="tree_entered"> <description> Emitted when the node enters the tree. This signal is emitted [i]after[/i] the related [constant NOTIFICATION_ENTER_TREE] notification. </description> </signal> <signal name="tree_exited"> <description> Emitted after the node exits the tree and is no longer active. This signal is emitted [i]after[/i] the related [constant NOTIFICATION_EXIT_TREE] notification. </description> </signal> <signal name="tree_exiting"> <description> Emitted when the node is just about to exit the tree. The node is still valid. As such, this is the right place for de-initialization (or a "destructor", if you will). This signal is emitted [i]after[/i] the node's [method _exit_tree], and [i]before[/i] the related [constant NOTIFICATION_EXIT_TREE]. </description> </signal> </signals> <constants> <constant name="NOTIFICATION_ENTER_TREE" value="10"> Notification received when the n
124548
<?xml version="1.0" encoding="UTF-8" ?> <class name="MainLoop" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Abstract base class for the game's main loop. </brief_description> <description> [MainLoop] is the abstract base class for a Godot project's game loop. It is inherited by [SceneTree], which is the default game loop implementation used in Godot projects, though it is also possible to write and use one's own [MainLoop] subclass instead of the scene tree. Upon the application start, a [MainLoop] implementation must be provided to the OS; otherwise, the application will exit. This happens automatically (and a [SceneTree] is created) unless a [MainLoop] [Script] is provided from the command line (with e.g. [code]godot -s my_loop.gd[/code]) or the "Main Loop Type" project setting is overwritten. Here is an example script implementing a simple [MainLoop]: [codeblocks] [gdscript] class_name CustomMainLoop extends MainLoop var time_elapsed = 0 func _initialize(): print("Initialized:") print(" Starting time: %s" % str(time_elapsed)) func _process(delta): time_elapsed += delta # Return true to end the main loop. return Input.get_mouse_button_mask() != 0 || Input.is_key_pressed(KEY_ESCAPE) func _finalize(): print("Finalized:") print(" End time: %s" % str(time_elapsed)) [/gdscript] [csharp] using Godot; [GlobalClass] public partial class CustomMainLoop : MainLoop { private double _timeElapsed = 0; public override void _Initialize() { GD.Print("Initialized:"); GD.Print($" Starting Time: {_timeElapsed}"); } public override bool _Process(double delta) { _timeElapsed += delta; // Return true to end the main loop. return Input.GetMouseButtonMask() != 0 || Input.IsKeyPressed(Key.Escape); } private void _Finalize() { GD.Print("Finalized:"); GD.Print($" End Time: {_timeElapsed}"); } } [/csharp] [/codeblocks] </description> <tutorials> </tutorials> <methods> <method name="_finalize" qualifiers="virtual"> <return type="void" /> <description> Called before the program exits. </description> </method> <method name="_initialize" qualifiers="virtual"> <return type="void" /> <description> Called once during initialization. </description> </method> <method name="_physics_process" qualifiers="virtual"> <return type="bool" /> <param index="0" name="delta" type="float" /> <description> Called each physics frame with the time since the last physics frame as argument ([param delta], in seconds). Equivalent to [method Node._physics_process]. If implemented, the method must return a boolean value. [code]true[/code] ends the main loop, while [code]false[/code] lets it proceed to the next frame. </description> </method> <method name="_process" qualifiers="virtual"> <return type="bool" /> <param index="0" name="delta" type="float" /> <description> Called each process (idle) frame with the time since the last process frame as argument (in seconds). Equivalent to [method Node._process]. If implemented, the method must return a boolean value. [code]true[/code] ends the main loop, while [code]false[/code] lets it proceed to the next frame. </description> </method> </methods> <signals> <signal name="on_request_permissions_result"> <param index="0" name="permission" type="String" /> <param index="1" name="granted" type="bool" /> <description> Emitted when a user responds to a permission request. </description> </signal> </signals> <constants> <constant name="NOTIFICATION_OS_MEMORY_WARNING" value="2009"> Notification received from the OS when the application is exceeding its allocated memory. Specific to the iOS platform. </constant> <constant name="NOTIFICATION_TRANSLATION_CHANGED" value="2010"> Notification received when translations may have changed. Can be triggered by the user changing the locale. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like [method Object.tr]. </constant> <constant name="NOTIFICATION_WM_ABOUT" value="2011"> Notification received from the OS when a request for "About" information is sent. Specific to the macOS platform. </constant> <constant name="NOTIFICATION_CRASH" value="2012"> Notification received from Godot's crash handler when the engine is about to crash. Implemented on desktop platforms if the crash handler is enabled. </constant> <constant name="NOTIFICATION_OS_IME_UPDATE" value="2013"> Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string). Specific to the macOS platform. </constant> <constant name="NOTIFICATION_APPLICATION_RESUMED" value="2014"> Notification received from the OS when the application is resumed. Specific to the Android and iOS platforms. </constant> <constant name="NOTIFICATION_APPLICATION_PAUSED" value="2015"> Notification received from the OS when the application is paused. Specific to the Android and iOS platforms. [b]Note:[/b] On iOS, you only have approximately 5 seconds to finish a task started by this signal. If you go over this allotment, iOS will kill the app instead of pausing it. </constant> <constant name="NOTIFICATION_APPLICATION_FOCUS_IN" value="2016"> Notification received from the OS when the application is focused, i.e. when changing the focus from the OS desktop or a thirdparty application to any open window of the Godot instance. Implemented on desktop and mobile platforms. </constant> <constant name="NOTIFICATION_APPLICATION_FOCUS_OUT" value="2017"> Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application. Implemented on desktop and mobile platforms. </constant> <constant name="NOTIFICATION_TEXT_SERVER_CHANGED" value="2018"> Notification received when text server is changed. </constant> </constants> </class>
124559
<?xml version="1.0" encoding="UTF-8" ?> <class name="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Base class for all other classes in the engine. </brief_description> <description> An advanced [Variant] type. All classes in the engine inherit from Object. Each class may define new properties, methods or signals, which are available to all inheriting classes. For example, a [Sprite2D] instance is able to call [method Node.add_child] because it inherits from [Node]. You can create new instances, using [code]Object.new()[/code] in GDScript, or [code]new GodotObject[/code] in C#. To delete an Object instance, call [method free]. This is necessary for most classes inheriting Object, because they do not manage memory on their own, and will otherwise cause memory leaks when no longer in use. There are a few classes that perform memory management. For example, [RefCounted] (and by extension [Resource]) deletes itself when no longer referenced, and [Node] deletes its children when freed. Objects can have a [Script] attached to them. Once the [Script] is instantiated, it effectively acts as an extension to the base class, allowing it to define and inherit new properties, methods and signals. Inside a [Script], [method _get_property_list] may be overridden to customize properties in several ways. This allows them to be available to the editor, display as lists of options, sub-divide into groups, save on disk, etc. Scripting languages offer easier ways to customize properties, such as with the [annotation @GDScript.@export] annotation. Godot is very dynamic. An object's script, and therefore its properties, methods and signals, can be changed at run-time. Because of this, there can be occasions where, for example, a property required by a method may not exist. To prevent run-time errors, see methods such as [method set], [method get], [method call], [method has_method], [method has_signal], etc. Note that these methods are [b]much[/b] slower than direct references. In GDScript, you can also check if a given property, method, or signal name exists in an object with the [code]in[/code] operator: [codeblock] var node = Node.new() print("name" in node) # Prints true print("get_parent" in node) # Prints true print("tree_entered" in node) # Prints true print("unknown" in node) # Prints false [/codeblock] Notifications are [int] constants commonly sent and received by objects. For example, on every rendered frame, the [SceneTree] notifies nodes inside the tree with a [constant Node.NOTIFICATION_PROCESS]. The nodes receive it and may call [method Node._process] to update. To make use of notifications, see [method notification] and [method _notification]. Lastly, every object can also contain metadata (data about data). [method set_meta] can be useful to store information that the object itself does not depend on. To keep your code clean, making excessive use of metadata is discouraged. [b]Note:[/b] Unlike references to a [RefCounted], references to an object stored in a variable can become invalid without being set to [code]null[/code]. To check if an object has been deleted, do [i]not[/i] compare it against [code]null[/code]. Instead, use [method @GlobalScope.is_instance_valid]. It's also recommended to inherit from [RefCounted] for classes storing data instead of [Object]. [b]Note:[/b] The [code]script[/code] is not exposed like most properties. To set or get an object's [Script] in code, use [method set_script] and [method get_script], respectively. </description> <tutorials> <link title="Object class introduction">$DOCS_URL/contributing/development/core_and_modules/object_class.html</link> <link title="When and how to avoid using nodes for everything">$DOCS_URL/tutorials/best_practices/node_alternatives.html</link> <link title="Object notifications">$DOCS_URL/tutorials/best_practices/godot_notifications.html</link> </tutorials>
124560
<methods> <method name="_get" qualifiers="virtual"> <return type="Variant" /> <param index="0" name="property" type="StringName" /> <description> Override this method to customize the behavior of [method get]. Should return the given [param property]'s value, or [code]null[/code] if the [param property] should be handled normally. Combined with [method _set] and [method _get_property_list], this method allows defining custom properties, which is particularly useful for editor plugins. Note that a property must be present in [method get_property_list], otherwise this method will not be called. [codeblocks] [gdscript] func _get(property): if property == "fake_property": print("Getting my property!") return 4 func _get_property_list(): return [ { "name": "fake_property", "type": TYPE_INT } ] [/gdscript] [csharp] public override Variant _Get(StringName property) { if (property == "FakeProperty") { GD.Print("Getting my property!"); return 4; } return default; } public override Godot.Collections.Array&lt;Godot.Collections.Dictionary&gt; _GetPropertyList() { return new Godot.Collections.Array&lt;Godot.Collections.Dictionary&gt;() { new Godot.Collections.Dictionary() { { "name", "FakeProperty" }, { "type", (int)Variant.Type.Int } } }; } [/csharp] [/codeblocks] </description> </method> <method name="_get_property_list" qualifiers="virtual"> <return type="Dictionary[]" /> <description> Override this method to provide a custom list of additional properties to handle by the engine. Should return a property list, as an [Array] of dictionaries. The result is added to the array of [method get_property_list], and should be formatted in the same way. Each [Dictionary] must at least contain the [code]name[/code] and [code]type[/code] entries. You can use [method _property_can_revert] and [method _property_get_revert] to customize the default values of the properties added by this method. The example below displays a list of numbers shown as words going from [code]ZERO[/code] to [code]FIVE[/code], with [code]number_count[/code] controlling the size of the list: [codeblocks] [gdscript] @tool extends Node @export var number_count = 3: set(nc): number_count = nc numbers.resize(number_count) notify_property_list_changed() var numbers = PackedInt32Array([0, 0, 0]) func _get_property_list(): var properties = [] for i in range(number_count): properties.append({ "name": "number_%d" % i, "type": TYPE_INT, "hint": PROPERTY_HINT_ENUM, "hint_string": "ZERO,ONE,TWO,THREE,FOUR,FIVE", }) return properties func _get(property): if property.begins_with("number_"): var index = property.get_slice("_", 1).to_int() return numbers[index] func _set(property, value): if property.begins_with("number_"): var index = property.get_slice("_", 1).to_int() numbers[index] = value return true return false [/gdscript] [csharp] [Tool] public partial class MyNode : Node { private int _numberCount; [Export] public int NumberCount { get =&gt; _numberCount; set { _numberCount = value; _numbers.Resize(_numberCount); NotifyPropertyListChanged(); } } private Godot.Collections.Array&lt;int&gt; _numbers = new(); public override Godot.Collections.Array&lt;Godot.Collections.Dictionary&gt; _GetPropertyList() { var properties = new Godot.Collections.Array&lt;Godot.Collections.Dictionary&gt;(); for (int i = 0; i &lt; _numberCount; i++) { properties.Add(new Godot.Collections.Dictionary() { { "name", $"number_{i}" }, { "type", (int)Variant.Type.Int }, { "hint", (int)PropertyHint.Enum }, { "hint_string", "Zero,One,Two,Three,Four,Five" }, }); } return properties; } public override Variant _Get(StringName property) { string propertyName = property.ToString(); if (propertyName.StartsWith("number_")) { int index = int.Parse(propertyName.Substring("number_".Length)); return _numbers[index]; } return default; } public override bool _Set(StringName property, Variant value) { string propertyName = property.ToString(); if (propertyName.StartsWith("number_")) { int index = int.Parse(propertyName.Substring("number_".Length)); _numbers[index] = value.As&lt;int&gt;(); return true; } return false; } } [/csharp] [/codeblocks] [b]Note:[/b] This method is intended for advanced purposes. For most common use cases, the scripting languages offer easier ways to handle properties. See [annotation @GDScript.@export], [annotation @GDScript.@export_enum], [annotation @GDScript.@export_group], etc. If you want to customize exported properties, use [method _validate_property]. [b]Note:[/b] If the object's script is not [annotation @GDScript.@tool], this method will not be called in the editor. </description> </method> <method name="_init" qualifiers="virtual"> <return type="void" /> <description> Called when the object's script is instantiated, oftentimes after the object is initialized in memory (through [code]Object.new()[/code] in GDScript, or [code]new GodotObject[/code] in C#). It can be also defined to take in parameters. This method is similar to a constructor in most programming languages. [b]Note:[/b] If [method _init] is defined with [i]required[/i] parameters, the Object with script may only be created directly. If any other means (such as [method PackedScene.instantiate] or [method Node.duplicate]) are used, the script's initialization will fail. </description> </method> <method name="_iter_get" qualifiers="virtual"> <return type="Variant" /> <param index="0" name="iter" type="Variant" /> <description> Returns the current iterable value. [param iter] stores the iteration state, but unlike [method _iter_init] and [method _iter_next] the state is supposed to be read-only, so there is no [Array] wrapper. </description> </method> <method name="_iter_init" qualifiers="virtual"> <return type="bool" /> <param index="0" name="iter" type="Array" /> <description> Initializes the iterator. [param iter] stores the iteration state. Since GDScript does not support passing arguments by reference, a single-element array is used as a wrapper. Returns [code]true[/code] so long as the iterator has not reached the end. Example: [codeblock] class MyRange: var _from var _to func _init(from, to): assert(from &lt;= to) _from = from _to = to func _iter_init(iter): iter[0] = _from return iter[0] &lt; _to func _iter_next(iter): iter[0] += 1 return iter[0] &lt; _to func _iter_get(iter): return iter func _ready(): var my_range = MyRange.new(2, 5) for x in my_range: print(x) # Prints 2, 3, 4. [/codeblock] [b]Note:[/b] Alternatively, you can ignore [param iter] and use the object's state instead, see [url=$DOCS_URL/tutorials/scripting/gdscript/gdscript_advanced.html#custom-iterators]online docs[/url] for an example. Note that in this case you will not be able to reuse the same iterator instance in nested loops. Also, make sure you reset the iterator state in this method if you want to reuse the same instance multiple times. </description> </method>
124561
<method name="_iter_next" qualifiers="virtual"> <return type="bool" /> <param index="0" name="iter" type="Array" /> <description> Moves the iterator to the next iteration. [param iter] stores the iteration state. Since GDScript does not support passing arguments by reference, a single-element array is used as a wrapper. Returns [code]true[/code] so long as the iterator has not reached the end. </description> </method> <method name="_notification" qualifiers="virtual"> <return type="void" /> <param index="0" name="what" type="int" /> <description> Called when the object receives a notification, which can be identified in [param what] by comparing it with a constant. See also [method notification]. [codeblocks] [gdscript] func _notification(what): if what == NOTIFICATION_PREDELETE: print("Goodbye!") [/gdscript] [csharp] public override void _Notification(int what) { if (what == NotificationPredelete) { GD.Print("Goodbye!"); } } [/csharp] [/codeblocks] [b]Note:[/b] The base [Object] defines a few notifications ([constant NOTIFICATION_POSTINITIALIZE] and [constant NOTIFICATION_PREDELETE]). Inheriting classes such as [Node] define a lot more notifications, which are also received by this method. </description> </method> <method name="_property_can_revert" qualifiers="virtual"> <return type="bool" /> <param index="0" name="property" type="StringName" /> <description> Override this method to customize the given [param property]'s revert behavior. Should return [code]true[/code] if the [param property] has a custom default value and is revertible in the Inspector dock. Use [method _property_get_revert] to specify the [param property]'s default value. [b]Note:[/b] This method must return consistently, regardless of the current value of the [param property]. </description> </method> <method name="_property_get_revert" qualifiers="virtual"> <return type="Variant" /> <param index="0" name="property" type="StringName" /> <description> Override this method to customize the given [param property]'s revert behavior. Should return the default value for the [param property]. If the default value differs from the [param property]'s current value, a revert icon is displayed in the Inspector dock. [b]Note:[/b] [method _property_can_revert] must also be overridden for this method to be called. </description> </method> <method name="_set" qualifiers="virtual"> <return type="bool" /> <param index="0" name="property" type="StringName" /> <param index="1" name="value" type="Variant" /> <description> Override this method to customize the behavior of [method set]. Should set the [param property] to [param value] and return [code]true[/code], or [code]false[/code] if the [param property] should be handled normally. The [i]exact[/i] way to set the [param property] is up to this method's implementation. Combined with [method _get] and [method _get_property_list], this method allows defining custom properties, which is particularly useful for editor plugins. Note that a property [i]must[/i] be present in [method get_property_list], otherwise this method will not be called. [codeblocks] [gdscript] var internal_data = {} func _set(property, value): if property == "fake_property": # Storing the value in the fake property. internal_data["fake_property"] = value return true return false func _get_property_list(): return [ { "name": "fake_property", "type": TYPE_INT } ] [/gdscript] [csharp] private Godot.Collections.Dictionary _internalData = new Godot.Collections.Dictionary(); public override bool _Set(StringName property, Variant value) { if (property == "FakeProperty") { // Storing the value in the fake property. _internalData["FakeProperty"] = value; return true; } return false; } public override Godot.Collections.Array&lt;Godot.Collections.Dictionary&gt; _GetPropertyList() { return new Godot.Collections.Array&lt;Godot.Collections.Dictionary&gt;() { new Godot.Collections.Dictionary() { { "name", "FakeProperty" }, { "type", (int)Variant.Type.Int } } }; } [/csharp] [/codeblocks] </description> </method> <method name="_to_string" qualifiers="virtual"> <return type="String" /> <description> Override this method to customize the return value of [method to_string], and therefore the object's representation as a [String]. [codeblock] func _to_string(): return "Welcome to Godot 4!" func _init(): print(self) # Prints Welcome to Godot 4!" var a = str(self) # a is "Welcome to Godot 4!" [/codeblock] </description> </method> <method name="_validate_property" qualifiers="virtual"> <return type="void" /> <param index="0" name="property" type="Dictionary" /> <description> Override this method to customize existing properties. Every property info goes through this method, except properties added with [method _get_property_list]. The dictionary contents is the same as in [method _get_property_list]. [codeblocks] [gdscript] @tool extends Node @export var is_number_editable: bool: set(value): is_number_editable = value notify_property_list_changed() @export var number: int func _validate_property(property: Dictionary): if property.name == "number" and not is_number_editable: property.usage |= PROPERTY_USAGE_READ_ONLY [/gdscript] [csharp] [Tool] public partial class MyNode : Node { private bool _isNumberEditable; [Export] public bool IsNumberEditable { get =&gt; _isNumberEditable; set { _isNumberEditable = value; NotifyPropertyListChanged(); } } [Export] public int Number { get; set; } public override void _ValidateProperty(Godot.Collections.Dictionary property) { if (property["name"].AsStringName() == PropertyName.Number &amp;&amp; !IsNumberEditable) { var usage = property["usage"].As&lt;PropertyUsageFlags&gt;() | PropertyUsageFlags.ReadOnly; property["usage"] = (int)usage; } } } [/csharp] [/codeblocks] </description> </method> <method name="add_user_signal"> <return type="void" /> <param index="0" name="signal" type="String" /> <param index="1" name="arguments" type="Array" default="[]" /> <description> Adds a user-defined [param signal]. Optional arguments for the signal can be added as an [Array] of dictionaries, each defining a [code]name[/code] [String] and a [code]type[/code] [int] (see [enum Variant.Type]). See also [method has_user_signal] and [method remove_user_signal]. [codeblocks] [gdscript] add_user_signal("hurt", [ { "name": "damage", "type": TYPE_INT }, { "name": "source", "type": TYPE_OBJECT } ]) [/gdscript] [csharp] AddUserSignal("Hurt", new Godot.Collections.Array() { new Godot.Collections.Dictionary() { { "name", "damage" }, { "type", (int)Variant.Type.Int } }, new Godot.Collections.Dictionary() { { "name", "source" }, { "type", (int)Variant.Type.Object } } }); [/csharp] [/codeblocks] </description> </method>
124563
<method name="connect"> <return type="int" enum="Error" /> <param index="0" name="signal" type="StringName" /> <param index="1" name="callable" type="Callable" /> <param index="2" name="flags" type="int" default="0" /> <description> Connects a [param signal] by name to a [param callable]. Optional [param flags] can be also added to configure the connection's behavior (see [enum ConnectFlags] constants). A signal can only be connected once to the same [Callable]. If the signal is already connected, this method returns [constant ERR_INVALID_PARAMETER] and pushes an error message, unless the signal is connected with [constant CONNECT_REFERENCE_COUNTED]. To prevent this, use [method is_connected] first to check for existing connections. If the [param callable]'s object is freed, the connection will be lost. [b]Examples with recommended syntax:[/b] Connecting signals is one of the most common operations in Godot and the API gives many options to do so, which are described further down. The code block below shows the recommended approach. [codeblocks] [gdscript] func _ready(): var button = Button.new() # `button_down` here is a Signal variant type, and we thus call the Signal.connect() method, not Object.connect(). # See discussion below for a more in-depth overview of the API. button.button_down.connect(_on_button_down) # This assumes that a `Player` class exists, which defines a `hit` signal. var player = Player.new() # We use Signal.connect() again, and we also use the Callable.bind() method, # which returns a new Callable with the parameter binds. player.hit.connect(_on_player_hit.bind("sword", 100)) func _on_button_down(): print("Button down!") func _on_player_hit(weapon_type, damage): print("Hit with weapon %s for %d damage." % [weapon_type, damage]) [/gdscript] [csharp] public override void _Ready() { var button = new Button(); // C# supports passing signals as events, so we can use this idiomatic construct: button.ButtonDown += OnButtonDown; // This assumes that a `Player` class exists, which defines a `Hit` signal. var player = new Player(); // We can use lambdas when we need to bind additional parameters. player.Hit += () =&gt; OnPlayerHit("sword", 100); } private void OnButtonDown() { GD.Print("Button down!"); } private void OnPlayerHit(string weaponType, int damage) { GD.Print($"Hit with weapon {weaponType} for {damage} damage."); } [/csharp] [/codeblocks] [b][code skip-lint]Object.connect()[/code] or [code skip-lint]Signal.connect()[/code]?[/b] As seen above, the recommended method to connect signals is not [method Object.connect]. The code block below shows the four options for connecting signals, using either this legacy method or the recommended [method Signal.connect], and using either an implicit [Callable] or a manually defined one. [codeblocks] [gdscript] func _ready(): var button = Button.new() # Option 1: Object.connect() with an implicit Callable for the defined function. button.connect("button_down", _on_button_down) # Option 2: Object.connect() with a constructed Callable using a target object and method name. button.connect("button_down", Callable(self, "_on_button_down")) # Option 3: Signal.connect() with an implicit Callable for the defined function. button.button_down.connect(_on_button_down) # Option 4: Signal.connect() with a constructed Callable using a target object and method name. button.button_down.connect(Callable(self, "_on_button_down")) func _on_button_down(): print("Button down!") [/gdscript] [csharp] public override void _Ready() { var button = new Button(); // Option 1: In C#, we can use signals as events and connect with this idiomatic syntax: button.ButtonDown += OnButtonDown; // Option 2: GodotObject.Connect() with a constructed Callable from a method group. button.Connect(Button.SignalName.ButtonDown, Callable.From(OnButtonDown)); // Option 3: GodotObject.Connect() with a constructed Callable using a target object and method name. button.Connect(Button.SignalName.ButtonDown, new Callable(this, MethodName.OnButtonDown)); } private void OnButtonDown() { GD.Print("Button down!"); } [/csharp] [/codeblocks] While all options have the same outcome ([code]button[/code]'s [signal BaseButton.button_down] signal will be connected to [code]_on_button_down[/code]), [b]option 3[/b] offers the best validation: it will print a compile-time error if either the [code]button_down[/code] [Signal] or the [code]_on_button_down[/code] [Callable] are not defined. On the other hand, [b]option 2[/b] only relies on string names and will only be able to validate either names at runtime: it will print a runtime error if [code]"button_down"[/code] doesn't correspond to a signal, or if [code]"_on_button_down"[/code] is not a registered method in the object [code]self[/code]. The main reason for using options 1, 2, or 4 would be if you actually need to use strings (e.g. to connect signals programmatically based on strings read from a configuration file). Otherwise, option 3 is the recommended (and fastest) method. [b]Binding and passing parameters:[/b] The syntax to bind parameters is through [method Callable.bind], which returns a copy of the [Callable] with its parameters bound. When calling [method emit_signal] or [method Signal.emit], the signal parameters can be also passed. The examples below show the relationship between these signal parameters and bound parameters. [codeblocks] [gdscript] func _ready(): # This assumes that a `Player` class exists, which defines a `hit` signal. var player = Player.new() # Using Callable.bind(). player.hit.connect(_on_player_hit.bind("sword", 100)) # Parameters added when emitting the signal are passed first. player.hit.emit("Dark lord", 5) # We pass two arguments when emitting (`hit_by`, `level`), # and bind two more arguments when connecting (`weapon_type`, `damage`). func _on_player_hit(hit_by, level, weapon_type, damage): print("Hit by %s (level %d) with weapon %s for %d damage." % [hit_by, level, weapon_type, damage]) [/gdscript] [csharp] public override void _Ready() { // This assumes that a `Player` class exists, which defines a `Hit` signal. var player = new Player(); // Using lambda expressions that create a closure that captures the additional parameters. // The lambda only receives the parameters defined by the signal's delegate. player.Hit += (hitBy, level) =&gt; OnPlayerHit(hitBy, level, "sword", 100); // Parameters added when emitting the signal are passed first. player.EmitSignal(SignalName.Hit, "Dark lord", 5); } // We pass two arguments when emitting (`hit_by`, `level`), // and bind two more arguments when connecting (`weapon_type`, `damage`). private void OnPlayerHit(string hitBy, int level, string weaponType, int damage) { GD.Print($"Hit by {hitBy} (level {level}) with weapon {weaponType} for {damage} damage."); } [/csharp] [/codeblocks] </description> </method> <method name="disconnect"> <return type="void" /> <param index="0" name="signal" type="StringName" /> <param index="1" name="callable" type="Callable" /> <description> Disconnects a [param signal] by name from a given [param callable]. If the connection does not exist, generates an error. Use [method is_connected] to make sure that the connection exists. </description> </method>
124564
<method name="emit_signal" qualifiers="vararg"> <return type="int" enum="Error" /> <param index="0" name="signal" type="StringName" /> <description> Emits the given [param signal] by name. The signal must exist, so it should be a built-in signal of this class or one of its inherited classes, or a user-defined signal (see [method add_user_signal]). This method supports a variable number of arguments, so parameters can be passed as a comma separated list. Returns [constant ERR_UNAVAILABLE] if [param signal] does not exist or the parameters are invalid. [codeblocks] [gdscript] emit_signal("hit", "sword", 100) emit_signal("game_over") [/gdscript] [csharp] EmitSignal(SignalName.Hit, "sword", 100); EmitSignal(SignalName.GameOver); [/csharp] [/codeblocks] [b]Note:[/b] In C#, [param signal] must be in snake_case when referring to built-in Godot signals. Prefer using the names exposed in the [code]SignalName[/code] class to avoid allocating a new [StringName] on each call. </description> </method> <method name="free" keywords="delete, remove, kill, die"> <return type="void" /> <description> Deletes the object from memory. Pre-existing references to the object become invalid, and any attempt to access them will result in a run-time error. Checking the references with [method @GlobalScope.is_instance_valid] will return [code]false[/code]. </description> </method> <method name="get" qualifiers="const"> <return type="Variant" /> <param index="0" name="property" type="StringName" /> <description> Returns the [Variant] value of the given [param property]. If the [param property] does not exist, this method returns [code]null[/code]. [codeblocks] [gdscript] var node = Node2D.new() node.rotation = 1.5 var a = node.get("rotation") # a is 1.5 [/gdscript] [csharp] var node = new Node2D(); node.Rotation = 1.5f; var a = node.Get(Node2D.PropertyName.Rotation); // a is 1.5 [/csharp] [/codeblocks] [b]Note:[/b] In C#, [param property] must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the [code]PropertyName[/code] class to avoid allocating a new [StringName] on each call. </description> </method> <method name="get_class" qualifiers="const"> <return type="String" /> <description> Returns the object's built-in class name, as a [String]. See also [method is_class]. [b]Note:[/b] This method ignores [code]class_name[/code] declarations. If this object's script has defined a [code]class_name[/code], the base, built-in class name is returned instead. </description> </method> <method name="get_incoming_connections" qualifiers="const"> <return type="Dictionary[]" /> <description> Returns an [Array] of signal connections received by this object. Each connection is represented as a [Dictionary] that contains three entries: - [code]signal[/code] is a reference to the [Signal]; - [code]callable[/code] is a reference to the [Callable]; - [code]flags[/code] is a combination of [enum ConnectFlags]. </description> </method> <method name="get_indexed" qualifiers="const"> <return type="Variant" /> <param index="0" name="property_path" type="NodePath" /> <description> Gets the object's property indexed by the given [param property_path]. The path should be a [NodePath] relative to the current object and can use the colon character ([code]:[/code]) to access nested properties. [b]Examples:[/b] [code]"position:x"[/code] or [code]"material:next_pass:blend_mode"[/code]. [codeblocks] [gdscript] var node = Node2D.new() node.position = Vector2(5, -10) var a = node.get_indexed("position") # a is Vector2(5, -10) var b = node.get_indexed("position:y") # b is -10 [/gdscript] [csharp] var node = new Node2D(); node.Position = new Vector2(5, -10); var a = node.GetIndexed("position"); // a is Vector2(5, -10) var b = node.GetIndexed("position:y"); // b is -10 [/csharp] [/codeblocks] [b]Note:[/b] In C#, [param property_path] must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the [code]PropertyName[/code] class to avoid allocating a new [StringName] on each call. [b]Note:[/b] This method does not support actual paths to nodes in the [SceneTree], only sub-property paths. In the context of nodes, use [method Node.get_node_and_resource] instead. </description> </method> <method name="get_instance_id" qualifiers="const"> <return type="int" /> <description> Returns the object's unique instance ID. This ID can be saved in [EncodedObjectAsID], and can be used to retrieve this object instance with [method @GlobalScope.instance_from_id]. [b]Note:[/b] This ID is only useful during the current session. It won't correspond to a similar object if the ID is sent over a network, or loaded from a file at a later time. </description> </method> <method name="get_meta" qualifiers="const"> <return type="Variant" /> <param index="0" name="name" type="StringName" /> <param index="1" name="default" type="Variant" default="null" /> <description> Returns the object's metadata value for the given entry [param name]. If the entry does not exist, returns [param default]. If [param default] is [code]null[/code], an error is also generated. [b]Note:[/b] A metadata's name must be a valid identifier as per [method StringName.is_valid_identifier] method. [b]Note:[/b] Metadata that has a name starting with an underscore ([code]_[/code]) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited, although it can still be found by this method. </description> </method> <method name="get_meta_list" qualifiers="const"> <return type="StringName[]" /> <description> Returns the object's metadata entry names as a [PackedStringArray]. </description> </method> <method name="get_method_argument_count" qualifiers="const"> <return type="int" /> <param index="0" name="method" type="StringName" /> <description> Returns the number of arguments of the given [param method] by name. [b]Note:[/b] In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]MethodName[/code] class to avoid allocating a new [StringName] on each call. </description> </method>
124565
<method name="get_method_list" qualifiers="const"> <return type="Dictionary[]" /> <description> Returns this object's methods and their signatures as an [Array] of dictionaries. Each [Dictionary] contains the following entries: - [code]name[/code] is the name of the method, as a [String]; - [code]args[/code] is an [Array] of dictionaries representing the arguments; - [code]default_args[/code] is the default arguments as an [Array] of variants; - [code]flags[/code] is a combination of [enum MethodFlags]; - [code]id[/code] is the method's internal identifier [int]; - [code]return[/code] is the returned value, as a [Dictionary]; [b]Note:[/b] The dictionaries of [code]args[/code] and [code]return[/code] are formatted identically to the results of [method get_property_list], although not all entries are used. </description> </method> <method name="get_property_list" qualifiers="const"> <return type="Dictionary[]" /> <description> Returns the object's property list as an [Array] of dictionaries. Each [Dictionary] contains the following entries: - [code]name[/code] is the property's name, as a [String]; - [code]class_name[/code] is an empty [StringName], unless the property is [constant TYPE_OBJECT] and it inherits from a class; - [code]type[/code] is the property's type, as an [int] (see [enum Variant.Type]); - [code]hint[/code] is [i]how[/i] the property is meant to be edited (see [enum PropertyHint]); - [code]hint_string[/code] depends on the hint (see [enum PropertyHint]); - [code]usage[/code] is a combination of [enum PropertyUsageFlags]. [b]Note:[/b] In GDScript, all class members are treated as properties. In C# and GDExtension, it may be necessary to explicitly mark class members as Godot properties using decorators or attributes. </description> </method> <method name="get_script" qualifiers="const"> <return type="Variant" /> <description> Returns the object's [Script] instance, or [code]null[/code] if no script is attached. </description> </method> <method name="get_signal_connection_list" qualifiers="const"> <return type="Dictionary[]" /> <param index="0" name="signal" type="StringName" /> <description> Returns an [Array] of connections for the given [param signal] name. Each connection is represented as a [Dictionary] that contains three entries: - [code skip-lint]signal[/code] is a reference to the [Signal]; - [code]callable[/code] is a reference to the connected [Callable]; - [code]flags[/code] is a combination of [enum ConnectFlags]. </description> </method> <method name="get_signal_list" qualifiers="const"> <return type="Dictionary[]" /> <description> Returns the list of existing signals as an [Array] of dictionaries. [b]Note:[/b] Due of the implementation, each [Dictionary] is formatted very similarly to the returned values of [method get_method_list]. </description> </method> <method name="get_translation_domain" qualifiers="const"> <return type="StringName" /> <description> Returns the name of the translation domain used by [method tr] and [method tr_n]. See also [TranslationServer]. </description> </method> <method name="has_connections" qualifiers="const"> <return type="bool" /> <param index="0" name="signal" type="StringName" /> <description> Returns [code]true[/code] if any connection exists on the given [param signal] name. [b]Note:[/b] In C#, [param signal] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]SignalName[/code] class to avoid allocating a new [StringName] on each call. </description> </method> <method name="has_meta" qualifiers="const"> <return type="bool" /> <param index="0" name="name" type="StringName" /> <description> Returns [code]true[/code] if a metadata entry is found with the given [param name]. See also [method get_meta], [method set_meta] and [method remove_meta]. [b]Note:[/b] A metadata's name must be a valid identifier as per [method StringName.is_valid_identifier] method. [b]Note:[/b] Metadata that has a name starting with an underscore ([code]_[/code]) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited, although it can still be found by this method. </description> </method> <method name="has_method" qualifiers="const"> <return type="bool" /> <param index="0" name="method" type="StringName" /> <description> Returns [code]true[/code] if the given [param method] name exists in the object. [b]Note:[/b] In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]MethodName[/code] class to avoid allocating a new [StringName] on each call. </description> </method> <method name="has_signal" qualifiers="const"> <return type="bool" /> <param index="0" name="signal" type="StringName" /> <description> Returns [code]true[/code] if the given [param signal] name exists in the object. [b]Note:[/b] In C#, [param signal] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]SignalName[/code] class to avoid allocating a new [StringName] on each call. </description> </method> <method name="has_user_signal" qualifiers="const"> <return type="bool" /> <param index="0" name="signal" type="StringName" /> <description> Returns [code]true[/code] if the given user-defined [param signal] name exists. Only signals added with [method add_user_signal] are included. See also [method remove_user_signal]. </description> </method> <method name="is_blocking_signals" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the object is blocking its signals from being emitted. See [method set_block_signals]. </description> </method> <method name="is_class" qualifiers="const"> <return type="bool" /> <param index="0" name="class" type="String" /> <description> Returns [code]true[/code] if the object inherits from the given [param class]. See also [method get_class]. [codeblocks] [gdscript] var sprite2d = Sprite2D.new() sprite2d.is_class("Sprite2D") # Returns true sprite2d.is_class("Node") # Returns true sprite2d.is_class("Node3D") # Returns false [/gdscript] [csharp] var sprite2D = new Sprite2D(); sprite2D.IsClass("Sprite2D"); // Returns true sprite2D.IsClass("Node"); // Returns true sprite2D.IsClass("Node3D"); // Returns false [/csharp] [/codeblocks] [b]Note:[/b] This method ignores [code]class_name[/code] declarations in the object's script. </description> </method>
124626
<?xml version="1.0" encoding="UTF-8" ?> <class name="Script" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A class stored as a resource. </brief_description> <description> A class stored as a resource. A script extends the functionality of all objects that instantiate 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> <link title="Scripting documentation index">$DOCS_URL/tutorials/scripting/index.html</link> </tutorials> <methods> <method name="can_instantiate" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the script can be instantiated. </description> </method> <method name="get_base_script" qualifiers="const"> <return type="Script" /> <description> Returns the script directly inherited by this script. </description> </method> <method name="get_global_name" qualifiers="const"> <return type="StringName" /> <description> Returns the class name associated with the script, if there is one. Returns an empty string otherwise. To give the script a global name, you can use the [code]class_name[/code] keyword in GDScript and the [code][GlobalClass][/code] attribute in C#. [codeblocks] [gdscript] class_name MyNode extends Node [/gdscript] [csharp] using Godot; [GlobalClass] public partial class MyNode : Node { } [/csharp] [/codeblocks] </description> </method> <method name="get_instance_base_type" qualifiers="const"> <return type="StringName" /> <description> Returns the script's base type. </description> </method> <method name="get_property_default_value"> <return type="Variant" /> <param index="0" name="property" type="StringName" /> <description> Returns the default value of the specified property. </description> </method> <method name="get_rpc_config" qualifiers="const"> <return type="Variant" /> <description> Returns a [Dictionary] mapping method names to their RPC configuration defined by this script. </description> </method> <method name="get_script_constant_map"> <return type="Dictionary" /> <description> Returns a dictionary containing constant names and their values. </description> </method> <method name="get_script_method_list"> <return type="Dictionary[]" /> <description> Returns the list of methods in this [Script]. </description> </method> <method name="get_script_property_list"> <return type="Dictionary[]" /> <description> Returns the list of properties in this [Script]. </description> </method> <method name="get_script_signal_list"> <return type="Dictionary[]" /> <description> Returns the list of user signals defined in this [Script]. </description> </method> <method name="has_script_signal" qualifiers="const"> <return type="bool" /> <param index="0" name="signal_name" type="StringName" /> <description> Returns [code]true[/code] if the script, or a base class, defines a signal with the given name. </description> </method> <method name="has_source_code" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the script contains non-empty source code. [b]Note:[/b] If a script does not have source code, this does not mean that it is invalid or unusable. For example, a [GDScript] that was exported with binary tokenization has no source code, but still behaves as expected and could be instantiated. This can be checked with [method can_instantiate]. </description> </method> <method name="instance_has" qualifiers="const"> <return type="bool" /> <param index="0" name="base_object" type="Object" /> <description> Returns [code]true[/code] if [param base_object] is an instance of this script. </description> </method> <method name="is_abstract" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the script is an abstract script. An abstract script does not have a constructor and cannot be instantiated. </description> </method> <method name="is_tool" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the script is a tool script. A tool script can run in the editor. </description> </method> <method name="reload"> <return type="int" enum="Error" /> <param index="0" name="keep_state" type="bool" default="false" /> <description> Reloads the script's class implementation. Returns an error code. </description> </method> </methods> <members> <member name="source_code" type="String" setter="set_source_code" getter="get_source_code"> The script source code or an empty string if source code is not available. When set, does not reload the class implementation automatically. </member> </members> </class>
124653
<brief_description> A 2D physics body that is moved by a physics simulation. </brief_description> <description> [RigidBody2D] implements full 2D physics. It cannot be controlled directly, instead, you must apply forces to it (gravity, impulses, etc.), and the physics simulation will calculate the resulting movement, rotation, react to collisions, and affect other physics bodies in its path. The body's behavior can be adjusted via [member lock_rotation], [member freeze], and [member freeze_mode]. By changing various properties of the object, such as [member mass], you can control how the physics simulation acts on it. A rigid body will always maintain its shape and size, even when forces are applied to it. It is useful for objects that can be interacted with in an environment, such as a tree that can be knocked over or a stack of crates that can be pushed around. If you need to override the default physics behavior, you can write a custom force integration function. See [member custom_integrator]. [b]Note:[/b] Changing the 2D transform or [member linear_velocity] of a [RigidBody2D] very often may lead to some unpredictable behaviors. If you need to directly affect the body, prefer [method _integrate_forces] as it allows you to directly access the physics state. </description> <tutorials> <link title="2D Physics Platformer Demo">https://godotengine.org/asset-library/asset/2725</link> <link title="Instancing Demo">https://godotengine.org/asset-library/asset/2716</link> </tutorials> <methods> <method name="_integrate_forces" qualifiers="virtual"> <return type="void" /> <param index="0" name="state" type="PhysicsDirectBodyState2D" /> <description> Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it is called before the standard force integration, but the [member custom_integrator] property allows you to disable the standard force integration and do fully custom force integration for a body. </description> </method> <method name="add_constant_central_force"> <return type="void" /> <param index="0" name="force" type="Vector2" /> <description> Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with [code]constant_force = Vector2(0, 0)[/code]. This is equivalent to using [method add_constant_force] at the body's center of mass. </description> </method> <method name="add_constant_force"> <return type="void" /> <param index="0" name="force" type="Vector2" /> <param index="1" name="position" type="Vector2" default="Vector2(0, 0)" /> <description> Adds a constant positioned force to the body that keeps being applied over time until cleared with [code]constant_force = Vector2(0, 0)[/code]. [param position] is the offset from the body origin in global coordinates. </description> </method> <method name="add_constant_torque"> <return type="void" /> <param index="0" name="torque" type="float" /> <description> Adds a constant rotational force without affecting position that keeps being applied over time until cleared with [code]constant_torque = 0[/code]. </description> </method> <method name="apply_central_force"> <return type="void" /> <param index="0" name="force" type="Vector2" /> <description> Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. This is equivalent to using [method apply_force] at the body's center of mass. </description> </method> <method name="apply_central_impulse"> <return type="void" /> <param index="0" name="impulse" type="Vector2" default="Vector2(0, 0)" /> <description> Applies a directional impulse without affecting rotation. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). This is equivalent to using [method apply_impulse] at the body's center of mass. </description> </method> <method name="apply_force"> <return type="void" /> <param index="0" name="force" type="Vector2" /> <param index="1" name="position" type="Vector2" default="Vector2(0, 0)" /> <description> Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. [param position] is the offset from the body origin in global coordinates. </description> </method> <method name="apply_impulse"> <return type="void" /> <param index="0" name="impulse" type="Vector2" /> <param index="1" name="position" type="Vector2" default="Vector2(0, 0)" /> <description> Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). [param position] is the offset from the body origin in global coordinates. </description> </method> <method name="apply_torque"> <return type="void" /> <param index="0" name="torque" type="float" /> <description> Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. [b]Note:[/b] [member inertia] is required for this to work. To have [member inertia], an active [CollisionShape2D] must be a child of the node, or you can manually set [member inertia]. </description> </method> <method name="apply_torque_impulse"> <return type="void" /> <param index="0" name="torque" type="float" /> <description> Applies a rotational impulse to the body without affecting the position. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). [b]Note:[/b] [member inertia] is required for this to work. To have [member inertia], an active [CollisionShape2D] must be a child of the node, or you can manually set [member inertia]. </description> </method> <method name="get_colliding_bodies" qualifiers="const"> <return type="Node2D[]" /> <description> Returns a list of the bodies colliding with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member max_contacts_reported] to be set high enough to detect all the collisions. [b]Note:[/b] The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead. </description> </method> <method name="get_contact_count" qualifiers="const"> <return type="int" /> <description> Returns the number of contacts this body has with other bodies. By default, this returns 0 unless bodies are configured to monitor contacts (see [member contact_monitor]). [b]Note:[/b] To retrieve the colliding bodies, use [method get_colliding_bodies]. </description> </method> <method name="set_axis_velocity"> <return type="void" /> <param index="0" name="axis_velocity" type="Vector2" /> <description> Sets the body's velocity on the given axis. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. </description> </method> </methods>
124659
<method name="area_set_monitor_callback"> <return type="void" /> <param index="0" name="area" type="RID" /> <param index="1" name="callback" type="Callable" /> <description> Sets the area's body monitor callback. This callback will be called when any other (shape of a) body enters or exits (a shape of) the given area, and must take the following five parameters: 1. an integer [code]status[/code]: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other body shape entered or exited the area, 2. an [RID] [code]body_rid[/code]: the [RID] of the body that entered or exited the area, 3. an integer [code]instance_id[/code]: the [code]ObjectID[/code] attached to the body, 4. an integer [code]body_shape_idx[/code]: the index of the shape of the body that entered or exited the area, 5. an integer [code]self_shape_idx[/code]: the index of the shape of the area where the body entered or exited. By counting (or keeping track of) the shapes that enter and exit, it can be determined if a body (with all its shapes) is entering for the first time or exiting for the last time. </description> </method> <method name="area_set_monitorable"> <return type="void" /> <param index="0" name="area" type="RID" /> <param index="1" name="monitorable" type="bool" /> <description> </description> </method> <method name="area_set_param"> <return type="void" /> <param index="0" name="area" type="RID" /> <param index="1" name="param" type="int" enum="PhysicsServer3D.AreaParameter" /> <param index="2" name="value" type="Variant" /> <description> Sets the value for an area parameter. A list of available parameters is on the [enum AreaParameter] constants. </description> </method> <method name="area_set_ray_pickable"> <return type="void" /> <param index="0" name="area" type="RID" /> <param index="1" name="enable" type="bool" /> <description> Sets object pickable with rays. </description> </method> <method name="area_set_shape"> <return type="void" /> <param index="0" name="area" type="RID" /> <param index="1" name="shape_idx" type="int" /> <param index="2" name="shape" type="RID" /> <description> Substitutes a given area shape by another. The old shape is selected by its index, the new one by its [RID]. </description> </method> <method name="area_set_shape_disabled"> <return type="void" /> <param index="0" name="area" type="RID" /> <param index="1" name="shape_idx" type="int" /> <param index="2" name="disabled" type="bool" /> <description> </description> </method> <method name="area_set_shape_transform"> <return type="void" /> <param index="0" name="area" type="RID" /> <param index="1" name="shape_idx" type="int" /> <param index="2" name="transform" type="Transform3D" /> <description> Sets the transform matrix for an area shape. </description> </method> <method name="area_set_space"> <return type="void" /> <param index="0" name="area" type="RID" /> <param index="1" name="space" type="RID" /> <description> Assigns a space to the area. </description> </method> <method name="area_set_transform"> <return type="void" /> <param index="0" name="area" type="RID" /> <param index="1" name="transform" type="Transform3D" /> <description> Sets the transform matrix for an area. </description> </method> <method name="body_add_collision_exception"> <return type="void" /> <param index="0" name="body" type="RID" /> <param index="1" name="excepted_body" type="RID" /> <description> Adds a body to the list of bodies exempt from collisions. </description> </method> <method name="body_add_constant_central_force"> <return type="void" /> <param index="0" name="body" type="RID" /> <param index="1" name="force" type="Vector3" /> <description> Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with [code]body_set_constant_force(body, Vector3(0, 0, 0))[/code]. This is equivalent to using [method body_add_constant_force] at the body's center of mass. </description> </method> <method name="body_add_constant_force"> <return type="void" /> <param index="0" name="body" type="RID" /> <param index="1" name="force" type="Vector3" /> <param index="2" name="position" type="Vector3" default="Vector3(0, 0, 0)" /> <description> Adds a constant positioned force to the body that keeps being applied over time until cleared with [code]body_set_constant_force(body, Vector3(0, 0, 0))[/code]. [param position] is the offset from the body origin in global coordinates. </description> </method> <method name="body_add_constant_torque"> <return type="void" /> <param index="0" name="body" type="RID" /> <param index="1" name="torque" type="Vector3" /> <description> Adds a constant rotational force without affecting position that keeps being applied over time until cleared with [code]body_set_constant_torque(body, Vector3(0, 0, 0))[/code]. </description> </method> <method name="body_add_shape"> <return type="void" /> <param index="0" name="body" type="RID" /> <param index="1" name="shape" type="RID" /> <param index="2" name="transform" type="Transform3D" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)" /> <param index="3" name="disabled" type="bool" default="false" /> <description> Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. </description> </method> <method name="body_apply_central_force"> <return type="void" /> <param index="0" name="body" type="RID" /> <param index="1" name="force" type="Vector3" /> <description> Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. This is equivalent to using [method body_apply_force] at the body's center of mass. </description> </method>