GodotSharp Axis-Aligned Bounding Box. AABB consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. Beginning corner. Typically has values lower than End. Directly uses a private field. Size from Position to End. Typically all components are positive. If the size is negative, you can use to fix it. Directly uses a private field. Ending corner. This is calculated as plus . Setting this value will change the size. Getting is equivalent to `value = Position + Size`, setting is equivalent to `Size = value - Position`. Returns an AABB with equivalent position and size, modified so that the most-negative corner is the origin and the size is positive. The modified AABB. Returns true if this AABB completely encloses another one. The other AABB that may be enclosed. A bool for whether or not this AABB encloses `b`. Returns this AABB expanded to include a given point. The point to include. The expanded AABB. Returns the area of the AABB. The area. Gets the position of one of the 8 endpoints of the AABB. Which endpoint to get. An endpoint of the AABB. Returns the normalized longest axis of the AABB. A vector representing the normalized longest axis of the AABB. Returns the index of the longest axis of the AABB. A index for which axis is longest. Returns the scalar length of the longest axis of the AABB. The scalar length of the longest axis of the AABB. Returns the normalized shortest axis of the AABB. A vector representing the normalized shortest axis of the AABB. Returns the index of the shortest axis of the AABB. A index for which axis is shortest. Returns the scalar length of the shortest axis of the AABB. The scalar length of the shortest axis of the AABB. Returns the support point in a given direction. This is useful for collision detection algorithms. The direction to find support for. A vector representing the support. Returns a copy of the AABB grown a given amount of units towards all the sides. The amount to grow by. The grown AABB. Returns true if the AABB is flat or empty, or false otherwise. A bool for whether or not the AABB has area. Returns true if the AABB has no surface (no size), or false otherwise. A bool for whether or not the AABB has area. Returns true if the AABB contains a point, or false otherwise. The point to check. A bool for whether or not the AABB contains `point`. Returns the intersection of this AABB and `b`. The other AABB. The clipped AABB. Returns true if the AABB overlaps with `b` (i.e. they have at least one point in common). If `includeBorders` is true, they will also be considered overlapping if their borders touch, even without intersection. The other AABB to check for intersections with. Whether or not to consider borders. A bool for whether or not they are intersecting. Returns true if the AABB is on both sides of `plane`. The plane to check for intersection. A bool for whether or not the AABB intersects the plane. Returns true if the AABB intersects the line segment between `from` and `to`. The start of the line segment. The end of the line segment. A bool for whether or not the AABB intersects the line segment. Returns a larger AABB that contains this AABB and `b`. The other AABB. The merged AABB. Constructs an AABB from a position and size. The position. The size, typically positive. Constructs an AABB from a position, width, height, and depth. The position. The width, typically positive. The height, typically positive. The depth, typically positive. Constructs an AABB from x, y, z, and size. The position's X coordinate. The position's Y coordinate. The position's Z coordinate. The size, typically positive. Constructs an AABB from x, y, z, width, height, and depth. The position's X coordinate. The position's Y coordinate. The position's Z coordinate. The width, typically positive. The height, typically positive. The depth, typically positive. Returns true if this AABB and `other` are approximately equal, by running on each component. The other AABB to compare. Whether or not the AABBs are approximately equal. 3×3 matrix used for 3D rotation and scale. Almost always used as an orthogonal basis for a Transform. Contains 3 vector fields X, Y and Z as its columns, which are typically interpreted as the local basis vectors of a 3D transformation. For such use, it is composed of a scaling and a rotation matrix, in that order (M = R.S). Can also be accessed as array of 3D vectors. These vectors are normally orthogonal to each other, but are not necessarily normalized (due to scaling). For more information, read this documentation article: https://docs.godotengine.org/en/3.3/tutorials/math/matrices_and_transforms.html The basis matrix's X vector (column 0). Equivalent to and array index `[0]`. The basis matrix's Y vector (column 1). Equivalent to and array index `[1]`. The basis matrix's Z vector (column 2). Equivalent to and array index `[2]`. Row 0 of the basis matrix. Shows which vectors contribute to the X direction. Rows are not very useful for user code, but are more efficient for some internal calculations. Row 1 of the basis matrix. Shows which vectors contribute to the Y direction. Rows are not very useful for user code, but are more efficient for some internal calculations. Row 2 of the basis matrix. Shows which vectors contribute to the Z direction. Rows are not very useful for user code, but are more efficient for some internal calculations. Column 0 of the basis matrix (the X vector). Equivalent to and array index `[0]`. Column 1 of the basis matrix (the Y vector). Equivalent to and array index `[1]`. Column 2 of the basis matrix (the Z vector). Equivalent to and array index `[2]`. The scale of this basis. Equivalent to the lengths of each column vector, but negative if the determinant is negative. Access whole columns in the form of Vector3. Which column vector. Access matrix elements in column-major order. Which column, the matrix horizontal position. Which row, the matrix vertical position. Returns the determinant of the basis matrix. If the basis is uniformly scaled, its determinant is the square of the scale. A negative determinant means the basis has a negative scale. A zero determinant means the basis isn't invertible, and is usually considered invalid. The determinant of the basis matrix. Returns the basis's rotation in the form of Euler angles (in the YXZ convention: when *decomposing*, first Z, then X, and Y last). The returned vector contains the rotation angles in the format (X angle, Y angle, Z angle). Consider using the method instead, which returns a quaternion instead of Euler angles. A Vector3 representing the basis rotation in Euler angles. Get rows by index. Rows are not very useful for user code, but are more efficient for some internal calculations. Which row. One of `Row0`, `Row1`, or `Row2`. Sets rows by index. Rows are not very useful for user code, but are more efficient for some internal calculations. Which row. The vector to set the row to. Deprecated, please use the array operator instead. Which column. One of `Column0`, `Column1`, or `Column2`. Deprecated, please use the array operator instead. Which column. The vector to set the column to. Deprecated, please use the array operator instead. Which column. One of `Column0`, `Column1`, or `Column2`. This function considers a discretization of rotations into 24 points on unit sphere, lying along the vectors (x, y, z) with each component being either -1, 0, or 1, and returns the index of the point best representing the orientation of the object. It is mainly used by the editor. For further details, refer to the Godot source code. The orthogonal index. Returns the inverse of the matrix. The inverse matrix. Returns the orthonormalized version of the basis matrix (useful to call occasionally to avoid rounding errors for orthogonal matrices). This performs a Gram-Schmidt orthonormalization on the basis of the matrix. An orthonormalized basis matrix. Introduce an additional rotation around the given `axis` by `phi` (in radians). The axis must be a normalized vector. The axis to rotate around. Must be normalized. The angle to rotate, in radians. The rotated basis matrix. Introduce an additional scaling specified by the given 3D scaling factor. The scale to introduce. The scaled basis matrix. Assuming that the matrix is a proper rotation matrix, slerp performs a spherical-linear interpolation with another rotation matrix. The destination basis for interpolation. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The resulting basis matrix of the interpolation. Transposed dot product with the X axis of the matrix. A vector to calculate the dot product with. The resulting dot product. Transposed dot product with the Y axis of the matrix. A vector to calculate the dot product with. The resulting dot product. Transposed dot product with the Z axis of the matrix. A vector to calculate the dot product with. The resulting dot product. Returns the transposed version of the basis matrix. The transposed basis matrix. Returns a vector transformed (multiplied) by the basis matrix. A vector to transform. The transformed vector. Returns a vector transformed (multiplied) by the transposed basis matrix. Note: This results in a multiplication by the inverse of the basis matrix only if it represents a rotation-reflection. A vector to inversely transform. The inversely transformed vector. Returns the basis's rotation in the form of a quaternion. See if you need Euler angles, but keep in mind that quaternions should generally be preferred to Euler angles. A representing the basis's rotation. The identity basis, with no rotation or scaling applied. This is used as a replacement for `Basis()` in GDScript. Do not use `new Basis()` with no arguments in C#, because it sets all values to zero. Equivalent to `new Basis(Vector3.Right, Vector3.Up, Vector3.Back)`. The basis that will flip something along the X axis when used in a transformation. Equivalent to `new Basis(Vector3.Left, Vector3.Up, Vector3.Back)`. The basis that will flip something along the Y axis when used in a transformation. Equivalent to `new Basis(Vector3.Right, Vector3.Down, Vector3.Back)`. The basis that will flip something along the Z axis when used in a transformation. Equivalent to `new Basis(Vector3.Right, Vector3.Up, Vector3.Forward)`. Constructs a pure rotation basis matrix from the given quaternion. The quaternion to create the basis from. Constructs a pure rotation basis matrix from the given Euler angles (in the YXZ convention: when *composing*, first Y, then X, and Z last), given in the vector format as (X angle, Y angle, Z angle). Consider using the constructor instead, which uses a quaternion instead of Euler angles. The Euler angles to create the basis from. Constructs a pure rotation basis matrix, rotated around the given `axis` by `phi` (in radians). The axis must be a normalized vector. The axis to rotate around. Must be normalized. The angle to rotate, in radians. Constructs a basis matrix from 3 axis vectors (matrix columns). The X vector, or Column0. The Y vector, or Column1. The Z vector, or Column2. Returns true if this basis and `other` are approximately equal, by running on each component. The other basis to compare. Whether or not the matrices are approximately equal. A color represented by red, green, blue, and alpha (RGBA) components. The alpha component is often used for transparency. Values are in floating-point and usually range from 0 to 1. Some properties (such as CanvasItem.modulate) may accept values greater than 1 (overbright or HDR colors). If you want to supply values in a range of 0 to 255, you should use and the `r8`/`g8`/`b8`/`a8` properties. The color's red component, typically on the range of 0 to 1. The color's green component, typically on the range of 0 to 1. The color's blue component, typically on the range of 0 to 1. The color's alpha (transparency) component, typically on the range of 0 to 1. Wrapper for that uses the range 0 to 255 instead of 0 to 1. Getting is equivalent to multiplying by 255 and rounding. Setting is equivalent to dividing by 255. Wrapper for that uses the range 0 to 255 instead of 0 to 1. Getting is equivalent to multiplying by 255 and rounding. Setting is equivalent to dividing by 255. Wrapper for that uses the range 0 to 255 instead of 0 to 1. Getting is equivalent to multiplying by 255 and rounding. Setting is equivalent to dividing by 255. Wrapper for that uses the range 0 to 255 instead of 0 to 1. Getting is equivalent to multiplying by 255 and rounding. Setting is equivalent to dividing by 255. The HSV hue of this color, on the range 0 to 1. Getting is a long process, refer to the source code for details. Setting uses . The HSV saturation of this color, on the range 0 to 1. Getting is equivalent to the ratio between the min and max RGB value. Setting uses . The HSV value (brightness) of this color, on the range 0 to 1. Getting is equivalent to using `Max()` on the RGB components. Setting uses . Returns a color according to the standardized name, with the specified alpha value. Supported color names are the same as the constants defined in . The name of the color. The alpha (transparency) component represented on the range of 0 to 1. Default: 1. The constructed color. Access color components using their index. `[0]` is equivalent to `.r`, `[1]` is equivalent to `.g`, `[2]` is equivalent to `.b`, `[3]` is equivalent to `.a`. Converts a color to HSV values. This is equivalent to using each of the `h`/`s`/`v` properties, but much more efficient. Output parameter for the HSV hue. Output parameter for the HSV saturation. Output parameter for the HSV value. Constructs a color from an HSV profile, with values on the range of 0 to 1. This is equivalent to using each of the `h`/`s`/`v` properties, but much more efficient. The HSV hue, typically on the range of 0 to 1. The HSV saturation, typically on the range of 0 to 1. The HSV value (brightness), typically on the range of 0 to 1. The alpha (transparency) value, typically on the range of 0 to 1. The constructed color. Returns a new color resulting from blending this color over another. If the color is opaque, the result is also opaque. The second color may have a range of alpha values. The color to blend over. This color blended over `over`. Returns the most contrasting color. The most contrasting color Returns a new color resulting from making this color darker by the specified ratio (on the range of 0 to 1). The ratio to darken by. The darkened color. Returns the inverted color: `(1 - r, 1 - g, 1 - b, a)`. The inverted color. Returns a new color resulting from making this color lighter by the specified ratio (on the range of 0 to 1). The ratio to lighten by. The darkened color. Returns the result of the linear interpolation between this color and `to` by amount `weight`. The destination color for interpolation. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The resulting color of the interpolation. Returns the result of the linear interpolation between this color and `to` by color amount `weight`. The destination color for interpolation. A color with components on the range of 0.0 to 1.0, representing the amount of interpolation. The resulting color of the interpolation. Returns the color converted to a 32-bit integer in ABGR format (each byte represents a color channel). ABGR is the reversed version of the default format. An int representing this color in ABGR32 format. Returns the color converted to a 64-bit integer in ABGR format (each word represents a color channel). ABGR is the reversed version of the default format. An int representing this color in ABGR64 format. Returns the color converted to a 32-bit integer in ARGB format (each byte represents a color channel). ARGB is more compatible with DirectX, but not used much in Godot. An int representing this color in ARGB32 format. Returns the color converted to a 64-bit integer in ARGB format (each word represents a color channel). ARGB is more compatible with DirectX, but not used much in Godot. A long representing this color in ARGB64 format. Returns the color converted to a 32-bit integer in RGBA format (each byte represents a color channel). RGBA is Godot's default and recommended format. An int representing this color in RGBA32 format. Returns the color converted to a 64-bit integer in RGBA format (each word represents a color channel). RGBA is Godot's default and recommended format. A long representing this color in RGBA64 format. Returns the color's HTML hexadecimal color string in RGBA format. Whether or not to include alpha. If false, the color is RGB instead of RGBA. A string for the HTML hexadecimal representation of this color. Constructs a color from RGBA values, typically on the range of 0 to 1. The color's red component, typically on the range of 0 to 1. The color's green component, typically on the range of 0 to 1. The color's blue component, typically on the range of 0 to 1. The color's alpha (transparency) value, typically on the range of 0 to 1. Default: 1. Constructs a color from an existing color and an alpha value. The color to construct from. Only its RGB values are used. The color's alpha (transparency) value, typically on the range of 0 to 1. Default: 1. Constructs a color from a 32-bit integer in RGBA format (each byte represents a color channel). The int representing the color. Constructs a color from a 64-bit integer in RGBA format (each word represents a color channel). The long representing the color. Returns a color constructed from integer red, green, blue, and alpha channels. Each channel should have 8 bits of information ranging from 0 to 255. The red component represented on the range of 0 to 255. The green component represented on the range of 0 to 255. The blue component represented on the range of 0 to 255. The alpha (transparency) component represented on the range of 0 to 255. The constructed color. Constructs a color from the HTML hexadecimal color string in RGBA format. A string for the HTML hexadecimal representation of this color. Returns true if this color and `other` are approximately equal, by running on each component. The other color to compare. Whether or not the colors are approximately equal. This class contains color constants created from standardized color names. The standardized color set is based on the X11 and .NET color names. Represents an whose members can be dynamically accessed at runtime through the Variant API. The class enables access to the Variant members of a instance at runtime. This allows accessing the class members using their original names in the engine as well as the members from the script attached to the , regardless of the scripting language it was written in. This sample shows how to use to dynamically access the engine members of a . dynamic sprite = GetNode("Sprite").DynamicGodotObject; sprite.add_child(this); if ((sprite.hframes * sprite.vframes) > 0) sprite.frame = 0; This sample shows how to use to dynamically access the members of the script attached to a . dynamic childNode = GetNode("ChildNode").DynamicGodotObject; if (childNode.print_allowed) { childNode.message = "Hello from C#"; childNode.print_message(3); } The ChildNode node has the following GDScript script attached: // # ChildNode.gd // var print_allowed = true // var message = "" // // func print_message(times): // for i in times: // print(message) Gets the associated with this . Initializes a new instance of the class. The that will be associated with this . Thrown when the parameter is null. 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 scene. Scenes can be saved to the disk and then instanced into other scenes. This allows for very high flexibility in the architecture and data model of Godot projects. Scene tree: The contains the active tree of nodes. When a node is added to the scene tree, it receives the notification and its callback is triggered. Child nodes are always added after their parent node, i.e. the callback of a parent node will be triggered before its child's. Once all nodes have been added in the scene tree, they receive the notification and their respective callbacks are triggered. For groups of nodes, the 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: of the parent, of the children, of the children and finally of the parent (recursively for the entire scene tree). Processing: Nodes can override the "process" state, so that they receive a callback on each frame requesting them to process (do something). Normal processing (callback , toggled with ) happens as fast as possible and is dependent on the frame rate, so the processing time delta (in seconds) is passed as an argument. Physics processing (callback , toggled with ) 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 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 function might be preferred; it is called when the input event was not handled by anyone else (typically, GUI nodes), ensuring that the node only receives the events that were meant for it. To keep track of the scene hierarchy (especially when instancing scenes into other scenes), an "owner" can be set for the node with the property. This keeps track of who instanced what. This is mostly useful when writing editors and tools, though. Finally, when a node is freed with or , it will also free all its children. Groups: 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 , and . You can then retrieve all nodes in these groups, iterate them and even call methods on groups via the methods on . Networking with nodes: After connecting to a server (or making one, see ), it is possible to use the built-in RPC (remote procedure call) system to communicate over the network. By calling 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 (make sure node names are the same on all peers). Also, take a look at the high-level networking tutorial and corresponding demos. Notification received when the node enters a . Notification received when the node is about to exit a . Notification received when the node is moved in the parent. Notification received when the node is ready. See . Notification received when the node is paused. Notification received when the node is unpaused. Notification received every frame when the physics process flag is set (see ). Notification received every frame when the process flag is set (see ). Notification received when a node is set as a child of another node. Note: This doesn't mean that a node entered the . Notification received when a node is unparented (parent removed it from the list of children). Notification received when the node is instanced. Notification received when a drag begins. Notification received when a drag ends. Notification received when the node's changed. Notification received every frame when the internal process flag is set (see ). Notification received every frame when the internal physics process flag is set (see ). Notification received when the node is ready, just before is received. Unlike the latter, it's sent every time the node enters tree, instead of only once. Notification received from the OS when the mouse enters the game window. Implemented on desktop and web platforms. Notification received from the OS when the mouse leaves the game window. Implemented on desktop and web platforms. Notification received from the OS when the game window is focused. Implemented on all platforms. Notification received from the OS when the game window is unfocused. Implemented on all platforms. Notification received from the OS when a quit request is sent (e.g. closing the window with a "Close" button or Alt+F4). Implemented on desktop platforms. Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android). Specific to the Android platform. Notification received from the OS when an unfocus request is sent (e.g. another OS window wants to take the focus). No supported platforms currently send this notification. Notification received from the OS when the application is exceeding its allocated memory. Specific to the iOS platform. 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 . Notification received from the OS when a request for "About" information is sent. Specific to the macOS platform. Notification received from Godot's crash handler when the engine is about to crash. Implemented on desktop platforms if the crash handler is enabled. 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. Notification received from the OS when the app is resumed. Specific to the Android platform. Notification received from the OS when the app is paused. Specific to the Android platform. Inherits pause mode from the node's parent. For the root node, it is equivalent to . Default. Stops processing when the is paused. Continue to process regardless of the pause state. Duplicate the node's signals. Duplicate the node's groups. Duplicate the node's scripts. Duplicate using instancing. An instance stays linked to the original so when the original changes, the instance changes too. Pause mode. How the node will behave if the is paused. The name of the node. This name is unique among the siblings (other child nodes from the same parent). When set to an existing name, the node will be automatically renamed. Note: Auto-generated names might include the @ character, which is reserved for unique names when using . When setting the name manually, any @ will be removed. When a scene is instanced from a file, its topmost node contains the filename from which it was loaded. The node owner. A node can have any other node as owner (as long as it is a valid parent, grandparent, etc. ascending in the tree). When saving a node (using ), all the nodes it owns will be saved with it. This allows for the creation of complex s, with instancing and subinstancing. The instance associated with this node. Either the , or the default SceneTree one (if inside tree). The override to the default . Set to null to use the default one. The node's priority in the execution order of the enabled processing callbacks (i.e. , and their internal counterparts). Nodes whose process priority value is lower will have their processing callbacks executed first. Called when the node enters the (e.g. upon instancing, scene changing, or after calling in a script). If the node has children, its callback will be called first, and then that of the children. Corresponds to the notification in . Called when the node is about to leave the (e.g. upon freeing, scene changing, or after calling in a script). If the node has children, its callback will be called last, after all its children have left the tree. Corresponds to the notification in and signal tree_exiting. To get notified when the node has already left the active tree, connect to the tree_exited. The string returned from this method is displayed as a warning in the Scene Dock if the script that overrides it is a tool script. Returning an empty string produces no warning. Call when the warning needs to be updated for this node. 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 . To consume the input event and stop it propagating further to other nodes, can be called. For gameplay input, and are usually a better fit as they allow the GUI to intercept the events first. Note: This method is only called if the node is present in the scene tree (i.e. if it's not orphan). 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 delta variable should be constant. 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 . Corresponds to the notification in . Note: This method is only called if the node is present in the scene tree (i.e. if it's not orphan). Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the delta time since the previous frame is not constant. 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 . Corresponds to the notification in . Note: This method is only called if the node is present in the scene tree (i.e. if it's not orphan). 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 callbacks get triggered first, and the parent node will receive the ready notification afterwards. Corresponds to the notification in . See also the onready keyword for variables. Usually used for initialization. For even earlier initialization, may be used. See also . Note: may be called only once for each node. After removing a node from the scene tree and adding again, _ready will not be called for the second time. This can be bypassed with requesting another call with , which may be called anywhere before adding the node again. Called when an hasn't been consumed by or any GUI. 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 . To consume the input event and stop it propagating further to other nodes, can be called. For gameplay input, this and are usually a better fit than as they allow the GUI to intercept the events first. Note: This method is only called if the node is present in the scene tree (i.e. if it's not orphan). Called when an hasn't been consumed by or any GUI. 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 . To consume the input event and stop it propagating further to other nodes, can be called. For gameplay input, this and are usually a better fit than as they allow the GUI to intercept the events first. Note: This method is only called if the node is present in the scene tree (i.e. if it's not orphan). Adds child_node as a child. The child is placed below the given node in the list of children. If legible_unique_name is true, the child node will have a human-readable name based on the name of the node being instanced instead of its type. Adds a child 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 legible_unique_name is true, the child node will have a human-readable name based on the name of the node being instanced instead of its type. Note: If the child node already has a parent, the function will fail. Use first to remove the node from its current parent. For example: if child_node.get_parent(): child_node.get_parent().remove_child(child_node) add_child(child_node) Note: If you want a child to be persisted to a , you must set in addition to calling . This is typically relevant for tool scripts and editor plugins. If is called without setting , the newly added will not be visible in the scene tree, though it will be visible in the 2D/3D view. Removes a child node. The node is NOT deleted and must be deleted manually. Returns the number of child nodes. Returns an array of references to node's children. Returns a child node by its index (see ). This method is often used for iterating all children of a node. To access a child node via its name, use . Returns true if the node that the points to exists. Fetches a node. The can be either a relative path (from the current node) or an absolute path (in the scene tree) to a node. If the path does not exist, a null instance is returned and an error is logged. Attempts to access methods on the return value will result in an "Attempt to call <method> on a null instance." error. Note: Fetching absolute paths only works when the node is inside the scene tree (see ). Example: Assume your current node is Character and the following tree: /root /root/Character /root/Character/Sword /root/Character/Backpack/Dagger /root/MyGame /root/Swamp/Alligator /root/Swamp/Mosquito /root/Swamp/Goblin Possible paths are: get_node("Sword") get_node("Backpack/Dagger") get_node("../Swamp/Alligator") get_node("/root/MyGame") Similar to , but does not log an error if path does not point to a valid . Returns the parent node of the current node, or a null instance if the node lacks a parent. Finds a descendant of this node whose name matches mask as in String.match (i.e. case-sensitive, but "*" matches zero or more characters and "?" matches any single character except "."). Note: It does not match against the full path, just against individual node names. If owned is true, this method only finds nodes whose owner is this node. This is especially important for scenes instantiated through a script, because those scenes don't have an owner. Note: As this method walks through all the descendants of the node, it is the slowest way to get a reference to another node. Whenever possible, consider using instead. To avoid using too often, consider caching the node reference into a variable. Finds the first parent of the current node whose name matches mask as in String.match (i.e. case-sensitive, but "*" matches zero or more characters and "?" matches any single character except "."). Note: It does not match against the full path, just against individual node names. Note: As this method walks upwards in the scene tree, it can be slow in large, deeply nested scene trees. Whenever possible, consider using instead. To avoid using too often, consider caching the node reference into a variable. Returns true if the points to a valid node and its subname points to a valid resource, e.g. Area2D/CollisionShape2D:shape. Properties with a non- type (e.g. nodes or primitive math types) are not considered resources. Fetches a node and one of its resources as specified by the 's subname (e.g. Area2D/CollisionShape2D:shape). If several nested resources are specified in the , the last one will be fetched. The return value is an array of size 3: the first index points to the (or null if not found), the second index points to the (or null if not found), and the third index is the remaining , if any. For example, assuming that Area2D/CollisionShape2D is a valid node and that its shape property has been assigned a resource, one could have this kind of output: print(get_node_and_resource("Area2D/CollisionShape2D")) # [[CollisionShape2D:1161], Null, ] print(get_node_and_resource("Area2D/CollisionShape2D:shape")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], ] print(get_node_and_resource("Area2D/CollisionShape2D:shape:extents")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], :extents] Returns true if this node is currently inside a . Returns true if the given node is a direct or indirect child of the current node. Returns true if the given node occurs later in the scene hierarchy than the current node. Returns the absolute path of the current node. This only works if the current node is inside the scene tree (see ). Returns the relative from this node to the specified node. Both nodes must be in the same scene or the function will fail. Adds the node to a group. Groups are helpers to name and organize a subset of nodes, for example "enemies" or "collectables". A node can be in any number of groups. Nodes can be assigned a group at any time, but will not be added until they are inside the scene tree (see ). See notes in the description, and the group methods in . The persistent option is used when packing node to and saving to file. Non-persistent groups aren't stored. Removes a node from a group. See notes in the description, and the group methods in . Returns true if this node is in the specified group. See notes in the description, and the group methods in . Moves a child node to a different position (order) among the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful. Returns an array listing the groups that the node is a member of. Moves this node to the bottom of parent node's children hierarchy. This is often useful in GUIs ( nodes), because their order of drawing depends on their order in the tree. The top Node is drawn first, then any siblings below the top Node in the hierarchy are successively drawn on top of it. After using raise, a Control will be drawn on top of its siblings. Removes a node and sets all its children as children of the parent node (if it exists). All event subscriptions that pass by the removed node will be unsubscribed. Returns the node's index, i.e. its position among the siblings of its parent. Prints the tree to stdout. Used mainly for debugging purposes. This version displays the path relative to the current node, and is good for copy/pasting into the function. Example output: TheGame TheGame/Menu TheGame/Menu/Label TheGame/Menu/Camera2D TheGame/SplashScreen TheGame/SplashScreen/Camera2D Similar to , this prints the tree to stdout. This version displays a more graphical representation similar to what is displayed in the scene inspector. It is useful for inspecting larger trees. Example output: ┖╴TheGame ┠╴Menu ┃ ┠╴Label ┃ ┖╴Camera2D ┖╴SplashScreen ┖╴Camera2D Notifies the current node and all its children recursively by calling on all of them. Calls the given method (if present) with the arguments given in args on this node and recursively on all its children. If the parent_first argument is true, the method will be called on the current node first, then on all its children. If parent_first is false, the children will be called first. If the parameter is null, then the default value is new Godot.Collections.Array {} Enables or disables physics (i.e. fixed framerate) processing. When a node is being processed, it will receive a at a fixed (usually 60 FPS, see to change) interval (and the callback will be called if exists). Enabled automatically if is overridden. Any calls to this before will be ignored. Returns the time elapsed (in seconds) since the last physics-bound frame (see ). This is always a constant value in physics processing unless the frames per second is changed via . Returns true if physics processing is enabled (see ). Returns the time elapsed (in seconds) since the last process callback. This value may vary from frame to frame. Enables or disables processing. When a node is being processed, it will receive a on every drawn frame (and the callback will be called if exists). Enabled automatically if is overridden. Any calls to this before will be ignored. Returns true if processing is enabled (see ). Enables or disables input processing. This is not required for GUI controls! Enabled automatically if is overridden. Any calls to this before will be ignored. Returns true if the node is processing input (see ). Enables unhandled input processing. This is not required for GUI controls! It enables the node to receive all input that was not previously handled (usually by a ). Enabled automatically if is overridden. Any calls to this before will be ignored. Returns true if the node is processing unhandled input (see ). Enables unhandled key input processing. Enabled automatically if is overridden. Any calls to this before will be ignored. Returns true if the node is processing unhandled key input (see ). Returns true if the node can process while the scene tree is paused (see ). Always returns true if the scene tree is not paused, and false if the node is not in the tree. Prints all stray nodes (nodes outside the ). Used for debugging. Works only in debug builds. Returns the node's order in the scene tree branch. For example, if called on the first child node the position is 0. Sets the folded state of the node in the Scene dock. Returns true if the node is folded (collapsed) in the Scene dock. Enables or disabled internal processing for this node. Internal processing happens in isolation from the normal calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting (). Only useful for advanced uses to manipulate built-in nodes' behavior. Warning: Built-in Nodes rely on the internal processing for their own logic, so changing this value from your code may lead to unexpected behavior. Script access to this internal logic is provided for specific advanced uses, but is unsafe and not supported. Returns true if internal processing is enabled (see ). Enables or disables internal physics for this node. Internal physics processing happens in isolation from the normal calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting (). Only useful for advanced uses to manipulate built-in nodes' behavior. Warning: Built-in Nodes rely on the internal processing for their own logic, so changing this value from your code may lead to unexpected behavior. Script access to this internal logic is provided for specific advanced uses, but is unsafe and not supported. Returns true if internal physics processing is enabled (see ). Returns the that contains this node. Duplicates the node, returning a new node. You can fine-tune the behavior using the flags (see ). Note: It will not work properly if the node contains a script with constructor arguments (i.e. needs to supply arguments to method). In that case, the node will be duplicated without a script. Replaces a node in a scene by the given one. Subscriptions that pass through this node will be lost. Sets whether this is an instance load placeholder. See . Returns true if this is an instance load placeholder. See . Returns the node's . Queues a node for deletion at the end of the current frame. When deleted, all of its child nodes will be deleted as well. This method ensures it's safe to delete the node, contrary to . Use to check whether a node will be deleted at the end of the frame. Important: If you have a variable pointing to a node, it will not be assigned to null once the node is freed. Instead, it will point to a previously freed instance and you should validate it with @GDScript.is_instance_valid before attempting to call its methods or access its properties. Requests that _ready be called again. Note that the method won't be called immediately, but is scheduled for when the node is added to the scene tree again (see ). _ready is called only for the node which requested it, which means that you need to request ready for each child if you want them to call _ready too (in which case, _ready will be called in the same order as it would normally). Sets the node's network master to the peer with the given peer ID. The network master is the peer that has authority over the node on the network. Useful in conjunction with the master and puppet keywords. Inherited from the parent node by default, which ultimately defaults to peer ID 1 (the server). If recursive, the given peer is recursively set as the master for all children of this node. Returns the peer ID of the network master for this node. See . Returns true if the local system is the master of this node. Changes the RPC mode for the given method to the given mode. See . An alternative is annotating methods and properties with the corresponding keywords (remote, master, puppet, remotesync, mastersync, puppetsync). By default, methods are not exposed to networking (and RPCs). See also and for properties. Changes the RPC mode for the given property to the given mode. See . An alternative is annotating methods and properties with the corresponding keywords (remote, master, puppet, remotesync, mastersync, puppetsync). By default, properties are not exposed to networking (and RPCs). See also and for methods. Sends a remote procedure call request for the given method to peers on the network (and locally), optionally sending all additional arguments as arguments to the method called by the RPC. The call request will only be received by nodes with the same , including the exact same node name. Behaviour depends on the RPC configuration for the given method, see . Methods are not exposed to RPCs by default. See also and for properties. Returns an empty Variant. Note: You can only safely use RPCs on clients after you received the connected_to_server signal from the . You also need to keep track of the connection state, either by the signals like server_disconnected or by checking SceneTree.network_peer.get_connection_status() == CONNECTION_CONNECTED. Sends a using an unreliable protocol. Returns an empty Variant. Sends a to a specific peer identified by peer_id (see ). Returns an empty Variant. Sends a to a specific peer identified by peer_id using an unreliable protocol (see ). Returns an empty Variant. Remotely changes a property's value on other peers (and locally). Behaviour depends on the RPC configuration for the given property, see . See also for RPCs for methods, most information applies to this method as well. Remotely changes the property's value on a specific peer identified by peer_id (see ). Remotely changes the property's value on other peers (and locally) using an unreliable protocol. Remotely changes property's value on a specific peer identified by peer_id using an unreliable protocol (see ). Updates the warning displayed for this node in the Scene Dock. Use to setup the warning message to display. Every class which is not a built-in type inherits from this class. You can construct Objects from scripting languages, using Object.new() in GDScript, new Object in C#, or the "Construct Object" node in VisualScript. Objects do not manage memory. If a class inherits from Object, you will have to delete instances of it manually. To do so, call the method from your script or delete the instance from C++. Some classes that extend Object add memory management. This is the case of , which counts references and deletes itself automatically when no longer referenced. , another fundamental type, deletes all its children when freed from memory. Objects export properties, which are mainly useful for storage and editing, but not really so much in programming. Properties are exported in and handled in and . However, scripting languages and C++ have simpler means to export them. Property membership can be tested directly in GDScript using in: var n = Node2D.new() print("position" in n) # Prints "True". print("other_property" in n) # Prints "False". The in operator will evaluate to true as long as the key exists, even if the value is null. Objects also receive notifications. Notifications are a simple way to notify the object about different events, so they can all be handled together. See . Note: Unlike references to a , references to an Object stored in a variable can become invalid without warning. Therefore, it's recommended to use for data classes instead of . Note: Due to a bug, you can't create a "plain" Object using Object.new(). Instead, use ClassDB.instance("Object"). This bug only applies to Object itself, not any of its descendents like . Returns a new awaiter configured to complete when the instance emits the signal specified by the parameter. The instance the awaiter will be listening to. The signal the awaiter will be waiting for. This sample prints a message once every frame up to 100 times. public override void _Ready() { for (int i = 0; i < 100; i++) { await ToSignal(GetTree(), "idle_frame"); GD.Print($"Frame {i}"); } } Gets a new associated with this instance. Called right when the object is initialized. Not available in script. Called before the object is about to be deleted. Connects a signal in deferred mode. This way, signal emissions are stored in a queue, then set on idle time. Persisting connections are saved when the object is serialized to file. One-shot connections disconnect themselves after emission. Connect a signal as reference-counted. This means that a given signal can be connected several times to the same target, and will only be fully disconnected once no references are left. Virtual method which can be overridden to customize the return value of . Returns the given property. Returns null if the property does not exist. Virtual method which can be overridden to customize the return value of . Returns the object's property list as an of dictionaries. Each property's must contain at least name: String and type: int (see ) entries. Optionally, it can also include hint: int (see ), hint_string: String, and usage: int (see ). Called whenever the object receives a notification, which is identified in what by a constant. The base has two constants and , but subclasses such as define a lot more notifications which are also received by this method. Virtual method which can be overridden to customize the return value of . Sets a property. Returns true if the property exists. Deletes the object from memory immediately. For s, you may want to use to queue the node for safe deletion at the end of the current frame. Important: If you have a variable pointing to an object, it will not be assigned to null once the object is freed. Instead, it will point to a previously freed instance and you should validate it with @GDScript.is_instance_valid before attempting to call its methods or access its properties. Returns the object's class as a . Returns true if the object inherits from the given class. Assigns a new value to the given property. If the property does not exist, nothing will happen. Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase). Returns the Variant value of the given property. If the property doesn't exist, this will return null. Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase). Assigns a new value to the property identified by the . The node path should be relative to the current object and can use the colon character (:) to access nested properties. Example: set_indexed("position", Vector2(42, 0)) set_indexed("position:y", -10) print(position) # (42, -10) Gets the object's property indexed by the given . The node path should be relative to the current object and can use the colon character (:) to access nested properties. Examples: "position:x" or "material:next_pass:blend_mode". Returns the object's property list as an of dictionaries. Each property's contain at least name: String and type: int (see ) entries. Optionally, it can also include hint: int (see ), hint_string: String, and usage: int (see ). Returns the object's methods and their signatures as an . Send a given notification to the object, which will also trigger a call to the method of all classes that the object inherits from. If reversed is true, is called first on the object's own class, and then up to its successive parent classes. If reversed is false, is called first on the highest ancestor ( itself), and then down to its successive inheriting classes. Returns the object's unique instance ID. This ID can be saved in , and can be used to retrieve the object instance with @GDScript.instance_from_id. Assigns a script to the object. Each object can have a single script assigned to it, which are used to extend its functionality. If the object already had a script, the previous script instance will be freed and its variables and state will be lost. The new script's method will be called. Returns the object's instance, or null if none is assigned. Adds, changes or removes a given entry in the object's metadata. Metadata are serialized and can take any Variant value. To remove a given entry from the object's metadata, use . Metadata is also removed if its value is set to null. This means you can also use set_meta("name", null) to remove metadata for "name". Removes a given entry from the object's metadata. See also . Returns the object's metadata entry for the given name. Returns true if a metadata entry is found with the given name. Returns the object's metadata as a . Adds a user-defined signal. Arguments are optional, but can be added as an of dictionaries, each containing name: String and type: int (see ) entries. If the parameter is null, then the default value is new Godot.Collections.Array {} Returns true if the given user-defined signal exists. Only signals added using are taken into account. Emits the given signal. The signal must exist, so it should be a built-in signal of this class or one of its parent classes, or a user-defined signal. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: emit_signal("hit", weapon_type, damage) emit_signal("game_over") Calls the method on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: call("set", "position", Vector2(42.0, 0.0)) Note: In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase). Calls the method on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: call_deferred("set", "position", Vector2(42.0, 0.0)) Note: In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase). Assigns a new value to the given property, after the current frame's physics step. This is equivalent to calling via , i.e. call_deferred("set", property, value). Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase). Calls the method on the object and returns the result. Contrarily to , this method does not support a variable number of arguments but expects all parameters to be via a single . callv("set", [ "position", Vector2(42.0, 0.0) ]) Returns true if the object contains the given method. Returns true if the given signal exists. Returns the list of signals as an of dictionaries. Returns an of connections for the given signal. Returns an of dictionaries with information about signals that are connected to the object. Each contains three String entries: - source is a reference to the signal emitter. - signal_name is the name of the connected signal. - method_name is the name of the method to which the signal is connected. Connects a signal to a method on a target object. Pass optional binds to the call as an of parameters. These parameters will be passed to the method after any parameter used in the call to . Use flags to set deferred or one-shot connections. See constants. A signal can only be connected once to a method. It will throw an error if already connected, unless the signal was connected with . To avoid this, first, use to check for existing connections. If the target is destroyed in the game's lifecycle, the connection will be lost. Examples: connect("pressed", self, "_on_Button_pressed") # BaseButton signal connect("text_entered", self, "_on_LineEdit_text_entered") # LineEdit signal connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # User-defined signal An example of the relationship between binds passed to and parameters used when calling : connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # weapon_type and damage are passed last emit_signal("hit", "Dark lord", 5) # "Dark lord" and 5 are passed first func _on_Player_hit(hit_by, level, weapon_type, damage): print("Hit by %s (lvl %d) with weapon %s for %d damage" % [hit_by, level, weapon_type, damage]) If the parameter is null, then the default value is new Godot.Collections.Array {} Disconnects a signal from a method on the given target. If you try to disconnect a connection that does not exist, the method will throw an error. Use to ensure that the connection exists. Returns true if a connection exists for a given signal, target, and method. If set to true, signal emission is blocked. Returns true if signal emission blocking is enabled. Notify the editor that the property list has changed, so that editor plugins can take the new values into account. Does nothing on export builds. Defines whether the object can translate strings (with calls to ). Enabled by default. Returns true if the object can translate strings. See and . Translates a message using translation catalogs configured in the Project Settings. Only works if message translation is enabled (which it is by default), otherwise it returns the message unchanged. See . Returns true if the method was called for the object. A simplified interface to a scene file. Provides access to operations and checks that can be performed on the scene resource itself. Can be used to save a node to a file. When saving, the node as well as all the nodes it owns get saved (see owner property on ). Note: The node doesn't need to own itself. Example of loading a saved scene: # Use `load()` instead of `preload()` if the path isn't known at compile-time. var scene = preload("res://scene.tscn").instance() # Add the node as a child of the node the script is attached to. add_child(scene) Example of saving a node with different owners: The following example creates 3 objects: Node2D (node), RigidBody2D (rigid) and CollisionObject2D (collision). collision is a child of rigid which is a child of node. Only rigid is owned by node and pack will therefore only save those two nodes, but not collision. # Create the objects. var node = Node2D.new() var rigid = RigidBody2D.new() var collision = CollisionShape2D.new() # Create the object hierarchy. rigid.add_child(collision) node.add_child(rigid) # Change owner of `rigid`, but not of `collision`. rigid.owner = node var scene = PackedScene.new() # Only `node` and `rigid` are now packed. var result = scene.pack(node) if result == OK: var error = ResourceSaver.save("res://path/name.scn", scene) # Or "user://..." if error != OK: push_error("An error occurred while saving the scene to disk.") Instantiates the scene's node hierarchy, erroring on failure. Triggers child scene instantiation(s). Triggers a `Node.NotificationInstanced` notification on the root node. The type to cast to. Should be a descendant of Node. Instantiates the scene's node hierarchy, returning null on failure. Triggers child scene instantiation(s). Triggers a `Node.NotificationInstanced` notification on the root node. The type to cast to. Should be a descendant of Node. If passed to , blocks edits to the scene state. If passed to , provides local scene resources to the local scene. Note: Only available in editor builds. If passed to , provides local scene resources to the local scene. Only the main scene should receive the main edit state. Note: Only available in editor builds. A dictionary representation of the scene contents. Available keys include "rnames" and "variants" for resources, "node_count", "nodes", "node_paths" for nodes, "editable_instances" for base scene children overrides, "conn_count" and "conns" for signal connections, and "version" for the format style of the PackedScene. Pack will ignore any sub-nodes not owned by given node. See . Instantiates the scene's node hierarchy. Triggers child scene instantiation(s). Triggers a notification on the root node. Returns true if the scene file has nodes. Returns the SceneState representing the scene file contents. Singleton used to load resource files from the filesystem. It uses the many classes registered in the engine (either built-in or from a plugin) to load files into memory and convert them to a format that can be used by the engine. Starts loading a resource interactively. The returned object allows to load with high granularity, calling its method successively to load chunks. An optional type_hint can be used to further specify the type that should be handled by the . Anything that inherits from can be used as a type hint, for example . Loads a resource at the given path, caching the result for further access. The registered s are queried sequentially to find the first one which can handle the file's extension, and then attempt loading. If loading fails, the remaining ResourceFormatLoaders are also attempted. An optional type_hint can be used to further specify the type that should be handled by the . Anything that inherits from can be used as a type hint, for example . If no_cache is true, the resource cache will be bypassed and the resource will be loaded anew. Otherwise, the cached resource will be returned if it exists. Returns an empty resource if no could handle the file. GDScript has a simplified @GDScript.load built-in method which can be used in most situations, leaving the use of for more advanced scenarios. Returns the list of recognized extensions for a resource type. Changes the behavior on missing sub-resources. The default behavior is to abort loading. Returns the dependencies for the resource at the given path. Returns whether a cached resource is available for the given path. Once a resource has been loaded by the engine, it is cached in memory for faster access, and future calls to the or methods will use the cached version. The cached resource can be overridden by using on a new resource for that same path. Returns whether a recognized resource exists for the given path. An optional type_hint can be used to further specify the type that should be handled by the . Deprecated method. Use or instead. Fires when an unhandled exception occurs, regardless of project settings. Scancodes with this bit applied are non-printable. Returns if the generic type definition of is ; otherwise returns . is not a generic type. That is, IsGenericType returns false. Returns if the generic type definition of is ; otherwise returns . is not a generic type. That is, IsGenericType returns false. The circle constant, the circumference of the unit circle in radians. Constant that represents how many times the diameter of a circle fits around its perimeter. This is equivalent to `Mathf.Tau / 2`. Positive infinity. For negative infinity, use `-Mathf.Inf`. "Not a Number", an invalid value. `NaN` has special properties, including that it is not equal to itself. It is output by some invalid operations, such as dividing zero by zero. Returns the absolute value of `s` (i.e. positive value). The input number. The absolute value of `s`. Returns the absolute value of `s` (i.e. positive value). The input number. The absolute value of `s`. Returns the arc cosine of `s` in radians. Use to get the angle of cosine s. The input cosine value. Must be on the range of -1.0 to 1.0. An angle that would result in the given cosine value. On the range `0` to `Tau/2`. Returns the arc sine of `s` in radians. Use to get the angle of sine s. The input sine value. Must be on the range of -1.0 to 1.0. An angle that would result in the given sine value. On the range `-Tau/4` to `Tau/4`. Returns the arc tangent of `s` in radians. Use to get the angle of tangent s. The method cannot know in which quadrant the angle should fall. See if you have both `y` and `x`. The input tangent value. An angle that would result in the given tangent value. On the range `-Tau/4` to `Tau/4`. Returns the arc tangent of `y` and `x` in radians. Use to get the angle of the tangent of `y/x`. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant. Important note: The Y coordinate comes first, by convention. The Y coordinate of the point to find the angle to. The X coordinate of the point to find the angle to. An angle that would result in the given tangent value. On the range `-Tau/2` to `Tau/2`. Converts a 2D point expressed in the cartesian coordinate system (X and Y axis) to the polar coordinate system (a distance from the origin and an angle). The input X coordinate. The input Y coordinate. A with X representing the distance and Y representing the angle. Rounds `s` upward (towards positive infinity). The number to ceil. The smallest whole number that is not less than `s`. Clamps a `value` so that it is not less than `min` and not more than `max`. The value to clamp. The minimum allowed value. The maximum allowed value. The clamped value. Clamps a `value` so that it is not less than `min` and not more than `max`. The value to clamp. The minimum allowed value. The maximum allowed value. The clamped value. Returns the cosine of angle `s` in radians. The angle in radians. The cosine of that angle. Returns the hyperbolic cosine of angle `s` in radians. The angle in radians. The hyperbolic cosine of that angle. Converts an angle expressed in degrees to radians. An angle expressed in degrees. The same angle expressed in radians. Easing function, based on exponent. The curve values are: `0` is constant, `1` is linear, `0` to `1` is ease-in, `1` or more is ease-out. Negative values are in-out/out-in. The value to ease. `0` is constant, `1` is linear, `0` to `1` is ease-in, `1` or more is ease-out. The eased value. The natural exponential function. It raises the mathematical constant `e` to the power of `s` and returns it. The exponent to raise `e` to. `e` raised to the power of `s`. Rounds `s` downward (towards negative infinity). The number to floor. The largest whole number that is not more than `s`. Returns a normalized value considering the given range. This is the opposite of . The interpolated value. The destination value for interpolation. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The resulting value of the inverse interpolation. Returns true if `a` and `b` are approximately equal to each other. The comparison is done using a tolerance calculation with . One of the values. The other value. A bool for whether or not the two values are approximately equal. Returns whether `s` is an infinity value (either positive infinity or negative infinity). The value to check. A bool for whether or not the value is an infinity value. Returns whether `s` is a `NaN` ("Not a Number" or invalid) value. The value to check. A bool for whether or not the value is a `NaN` value. Returns true if `s` is approximately zero. The comparison is done using a tolerance calculation with . This method is faster than using with one value as zero. The value to check. A bool for whether or not the value is nearly zero. Linearly interpolates between two values by a normalized value. This is the opposite . The start value for interpolation. The destination value for interpolation. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The resulting value of the interpolation. Linearly interpolates between two angles (in radians) by a normalized value. Similar to , but interpolates correctly when the angles wrap around . The start angle for interpolation. The destination angle for interpolation. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The resulting angle of the interpolation. Natural logarithm. The amount of time needed to reach a certain level of continuous growth. Note: This is not the same as the "log" function on most calculators, which uses a base 10 logarithm. The input value. The natural log of `s`. Returns the maximum of two values. One of the values. The other value. Whichever of the two values is higher. Returns the maximum of two values. One of the values. The other value. Whichever of the two values is higher. Returns the minimum of two values. One of the values. The other value. Whichever of the two values is lower. Returns the minimum of two values. One of the values. The other value. Whichever of the two values is lower. Moves `from` toward `to` by the `delta` value. Use a negative delta value to move away. The start value. The value to move towards. The amount to move by. The value after moving. Returns the nearest larger power of 2 for the integer `value`. The input value. The nearest larger power of 2. Converts a 2D point expressed in the polar coordinate system (a distance from the origin `r` and an angle `th`) to the cartesian coordinate system (X and Y axis). The distance from the origin. The angle of the point. A representing the cartesian coordinate. Performs a canonical Modulus operation, where the output is on the range `[0, b)`. The dividend, the primary input. The divisor. The output is on the range `[0, b)`. The resulting output. Performs a canonical Modulus operation, where the output is on the range `[0, b)`. The dividend, the primary input. The divisor. The output is on the range `[0, b)`. The resulting output. Returns the result of `x` raised to the power of `y`. The base. The exponent. `x` raised to the power of `y`. Converts an angle expressed in radians to degrees. An angle expressed in radians. The same angle expressed in degrees. Rounds `s` to the nearest whole number, with halfway cases rounded towards the nearest multiple of two. The number to round. The rounded number. Returns the sign of `s`: `-1` or `1`. Returns `0` if `s` is `0`. The input number. One of three possible values: `1`, `-1`, or `0`. Returns the sign of `s`: `-1` or `1`. Returns `0` if `s` is `0`. The input number. One of three possible values: `1`, `-1`, or `0`. Returns the sine of angle `s` in radians. The angle in radians. The sine of that angle. Returns the hyperbolic sine of angle `s` in radians. The angle in radians. The hyperbolic sine of that angle. Returns a number smoothly interpolated between `from` and `to`, based on the `weight`. Similar to , but interpolates faster at the beginning and slower at the end. The start value for interpolation. The destination value for interpolation. A value representing the amount of interpolation. The resulting value of the interpolation. Returns the square root of `s`, where `s` is a non-negative number. If you need negative inputs, use `System.Numerics.Complex`. The input number. Must not be negative. The square root of `s`. Returns the position of the first non-zero digit, after the decimal point. Note that the maximum return value is 10, which is a design decision in the implementation. The input value. The position of the first non-zero digit. Snaps float value `s` to a given `step`. This can also be used to round a floating point number to an arbitrary number of decimals. The value to stepify. The step size to snap to. Returns the tangent of angle `s` in radians. The angle in radians. The tangent of that angle. Returns the hyperbolic tangent of angle `s` in radians. The angle in radians. The hyperbolic tangent of that angle. Wraps `value` between `min` and `max`. Usable for creating loop-alike behavior or infinite surfaces. If `min` is `0`, this is equivalent to , so prefer using that instead. The value to wrap. The minimum allowed value and lower bound of the range. The maximum allowed value and upper bound of the range. The wrapped value. Wraps `value` between `min` and `max`. Usable for creating loop-alike behavior or infinite surfaces. If `min` is `0`, this is equivalent to , so prefer using that instead. The value to wrap. The minimum allowed value and lower bound of the range. The maximum allowed value and upper bound of the range. The wrapped value. The natural number `e`. The square root of 2. A very small number used for float comparison with error tolerance. 1e-06 with single-precision floats, but 1e-14 if `REAL_T_IS_DOUBLE`. Returns the amount of digits after the decimal place. The input value. The amount of digits. Returns the amount of digits after the decimal place. The input value. The amount of digits. Rounds `s` upward (towards positive infinity). This is the same as , but returns an `int`. The number to ceil. The smallest whole number that is not less than `s`. Rounds `s` downward (towards negative infinity). This is the same as , but returns an `int`. The number to floor. The largest whole number that is not more than `s`. Returns true if `a` and `b` are approximately equal to each other. The comparison is done using the provided tolerance value. If you want the tolerance to be calculated for you, use . One of the values. The other value. The pre-calculated tolerance value. A bool for whether or not the two values are equal. Plane represents a normalized plane equation. "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing. The normal of the plane, which must be normalized. In the scalar equation of the plane `ax + by + cz = d`, this is the vector `(a, b, c)`, where `d` is the property. Equivalent to `x`, `y`, and `z`. The X component of the plane's normal vector. Equivalent to 's X value. The Y component of the plane's normal vector. Equivalent to 's Y value. The Z component of the plane's normal vector. Equivalent to 's Z value. The distance from the origin to the plane (in the direction of ). This value is typically non-negative. In the scalar equation of the plane `ax + by + cz = d`, this is `d`, while the `(a, b, c)` coordinates are represented by the property. The plane's distance from the origin. The center of the plane, the point where the normal line intersects the plane. Equivalent to multiplied by `D`. Returns the shortest distance from this plane to the position `point`. The position to use for the calculation. The shortest distance. The center of the plane, the point where the normal line intersects the plane. Deprecated, use the Center property instead. Equivalent to multiplied by `D`. Returns true if point is inside the plane. Comparison uses a custom minimum epsilon threshold. The point to check. The tolerance threshold. A bool for whether or not the plane has the point. Returns the intersection point of the three planes: `b`, `c`, and this plane. If no intersection is found, `null` is returned. One of the three planes to use in the calculation. One of the three planes to use in the calculation. The intersection, or `null` if none is found. Returns the intersection point of a ray consisting of the position `from` and the direction normal `dir` with this plane. If no intersection is found, `null` is returned. The start of the ray. The direction of the ray, normalized. The intersection, or `null` if none is found. Returns the intersection point of a line segment from position `begin` to position `end` with this plane. If no intersection is found, `null` is returned. The start of the line segment. The end of the line segment. The intersection, or `null` if none is found. Returns true if `point` is located above the plane. The point to check. A bool for whether or not the point is above the plane. Returns the plane scaled to unit length. A normalized version of the plane. Returns the orthogonal projection of `point` into the plane. The point to project. The projected point. A plane that extends in the Y and Z axes (normal vector points +X). Equivalent to `new Plane(1, 0, 0, 0)`. A plane that extends in the X and Z axes (normal vector points +Y). Equivalent to `new Plane(0, 1, 0, 0)`. A plane that extends in the X and Y axes (normal vector points +Z). Equivalent to `new Plane(0, 0, 1, 0)`. Constructs a plane from four values. `a`, `b` and `c` become the components of the resulting plane's vector. `d` becomes the plane's distance from the origin. The X component of the plane's normal vector. The Y component of the plane's normal vector. The Z component of the plane's normal vector. The plane's distance from the origin. This value is typically non-negative. Constructs a plane from a normal vector and the plane's distance to the origin. The normal of the plane, must be normalized. The plane's distance from the origin. This value is typically non-negative. Constructs a plane from the three points, given in clockwise order. The first point. The second point. The third point. Returns true if this plane and `other` are approximately equal, by running on each component. The other plane to compare. Whether or not the planes are approximately equal. A unit quaternion used for representing 3D rotations. Quaternions need to be normalized to be used for rotation. It is similar to Basis, which implements matrix representation of rotations, and can be parametrized using both an axis-angle pair or Euler angles. Basis stores rotation, scale, and shearing, while Quat only stores rotation. Due to its compactness and the way it is stored in memory, certain operations (obtaining axis-angle and performing SLERP, in particular) are more efficient and robust against floating-point errors. X component of the quaternion (imaginary `i` axis part). Quaternion components should usually not be manipulated directly. Y component of the quaternion (imaginary `j` axis part). Quaternion components should usually not be manipulated directly. Z component of the quaternion (imaginary `k` axis part). Quaternion components should usually not be manipulated directly. W component of the quaternion (real part). Quaternion components should usually not be manipulated directly. Access quaternion components using their index. `[0]` is equivalent to `.x`, `[1]` is equivalent to `.y`, `[2]` is equivalent to `.z`, `[3]` is equivalent to `.w`. Returns the length (magnitude) of the quaternion. Equivalent to `Mathf.Sqrt(LengthSquared)`. Returns the squared length (squared magnitude) of the quaternion. This method runs faster than , so prefer it if you need to compare quaternions or need the squared length for some formula. Equivalent to `Dot(this)`. Performs a cubic spherical interpolation between quaternions `preA`, this vector, `b`, and `postB`, by the given amount `t`. The destination quaternion. A quaternion before this quaternion. A quaternion after `b`. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The interpolated quaternion. Returns the dot product of two quaternions. The other quaternion. The dot product. Returns Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last) corresponding to the rotation represented by the unit quaternion. Returned vector contains the rotation angles in the format (X angle, Y angle, Z angle). The Euler angle representation of this quaternion. Returns the inverse of the quaternion. The inverse quaternion. Returns whether the quaternion is normalized or not. A bool for whether the quaternion is normalized or not. Returns a copy of the quaternion, normalized to unit length. The normalized quaternion. Returns the result of the spherical linear interpolation between this quaternion and `to` by amount `weight`. Note: Both quaternions must be normalized. The destination quaternion for interpolation. Must be normalized. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The resulting quaternion of the interpolation. Returns the result of the spherical linear interpolation between this quaternion and `to` by amount `weight`, but without checking if the rotation path is not bigger than 90 degrees. The destination quaternion for interpolation. Must be normalized. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The resulting quaternion of the interpolation. Returns a vector transformed (multiplied) by this quaternion. A vector to transform. The transformed vector. The identity quaternion, representing no rotation. Equivalent to an identity matrix. If a vector is transformed by an identity quaternion, it will not change. Equivalent to `new Quat(0, 0, 0, 1)`. Constructs a quaternion defined by the given values. X component of the quaternion (imaginary `i` axis part). Y component of the quaternion (imaginary `j` axis part). Z component of the quaternion (imaginary `k` axis part). W component of the quaternion (real part). Constructs a quaternion from the given quaternion. The existing quaternion. Constructs a quaternion from the given . The basis to construct from. Constructs a quaternion that will perform a rotation specified by Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle). Constructs a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector. The axis to rotate around. Must be normalized. The angle to rotate, in radians. Returns true if this quaternion and `other` are approximately equal, by running on each component. The other quaternion to compare. Whether or not the quaternions are approximately equal. 2D axis-aligned bounding box. Rect2 consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. Beginning corner. Typically has values lower than End. Directly uses a private field. Size from Position to End. Typically all components are positive. If the size is negative, you can use to fix it. Directly uses a private field. Ending corner. This is calculated as plus . Setting this value will change the size. Getting is equivalent to `value = Position + Size`, setting is equivalent to `Size = value - Position`. The area of this rect. Equivalent to . Returns a Rect2 with equivalent position and size, modified so that the top-left corner is the origin and width and height are positive. The modified rect. Returns the intersection of this Rect2 and `b`. The other rect. The clipped rect. Returns true if this Rect2 completely encloses another one. The other rect that may be enclosed. A bool for whether or not this rect encloses `b`. Returns this Rect2 expanded to include a given point. The point to include. The expanded rect. Returns the area of the Rect2. The area. Returns a copy of the Rect2 grown a given amount of units towards all the sides. The amount to grow by. The grown rect. Returns a copy of the Rect2 grown a given amount of units towards each direction individually. The amount to grow by on the left. The amount to grow by on the top. The amount to grow by on the right. The amount to grow by on the bottom. The grown rect. Returns a copy of the Rect2 grown a given amount of units towards the direction. The direction to grow in. The amount to grow by. The grown rect. Returns true if the Rect2 is flat or empty, or false otherwise. A bool for whether or not the rect has area. Returns true if the Rect2 contains a point, or false otherwise. The point to check. A bool for whether or not the rect contains `point`. Returns true if the Rect2 overlaps with `b` (i.e. they have at least one point in common). If `includeBorders` is true, they will also be considered overlapping if their borders touch, even without intersection. The other rect to check for intersections with. Whether or not to consider borders. A bool for whether or not they are intersecting. Returns a larger Rect2 that contains this Rect2 and `b`. The other rect. The merged rect. Constructs a Rect2 from a position and size. The position. The size. Constructs a Rect2 from a position, width, and height. The position. The width. The height. Constructs a Rect2 from x, y, and size. The position's X coordinate. The position's Y coordinate. The size. Constructs a Rect2 from x, y, width, and height. The position's X coordinate. The position's Y coordinate. The width. The height. Returns true if this rect and `other` are approximately equal, by running on each component. The other rect to compare. Whether or not the rects are approximately equal. Converts a string containing a binary number into an integer. Binary strings can either be prefixed with `0b` or not, and they can also start with a `-` before the optional prefix. The string to convert. The converted string. Find the first occurrence of a substring. Optionally, the search starting position can be passed. The starting position of the substring, or -1 if not found. Find the first occurrence of a char. Optionally, the search starting position can be passed. The first instance of the char, or -1 if not found. Find the last occurrence of a substring. The starting position of the substring, or -1 if not found. Find the last occurrence of a substring specifying the search starting position. The starting position of the substring, or -1 if not found. Find the first occurrence of a substring but search as case-insensitive. Optionally, the search starting position can be passed. The starting position of the substring, or -1 if not found. Converts the given byte array of ASCII encoded text to a string. Faster alternative to if the content is ASCII-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 . A byte array of ASCII characters (on the range of 0-127). A string created from the bytes. Converts the given byte array of UTF-8 encoded text to a string. Slower than 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. A byte array of UTF-8 characters (a character may take up multiple bytes). A string created from the bytes. Returns a hexadecimal representation of this byte as a string. The byte to encode. The hexadecimal representation of this byte. Returns a hexadecimal representation of this byte array as a string. The byte array to encode. The hexadecimal representation of this byte array. Converts a string containing a hexadecimal number into an integer. Hexadecimal strings can either be prefixed with `0x` or not, and they can also start with a `-` before the optional prefix. The string to convert. The converted string. Return the length of the string in characters. Returns a copy of the string with characters removed from the left. The string to remove characters from. The characters to be removed. A copy of the string with characters removed from the left. Do a simple expression match, where '*' matches zero or more arbitrary characters and '?' matches any single character except '.'. Do a simple case sensitive expression match, using ? and * wildcards (see [method expr_match]). Do a simple case insensitive expression match, using ? and * wildcards (see [method expr_match]). Returns a copy of the string with characters removed from the right. The string to remove characters from. The characters to be removed. A copy of the string with characters removed from the right. 3×4 matrix (3 rows, 4 columns) used for 3D linear transformations. It can represent transformations such as translation, rotation, or scaling. It consists of a (first 3 columns) and a for the origin (last column). For more information, read this documentation article: https://docs.godotengine.org/en/3.3/tutorials/math/matrices_and_transforms.html The of this transform. Contains the X, Y, and Z basis vectors (columns 0 to 2) and is responsible for rotation and scale. The origin vector (column 3, the fourth column). Equivalent to array index `[3]`. Access whole columns in the form of Vector3. The fourth column is the origin vector. Which column vector. Access matrix elements in column-major order. The fourth column is the origin vector. Which column, the matrix horizontal position. Which row, the matrix vertical position. Returns the inverse of the transform, under the assumption that the transformation is composed of rotation, scaling, and translation. The inverse transformation matrix. Interpolates this transform to the other `transform` by `weight`. The other transform. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The interpolated transform. Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use for transforms with scaling). The inverse matrix. Returns a copy of the transform rotated such that its -Z axis (forward) points towards the target position. The transform will first be rotated around the given up vector, and then fully aligned to the target by a further rotation around an axis perpendicular to both the target and up vectors. Operations take place in global space. The object to look at. The relative up direction The resulting transform. Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors (scale of 1 or -1). The orthonormalized transform. Rotates the transform around the given `axis` by `phi` (in radians), using matrix multiplication. The axis must be a normalized vector. The axis to rotate around. Must be normalized. The angle to rotate, in radians. The rotated transformation matrix. Scales the transform by the given 3D scaling factor, using matrix multiplication. The scale to introduce. The scaled transformation matrix. Translates the transform by the given `offset`, relative to the transform's basis vectors. Unlike and , this does not use matrix multiplication. The offset to translate by. The translated matrix. Returns a vector transformed (multiplied) by this transformation matrix. A vector to transform. The transformed vector. Returns a vector transformed (multiplied) by the transposed transformation matrix. Note: This results in a multiplication by the inverse of the transformation matrix only if it represents a rotation-reflection. A vector to inversely transform. The inversely transformed vector. The identity transform, with no translation, rotation, or scaling applied. This is used as a replacement for `Transform()` in GDScript. Do not use `new Transform()` with no arguments in C#, because it sets all values to zero. Equivalent to `new Transform(Vector3.Right, Vector3.Up, Vector3.Back, Vector3.Zero)`. The transform that will flip something along the X axis. Equivalent to `new Transform(Vector3.Left, Vector3.Up, Vector3.Back, Vector3.Zero)`. The transform that will flip something along the Y axis. Equivalent to `new Transform(Vector3.Right, Vector3.Down, Vector3.Back, Vector3.Zero)`. The transform that will flip something along the Z axis. Equivalent to `new Transform(Vector3.Right, Vector3.Up, Vector3.Forward, Vector3.Zero)`. Constructs a transformation matrix from 4 vectors (matrix columns). The X vector, or column index 0. The Y vector, or column index 1. The Z vector, or column index 2. The origin vector, or column index 3. Constructs a transformation matrix from the given quaternion and origin vector. The to create the basis from. The origin vector, or column index 3. Constructs a transformation matrix from the given basis and origin vector. The to create the basis from. The origin vector, or column index 3. Returns true if this transform and `other` are approximately equal, by running on each component. The other transform to compare. Whether or not the matrices are approximately equal. 2×3 matrix (2 rows, 3 columns) used for 2D linear transformations. It can represent transformations such as translation, rotation, or scaling. It consists of a three values: x, y, and the origin. For more information, read this documentation article: https://docs.godotengine.org/en/3.3/tutorials/math/matrices_and_transforms.html The basis matrix's X vector (column 0). Equivalent to array index `[0]`. The basis matrix's Y vector (column 1). Equivalent to array index `[1]`. The origin vector (column 2, the third column). Equivalent to array index `[2]`. The origin vector represents translation. The rotation of this transformation matrix. Getting is equivalent to calling with the values of . The scale of this transformation matrix. Equivalent to the lengths of each column vector, but Y is negative if the determinant is negative. Access whole columns in the form of Vector2. The third column is the origin vector. Which column vector. Access matrix elements in column-major order. The third column is the origin vector. Which column, the matrix horizontal position. Which row, the matrix vertical position. Returns the inverse of the transform, under the assumption that the transformation is composed of rotation, scaling, and translation. The inverse transformation matrix. Returns the determinant of the basis matrix. If the basis is uniformly scaled, its determinant is the square of the scale. A negative determinant means the Y scale is negative. A zero determinant means the basis isn't invertible, and is usually considered invalid. The determinant of the basis matrix. Returns a vector transformed (multiplied) by the basis matrix. This method does not account for translation (the origin vector). A vector to transform. The transformed vector. Returns a vector transformed (multiplied) by the inverse basis matrix. This method does not account for translation (the origin vector). Note: This results in a multiplication by the inverse of the basis matrix only if it represents a rotation-reflection. A vector to inversely transform. The inversely transformed vector. Interpolates this transform to the other `transform` by `weight`. The other transform. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The interpolated transform. Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use for transforms with scaling). The inverse matrix. Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors (scale of 1 or -1). The orthonormalized transform. Rotates the transform by `phi` (in radians), using matrix multiplication. The angle to rotate, in radians. The rotated transformation matrix. Scales the transform by the given scaling factor, using matrix multiplication. The scale to introduce. The scaled transformation matrix. Translates the transform by the given `offset`, relative to the transform's basis vectors. Unlike and , this does not use matrix multiplication. The offset to translate by. The translated matrix. Returns a vector transformed (multiplied) by this transformation matrix. A vector to transform. The transformed vector. Returns a vector transformed (multiplied) by the inverse transformation matrix. A vector to inversely transform. The inversely transformed vector. The identity transform, with no translation, rotation, or scaling applied. This is used as a replacement for `Transform2D()` in GDScript. Do not use `new Transform2D()` with no arguments in C#, because it sets all values to zero. Equivalent to `new Transform2D(Vector2.Right, Vector2.Down, Vector2.Zero)`. The transform that will flip something along the X axis. Equivalent to `new Transform2D(Vector2.Left, Vector2.Down, Vector2.Zero)`. The transform that will flip something along the Y axis. Equivalent to `new Transform2D(Vector2.Right, Vector2.Up, Vector2.Zero)`. Constructs a transformation matrix from 3 vectors (matrix columns). The X vector, or column index 0. The Y vector, or column index 1. The origin vector, or column index 2. Constructs a transformation matrix from the given components. Arguments are named such that xy is equal to calling x.y The X component of the X column vector, accessed via `t.x.x` or `[0][0]` The Y component of the X column vector, accessed via `t.x.y` or `[0][1]` The X component of the Y column vector, accessed via `t.y.x` or `[1][0]` The Y component of the Y column vector, accessed via `t.y.y` or `[1][1]` The X component of the origin vector, accessed via `t.origin.x` or `[2][0]` The Y component of the origin vector, accessed via `t.origin.y` or `[2][1]` Constructs a transformation matrix from a rotation value and origin vector. The rotation of the new transform, in radians. The origin vector, or column index 2. Returns true if this transform and `other` are approximately equal, by running on each component. The other transform to compare. Whether or not the matrices are approximately equal. Event arguments for when unhandled exceptions occur. Exception object 2-element structure that can be used to represent positions in 2D space or any other pair of numeric values. Enumerated index values for the axes. Returned by and . The vector's X component. Also accessible by using the index position `[0]`. The vector's Y component. Also accessible by using the index position `[1]`. Access vector components using their index. `[0]` is equivalent to `.x`, `[1]` is equivalent to `.y`. Returns a new vector with all components in absolute values (i.e. positive). A vector with called on each component. Returns this vector's angle with respect to the X axis, or (1, 0) vector, in radians. Equivalent to the result of when called with the vector's `y` and `x` as parameters: `Mathf.Atan2(v.y, v.x)`. The angle of this vector, in radians. Returns the angle to the given vector, in radians. The other vector to compare this vector to. The angle between the two vectors, in radians. Returns the angle between the line connecting the two points and the X axis, in radians. The other vector to compare this vector to. The angle between the two vectors, in radians. Returns the aspect ratio of this vector, the ratio of `x` to `y`. The `x` component divided by the `y` component. Returns the vector "bounced off" from a plane defined by the given normal. The normal vector defining the plane to bounce off. Must be normalized. The bounced vector. Returns a new vector with all components rounded up (towards positive infinity). A vector with called on each component. Returns the vector with a maximum length by limiting its length to `length`. The length to limit to. The vector with its length limited. Returns the cross product of this vector and `b`. The other vector. The cross product value. Performs a cubic interpolation between vectors `preA`, this vector, `b`, and `postB`, by the given amount `t`. The destination vector. A vector before this vector. A vector after `b`. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The interpolated vector. Returns the normalized vector pointing from this vector to `b`. The other vector to point towards. The direction from this vector to `b`. Returns the squared distance between this vector and `to`. This method runs faster than , so prefer it if you need to compare vectors or need the squared distance for some formula. The other vector to use. The squared distance between the two vectors. Returns the distance between this vector and `to`. The other vector to use. The distance between the two vectors. Returns the dot product of this vector and `with`. The other vector to use. The dot product of the two vectors. Returns a new vector with all components rounded down (towards negative infinity). A vector with called on each component. Returns the inverse of this vector. This is the same as `new Vector2(1 / v.x, 1 / v.y)`. The inverse of this vector. Returns true if the vector is normalized, and false otherwise. A bool indicating whether or not the vector is normalized. Returns the length (magnitude) of this vector. The length of this vector. Returns the squared length (squared magnitude) of this vector. This method runs faster than , so prefer it if you need to compare vectors or need the squared length for some formula. The squared length of this vector. Returns the result of the linear interpolation between this vector and `to` by amount `weight`. The destination vector for interpolation. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The resulting vector of the interpolation. Returns the result of the linear interpolation between this vector and `to` by the vector amount `weight`. The destination vector for interpolation. A vector with components on the range of 0.0 to 1.0, representing the amount of interpolation. The resulting vector of the interpolation. Returns the axis of the vector's largest value. See . If both components are equal, this method returns . The index of the largest axis. Returns the axis of the vector's smallest value. See . If both components are equal, this method returns . The index of the smallest axis. Moves this vector toward `to` by the fixed `delta` amount. The vector to move towards. The amount to move towards by. The resulting vector. Returns the vector scaled to unit length. Equivalent to `v / v.Length()`. A normalized version of the vector. Returns a perpendicular vector rotated 90 degrees counter-clockwise compared to the original, with the same length. The perpendicular vector. Returns a vector composed of the of this vector's components and `mod`. A value representing the divisor of the operation. A vector with each component by `mod`. Returns a vector composed of the of this vector's components and `modv`'s components. A vector representing the divisors of the operation. A vector with each component by `modv`'s components. Returns this vector projected onto another vector. The vector to project onto. The projected vector. Returns this vector reflected from a plane defined by the given `normal`. The normal vector defining the plane to reflect from. Must be normalized. The reflected vector. Rotates this vector by `phi` radians. The angle to rotate by, in radians. The rotated vector. Returns this vector with all components rounded to the nearest integer, with halfway cases rounded towards the nearest multiple of two. The rounded vector. Returns a vector with each component set to one or negative one, depending on the signs of this vector's components, or zero if the component is zero, by calling on each component. A vector with all components as either `1`, `-1`, or `0`. Returns the result of the spherical linear interpolation between this vector and `to` by amount `weight`. Note: Both vectors must be normalized. The destination vector for interpolation. Must be normalized. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The resulting vector of the interpolation. Returns this vector slid along a plane defined by the given normal. The normal vector defining the plane to slide on. The slid vector. Returns this vector with each component snapped to the nearest multiple of `step`. This can also be used to round to an arbitrary number of decimals. A vector value representing the step size to snap to. The snapped vector. Returns a perpendicular vector rotated 90 degrees counter-clockwise compared to the original, with the same length. Deprecated, will be replaced by in 4.0. The perpendicular vector. Zero vector, a vector with all components set to `0`. Equivalent to `new Vector2(0, 0)` Deprecated, please use a negative sign with instead. Equivalent to `new Vector2(-1, -1)` One vector, a vector with all components set to `1`. Equivalent to `new Vector2(1, 1)` Infinity vector, a vector with all components set to `Mathf.Inf`. Equivalent to `new Vector2(Mathf.Inf, Mathf.Inf)` Up unit vector. Y is down in 2D, so this vector points -Y. Equivalent to `new Vector2(0, -1)` Down unit vector. Y is down in 2D, so this vector points +Y. Equivalent to `new Vector2(0, 1)` Right unit vector. Represents the direction of right. Equivalent to `new Vector2(1, 0)` Left unit vector. Represents the direction of left. Equivalent to `new Vector2(-1, 0)` Constructs a new with the given components. The vector's X component. The vector's Y component. Constructs a new from an existing . The existing . Returns true if this vector and `other` are approximately equal, by running on each component. The other vector to compare. Whether or not the vectors are approximately equal. 3-element structure that can be used to represent positions in 3D space or any other pair of numeric values. Enumerated index values for the axes. Returned by and . The vector's X component. Also accessible by using the index position `[0]`. The vector's Y component. Also accessible by using the index position `[1]`. The vector's Z component. Also accessible by using the index position `[2]`. Access vector components using their index. `[0]` is equivalent to `.x`, `[1]` is equivalent to `.y`, `[2]` is equivalent to `.z`. Returns a new vector with all components in absolute values (i.e. positive). A vector with called on each component. Returns the minimum angle to the given vector, in radians. The other vector to compare this vector to. The angle between the two vectors, in radians. Returns this vector "bounced off" from a plane defined by the given normal. The normal vector defining the plane to bounce off. Must be normalized. The bounced vector. Returns a new vector with all components rounded up (towards positive infinity). A vector with called on each component. Returns the cross product of this vector and `b`. The other vector. The cross product vector. Performs a cubic interpolation between vectors `preA`, this vector, `b`, and `postB`, by the given amount `t`. The destination vector. A vector before this vector. A vector after `b`. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The interpolated vector. Returns the normalized vector pointing from this vector to `b`. The other vector to point towards. The direction from this vector to `b`. Returns the squared distance between this vector and `b`. This method runs faster than , so prefer it if you need to compare vectors or need the squared distance for some formula. The other vector to use. The squared distance between the two vectors. Returns the distance between this vector and `b`. The other vector to use. The distance between the two vectors. Returns the dot product of this vector and `b`. The other vector to use. The dot product of the two vectors. Returns a new vector with all components rounded down (towards negative infinity). A vector with called on each component. Returns the inverse of this vector. This is the same as `new Vector3(1 / v.x, 1 / v.y, 1 / v.z)`. The inverse of this vector. Returns true if the vector is normalized, and false otherwise. A bool indicating whether or not the vector is normalized. Returns the length (magnitude) of this vector. The length of this vector. Returns the squared length (squared magnitude) of this vector. This method runs faster than , so prefer it if you need to compare vectors or need the squared length for some formula. The squared length of this vector. Returns the result of the linear interpolation between this vector and `to` by amount `weight`. The destination vector for interpolation. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The resulting vector of the interpolation. Returns the result of the linear interpolation between this vector and `to` by the vector amount `weight`. The destination vector for interpolation. A vector with components on the range of 0.0 to 1.0, representing the amount of interpolation. The resulting vector of the interpolation. Returns the axis of the vector's largest value. See . If all components are equal, this method returns . The index of the largest axis. Returns the axis of the vector's smallest value. See . If all components are equal, this method returns . The index of the smallest axis. Moves this vector toward `to` by the fixed `delta` amount. The vector to move towards. The amount to move towards by. The resulting vector. Returns the vector scaled to unit length. Equivalent to `v / v.Length()`. A normalized version of the vector. Returns the outer product with `b`. The other vector. A representing the outer product matrix. Returns a vector composed of the of this vector's components and `mod`. A value representing the divisor of the operation. A vector with each component by `mod`. Returns a vector composed of the of this vector's components and `modv`'s components. A vector representing the divisors of the operation. A vector with each component by `modv`'s components. Returns this vector projected onto another vector `b`. The vector to project onto. The projected vector. Returns this vector reflected from a plane defined by the given `normal`. The normal vector defining the plane to reflect from. Must be normalized. The reflected vector. Rotates this vector around a given `axis` vector by `phi` radians. The `axis` vector must be a normalized vector. The vector to rotate around. Must be normalized. The angle to rotate by, in radians. The rotated vector. Returns this vector with all components rounded to the nearest integer, with halfway cases rounded towards the nearest multiple of two. The rounded vector. Returns a vector with each component set to one or negative one, depending on the signs of this vector's components, or zero if the component is zero, by calling on each component. A vector with all components as either `1`, `-1`, or `0`. Returns the result of the spherical linear interpolation between this vector and `to` by amount `weight`. Note: Both vectors must be normalized. The destination vector for interpolation. Must be normalized. A value on the range of 0.0 to 1.0, representing the amount of interpolation. The resulting vector of the interpolation. Returns this vector slid along a plane defined by the given normal. The normal vector defining the plane to slide on. The slid vector. Returns this vector with each component snapped to the nearest multiple of `step`. This can also be used to round to an arbitrary number of decimals. A vector value representing the step size to snap to. The snapped vector. Returns a diagonal matrix with the vector as main diagonal. This is equivalent to a Basis with no rotation or shearing and this vector's components set as the scale. A Basis with the vector as its main diagonal. Zero vector, a vector with all components set to `0`. Equivalent to `new Vector3(0, 0, 0)` One vector, a vector with all components set to `1`. Equivalent to `new Vector3(1, 1, 1)` Deprecated, please use a negative sign with instead. Equivalent to `new Vector3(-1, -1, -1)` Infinity vector, a vector with all components set to `Mathf.Inf`. Equivalent to `new Vector3(Mathf.Inf, Mathf.Inf, Mathf.Inf)` Up unit vector. Equivalent to `new Vector3(0, 1, 0)` Down unit vector. Equivalent to `new Vector3(0, -1, 0)` Right unit vector. Represents the local direction of right, and the global direction of east. Equivalent to `new Vector3(1, 0, 0)` Left unit vector. Represents the local direction of left, and the global direction of west. Equivalent to `new Vector3(-1, 0, 0)` Forward unit vector. Represents the local direction of forward, and the global direction of north. Equivalent to `new Vector3(0, 0, -1)` Back unit vector. Represents the local direction of back, and the global direction of south. Equivalent to `new Vector3(0, 0, 1)` Constructs a new with the given components. The vector's X component. The vector's Y component. The vector's Z component. Constructs a new from an existing . The existing . Returns true if this vector and `other` are approximately equal, by running on each component. The other vector to compare. Whether or not the vectors are approximately equal. Left margin, usually used for or -derived classes. Top margin, usually used for or -derived classes. Right margin, usually used for or -derived classes. Bottom margin, usually used for or -derived classes. Top-left corner. Top-right corner. Bottom-right corner. Bottom-left corner. General vertical alignment, usually used for , , , etc. General horizontal alignment, usually used for , , , etc. Horizontal left alignment, usually for text-derived classes. Horizontal center alignment, usually for text-derived classes. Horizontal right alignment, usually for text-derived classes. Vertical top alignment, usually for text-derived classes. Vertical center alignment, usually for text-derived classes. Vertical bottom alignment, usually for text-derived classes. Escape key. Tab key. Shift+Tab key. Backspace key. Return key (on the main keyboard). Enter key on the numeric keypad. Insert key. Delete key. Pause key. Print Screen key. System Request key. Clear key. Home key. End key. Left arrow key. Up arrow key. Right arrow key. Down arrow key. Page Up key. Page Down key. Shift key. Control key. Meta key. Alt key. Caps Lock key. Num Lock key. Scroll Lock key. F1 key. F2 key. F3 key. F4 key. F5 key. F6 key. F7 key. F8 key. F9 key. F10 key. F11 key. F12 key. F13 key. F14 key. F15 key. F16 key. Multiply (*) key on the numeric keypad. Divide (/) key on the numeric keypad. Subtract (-) key on the numeric keypad. Period (.) key on the numeric keypad. Add (+) key on the numeric keypad. Number 0 on the numeric keypad. Number 1 on the numeric keypad. Number 2 on the numeric keypad. Number 3 on the numeric keypad. Number 4 on the numeric keypad. Number 5 on the numeric keypad. Number 6 on the numeric keypad. Number 7 on the numeric keypad. Number 8 on the numeric keypad. Number 9 on the numeric keypad. Left Super key (Windows key). Right Super key (Windows key). Context menu key. Left Hyper key. Right Hyper key. Help key. Left Direction key. Right Direction key. Media back key. Not to be confused with the Back button on an Android device. Media forward key. Media stop key. Media refresh key. Volume down key. Mute volume key. Volume up key. Bass Boost key. Bass up key. Bass down key. Treble up key. Treble down key. Media play key. Media stop key. Previous song key. Next song key. Media record key. Home page key. Favorites key. Search key. Standby key. Open URL / Launch Browser key. Launch Mail key. Launch Media key. Launch Shortcut 0 key. Launch Shortcut 1 key. Launch Shortcut 2 key. Launch Shortcut 3 key. Launch Shortcut 4 key. Launch Shortcut 5 key. Launch Shortcut 6 key. Launch Shortcut 7 key. Launch Shortcut 8 key. Launch Shortcut 9 key. Launch Shortcut A key. Launch Shortcut B key. Launch Shortcut C key. Launch Shortcut D key. Launch Shortcut E key. Launch Shortcut F key. Unknown key. Space key. ! key. " key. # key. $ key. % key. & key. ' key. ( key. ) key. * key. + key. , key. - key. . key. / key. Number 0. Number 1. Number 2. Number 3. Number 4. Number 5. Number 6. Number 7. Number 8. Number 9. : key. ; key. < key. = key. > key. ? key. @ key. A key. B key. C key. D key. E key. F key. G key. H key. I key. J key. K key. L key. M key. N key. O key. P key. Q key. R key. S key. T key. U key. V key. W key. X key. Y key. Z key. [ key. \ key. ] key. ^ key. _ key. ` key. { key. | key. } key. ~ key. Non-breakable space key. ¡ key. ¢ key. £ key. ¤ key. ¥ key. ¦ key. § key. ¨ key. © key. ª key. « key. ¬ key. Soft hyphen key. ® key. ¯ key. ° key. ± key. ² key. ³ key. ´ key. µ key. ¶ key. · key. ¸ key. ¹ key. º key. » key. ¼ key. ½ key. ¾ key. ¿ key. À key. Á key. Â key. Ã key. Ä key. Å key. Æ key. Ç key. È key. É key. Ê key. Ë key. Ì key. Í key. Î key. Ï key. Ð key. Ñ key. Ò key. Ó key. Ô key. Õ key. Ö key. × key. Ø key. Ù key. Ú key. Û key. Ü key. Ý key. Þ key. ß key. ÷ key. ÿ key. Key Code mask. Modifier key mask. Shift key mask. Alt key mask. Meta key mask. Ctrl key mask. Command key mask. On macOS, this is equivalent to . On other platforms, this is equivalent to . This mask should be preferred to or for system shortcuts as it handles all platforms correctly. Keypad key mask. Group Switch key mask. Left mouse button. Right mouse button. Middle mouse button. Extra mouse button 1 (only present on some mice). Extra mouse button 2 (only present on some mice). Mouse wheel up. Mouse wheel down. Mouse wheel left button (only present on some mice). Mouse wheel right button (only present on some mice). Left mouse button mask. Right mouse button mask. Middle mouse button mask. Extra mouse button 1 mask. Extra mouse button 2 mask. Invalid button or axis. Gamepad button 0. Gamepad button 1. Gamepad button 2. Gamepad button 3. Gamepad button 4. Gamepad button 5. Gamepad button 6. Gamepad button 7. Gamepad button 8. Gamepad button 9. Gamepad button 10. Gamepad button 11. Gamepad button 12. Gamepad button 13. Gamepad button 14. Gamepad button 15. Gamepad button 16. Gamepad button 17. Gamepad button 18. Gamepad button 19. Gamepad button 20. Gamepad button 21. Represents the maximum number of joystick buttons supported. DualShock circle button. DualShock X button. DualShock square button. DualShock triangle button. Xbox controller B button. Xbox controller A button. Xbox controller X button. Xbox controller Y button. Nintendo controller A button. Nintendo controller B button. Nintendo controller X button. Nintendo controller Y button. Grip (side) buttons on a VR controller. Push down on the touchpad or main joystick on a VR controller. Trigger on a VR controller. A button on the right Oculus Touch controller, X button on the left controller (also when used in OpenVR). B button on the right Oculus Touch controller, Y button on the left controller (also when used in OpenVR). Menu button on either Oculus Touch controller. Menu button in OpenVR (Except when Oculus Touch controllers are used). Gamepad button Select. Gamepad button Start. Gamepad DPad up. Gamepad DPad down. Gamepad DPad left. Gamepad DPad right. Gamepad SDL miscellaneous button. Gamepad SDL paddle 1 button. Gamepad SDL paddle 2 button. Gamepad SDL paddle 3 button. Gamepad SDL paddle 4 button. Gamepad SDL touchpad button. Gamepad left Shoulder button. Gamepad left trigger. Gamepad left stick click. Gamepad right Shoulder button. Gamepad right trigger. Gamepad right stick click. Gamepad left stick horizontal axis. Gamepad left stick vertical axis. Gamepad right stick horizontal axis. Gamepad right stick vertical axis. Generic gamepad axis 4. Generic gamepad axis 5. Gamepad left trigger analog axis. Gamepad right trigger analog axis. Generic gamepad axis 8. Generic gamepad axis 9. Represents the maximum number of joystick axes supported. Gamepad left stick horizontal axis. Gamepad left stick vertical axis. Gamepad right stick horizontal axis. Gamepad right stick vertical axis. Gamepad left analog trigger. Gamepad right analog trigger. VR Controller analog trigger. VR Controller analog grip (side buttons). OpenVR touchpad X axis (Joystick axis on Oculus Touch and Windows MR controllers). OpenVR touchpad Y axis (Joystick axis on Oculus Touch and Windows MR controllers). MIDI note OFF message. MIDI note ON message. MIDI aftertouch message. MIDI control change message. MIDI program change message. MIDI channel pressure message. MIDI pitch bend message. Methods that return return when no error occurred. Note that many functions don't return an error code but will print error messages to standard output. Since has value 0, and all other failure codes are positive integers, it can also be used in boolean checks, e.g.: var err = method_that_returns_error() if err != OK: print("Failure!") # Or, equivalent: if err: print("Still failing!") Generic error. Unavailable error. Unconfigured error. Unauthorized error. Parameter range error. Out of memory (OOM) error. File: Not found error. File: Bad drive error. File: Bad path error. File: No permission error. File: Already in use error. File: Can't open error. File: Can't write error. File: Can't read error. File: Unrecognized error. File: Corrupt error. File: Missing dependencies error. File: End of file (EOF) error. Can't open error. Can't create error. Query failed error. Already in use error. Locked error. Timeout error. Can't connect error. Can't resolve error. Connection error. Can't acquire resource error. Can't fork process error. Invalid data error. Invalid parameter error. Already exists error. Does not exist error. Database: Read error. Database: Write error. Compilation failed error. Method not found error. Linking failed error. Script failed error. Cycling link (import cycle) error. Invalid declaration error. Duplicate symbol error. Parse error. Busy error. Skip error. Help error. Bug error. Printer on fire error. (This is an easter egg, no engine methods return this error code.) No hint for the edited property. Hints that an integer or float property should be within a range specified via the hint string "min,max" or "min,max,step". The hint string can optionally include "or_greater" and/or "or_lesser" to allow manual input going respectively above the max or below the min values. Example: "-360,360,1,or_greater,or_lesser". Hints that an integer or float property should be within an exponential range specified via the hint string "min,max" or "min,max,step". The hint string can optionally include "or_greater" and/or "or_lesser" to allow manual input going respectively above the max or below the min values. Example: "0.01,100,0.01,or_greater". Hints that an integer, float or string property is an enumerated value to pick in a list specified via a hint string such as "Hello,Something,Else". Hints that a float property should be edited via an exponential easing function. The hint string can include "attenuation" to flip the curve horizontally and/or "inout" to also include in/out easing. Deprecated hint, unused. Deprecated hint, unused. Hints that an integer property is a bitmask with named bit flags. For example, to allow toggling bits 0, 1, 2 and 4, the hint could be something like "Bit0,Bit1,Bit2,,Bit4". Hints that an integer property is a bitmask using the optionally named 2D render layers. Hints that an integer property is a bitmask using the optionally named 2D physics layers. Hints that an integer property is a bitmask using the optionally named 3D render layers. Hints that an integer property is a bitmask using the optionally named 3D physics layers. Hints that a string property is a path to a file. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like "*.png,*.jpg". Hints that a string property is a path to a directory. Editing it will show a file dialog for picking the path. Hints that a string property is an absolute path to a file outside the project folder. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like "*.png,*.jpg". Hints that a string property is an absolute path to a directory outside the project folder. Editing it will show a file dialog for picking the path. Hints that a property is an instance of a -derived type, optionally specified via the hint string (e.g. "Texture"). Editing it will show a popup menu of valid resource types to instantiate. Hints that a string property is text with line breaks. Editing it will show a text input field where line breaks can be typed. Hints that a string property should have a placeholder text visible on its input field, whenever the property is empty. The hint string is the placeholder text to use. Hints that a color property should be edited without changing its alpha component, i.e. only R, G and B channels are edited. Hints that an image is compressed using lossy compression. Hints that an image is compressed using lossless compression. The property is serialized and saved in the scene file (default). The property is shown in the editor inspector (default). Deprecated usage flag, unused. Deprecated usage flag, unused. The property can be checked in the editor inspector. The property is checked in the editor inspector. The property is a translatable string. Used to group properties together in the editor. Used to categorize properties together in the editor. The property does not save its state in . Editing the property prompts the user for restarting the editor. The property is a script variable which should be serialized and saved in the scene file. Default usage (storage, editor and network). Default usage for translatable strings (storage, editor, network and internationalized). Default usage but without showing the property in the editor (storage, network). Flag for a normal method. Flag for an editor method. Deprecated method flag, unused. Flag for a constant method. Deprecated method flag, unused. Flag for a virtual method. Deprecated method flag, unused. Default method flags. Variable is null. Variable is of type . Variable is of type . Variable is of type (real). Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Variable is of type . Represents the size of the enum. Equality operator (==). Inequality operator (!=). Less than operator (<). Less than or equal operator (<=). Greater than operator (>). Greater than or equal operator (>=). Addition operator (+). Subtraction operator (-). Multiplication operator (*). Division operator (/). Unary negation operator (-). Unary plus operator (+). Remainder/modulo operator (%). String concatenation operator (+). Left shift operator (<<). Right shift operator (>>). Bitwise AND operator (&). Bitwise OR operator (|). Bitwise XOR operator (^). Bitwise NOT operator (~). Logical AND operator (and or &&). Logical OR operator (or or ||). Logical XOR operator (not implemented in GDScript). Logical NOT operator (not or !). Logical IN operator (in). Represents the size of the enum. The point is a spatial node that maps a real world location identified by the AR platform to a position within the game world. For example, as long as plane detection in ARKit is on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors for them. This node is mapped to one of the anchors through its unique ID. When you receive a signal that a new anchor is available, you should add this node to your scene for that anchor. You can predefine nodes and set the ID; the nodes will simply remain on 0,0,0 until a plane is recognized. Keep in mind that, as long as plane detection is enabled, the size, placing and orientation of an anchor will be updated as the detection logic learns more about the real world out there especially if only part of the surface is in view. The anchor's ID. You can set this before the anchor itself exists. The first anchor gets an ID of 1, the second an ID of 2, etc. When anchors get removed, the engine can then assign the corresponding ID to new anchors. The most common situation where anchors "disappear" is when the AR server identifies that two anchors represent different parts of the same plane and merges them. Returns the name given to this anchor. Returns true if the anchor is being tracked and false if no anchor with this ID is currently known. Returns the estimated size of the plane that was detected. Say when the anchor relates to a table in the real world, this is the estimated size of the surface of that table. Returns a plane aligned with our anchor; handy for intersection testing. If provided by the , this returns a mesh object for the anchor. For an anchor, this can be a shape related to the object being tracked or it can be a mesh that provides topology related to the anchor and can be used to create shadows/reflections on surfaces or for generating collision shapes. This is a helper spatial node for our camera; note that, if stereoscopic rendering is applicable (VR-HMD), most of the camera properties are ignored, as the HMD information overrides them. The only properties that can be trusted are the near and far planes. The position and orientation of this node is automatically updated by the ARVR Server to represent the location of the HMD if such tracking is available and can thus be used by game logic. Note that, in contrast to the ARVR Controller, the render thread has access to the most up-to-date tracking data of the HMD and the location of the ARVRCamera can lag a few milliseconds behind what is used for rendering as a result. This is a helper spatial node that is linked to the tracking of controllers. It also offers several handy passthroughs to the state of buttons and such on the controllers. Controllers are linked by their ID. You can create controller nodes before the controllers are available. If your game always uses two controllers (one for each hand), you can predefine the controllers with ID 1 and 2; they will become active as soon as the controllers are identified. If you expect additional controllers to be used, you should react to the signals and add ARVRController nodes to your scene. The position of the controller node is automatically updated by the . This makes this node ideal to add child nodes to visualize the controller. The controller's ID. A controller ID of 0 is unbound and will always result in an inactive node. Controller ID 1 is reserved for the first controller that identifies itself as the left-hand controller and ID 2 is reserved for the first controller that identifies itself as the right-hand controller. For any other controller that the detects, we continue with controller ID 3. When a controller is turned off, its slot is freed. This ensures controllers will keep the same ID even when controllers with lower IDs are turned off. The degree to which the controller vibrates. Ranges from 0.0 to 1.0 with precision .01. If changed, updates accordingly. This is a useful property to animate if you want the controller to vibrate for a limited duration. If active, returns the name of the associated controller if provided by the AR/VR SDK used. Returns the ID of the joystick object bound to this. Every controller tracked by the that has buttons and axis will also be registered as a joystick within Godot. This means that all the normal joystick tracking and input mapping will work for buttons and axis found on the AR/VR controllers. This ID is purely offered as information so you can link up the controller with its joystick entry. Returns true if the button at index button is pressed. See , in particular the JOY_VR_* constants. Returns the value of the given axis for things like triggers, touchpads, etc. that are embedded into the controller. Returns true if the bound controller is active. ARVR systems attempt to track active controllers. Returns the hand holding this controller, if known. See . If provided by the , this returns a mesh associated with the controller. This can be used to visualize the controller. This class needs to be implemented to make an AR or VR platform available to Godot and these should be implemented as C++ modules or GDNative modules (note that for GDNative the subclass ARVRScriptInterface should be used). Part of the interface is exposed to GDScript so you can detect, enable and configure an AR or VR platform. Interfaces should be written in such a way that simply enabling them will give us a working setup. You can query the available interfaces through . Tracking is behaving as expected. Tracking is hindered by excessive motion (the player is moving faster than tracking can keep up). Tracking is hindered by insufficient features, it's too dark (for camera-based tracking), player is blocked, etc. We don't know the status of the tracking or this interface does not provide feedback. Tracking is not functional (camera not plugged in or obscured, lighthouses turned off, etc.). Mono output, this is mostly used internally when retrieving positioning information for our camera node or when stereo scopic rendering is not supported. Left eye output, this is mostly used internally when rendering the image for the left eye and obtaining positioning and projection information. Right eye output, this is mostly used internally when rendering the image for the right eye and obtaining positioning and projection information. No ARVR capabilities. This interface can work with normal rendering output (non-HMD based AR). This interface supports stereoscopic rendering. This interface supports AR (video background and real world tracking). This interface outputs to an external device. If the main viewport is used, the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of ). Using a separate viewport node frees up the main viewport for other purposes. true if this is the primary interface. true if this interface been initialized. On an AR interface, true if anchor detection is enabled. Returns the name of this interface (OpenVR, OpenHMD, ARKit, etc). Returns a combination of flags providing information about the capabilities of this interface. Call this to initialize this interface. The first interface that is initialized is identified as the primary interface and it will be used for rendering output. After initializing the interface you want to use you then need to enable the AR/VR mode of a viewport and rendering should commence. Note: You must enable the AR/VR mode on the main viewport for any device that uses the main output of Godot, such as for mobile VR. If you do this for a platform that handles its own output (such as OpenVR) Godot will show just one eye without distortion on screen. Alternatively, you can add a separate viewport node to your scene and enable AR/VR on that viewport. It will be used to output to the HMD, leaving you free to do anything you like in the main window, such as using a separate camera as a spectator camera or rendering something completely different. While currently not used, you can activate additional interfaces. You may wish to do this if you want to track controllers from other platforms. However, at this point in time only one interface can render to an HMD. Turns the interface off. If supported, returns the status of our tracking. This will allow you to provide feedback to the user whether there are issues with positional tracking. Returns the resolution at which we should render our intermediate results before things like lens distortion are applied by the VR platform. Returns true if the current output of this interface is in stereo. If this is an AR interface that requires displaying a camera feed as the background, this method returns the feed ID in the for this interface. This is a wrapper class for GDNative implementations of the ARVR interface. To use a GDNative ARVR interface, simply instantiate this object and set your GDNative library containing the ARVR interface implementation. This is a special node within the AR/VR system that maps the physical location of the center of our tracking space to the virtual location within our game world. There should be only one of these nodes in your scene and you must have one. All the ARVRCamera, ARVRController and ARVRAnchor nodes should be direct children of this node for spatial tracking to work correctly. It is the position of this node that you update when your character needs to move through your game world while we're not moving in the real world. Movement in the real world is always in relation to this origin point. For example, if your character is driving a car, the ARVROrigin node should be a child node of this car. Or, if you're implementing a teleport system to move your character, you should change the position of this node. Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter. Note: This method is a passthrough to the itself. An instance of this object represents a device that is tracked, such as a controller or anchor point. HMDs aren't represented here as they are handled internally. As controllers are turned on and the AR/VR interface detects them, instances of this object are automatically added to this list of active tracking objects accessible through the . The and both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDNative-based interfaces can interact with them. The hand this tracker is held in is unknown or not applicable. This tracker is the left hand controller. This tracker is the right hand controller. The degree to which the tracker rumbles. Ranges from 0.0 to 1.0 with precision .01. Returns the tracker's type. Returns the internal tracker ID. This uniquely identifies the tracker per tracker type and matches the ID you need to specify for nodes such as the and nodes. Returns the controller or anchor point's name if available. If this is a controller that is being tracked, the controller will also be represented by a joystick entry with this ID. Returns true if this device tracks orientation. Returns the controller's orientation matrix. Returns true if this device tracks position. Returns the world-space controller position. Returns the hand holding this tracker, if known. See constants. Returns the transform combining this device's orientation and position. Returns the mesh related to a controller or anchor point if one is available. The AR/VR server is the heart of our Advanced and Virtual Reality solution and handles all the processing. Fully reset the orientation of the HMD. Regardless of what direction the user is looking to in the real world. The user will look dead ahead in the virtual world. Resets the orientation but keeps the tilt of the device. So if we're looking down, we keep looking down but heading will be reset. Does not reset the orientation of the HMD, only the position of the player gets centered. The tracker tracks the location of a controller. The tracker tracks the location of a base station. The tracker tracks the location and size of an AR anchor. Used internally to filter trackers of any known type. Used internally if we haven't set the tracker type yet. Used internally to select all trackers. Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter. The primary currently bound to the . Returns the reference frame transform. Mostly used internally and exposed for GDNative build interfaces. This is an important function to understand correctly. AR and VR platforms all handle positioning slightly differently. For platforms that do not offer spatial tracking, our origin point (0,0,0) is the location of our HMD, but you have little control over the direction the player is facing in the real world. For platforms that do offer spatial tracking, our origin point depends very much on the system. For OpenVR, our origin point is usually the center of the tracking space, on the ground. For other platforms, it's often the location of the tracking camera. This method allows you to center your tracker on the location of the HMD. It will take the current location of the HMD and use that to adjust all your tracking data; in essence, realigning the real world to your player's current position in the game world. For this method to produce usable results, tracking information must be available. This often takes a few frames after starting your game. You should call this method after a few seconds have passed. For instance, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism. Returns the primary interface's transformation. Returns the number of interfaces currently registered with the AR/VR server. If your project supports multiple AR/VR platforms, you can look through the available interface, and either present the user with a selection or simply try to initialize each interface and use the first one that returns true. Returns the interface registered at a given index in our list of interfaces. Returns a list of available interfaces the ID and name of each interface. Finds an interface by its name. For instance, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it. Returns the number of trackers currently registered. Returns the positional tracker at the given ID. Returns the absolute timestamp (in μs) of the last process callback. The value comes from an internal call to . Returns the absolute timestamp (in μs) of the last commit of the AR/VR eyes to . The value comes from an internal call to . Returns the duration (in μs) of the last frame. This is computed as the difference between and when committing. A* (A star) is a computer algorithm that is widely used in pathfinding and graph traversal, the process of plotting short paths among vertices (points), passing through a given set of edges (segments). It enjoys widespread use due to its performance and accuracy. Godot's A* implementation uses points in three-dimensional space and Euclidean distances by default. You must add points manually with and create segments manually with . Then you can test if there is a path between two points with the function, get a path containing indices by , or one containing actual coordinates with . It is also possible to use non-Euclidean distances. To do so, create a class that extends AStar and override methods and . Both take two indices and return a length, as is shown in the following example. class MyAStar: extends AStar func _compute_cost(u, v): return abs(u - v) func _estimate_cost(u, v): return min(0, abs(u - v) - 1) should return a lower bound of the distance, i.e. _estimate_cost(u, v) <= _compute_cost(u, v). This serves as a hint to the algorithm because the custom _compute_cost might be computation-heavy. If this is not the case, make return the same value as to provide the algorithm with the most accurate information. If the default and methods are used, or if the supplied method returns a lower bound of the cost, then the paths returned by A* will be the lowest cost paths. Here, the cost of a path equals to the sum of the results of all segments in the path multiplied by the weight_scales of the end points of the respective segments. If the default methods are used and the weight_scales of all points are set to 1.0, then this equals to the sum of Euclidean distances of all segments in the path. Called when computing the cost between two connected points. Note that this function is hidden in the default AStar class. Called when estimating the cost between a point and the path's ending point. Note that this function is hidden in the default AStar class. Returns the next available point ID with no point associated to it. Adds a new point at the given position with the given identifier. The id must be 0 or larger, and the weight_scale must be 1 or larger. The weight_scale is multiplied by the result of when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower weight_scales to form a path. var astar = AStar.new() astar.add_point(1, Vector3(1, 0, 0), 4) # Adds the point (1, 0, 0) with weight_scale 4 and id 1 If there already exists a point for the given id, its position and weight scale are updated to the given values. Returns the position of the point associated with the given id. Sets the position for the point with the given id. Returns the weight scale of the point associated with the given id. Sets the weight_scale for the point with the given id. The weight_scale is multiplied by the result of when determining the overall cost of traveling across a segment from a neighboring point to this point. Removes the point associated with the given id from the points pool. Returns whether a point associated with the given id exists. Returns an array with the IDs of the points that form the connection with the given point. var astar = AStar.new() astar.add_point(1, Vector3(0, 0, 0)) astar.add_point(2, Vector3(0, 1, 0)) astar.add_point(3, Vector3(1, 1, 0)) astar.add_point(4, Vector3(2, 0, 0)) astar.connect_points(1, 2, true) astar.connect_points(1, 3, true) var neighbors = astar.get_point_connections(1) # Returns [2, 3] Returns an array of all points. Disables or enables the specified point for pathfinding. Useful for making a temporary obstacle. Returns whether a point is disabled or not for pathfinding. By default, all points are enabled. Creates a segment between the given points. If bidirectional is false, only movement from id to to_id is allowed, not the reverse direction. var astar = AStar.new() astar.add_point(1, Vector3(1, 1, 0)) astar.add_point(2, Vector3(0, 5, 0)) astar.connect_points(1, 2, false) Deletes the segment between the given points. If bidirectional is false, only movement from id to to_id is prevented, and a unidirectional segment possibly remains. Returns whether the two given points are directly connected by a segment. If bidirectional is false, returns whether movement from id to to_id is possible through this segment. Returns the number of points currently in the points pool. Returns the capacity of the structure backing the points, useful in conjunction with reserve_space. Reserves space internally for num_nodes points, useful if you're adding a known large number of points at once, for a grid for instance. New capacity must be greater or equals to old capacity. Clears all the points and segments. Returns the ID of the closest point to to_position, optionally taking disabled points into account. Returns -1 if there are no points in the points pool. Note: If several points are the closest to to_position, the one with the smallest ID will be returned, ensuring a deterministic result. Returns the closest position to to_position that resides inside a segment between two connected points. var astar = AStar.new() astar.add_point(1, Vector3(0, 0, 0)) astar.add_point(2, Vector3(0, 5, 0)) astar.connect_points(1, 2) var res = astar.get_closest_position_in_segment(Vector3(3, 3, 0)) # Returns (0, 3, 0) The result is in the segment that goes from y = 0 to y = 5. It's the closest position in the segment to the given point. Returns an array with the points that are in the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path. Note: This method is not thread-safe. If called from a , it will return an empty and will print an error message. Returns an array with the IDs of the points that form the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path. var astar = AStar.new() astar.add_point(1, Vector3(0, 0, 0)) astar.add_point(2, Vector3(0, 1, 0), 1) # Default weight is 1 astar.add_point(3, Vector3(1, 1, 0)) astar.add_point(4, Vector3(2, 0, 0)) astar.connect_points(1, 2, false) astar.connect_points(2, 3, false) astar.connect_points(4, 3, false) astar.connect_points(1, 4, false) var res = astar.get_id_path(1, 3) # Returns [1, 2, 3] If you change the 2nd point's weight to 3, then the result will be [1, 4, 3] instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. This is a wrapper for the class which uses 2D vectors instead of 3D vectors. Called when computing the cost between two connected points. Note that this function is hidden in the default AStar2D class. Called when estimating the cost between a point and the path's ending point. Note that this function is hidden in the default AStar2D class. Returns the next available point ID with no point associated to it. Adds a new point at the given position with the given identifier. The id must be 0 or larger, and the weight_scale must be 1 or larger. The weight_scale is multiplied by the result of when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower weight_scales to form a path. var astar = AStar2D.new() astar.add_point(1, Vector2(1, 0), 4) # Adds the point (1, 0) with weight_scale 4 and id 1 If there already exists a point for the given id, its position and weight scale are updated to the given values. Returns the position of the point associated with the given id. Sets the position for the point with the given id. Returns the weight scale of the point associated with the given id. Sets the weight_scale for the point with the given id. The weight_scale is multiplied by the result of when determining the overall cost of traveling across a segment from a neighboring point to this point. Removes the point associated with the given id from the points pool. Returns whether a point associated with the given id exists. Returns an array with the IDs of the points that form the connection with the given point. var astar = AStar2D.new() astar.add_point(1, Vector2(0, 0)) astar.add_point(2, Vector2(0, 1)) astar.add_point(3, Vector2(1, 1)) astar.add_point(4, Vector2(2, 0)) astar.connect_points(1, 2, true) astar.connect_points(1, 3, true) var neighbors = astar.get_point_connections(1) # Returns [2, 3] Returns an array of all points. Disables or enables the specified point for pathfinding. Useful for making a temporary obstacle. Returns whether a point is disabled or not for pathfinding. By default, all points are enabled. Creates a segment between the given points. If bidirectional is false, only movement from id to to_id is allowed, not the reverse direction. var astar = AStar2D.new() astar.add_point(1, Vector2(1, 1)) astar.add_point(2, Vector2(0, 5)) astar.connect_points(1, 2, false) Deletes the segment between the given points. Returns whether there is a connection/segment between the given points. Returns the number of points currently in the points pool. Returns the capacity of the structure backing the points, useful in conjunction with reserve_space. Reserves space internally for num_nodes points, useful if you're adding a known large number of points at once, for a grid for instance. New capacity must be greater or equals to old capacity. Clears all the points and segments. Returns the ID of the closest point to to_position, optionally taking disabled points into account. Returns -1 if there are no points in the points pool. Note: If several points are the closest to to_position, the one with the smallest ID will be returned, ensuring a deterministic result. Returns the closest position to to_position that resides inside a segment between two connected points. var astar = AStar2D.new() astar.add_point(1, Vector2(0, 0)) astar.add_point(2, Vector2(0, 5)) astar.connect_points(1, 2) var res = astar.get_closest_position_in_segment(Vector2(3, 3)) # Returns (0, 3) The result is in the segment that goes from y = 0 to y = 5. It's the closest position in the segment to the given point. Returns an array with the points that are in the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path. Note: This method is not thread-safe. If called from a , it will return an empty and will print an error message. Returns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path. var astar = AStar2D.new() astar.add_point(1, Vector2(0, 0)) astar.add_point(2, Vector2(0, 1), 1) # Default weight is 1 astar.add_point(3, Vector2(1, 1)) astar.add_point(4, Vector2(2, 0)) astar.connect_points(1, 2, false) astar.connect_points(2, 3, false) astar.connect_points(4, 3, false) astar.connect_points(1, 4, false) var res = astar.get_id_path(1, 3) # Returns [1, 2, 3] If you change the 2nd point's weight to 3, then the result will be [1, 4, 3] instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. This dialog is useful for small notifications to the user about an event. It can only be accepted or closed, with the same result. The text displayed by the dialog. If true, the dialog is hidden when the OK button is pressed. You can set it to false if you want to do e.g. input validation when receiving the confirmed signal, and handle hiding the dialog in your own logic. Note: Some nodes derived from this class can have a different default value, and potentially their own built-in logic overriding this setting. For example defaults to false, and has its own input validation code that is called when you press OK, which eventually hides the dialog if the input is valid. As such, this property can't be used in to disable hiding the dialog when pressing OK. Sets autowrapping for the text in the dialog. Returns the OK instance. Returns the label used for built-in text. Adds a button with label text and a custom action to the dialog and returns the created button. action will be passed to the custom_action signal when pressed. If true, right will place the button to the right of any sibling buttons. Adds a button with label name and a cancel action to the dialog and returns the created button. Registers a in the dialog. When the enter key is pressed, the dialog will be accepted. Animations are created using a resource, which can be configured in the editor via the SpriteFrames panel. Note: You can associate a set of normal maps by creating additional resources with a _normal suffix. For example, having 2 resources run and run_normal will make it so the run animation uses the normal map. The resource containing the animation(s). The current animation from the frames resource. If this value changes, the frame counter is reset. The displayed animation frame's index. The animation speed is multiplied by this value. If true, the is currently playing. If true, texture will be centered. The texture's drawing offset. If true, texture is flipped horizontally. If true, texture is flipped vertically. Plays the animation named anim. If no anim is provided, the current animation is played. If backwards is true, the animation will be played in reverse. Stops the current animation (does not reset the frame counter). Returns true if an animation is currently being played. Animations are created using a resource, which can be configured in the editor via the SpriteFrames panel. The resource containing the animation(s). The current animation from the frames resource. If this value changes, the frame counter is reset. The displayed animation frame's index. If true, the is currently playing. Plays the animation named anim. If no anim is provided, the current animation is played. Stops the current animation (does not reset the frame counter). Returns true if an animation is currently being played. is a resource format for frame-based animations, where multiple textures can be chained automatically with a predefined delay for each frame. Unlike or , it isn't a , but has the advantage of being usable anywhere a resource can be used, e.g. in a . The playback of the animation is controlled by the property as well as each frame's optional delay (see ). The animation loops, i.e. it will restart at frame 0 automatically after playing the last frame. currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one. Note: AnimatedTexture doesn't support using s. Each frame needs to be a separate . The maximum number of frames supported by . If you need more frames in your animation, use or . Number of frames to use in the animation. While you can create the frames independently with , you need to set this value for the animation to take new frames into account. The maximum number of frames is . Sets the currently visible frame of the texture. If true, the animation will pause where it currently is (i.e. at ). The animation will continue from where it was paused when changing this property to false. If true, the animation will only play once and will not loop back to the first frame after reaching the end. Note that reaching the end will not set to true. Animation speed in frames per second. This value defines the default time interval between two frames of the animation, and thus the overall duration of the animation loop based on the property. A value of 0 means no predefined number of frames per second, the animation will play according to each frame's frame delay (see ). For example, an animation with 8 frames, no frame delay and a fps value of 2 will run for 4 seconds, with each frame lasting 0.5 seconds. Assigns a to the given frame. Frame IDs start at 0, so the first frame has ID 0, and the last frame of the animation has ID - 1. You can define any number of textures up to , but keep in mind that only frames from 0 to - 1 will be part of the animation. Returns the given frame's . Sets an additional delay (in seconds) between this frame and the next one, that will be added to the time interval defined by . By default, frames have no delay defined. If a delay value is defined, the final time interval between this frame and the next will be 1.0 / fps + delay. For example, for an animation with 3 frames, 2 FPS and a frame delay on the second frame of 1.2, the resulting playback will be: Frame 0: 0.5 s (1 / fps) Frame 1: 1.7 s (1 / fps + 1.2) Frame 2: 0.5 s (1 / fps) Total duration: 2.7 s Returns the given frame's delay value. An Animation resource contains data used to animate everything in the engine. Animations are divided into tracks, and each track must be linked to a node. The state of that node can be changed through time, by adding timed keys (events) to the track. # This creates an animation that makes the node "Enemy" move to the right by # 100 pixels in 0.5 seconds. var animation = Animation.new() var track_index = animation.add_track(Animation.TYPE_VALUE) animation.track_set_path(track_index, "Enemy:position:x") animation.track_insert_key(track_index, 0.0, 0) animation.track_insert_key(track_index, 0.5, 100) Animations are just data containers, and must be added to nodes such as an or to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check to see available types. Value tracks set values in node properties, but only those which can be Interpolated. Transform tracks are used to change node local transforms or skeleton pose bones. Transitions are interpolated. Method tracks call functions with given arguments per key. Bezier tracks are used to interpolate a value using custom curves. They can also be used to animate sub-properties of vectors and colors (e.g. alpha value of a ). Audio tracks are used to play an audio stream with either type of . The stream can be trimmed and previewed in the animation. Animation tracks play animations in other nodes. Update between keyframes. Update at the keyframes and hold the value. Update at the keyframes. Same as linear interpolation, but also interpolates from the current value (i.e. dynamically at runtime) if the first key isn't at 0 seconds. No interpolation (nearest value). Linear interpolation. Cubic interpolation. The total length of the animation (in seconds). Note: Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping. A flag indicating that the animation must loop. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation. The animation step value. Adds a track to the Animation. Removes a track by specifying the track index. Returns the amount of tracks in the animation. Gets the type of a track. Gets the path of a track. For more information on the path format, see . Sets the path of a track. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by ":". For example, "character/skeleton:ankle" or "character/mesh:transform/local". Returns the index of the specified track. If the track is not found, return -1. Moves a track up. Moves a track down. Changes the index position of track idx to the one defined in to_idx. Swaps the track idx's index position with the track with_idx. Sets the given track as imported or not. Returns true if the given track is imported. Else, return false. Enables/disables the given track. Tracks are enabled by default. Returns true if the track at index idx is enabled. Insert a transform key for a transform track. Insert a generic key in a given track. Removes a key by index in a given track. Removes a key by position (seconds) in a given track. Sets the value of an existing key. Sets the transition curve (easing) for a specific key (see the built-in math function @GDScript.ease). Sets the time of an existing key. Returns the transition curve (easing) for a specific key (see the built-in math function @GDScript.ease). Returns the amount of keys in a given track. Returns the value of a given key in a given track. Returns the time at which the key is located. Finds the key index by time in a given track. Optionally, only find it if the exact time is given. Sets the interpolation type of a given track. Returns the interpolation type of a given track. If true, the track at idx wraps the interpolation loop. Returns true if the track at idx wraps the interpolation loop. New tracks wrap the interpolation loop by default. Returns the interpolated value of a transform track at a given time (in seconds). An array consisting of 3 elements: position (), rotation () and scale (). Sets the update mode (see ) of a value track. Returns the update mode of a value track. Returns all the key indices of a value track, given a position and delta time. Returns the interpolated value at the given time (in seconds). The track_idx must be the index of a value track. Returns all the key indices of a method track, given a position and delta time. Returns the method name of a method track. Returns the arguments values to be called on a method track for a given key in a given track. Inserts a Bezier Track key at the given time in seconds. The track_idx must be the index of a Bezier Track. in_handle is the left-side weight of the added Bezier curve point, out_handle is the right-side one, while value is the actual value at this point. If the parameter is null, then the default value is new Vector2(0, 0) If the parameter is null, then the default value is new Vector2(0, 0) Sets the value of the key identified by key_idx to the given value. The track_idx must be the index of a Bezier Track. Sets the in handle of the key identified by key_idx to value in_handle. The track_idx must be the index of a Bezier Track. Sets the out handle of the key identified by key_idx to value out_handle. The track_idx must be the index of a Bezier Track. Returns the value of the key identified by key_idx. The track_idx must be the index of a Bezier Track. Returns the in handle of the key identified by key_idx. The track_idx must be the index of a Bezier Track. Returns the out handle of the key identified by key_idx. The track_idx must be the index of a Bezier Track. Returns the interpolated value at the given time (in seconds). The track_idx must be the index of a Bezier Track. Inserts an Audio Track key at the given time in seconds. The track_idx must be the index of an Audio Track. stream is the resource to play. start_offset is the number of seconds cut off at the beginning of the audio stream, while end_offset is at the ending. Sets the stream of the key identified by key_idx to value stream. The track_idx must be the index of an Audio Track. Sets the start offset of the key identified by key_idx to value offset. The track_idx must be the index of an Audio Track. Sets the end offset of the key identified by key_idx to value offset. The track_idx must be the index of an Audio Track. Returns the audio stream of the key identified by key_idx. The track_idx must be the index of an Audio Track. Returns the start offset of the key identified by key_idx. The track_idx must be the index of an Audio Track. Start offset is the number of seconds cut off at the beginning of the audio stream. Returns the end offset of the key identified by key_idx. The track_idx must be the index of an Audio Track. End offset is the number of seconds cut off at the ending of the audio stream. Inserts a key with value animation at the given time (in seconds). The track_idx must be the index of an Animation Track. Sets the key identified by key_idx to value animation. The track_idx must be the index of an Animation Track. Returns the animation name at the key identified by key_idx. The track_idx must be the index of an Animation Track. Clear the animation (clear all tracks and reset all). Adds a new track that is a copy of the given track from to_animation. Base resource for nodes. In general, it's not used directly, but you can create custom ones with custom blending formulas. Inherit this when creating nodes mainly for use in , otherwise should be used instead. Do not use filtering. Paths matching the filter will be allowed to pass. Paths matching the filter will be discarded. Paths matching the filter will be blended (by the blend value). If true, filtering is enabled. Gets the text caption for this node (used by some editors). Gets a child node by index (used by editors inheriting from ). Gets all children nodes in order as a name: node dictionary. Only useful when inheriting . Gets the default value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Gets the property information for parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to . Returns true whether you want the blend tree editor to display filter editing on this node. User-defined callback called when a custom node is processed. The time parameter is a relative delta, unless seek is true, in which case it is absolute. Here, call the , or functions. You can also use and to modify local memory. This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called). Amount of inputs in this node, only useful for nodes that go into . Gets the name of an input by index. Adds an input to the node. This is only useful for nodes created for use in an . Removes an input, call this only when inactive. Adds or removes a path for the filter. Returns true whether a given path is filtered. Blend an animation by blend amount (name must be valid in the linked ). A time and delta may be passed, as well as whether seek happened. Blend another animation node (in case this node contains children animation nodes). This function is only useful if you inherit from instead, else editors will not display your node for addition. Blend an input. This is only useful for nodes created for an . The time parameter is a relative delta, unless seek is true, in which case it is absolute. A filter mode may be optionally passed (see for options). Sets a custom parameter. These are used as local storage, because resources can be reused across the tree or scenes. Gets the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. A resource to add to an . Blends two animations additively based on an amount value in the [0.0, 1.0] range. If true, sets the optimization to false when calling , forcing the blended animations to update every frame. A resource to add to an . Blends two animations together additively out of three based on a value in the [-1.0, 1.0] range. This node has three inputs: - The base animation to add to - A -add animation to blend with when the blend amount is in the [-1.0, 0.0] range. - A +add animation to blend with when the blend amount is in the [0.0, 1.0] range If true, sets the optimization to false when calling , forcing the blended animations to update every frame. A resource to add to an . Only features one output set using the property. Use it as an input for that blend animations together. Animation to use as an output. It is one of the animations provided by . A resource to add to an . Blends two animations linearly based on an amount value in the [0.0, 1.0] range. If true, sets the optimization to false when calling , forcing the blended animations to update every frame. A resource to add to an . Blends two animations together linearly out of three based on a value in the [-1.0, 1.0] range. This node has three inputs: - The base animation - A -blend animation to blend with when the blend amount is in the [-1.0, 0.0] range. - A +blend animation to blend with when the blend amount is in the [0.0, 1.0] range If true, sets the optimization to false when calling , forcing the blended animations to update every frame. A resource to add to an . This is a virtual axis on which you can add any type of using . Outputs the linear blend of the two s closest to the node's current value. You can set the extents of the axis using the and . The blend space's axis's lower limit for the points' position. See . The blend space's axis's upper limit for the points' position. See . Position increment to snap to when moving a point on the axis. Label of the virtual axis of the blend space. Adds a new point that represents a node on the virtual axis at a given position set by pos. You can insert it at a specific index using the at_index argument. If you use the default value for at_index, the point is inserted at the end of the blend points array. Updates the position of the point at index point on the blend axis. Returns the position of the point at index point. Changes the referenced by the point at index point. Returns the referenced by the point at index point. Removes the point at index point from the blend axis. Returns the number of points on the blend axis. A resource to add to an . This node allows you to blend linearly between three animations using a weight. You can add vertices to the blend space with and automatically triangulate it by setting to true. Otherwise, use and to create up the blend space by hand. The interpolation between animations is linear. The blend space plays the animation of the node the blending position is closest to. Useful for frame-by-frame 2D animations. Similar to , but starts the new animation at the last animation's playback position. If true, the blend space is triangulated automatically. The mesh updates every time you add or remove points with and . The blend space's X and Y axes' lower limit for the points' position. See . The blend space's X and Y axes' upper limit for the points' position. See . Position increment to snap to when moving a point. Name of the blend space's X axis. Name of the blend space's Y axis. Controls the interpolation between animations. See constants. Adds a new point that represents a node at the position set by pos. You can insert it at a specific index using the at_index argument. If you use the default value for at_index, the point is inserted at the end of the blend points array. Updates the position of the point at index point on the blend axis. Returns the position of the point at index point. Changes the referenced by the point at index point. Returns the referenced by the point at index point. Removes the point at index point from the blend space. Returns the number of points in the blend space. Creates a new triangle using three points x, y, and z. Triangles can overlap. You can insert the triangle at a specific index using the at_index argument. If you use the default value for at_index, the point is inserted at the end of the blend points array. Returns the position of the point at index point in the triangle of index triangle. Removes the triangle at index triangle from the blend space. Returns the number of triangles in the blend space. This node may contain a sub-tree of any other blend type nodes, such as mix, blend2, blend3, one shot, etc. This is one of the most commonly used roots. The connection was successful. The input node is null. The specified input port is out of range. The output node is null. Input and output nodes are the same. The specified connection already exists. The global offset of all sub-nodes. Adds an at the given position. The name is used to identify the created sub-node later. If the parameter is null, then the default value is new Vector2(0, 0) Returns the sub-node with the specified name. Removes a sub-node. Changes the name of a sub-node. Returns true if a sub-node with specified name exists. Connects the output of an as input for another , at the input port specified by input_index. Disconnects the node connected to the specified input. Modifies the position of a sub-node. Returns the position of the sub-node with the specified name. A resource to add to an . This node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters. If true, the sub-animation will restart automatically after finishing. The delay after which the automatic restart is triggered, in seconds. If is true, a random additional delay (in seconds) between 0 and this value will be added to . Contains multiple nodes representing animation states, connected in a graph. Node transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the object from the node to control it programmatically. Example: var state_machine = $AnimationTree.get("parameters/playback") state_machine.travel("some_state") Adds a new node to the graph. The position is used for display in the editor. If the parameter is null, then the default value is new Vector2(0, 0) Replaces the node and keeps its transitions unchanged. Returns the animation node with the given name. Deletes the given node from the graph. Renames the given node. Returns true if the graph contains the given node. Returns the given animation node's name. Sets the node's coordinates. Used for display in the editor. Returns the given node's coordinates. Used for display in the editor. Returns true if there is a transition between the given nodes. Adds a transition between the given nodes. Returns the given transition. Returns the given transition's start node. Returns the given transition's end node. Returns the number of connections in the graph. Deletes the given transition by index. Deletes the transition between the two specified nodes. Sets the given node as the graph start point. Returns the graph's end node. Sets the given node as the graph end point. Returns the graph's end node. Sets the draw offset of the graph. Used for display in the editor. Returns the draw offset of the graph. Used for display in the editor. Allows control of state machines created with . Retrieve with $AnimationTree.get("parameters/playback"). Example: var state_machine = $AnimationTree.get("parameters/playback") state_machine.travel("some_state") Transitions from the current state to another one, following the shortest path. Starts playing the given animation. Stops the currently playing animation. Returns true if an animation is playing. Returns the currently playing animation state. Returns the playback position within the current animation state. Returns the current travel path as computed internally by the A* algorithm. Switch to the next state immediately. The current state will end and blend into the beginning of the new one. Switch to the next state immediately, but will seek the new state to the playback position of the old state. Wait for the current state playback to end, then switch to the beginning of the next state animation. The transition type. Turn on the transition automatically when this state is reached. This works best with . Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the that can be controlled from code (see ). For example, if is an and is set to "idle": $animation_tree["parameters/conditions/idle"] = is_on_floor and (linear_velocity.x == 0) The time to cross-fade between this state and the next. Lower priority transitions are preferred when travelling through the tree via or . Don't use this transition during or . Allows scaling the speed of the animation (or reversing it) in any children nodes. Setting it to 0 will pause the animation. This node can be used to cause a seek command to happen to any sub-children of the animation graph. Use this node type to play an from the start or a certain playback position inside the . After setting the time and changing the animation playback, the seek node automatically goes into sleep mode on the next process frame by setting its seek_position value to -1.0. # Play child animation from the start. animation_tree.set("parameters/Seek/seek_position", 0.0) # Alternative syntax (same result as above). animation_tree["parameters/Seek/seek_position"] = 0.0 # Play child animation from 12 second timestamp. animation_tree.set("parameters/Seek/seek_position", 12.0) # Alternative syntax (same result as above). animation_tree["parameters/Seek/seek_position"] = 12.0 Simple state machine for cases which don't require a more advanced . Animations can be connected to the inputs and transition times can be specified. The number of available input ports for this node. Cross-fading time (in seconds) between each animation connected to the inputs. An animation player is used for general-purpose playback of resources. It contains a dictionary of animations (referenced by name) and custom blend times between their transitions. Additionally, animations can be played and blended in different channels. is more suited than for animations where you know the final values in advance. For example, fading a screen in and out is more easily done with an node thanks to the animation tools provided by the editor. That particular example can also be implemented with a node, but it requires doing everything by code. Updating the target properties of animations occurs at process time. Process animation during the physics process. This is especially useful when animating physics bodies. Process animation during the idle process. Do not process animation. Use to process the animation manually. Batch method calls during the animation process, then do the calls after events are processed. This avoids bugs involving deleting nodes or modifying the AnimationPlayer while playing. Make method calls immediately when reached in the animation. The node from which node path references will travel. The name of the currently playing animation. If no animation is playing, the property's value is an empty string. Changing this value does not restart the animation. See for more information on playing animations. Note: while this property appears in the inspector, it's not meant to be edited, and it's not saved in the scene. This property is mainly used to get the currently playing animation, and internally for animation playback tracks. For more information, see . If playing, the current animation; otherwise, the animation last played. When set, would change the animation, but would not play it unless currently playing. See also . The name of the animation to play when the scene loads. The length (in seconds) of the currently being played animation. The position (in seconds) of the currently playing animation. The process notification in which to update animations. The default time in which to blend animations. Ranges from 0 to 4096 with 0.01 precision. If true, updates animations in response to process-related notifications. The speed scaling ratio. For instance, if this value is 1, then the animation plays at normal speed. If it's 0.5, then it plays at half speed. If it's 2, then it plays at double speed. The call mode to use for Call Method tracks. Adds animation to the player accessible with the key name. Removes the animation with key name. Renames an existing animation with key name to newname. Returns true if the stores an with key name. Returns the with key name or null if not found. Returns the list of stored animation names. Triggers the anim_to animation when the anim_from animation completes. Returns the name of the next animation in the queue. Specifies a blend time (in seconds) between two animations, referenced by their names. Gets the blend time (in seconds) between two animations, referenced by their names. Plays the animation with key name. Custom blend times and speed can be set. If custom_speed is negative and from_end is true, the animation will play backwards (which is equivalent to calling ). The keeps track of its current or last played animation with . If this method is called with that same animation name, or with no name parameter, the assigned animation will resume playing if it was paused, or restart if it was stopped (see for both pause and stop). If the animation was already playing, it will keep playing. Note: The animation will be updated the next time the is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call advance(0). Plays the animation with key name in reverse. This method is a shorthand for with custom_speed = -1.0 and from_end = true, so see its description for more information. Stops or pauses the currently playing animation. If reset is true, the animation position is reset to 0 and the playback speed is reset to 1.0. If reset is false, the will be kept and calling or without arguments or with the same animation name as will resume the animation. Returns true if playing an animation. Queues an animation for playback once the current one is done. Note: If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow. Returns a list of the animation names that are currently queued to play. Clears all queued, unplayed animations. Gets the actual playing speed of current animation or 0 if not playing. This speed is the property multiplied by custom_speed argument specified when calling the method. Returns the name of animation or an empty string if not found. caches animated nodes. It may not notice if a node disappears; forces it to update the cache again. Seeks the animation to the seconds point in time (in seconds). If update is true, the animation updates too, otherwise it updates at process time. Events between the current frame and seconds are skipped. Shifts position in the animation timeline and immediately updates the animation. delta is the time in seconds to shift. Events between the current frame and delta are handled. Note: When linked with an , several properties and methods of the corresponding will not function as expected. Playback and transitions should be handled using only the and its constituent (s). The node should be used solely for adding, deleting, and editing animations. The animations will progress during the physics frame (i.e. ). The animations will progress during the idle frame (i.e. ). The animations will only progress manually (see ). The root animation node of this . See . The path to the used for animating. If true, the will be processing. The process mode of this . See for available modes. The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by ":". For example, "character/skeleton:ankle" or "character/mesh:transform/local". If the track has type , the transformation will be cancelled visually, and the animation will appear to stay in place. Retrieve the motion of the as a that can be used elsewhere. If is not a path to a track of type , returns an identity transformation. Manually advance the animations by the specified time (in seconds). Deprecated. A node graph tool for blending multiple animations bound to an . Especially useful for animating characters or other skeleton-based rigs. It can combine several animations to form a desired pose. It takes s from an node and mixes them depending on the graph. See for a more full-featured replacement of this node. Process animation during the physics process. This is especially useful when animating physics bodies. Process animation during the idle process. Output node. Animation node. OneShot node. Mix node. Blend2 node. Blend3 node. Blend4 node. TimeScale node. TimeSeek node. Transition node. The thread in which to update animations. The path to the from which this binds animations to animation nodes. Once set, nodes can be added to the . The node from which to relatively access other nodes. It accesses the bones, so it should point to the same node the would point its Root Node at. If true, the is able to play animations. Adds a type node to the graph with name id. Check if a node exists (by name). Renames a node in the graph. Gets the node type, will return from enum. Returns the input count for a given node. Different types of nodes have different amount of inputs. Returns the input source for a given node input. Binds a new from the to the 's animation node with name id. Returns the 's bound to the 's animation node with name id. Binds the named source from to the animation node id. Recalculates caches. Returns the name of the 's bound to this animation node. Returns the absolute playback timestamp of the animation node with name id. If enable is true, the animation node with ID id turns off the track modifying the property at path. The modified node's children continue to animate. Sets the fade in time of a OneShot node given its name and value in seconds. Returns the fade in time of a OneShot node given its name. Sets the fade out time of a OneShot node given its name and value in seconds. Returns the fade out time of a OneShot node given its name. Sets the autorestart property of a OneShot node given its name and value. Sets the autorestart delay of a OneShot node given its name and value in seconds. Sets the autorestart random delay of a OneShot node given its name and value in seconds. Returns whether a OneShot node will auto restart given its name. Returns the autostart delay of a OneShot node given its name. Returns the autostart random delay of a OneShot node given its name. Starts a OneShot node given its name. Stops the OneShot node with name id. Returns whether a OneShot node is active given its name. If enable is true, the OneShot node with ID id turns off the track modifying the property at path. The modified node's children continue to animate. Sets the mix amount of a Mix node given its name and value. A Mix node adds input b to input a by the amount given by ratio. Returns the mix amount of a Mix node given its name. Sets the blend amount of a Blend2 node given its name and value. A Blend2 node blends two animations (A and B) with the amount between 0 and 1. At 0, output is input A. Towards 1, the influence of A gets lessened, the influence of B gets raised. At 1, output is input B. Returns the blend amount of a Blend2 node given its name. If enable is true, the Blend2 node with name id turns off the track modifying the property at path. The modified node's children continue to animate. Sets the blend amount of a Blend3 node given its name and value. A Blend3 Node blends three animations (A, B-, B+) with the amount between -1 and 1. At -1, output is input B-. From -1 to 0, the influence of B- gets lessened, the influence of A gets raised and the influence of B+ is 0. At 0, output is input A. From 0 to 1, the influence of A gets lessened, the influence of B+ gets raised and the influence of B+ is 0. At 1, output is input B+. Returns the blend amount of a Blend3 node given its name. Sets the blend amount of a Blend4 node given its name and value. A Blend4 Node blends two pairs of animations. The two pairs are blended like Blend2 and then added together. Returns the blend amount of a Blend4 node given its name. Sets the time scale of the TimeScale node with name id to scale. The TimeScale node is used to speed s up if the scale is above 1 or slow them down if it is below 1. If applied after a blend or mix, affects all input animations to that blend or mix. Returns the time scale value of the TimeScale node with name id. Sets the time seek value of the TimeSeek node with name id to seconds. This functions as a seek in the or the blend or mix of s input in it. Resizes the number of inputs available for the transition node with name id. Returns the number of inputs for the transition node with name id. You can add inputs by right-clicking on the transition node. Deletes the input at input_idx for the transition node with name id. The transition node with name id advances to its next input automatically when the input at input_idx completes. Returns true if the input at input_idx on the transition node with name id is set to automatically advance to the next input upon completion. The transition node with name id sets its cross fade time to time_sec. Returns the cross fade time for the transition node with name id. The transition node with name id sets its current input at input_idx. Returns the index of the currently evaluated input for the transition node with name id. Sets the position of a node in the graph given its name and position. Returns position of a node in the graph given its name. Removes the animation node with name id. Connects node id to dst_id at the specified input slot. Returns whether node id and dst_id are connected at the specified slot. Disconnects nodes connected to id at the specified input slot. Returns a containing the name of all nodes. Shifts position in the animation timeline. delta is the time in seconds to shift. Events between the current frame and delta are handled. Resets this . Manually recalculates the cache of track information generated from animation nodes. Needed when external sources modify the animation nodes' state. 3D area that detects nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping). This area does not affect gravity/damping. This area adds its gravity/damping values to whatever has been calculated so far (in order). This area adds its gravity/damping values to whatever has been calculated so far (in order), ignoring any lower priority areas. This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas. This area replaces any gravity/damping calculated so far (in order), but keeps calculating the rest of the areas. Override mode for gravity and damping calculations within this area. See for possible values. If true, gravity is calculated from a point (set via ). See also . The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance. The area's gravity vector (not normalized). If gravity is a point (see ), this will be the point of attraction. The area's gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction. The rate at which objects stop moving in this area. Represents the linear velocity lost per second. See for more details about damping. The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. See for more details about damping. The area's priority. Higher priority areas are processed first. If true, the area detects bodies or areas entering and exiting it. If true, other monitoring areas can detect this area. The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also . See Collision layers and masks in the documentation for more information. The physics layers this area scans to determine collision detection. See Collision layers and masks in the documentation for more information. If true, the area's audio bus overrides the default audio bus. The name of the area's audio bus. If true, the area applies reverb to its associated audio. The reverb bus name to use for this area's associated audio. The degree to which this area applies reverb to its associated audio. Ranges from 0 to 1 with 0.1 precision. The degree to which this area's reverb is a uniform effect. Ranges from 0 to 1 with 0.1 precision. Set/clear individual bits on the collision mask. This simplifies editing which layers this scans. Returns an individual bit on the collision mask. Set/clear individual bits on the layer mask. This simplifies editing this 's layers. Returns an individual bit on the layer mask. Returns a list of intersecting s. 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. Returns a list of intersecting s. 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. If true, the given physics body overlaps the Area. Note: 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 body argument can either be a or a instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body). If true, the given area overlaps the Area. Note: 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. 2D area that detects nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping). This area does not affect gravity/damping. This area adds its gravity/damping values to whatever has been calculated so far (in order). This area adds its gravity/damping values to whatever has been calculated so far (in order), ignoring any lower priority areas. This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas. This area replaces any gravity/damping calculated so far (in order), but keeps calculating the rest of the areas. Override mode for gravity and damping calculations within this area. See for possible values. If true, gravity is calculated from a point (set via ). See also . The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance. The area's gravity vector (not normalized). If gravity is a point (see ), this will be the point of attraction. The area's gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction. The rate at which objects stop moving in this area. Represents the linear velocity lost per second. See for more details about damping. The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. See for more details about damping. The area's priority. Higher priority areas are processed first. If true, the area detects bodies or areas entering and exiting it. If true, other monitoring areas can detect this area. The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also . See Collision layers and masks in the documentation for more information. The physics layers this area scans to determine collision detection. See Collision layers and masks in the documentation for more information. If true, the area's audio bus overrides the default audio bus. The name of the area's audio bus. Set/clear individual bits on the collision mask. This makes selecting the areas scanned easier. Returns an individual bit on the collision mask. Describes whether this area will collide with others on the given layer. Set/clear individual bits on the layer mask. This makes getting an area in/out of only one layer easier. Returns an individual bit on the layer mask. Describes whether other areas will collide with this one on the given layer. Returns a list of intersecting s. 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. Returns a list of intersecting s. 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. If true, the given physics body overlaps the Area2D. Note: 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 body argument can either be a or a instance (while TileMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body). If true, the given area overlaps the Area2D. Note: 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 is used to construct a by specifying the attributes as arrays. The most basic example is the creation of a single triangle: var vertices = PoolVector3Array() vertices.push_back(Vector3(0, 1, 0)) vertices.push_back(Vector3(1, 0, 0)) vertices.push_back(Vector3(0, 0, 1)) # Initialize the ArrayMesh. var arr_mesh = ArrayMesh.new() var arrays = [] arrays.resize(ArrayMesh.ARRAY_MAX) arrays[ArrayMesh.ARRAY_VERTEX] = vertices # Create the Mesh. arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays) var m = MeshInstance.new() m.mesh = arr_mesh The is ready to be added to the to be shown. See also , and for procedural geometry generation. Note: Godot uses clockwise winding order for front faces of triangle primitive modes. Default value used for index_array_len when no indices are present. Amount of weights/bone indices per vertex (always 4). Array format will include vertices (mandatory). Array format will include normals. Array format will include tangents. Array format will include a color array. Array format will include UVs. Array format will include another set of UVs. Array format will include bone indices. Array format will include bone weights. Index array will be used. , , or of vertex positions. of vertex normals. of vertex tangents. Each element in groups of 4 floats, first 3 floats determine the tangent, and the last the binormal direction as -1 or 1. of vertex colors. for UV coordinates. for second UV coordinates. or of bone indices. Each element in groups of 4 floats. of bone weights. Each element in groups of 4 floats. of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the *i*'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices. For triangles, the index array is interpreted as triples, referring to the vertices of each triangle. For lines, the index array is in pairs indicating the start and end of each line. Represents the size of the enum. Sets the blend shape mode to one of . Overrides the with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. Adds name for a blend shape that will be added with . Must be called before surface is added. Returns the number of blend shapes that the holds. Returns the name of the blend shape at this index. Removes all blend shapes from this . Creates a new surface. Surfaces are created to be rendered using a primitive, which may be any of the types defined in . (As a note, when using indices, it is recommended to only use points, lines or triangles.) will become the surf_idx for this new surface. The arrays argument is an array of arrays. See for the values used in this array. For example, arrays[0] is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for if it is used. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data, and the index array defines the order of the vertices. If the parameter is null, then the default value is new Godot.Collections.Array {} Removes a surface at position surf_idx, shifting greater surfaces one surf_idx slot down. Updates a specified region of mesh arrays on the GPU. Warning: Only use if you know what you are doing. You can easily cause crashes by calling this function with improper arguments. Returns the length in vertices of the vertex array in the requested surface (see ). Returns the length in indices of the index array in the requested surface (see ). Returns the format mask of the requested surface (see ). Returns the primitive type of the requested surface (see ). Returns the index of the first surface with this name held within this . If none are found, -1 is returned. Sets a name for a given surface. Gets the name assigned to this surface. Will regenerate normal maps for the . Will perform a UV unwrap on the to prepare the mesh for lightmapping. Arranges child controls in a way to preserve their aspect ratio automatically whenever the container is resized. Solves the problem where the container size is dynamic and the contents' size needs to adjust accordingly without losing proportions. Aligns child controls with the beginning (left or top) of the container. Aligns child controls with the center of the container. Aligns child controls with the end (right or bottom) of the container. The height of child controls is automatically adjusted based on the width of the container. The width of child controls is automatically adjusted based on the height of the container. The bounding rectangle of child controls is automatically adjusted to fit inside the container while keeping the aspect ratio. The width and height of child controls is automatically adjusted to make their bounding rectangle cover the entire area of the container while keeping the aspect ratio. When the bounding rectangle of child controls exceed the container's size and is enabled, this allows to show only the container's area restricted by its own bounding rectangle. The aspect ratio to enforce on child controls. This is the width divided by the height. The ratio depends on the . The stretch mode used to align child controls. Specifies the horizontal relative position of child controls. Specifies the vertical relative position of child controls. resource that crops out one part of the texture, defined by . The main use case is cropping out textures from a texture atlas, which is a big texture file that packs multiple smaller textures. Consists of a for the , a that defines the area of to use, and a that defines the border width. cannot be used in an , cannot be tiled in nodes such as , and does not work properly if used inside of other resources. Multiple resources can be used to crop multiple textures from the atlas. Using a texture atlas helps to optimize video memory costs and render calls compared to using multiple small files. Note: AtlasTextures don't support repetition. The and flags are ignored when using an AtlasTexture. The texture that contains the atlas. Can be any subtype. The AtlasTexture's used region. The margin around the region. The 's Rect2.size parameter ("w" and "h" in the editor) resizes the texture so it fits within the margin. If true, clips the area outside of the region to avoid bleeding of the surrounding texture pixels. Stores position, muting, solo, bypass, effects, effect position, volume, and the connections between buses. See for usage. Base resource for audio bus. Applies an audio effect on the bus that the resource is applied on. Increases or decreases the volume being routed through the audio bus. Amount of amplification in decibels. Positive values make the sound louder, negative values make it quieter. Value can range from -80 to 24. Limits the frequencies in a range around the and allows frequencies outside of this range to pass. Attenuates the frequencies inside of a range around the and cuts frequencies outside of this band. AudioEffectCapture is an AudioEffect which copies all audio frames from the attached audio effect bus into its internal ring buffer. Application code should consume these audio frames from this ring buffer using and process it as needed, for example to capture data from a microphone, implement application defined effects, or to transmit audio over the network. Length of the internal ring buffer, in seconds. Setting the buffer length will have no effect if already initialized. Returns true if at least frames audio frames are available to read in the internal ring buffer. Gets the next frames audio samples from the internal ring buffer. Returns a containing exactly frames audio samples if available, or an empty if insufficient data was available. Clears the internal ring buffer. Returns the number of frames available to read using . Returns the number of audio frames discarded from the audio bus due to full buffer. Returns the total size of the internal ring buffer in frames. Returns the number of audio frames inserted from the audio bus. Adds a chorus audio effect. The effect applies a filter with voices to duplicate the audio source and manipulate it through the filter. The amount of voices in the effect. The effect's raw signal. The effect's processed signal. The voice's signal delay. The voice's filter rate. The voice filter's depth. The voice's volume. The voice's cutoff frequency. The voice's pan level. The voice's signal delay. The voice's filter rate. The voice filter's depth. The voice's volume. The voice's cutoff frequency. The voice's pan level. The voice's signal delay. The voice's filter rate. The voice filter's depth. The voice's volume. The voice's cutoff frequency. The voice's pan level. The voice's signal delay. The voice's filter rate. The voice filter's depth. The voice's volume. The voice's cutoff frequency. The voice's pan level. Dynamic range compressor reduces the level of the sound when the amplitude goes over a certain threshold in Decibels. One of the main uses of a compressor is to increase the dynamic range by clipping as little as possible (when sound goes over 0dB). Compressor has many uses in the mix: - In the Master bus to compress the whole output (although an is probably better). - In voice channels to ensure they sound as balanced as possible. - Sidechained. This can reduce the sound level sidechained with another audio bus for threshold detection. This technique is common in video game mixing to the level of music and SFX while voices are being heard. - Accentuates transients by using a wider attack, making effects sound more punchy. The level above which compression is applied to the audio. Value can range from -60 to 0. Amount of compression applied to the audio once it passes the threshold level. The higher the ratio, the more the loud parts of the audio will be compressed. Value can range from 1 to 48. Gain applied to the output signal. Compressor's reaction time when the signal exceeds the threshold, in microseconds. Value can range from 20 to 2000. Compressor's delay time to stop reducing the signal after the signal level falls below the threshold, in milliseconds. Value can range from 20 to 2000. Balance between original signal and effect signal. Value can range from 0 (totally dry) to 1 (totally wet). Reduce the sound level using another audio bus for threshold detection. Plays input signal back after a period of time. The delayed signal may be played back multiple times to create the sound of a repeating, decaying echo. Delay effects range from a subtle echo effect to a pronounced blending of previous sounds with new sounds. Output percent of original sound. At 0, only delayed sounds are output. Value can range from 0 to 1. If true, tap1 will be enabled. tap1 delay time in milliseconds. Sound level for tap1. Pan position for tap1. Value can range from -1 (fully left) to 1 (fully right). If true, tap2 will be enabled. Tap2 delay time in milliseconds. Sound level for tap2. Pan position for tap2. Value can range from -1 (fully left) to 1 (fully right). If true, feedback is enabled. Feedback delay time in milliseconds. Sound level for tap1. Low-pass filter for feedback, in Hz. Frequencies below this value are filtered out of the source signal. Different types are available: clip, tan, lo-fi (bit crushing), overdrive, or waveshape. By distorting the waveform the frequency content change, which will often make the sound "crunchy" or "abrasive". For games, it can simulate sound coming from some saturated device or speaker very efficiently. Digital distortion effect which cuts off peaks at the top and bottom of the waveform. Low-resolution digital distortion effect. You can use it to emulate the sound of early digital audio devices. Emulates the warm distortion produced by a field effect transistor, which is commonly used in solid-state musical instrument amplifiers. Waveshaper distortions are used mainly by electronic musicians to achieve an extra-abrasive sound. Distortion type. Increases or decreases the volume before the effect. Value can range from -60 to 60. High-pass filter, in Hz. Frequencies higher than this value will not be affected by the distortion. Value can range from 1 to 20000. Distortion power. Value can range from 0 to 1. Increases or decreases the volume after the effect. Value can range from -80 to 24. AudioEffectEQ gives you control over frequencies. Use it to compensate for existing deficiencies in audio. AudioEffectEQs are useful on the Master bus to completely master a mix and give it more character. They are also useful when a game is run on a mobile device, to adjust the mix to that kind of speakers (it can be added but disabled when headphones are plugged). Sets band's gain at the specified index, in dB. Returns the band's gain at the specified index, in dB. Returns the number of bands of the equalizer. Frequency bands: Band 1: 31 Hz Band 2: 62 Hz Band 3: 125 Hz Band 4: 250 Hz Band 5: 500 Hz Band 6: 1000 Hz Band 7: 2000 Hz Band 8: 4000 Hz Band 9: 8000 Hz Band 10: 16000 Hz See also , , . Frequency bands: Band 1: 22 Hz Band 2: 32 Hz Band 3: 44 Hz Band 4: 63 Hz Band 5: 90 Hz Band 6: 125 Hz Band 7: 175 Hz Band 8: 250 Hz Band 9: 350 Hz Band 10: 500 Hz Band 11: 700 Hz Band 12: 1000 Hz Band 13: 1400 Hz Band 14: 2000 Hz Band 15: 2800 Hz Band 16: 4000 Hz Band 17: 5600 Hz Band 18: 8000 Hz Band 19: 11000 Hz Band 20: 16000 Hz Band 21: 22000 Hz See also , , . Frequency bands: Band 1: 32 Hz Band 2: 100 Hz Band 3: 320 Hz Band 4: 1000 Hz Band 5: 3200 Hz Band 6: 10000 Hz See also , , . Allows frequencies other than the to pass. Threshold frequency for the filter, in Hz. Amount of boost in the frequency range near the cutoff frequency. Gain amount of the frequencies after the filter. Cuts frequencies lower than the and allows higher frequencies to pass. A limiter is similar to a compressor, but it's less flexible and designed to disallow sound going over a given dB threshold. Adding one in the Master bus is always recommended to reduce the effects of clipping. Soft clipping starts to reduce the peaks a little below the threshold level and progressively increases its effect as the input level increases such that the threshold is never exceeded. The waveform's maximum allowed value, in decibels. Value can range from -20 to -0.1. Threshold from which the limiter begins to be active, in decibels. Value can range from -30 to 0. Applies a gain to the limited waves, in decibels. Value can range from 0 to 6. Cuts frequencies higher than the and allows lower frequencies to pass. Attenuates frequencies in a narrow band around the and cuts frequencies outside of this range. Determines how much of an audio signal is sent to the left and right buses. Pan position. Value can range from -1 (fully left) to 1 (fully right). Combines phase-shifted signals with the original signal. The movement of the phase-shifted signals is controlled using a low-frequency oscillator. Determines the minimum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000. Determines the maximum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000. Adjusts the rate in Hz at which the effect sweeps up and down across the frequency range. Output percent of modified sound. Value can range from 0.1 to 0.9. Governs how high the filter frequencies sweep. Low value will primarily affect bass frequencies. High value can sweep high into the treble. Value can range from 0.1 to 4. Allows modulation of pitch independently of tempo. All frequencies can be increased/decreased with minimal effect on transients. Represents the size of the enum. Pitch value. Can range from 0 (-1 octave) to 16 (+16 octaves). Allows the user to record sound from a microphone. It sets and gets the format in which the audio file will be recorded (8-bit, 16-bit, or compressed). It checks whether or not the recording is active, and if it is, records the sound. It then returns the recorded sample. Specifies the format in which the sample will be recorded. See for available formats. If true, the sound will be recorded. Note that restarting the recording will remove the previously recorded sample. Returns whether the recording is active or not. Returns the recorded sample. Simulates rooms of different sizes. Its parameters can be adjusted to simulate the sound of a specific room. Time between the original signal and the early reflections of the reverb signal, in milliseconds. Output percent of predelay. Value can range from 0 to 1. Dimensions of simulated room. Bigger means more echoes. Value can range from 0 to 1. Defines how reflective the imaginary room's walls are. Value can range from 0 to 1. Widens or narrows the stereo image of the reverb tail. 1 means fully widens. Value can range from 0 to 1. High-pass filter passes signals with a frequency higher than a certain cutoff frequency and attenuates signals with frequencies lower than the cutoff frequency. Value can range from 0 to 1. Output percent of original sound. At 0, only modified sound is outputted. Value can range from 0 to 1. Output percent of modified sound. At 0, only original sound is outputted. Value can range from 0 to 1. Represents the size of the enum. Use the average value as magnitude. Use the maximum value as magnitude. is a low-level server interface for audio access. It is in charge of creating sample data (playable audio) as well as its playback via a voice interface. Two or fewer speakers were detected. A 3.1 channel surround setup was detected. A 5.1 channel surround setup was detected. A 7.1 channel surround setup was detected. Number of available audio buses. Name of the current device for audio output (see ). Scales the rate at which audio is played (i.e. setting it to 0.5 will make the audio be played twice as fast). Removes the bus at index index. Adds a bus at at_position. Moves the bus from index index to index to_index. Sets the name of the bus at index bus_idx to name. Returns the name of the bus with the index bus_idx. Returns the index of the bus with the name bus_name. Returns the amount of channels of the bus at index bus_idx. Sets the volume of the bus at index bus_idx to volume_db. Returns the volume of the bus at index bus_idx in dB. Connects the output of the bus at bus_idx to the bus named send. Returns the name of the bus that the bus at index bus_idx sends to. If true, the bus at index bus_idx is in solo mode. If true, the bus at index bus_idx is in solo mode. If true, the bus at index bus_idx is muted. If true, the bus at index bus_idx is muted. If true, the bus at index bus_idx is bypassing effects. If true, the bus at index bus_idx is bypassing effects. Adds an effect to the bus bus_idx at at_position. Removes the effect at index effect_idx from the bus at index bus_idx. Returns the number of effects on the bus at bus_idx. Returns the at position effect_idx in bus bus_idx. Returns the assigned to the given bus and effect indices (and optionally channel). Swaps the position of two effects in bus bus_idx. If true, the effect at index effect_idx on the bus at index bus_idx is enabled. If true, the effect at index effect_idx on the bus at index bus_idx is enabled. Returns the peak volume of the left speaker at bus index bus_idx and channel index channel. Returns the peak volume of the right speaker at bus index bus_idx and channel index channel. Locks the audio driver's main loop. Note: Remember to unlock it afterwards. Unlocks the audio driver's main loop. (After locking it, you should always unlock it.) Returns the speaker configuration. Returns the sample rate at the output of the . Returns the names of all audio devices detected on the system. Returns the relative time until the next mix occurs. Returns the relative time since the last mix occurred. Returns the audio driver's output latency. Returns the names of all audio input devices detected on the system. Name of the current device for audio input (see ). Sets which audio input device is used for audio capture. Overwrites the currently used . Generates an using the available buses and effects. Base class for audio streams. Audio streams are used for sound effects and music playback, and support WAV (via ) and OGG (via ) file formats. Returns the length of the audio stream in seconds. MP3 audio stream driver. Contains the audio data in bytes. If true, the stream will automatically loop when it reaches the end. Time in seconds at which the stream starts after being looped. OGG Vorbis audio stream driver. Contains the audio data in bytes. If true, the stream will automatically loop when it reaches the end. Time in seconds at which the stream starts after being looped. Can play, loop, pause a scroll through audio. See and for usage. Plays an audio stream non-positionally. To play audio positionally, use or instead of . The audio will be played only on the first channel. The audio will be played on all surround channels. The audio will be played on the second channel, which is usually the center. The object to be played. Volume of sound, in dB. The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. If true, audio is playing. If true, audio plays when added to scene tree. If true, the playback is paused. You can resume it by setting stream_paused to false. If the audio configuration has more than two speakers, this sets the target channels. See constants. Bus on which this audio is playing. Plays the audio from the given from_position, in seconds. Sets the position from which audio will be played, in seconds. Stops the audio. Returns the position in the in seconds. Returns the object associated with this . Plays audio that dampens with distance from screen center. See also to play a sound non-positionally. Note: Hiding an node does not disable its audio output. To temporarily disable an 's audio output, set to a very low value like -100 (which isn't audible to human hearing). The object to be played. Base volume without dampening. The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. If true, audio is playing. If true, audio plays when added to scene tree. If true, the playback is paused. You can resume it by setting stream_paused to false. Maximum distance from which audio is still hearable. Dampens audio over distance with this as an exponent. Bus on which this audio is playing. Areas in which this sound plays. Plays the audio from the given position from_position, in seconds. Sets the position from which audio will be played, in seconds. Stops the audio. Returns the position in the . Returns the object associated with this . Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space. For greater realism, a low-pass filter is automatically applied to distant sounds. This can be disabled by setting to 20500. By default, audio is heard from the camera position. This can be changed by adding a node to the scene and enabling it by calling on it. See also to play a sound non-positionally. Note: Hiding an node does not disable its audio output. To temporarily disable an 's audio output, set to a very low value like -100 (which isn't audible to human hearing). Linear dampening of loudness according to distance. Squared dampening of loudness according to distance. Logarithmic dampening of loudness according to distance. No dampening of loudness according to distance. The sound will still be heard positionally, unlike an . Mix this audio in, even when it's out of range. This increases CPU usage, but keeps the sound playing at the correct position if the camera leaves and enters the 's radius. Pause this audio when it gets out of range. This decreases CPU usage, but will cause the sound to restart if the camera leaves and enters the 's radius. Disables doppler tracking. Executes doppler tracking in idle step. Executes doppler tracking in physics step. The resource to be played. Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation. The base sound level unaffected by dampening, in decibels. The factor for the attenuation effect. Higher values make the sound audible over a larger distance. Sets the absolute maximum of the soundlevel, in decibels. The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. If true, audio is playing. If true, audio plays when the AudioStreamPlayer3D node is added to scene tree. If true, the playback is paused. You can resume it by setting to false. Sets the distance from which the takes effect. Has no effect if set to 0. Decides if audio should pause when source is outside of range. The bus on which this audio is playing. Areas in which this sound plays. If true, the audio should be dampened according to the direction of the sound. The angle in which the audio reaches cameras undampened. Dampens audio if camera is outside of and is set by this factor, in decibels. Dampens audio using a low-pass filter above this frequency, in Hz. To disable the dampening effect entirely, set this to 20500 as this frequency is above the human hearing limit. Amount how much the filter affects the loudness, in decibels. Decides in which step the Doppler effect should be calculated. Plays the audio from the given position from_position, in seconds. Sets the position from which audio will be played, in seconds. Stops the audio. Returns the position in the . Returns the object associated with this . Randomly varies pitch on each start. The current . The intensity of random pitch variation. AudioStreamSample stores sound samples loaded from WAV files. To play the stored sound, use an (for non-positional audio) or / (for positional audio). The sound can be looped. This class can also be used to store dynamically-generated PCM audio data. Audio does not loop. Audio loops the data between and , playing forward only. Audio loops the data between and , playing back and forth. Audio loops the data between and , playing backward only. 8-bit audio codec. 16-bit audio codec. Audio is compressed using IMA ADPCM. Contains the audio data in bytes. Note: This property expects signed PCM8 data. To convert unsigned PCM8 to signed PCM8, subtract 128 from each byte. Audio format. See constants for values. The loop mode. This information will be imported automatically from the WAV file if present. See constants for values. The loop start point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present. The loop end point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present. The sample rate for mixing this audio. If true, audio is stereo. Saves the AudioStreamSample as a WAV file to path. Samples with IMA ADPCM format can't be saved. Note: A .wav extension is automatically appended to path if it is missing. Node for back-buffering the currently-displayed screen. The region defined in the BackBufferCopy node is buffered with the content of the screen it covers, or the entire screen according to the copy mode set. Use the texture(SCREEN_TEXTURE, ...) function in your shader scripts to access the buffer. Note: Since this node inherits from (and not ), anchors and margins won't apply to child -derived nodes. This can be problematic when resizing the window. To avoid this, add -derived nodes as siblings to the BackBufferCopy node instead of adding them as children. Disables the buffering mode. This means the BackBufferCopy node will directly use the portion of screen it covers. BackBufferCopy buffers a rectangular region. BackBufferCopy buffers the entire screen. Buffer mode. See constants. The area covered by the BackBufferCopy. Only used if is . Baked lightmaps are an alternative workflow for adding indirect (or baked) lighting to a scene. Unlike the approach, baked lightmaps work fine on low-end PCs and mobile devices as they consume almost no resources in run-time. The lowest bake quality mode. Fastest to calculate. The default bake quality mode. A higher bake quality mode. Takes longer to calculate. The highest bake quality mode. Takes the longest to calculate. Baking was successful. Returns if no viable save path is found. This can happen where an is not specified or when the save location is invalid. Currently unused. Returns when the baker cannot save per-mesh textures to file. The size of the generated lightmaps is too large. Some mesh contains UV2 values outside the [0,1] range. Returns if user cancels baking. No environment is used during baking. The baked environment is automatically picked from the current scene. A custom sky is used as environment during baking. A custom solid color is used as environment during baking. Size of the baked lightmap. Only meshes inside this region will be included in the baked lightmap, also used as the bounds of the captured region for dynamic lighting. Determines the amount of samples per texel used in indrect light baking. The amount of samples for each quality level can be configured in the project settings. Number of light bounces that are taken into account during baking. When enabled, a lightmap denoiser will be used to reduce the noise inherent to Monte Carlo based global illumination. If true, stores the lightmap textures in a high dynamic range format (EXR). If false, stores the lightmap texture in a low dynamic range PNG image. This can be set to false to reduce disk usage, but light values over 1.0 will be clamped and you may see banding caused by the reduced precision. Note: Setting to true will decrease lightmap banding even when using the GLES2 backend or if is false. Store full color values in the lightmap textures. When disabled, lightmap textures will store a single brightness channel. Can be disabled to reduce disk usage if the scene contains only white lights or you don't mind losing color information in indirect lighting. Raycasting bias used during baking to avoid floating point precission issues. If a baked mesh doesn't have a UV2 size hint, this value will be used to roughly compute a suitable lightmap size. When enabled, the lightmapper will merge the textures for all meshes into a single large layered texture. Not supported in GLES2. Maximum size of each lightmap layer, only used when is enabled. Decides which environment to use during baking. The resource to use when is set o . The rotation of the baked custom sky. The environment color when is set to . The energy scaling factor when when is set to or . Minimum ambient light for all the lightmap texels. This doesn't take into account any occlusion from the scene's geometry, it simply ensures a minimum amount of light on all the lightmap texels. Can be used for artistic control on shadow color. When enabled, an octree containing the scene's lighting information will be computed. This octree will then be used to light dynamic objects in the scene. Grid size used for real-time capture information on dynamic objects. Bake quality of the capture data. Bias value to reduce the amount of light proagation in the captured octree. Deprecated, in previous versions it determined the location where lightmaps were be saved. The calculated light data. Bakes the lightmap, scanning from the given from_node root and saves the resulting in data_save_path. If no save path is provided it will try to match the path from the current . Global energy multiplier for baked and dynamic capture objects. Controls whether dynamic capture objects receive environment lighting or not. BaseButton is the abstract base class for buttons, so it shouldn't be used directly (it doesn't display anything). Other types of buttons inherit from it. Require just a press to consider the button clicked. Require a press and a subsequent release before considering the button clicked. The normal state (i.e. not pressed, not hovered, not toggled and enabled) of buttons. The state of buttons are pressed. The state of buttons are hovered. The state of buttons are disabled. The state of buttons are both hovered and pressed. If true, the button is in disabled state and can't be clicked or toggled. If true, the button is in toggle mode. Makes the button flip state between pressed and unpressed each time its area is clicked. If true, the button will add information about its shortcut in the tooltip. If true, the button's state is pressed. Means the button is pressed down or toggled (if is active). Determines when the button is considered clicked, one of the constants. Binary mask to choose which mouse buttons this button will respond to. To allow both left-click and right-click, use BUTTON_MASK_LEFT | BUTTON_MASK_RIGHT. Deprecated. This property has been deprecated due to redundancy and no longer has any effect when set. Please use instead. If true, the button stays pressed when moving the cursor outside the button while pressing it. Note: This property only affects the button's visual appearance. Signals will be emitted at the same moment regardless of this property's value. associated to the button. associated to the button. Called when the button is pressed. If you need to know the button's pressed state (and is active), use instead. Called when the button is toggled (only if is active). Returns true if the mouse has entered the button and has not left it yet. Returns the visual state used to draw the button. This is useful mainly when implementing your own draw code by either overriding _draw() or connecting to "draw" signal. The visual state of the button is defined by the enum. A two-dimensional array of boolean values, can be used to efficiently store a binary matrix (every matrix element takes only one bit) and query the values using natural cartesian coordinates. Creates a bitmap with the specified size, filled with false. Creates a bitmap that matches the given image dimensions, every element of the bitmap is set to false if the alpha value of the image at that position is equal to threshold or less, and true in other case. Sets the bitmap's element at the specified position, to the specified value. Returns bitmap's value at the specified position. Sets a rectangular portion of the bitmap to the specified value. Returns the amount of bitmap elements that are set to true. Returns bitmap's dimensions. Applies morphological dilation to the bitmap. The first argument is the dilation amount, Rect2 is the area where the dilation will be applied. Renders text using *.fnt fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see . Total font height (ascent plus descent) in pixels. Ascent (number of pixels above the baseline). If true, distance field hint is enabled. The fallback font. Creates a BitmapFont from the *.fnt file at path. Adds a kerning pair to the as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character. Returns a kerning pair as a difference. Adds a texture to the . Adds a character to the font, where character is the Unicode value, texture is the texture index, rect is the region in the texture (in pixels!), align is the (optional) alignment for the character and advance is the (optional) advance. If the parameter is null, then the default value is new Vector2(0, 0) Returns the number of textures in the BitmapFont atlas. Returns the font atlas texture at index idx. Clears all the font data and settings. Use a hierarchy of Bone2D bound to a to control, and animate other nodes. You can use Bone2D and Skeleton2D nodes to animate 2D meshes created with the Polygon 2D UV editor. Each bone has a transform that you can reset to with . These rest poses are relative to the bone's parent. If in the editor, you can set the rest pose of an entire skeleton using a menu option, from the code, you need to iterate over the bones to set their individual rest poses. Rest transform of the bone. You can reset the node's transforms to this value using . Length of the bone's representation drawn in the editor's viewport in pixels. Stores the node's current transforms in . Returns the node's Transform2D if it doesn't have a parent, or its rest pose relative to its parent. Returns the node's index as part of the entire skeleton. See . This node must be the child of a node. You can then select a bone for this node to attach to. The BoneAttachment node will copy the transform of the selected bone. The name of the attached bone. Arranges child controls vertically or horizontally, and rearranges the controls automatically when their minimum size changes. Aligns children with the beginning of the container. Aligns children with the center of the container. Aligns children with the end of the container. The alignment of the container's children (must be one of , or ). Adds a control to the box as a spacer. If true, begin will insert the spacer control in front of other children. 3D box shape that can be a child of a or . The box's half extents. The width, height and depth of this shape is twice the half extents. Button is the standard themed button. It can contain text and an icon, and will display them according to the current . Example of creating a button and assigning an action when pressed by code: func _ready(): var button = Button.new() button.text = "Click me" button.connect("pressed", self, "_button_pressed") add_child(button) func _button_pressed(): print("Hello world!") Buttons (like all Control nodes) can also be created in the editor, but some situations may require creating them from code. See also which contains common properties and methods associated with this node. Note: Buttons do not interpret touch input and therefore don't support multitouch, since mouse emulation can only press one button at a given time. Use for buttons that trigger gameplay movement or actions, as supports multitouch. Align the text to the left. Align the text to the center. Align the text to the right. The button's text that will be displayed inside the button's area. Button's icon, if text is present the icon will be placed before the text. Flat buttons don't display decoration. When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text. Text alignment policy for the button's text, use one of the constants. When enabled, the button's icon will expand/shrink to fit the button's size while keeping its aspect. Group of . All direct and indirect children buttons become radios. Only one allows being pressed. should be true. Returns the current pressed button. Returns an of s who have this as their (see ). CPU-based 3D particle node used to create a variety of particle systems and effects. See also , which provides the same functionality with hardware acceleration, but may not run on older devices. Note: Unlike , the visibility rect is generated on-the-fly and doesn't need to be configured by the user. Use with to set . Use with to set . Use with to set . Represents the size of the enum. All particles will be emitted from a single point. Particles will be emitted in the volume of a sphere. Particles will be emitted in the volume of a box. Particles will be emitted at a position chosen randomly among . Particle color will be modulated by . Particles will be emitted at a position chosen randomly among . Particle velocity and rotation will be set based on . Particle color will be modulated by . Represents the size of the enum. Use with , , and to set initial velocity properties. Use with , , and to set angular velocity properties. Use with , , and to set orbital velocity properties. Use with , , and to set linear acceleration properties. Use with , , and to set radial acceleration properties. Use with , , and to set tangential acceleration properties. Use with , , and to set damping properties. Use with , , and to set angle properties. Use with , , and to set scale properties. Use with , , and to set hue variation properties. Use with , , and to set animation speed properties. Use with , , and to set animation offset properties. Represents the size of the enum. Particles are drawn in the order emitted. Particles are drawn in order of remaining lifetime. Particles are drawn in order of depth. If true, particles are being emitted. The number of particles emitted in one emission cycle (corresponding to the ). Note: Changing will reset the particle emission, therefore removing all particles that were already emitted before changing . The amount of time each particle will exist (in seconds). If true, only one emission cycle occurs. If set true during a cycle, emission will stop at the cycle's end. Particle system starts as if it had already run for this many seconds. Particle system's running speed scaling ratio. A value of 0 can be used to pause the particles. How rapidly particles in an emission cycle are emitted. If greater than 0, there will be a gap in emissions before the next cycle begins. Emission lifetime randomness ratio. Particle lifetime randomness ratio. The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself. If true, results in fractional delta calculation which has a smoother particles display effect. If true, particles use the parent node's coordinate space. If false, they use global coordinates. Particle draw order. Uses values. The used for each particle. If null, particles will be spheres. Particles will be emitted inside this region. See for possible values. The sphere's radius if is set to . The rectangle's extents if is set to . Sets the initial positions to spawn particles when using or . Sets the direction the particles will be emitted in when using . Sets the s to modulate particles by when using or . Align Y axis of particle with the direction of its velocity. If true, particles rotate around Y axis by . If true, particles will not move on the z axis. Unit vector specifying the particles' emission direction. Each particle's initial direction range from +spread to -spread degrees. Applied to X/Z plane and Y/Z planes. Amount of in Y/Z plane. A value of 1 restricts particles to X/Z plane. Gravity applied to every particle. Initial velocity magnitude for each particle. Direction comes from and the node's orientation. Initial velocity randomness ratio. Initial angular velocity applied to each particle. Sets the speed of rotation of the particle. Angular velocity randomness ratio. Each particle's angular velocity will vary along this . Orbital velocity applied to each particle. Makes the particles circle around origin in the local XY plane. Specified in number of full rotations around origin per second. This property is only available when is true. Orbital velocity randomness ratio. Each particle's orbital velocity will vary along this . Linear acceleration applied to each particle in the direction of motion. Linear acceleration randomness ratio. Each particle's linear acceleration will vary along this . Radial acceleration applied to each particle. Makes particle accelerate away from origin. Radial acceleration randomness ratio. Each particle's radial acceleration will vary along this . Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. Tangential acceleration randomness ratio. Each particle's tangential acceleration will vary along this . The rate at which particles lose velocity. Damping randomness ratio. Damping will vary along this . Initial rotation applied to each particle, in degrees. Rotation randomness ratio. Each particle's rotation will be animated along this . Initial scale applied to each particle. Scale randomness ratio. Each particle's scale will vary along this . Unused for 3D particles. Unused for 3D particles. Initial hue variation applied to each particle. Hue variation randomness ratio. Each particle's hue will vary along this . Particle animation speed. Animation speed randomness ratio. Each particle's animation speed will vary along this . Particle animation offset. Animation offset randomness ratio. Each particle's animation offset will vary along this . Restarts the particle emitter. Sets the base value of the parameter specified by . Returns the base value of the parameter specified by . Sets the randomness factor of the parameter specified by . Returns the randomness factor of the parameter specified by . Sets the of the parameter specified by . Returns the of the parameter specified by . Enables or disables the given flag (see for options). Returns the enabled state of the given flag (see for options). Sets this node's properties to match a given node with an assigned . CPU-based 2D particle node used to create a variety of particle systems and effects. See also , which provides the same functionality with hardware acceleration, but may not run on older devices. Note: Unlike , the visibility rect is generated on-the-fly and doesn't need to be configured by the user. Use with to set . Present for consistency with 3D particle nodes, not used in 2D. Present for consistency with 3D particle nodes, not used in 2D. Represents the size of the enum. All particles will be emitted from a single point. Particles will be emitted on the surface of a sphere flattened to two dimensions. Particles will be emitted in the area of a rectangle. Particles will be emitted at a position chosen randomly among . Particle color will be modulated by . Particles will be emitted at a position chosen randomly among . Particle velocity and rotation will be set based on . Particle color will be modulated by . Represents the size of the enum. Use with , , and to set initial velocity properties. Use with , , and to set angular velocity properties. Use with , , and to set orbital velocity properties. Use with , , and to set linear acceleration properties. Use with , , and to set radial acceleration properties. Use with , , and to set tangential acceleration properties. Use with , , and to set damping properties. Use with , , and to set angle properties. Use with , , and to set scale properties. Use with , , and to set hue variation properties. Use with , , and to set animation speed properties. Use with , , and to set animation offset properties. Represents the size of the enum. Particles are drawn in the order emitted. Particles are drawn in order of remaining lifetime. If true, particles are being emitted. The number of particles emitted in one emission cycle (corresponding to the ). Note: Changing will reset the particle emission, therefore removing all particles that were already emitted before changing . The amount of time each particle will exist (in seconds). If true, only one emission cycle occurs. If set true during a cycle, emission will stop at the cycle's end. Particle system starts as if it had already run for this many seconds. Particle system's running speed scaling ratio. A value of 0 can be used to pause the particles. How rapidly particles in an emission cycle are emitted. If greater than 0, there will be a gap in emissions before the next cycle begins. Emission lifetime randomness ratio. Particle lifetime randomness ratio. The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. If true, results in fractional delta calculation which has a smoother particles display effect. If true, particles use the parent node's coordinate space. If false, they use global coordinates. Particle draw order. Uses values. Particle texture. If null, particles will be squares. Normal map to be used for the property. Note: Godot expects the normal map to use X+, Y-, and Z+ coordinates. See this page for a comparison of normal map coordinates expected by popular engines. Particles will be emitted inside this region. See for possible values. The sphere's radius if is set to . The rectangle's extents if is set to . Sets the initial positions to spawn particles when using or . Sets the direction the particles will be emitted in when using . Sets the s to modulate particles by when using or . Align Y axis of particle with the direction of its velocity. Unit vector specifying the particles' emission direction. Each particle's initial direction range from +spread to -spread degrees. Gravity applied to every particle. Initial velocity magnitude for each particle. Direction comes from and the node's orientation. Initial velocity randomness ratio. Initial angular velocity applied to each particle. Sets the speed of rotation of the particle. Angular velocity randomness ratio. Each particle's angular velocity will vary along this . Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. Orbital velocity randomness ratio. Each particle's orbital velocity will vary along this . Linear acceleration applied to each particle in the direction of motion. Linear acceleration randomness ratio. Each particle's linear acceleration will vary along this . Radial acceleration applied to each particle. Makes particle accelerate away from origin. Radial acceleration randomness ratio. Each particle's radial acceleration will vary along this . Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. Tangential acceleration randomness ratio. Each particle's tangential acceleration will vary along this . The rate at which particles lose velocity. Damping randomness ratio. Damping will vary along this . Initial rotation applied to each particle, in degrees. Rotation randomness ratio. Each particle's rotation will be animated along this . Initial scale applied to each particle. Scale randomness ratio. Each particle's scale will vary along this . Each particle's initial color. If is defined, it will be multiplied by this color. Each particle's color will vary along this . Initial hue variation applied to each particle. Hue variation randomness ratio. Each particle's hue will vary along this . Particle animation speed. Animation speed randomness ratio. Each particle's animation speed will vary along this . Particle animation offset. Animation offset randomness ratio. Each particle's animation offset will vary along this . Restarts the particle emitter. Sets the base value of the parameter specified by . Returns the base value of the parameter specified by . Sets the randomness factor of the parameter specified by . Returns the randomness factor of the parameter specified by . Sets the of the parameter specified by . Returns the of the parameter specified by . Enables or disables the given flag (see for options). Returns the enabled state of the given flag (see for options). Sets this node's properties to match a given node with an assigned . This node allows you to create a box for use with the CSG system. Width of the box measured from the center of the box. Height of the box measured from the center of the box. Depth of the box measured from the center of the box. The material used to render the box. For complex arrangements of shapes, it is sometimes needed to add structure to your CSG nodes. The CSGCombiner node allows you to create this structure. The node encapsulates the result of the CSG operations of its children. In this way, it is possible to do operations on one set of shapes that are children of one CSGCombiner node, and a set of separate operations on a second set of shapes that are children of a second CSGCombiner node, and then do an operation that takes the two end results as its input to create the final shape. This node allows you to create a cylinder (or cone) for use with the CSG system. The radius of the cylinder. The height of the cylinder. The number of sides of the cylinder, the higher this number the more detail there will be in the cylinder. If true a cone is created, the will only apply to one side. If true the normals of the cylinder are set to give a smooth effect making the cylinder seem rounded. If false the cylinder will have a flat shaded look. The material used to render the cylinder. This CSG node allows you to use any mesh resource as a CSG shape, provided it is closed, does not self-intersect, does not contain internal faces and has no edges that connect to more then two faces. The resource to use as a CSG shape. The used in drawing the CSG shape. This node takes a 2D polygon shape and extrudes it to create a 3D mesh. Slice is not rotated. Slice is rotated around the up vector of the path. Slice is rotate to match the path exactly. Shape is extruded to . Shape is extruded by rotating it around an axis. Shape is extruded along a path set by a set in . Point array that defines the shape that we'll extrude. Extrusion mode. Extrusion depth when is . Degrees to rotate our extrusion for each slice when is . Number of extrusion when is . The object containing the path along which we extrude when is . Interval at which a new extrusion slice is added along the path when is . The method by which each slice is rotated along the path when is . If false we extrude centered on our path, if true we extrude in relation to the position of our CSGPolygon when is . If true the u component of our uv will continuously increase in unison with the distance traveled along our path when is . If true the start and end of our path are joined together ensuring there is no seam when is . Generates smooth normals so smooth shading is applied to our mesh. Material to use for the resulting mesh. Parent class for various CSG primitives. It contains code and functionality that is common between them. It cannot be used directly. Instead use one of the various classes that inherit from it. Invert the faces of the mesh. This is the CSG base class that provides CSG operation support to the various CSG nodes in Godot. Geometry of both primitives is merged, intersecting geometry is removed. Only intersecting geometry remains, the rest is removed. The second shape is subtracted from the first, leaving a dent with its shape. The operation that is performed on this shape. This is ignored for the first CSG child node as the operation is between this node and the previous child of this nodes parent. Snap makes the mesh snap to a given distance so that the faces of two meshes can be perfectly aligned. A lower value results in greater precision but may be harder to adjust. Calculate tangents for the CSG shape which allows the use of normal maps. This is only applied on the root shape, this setting is ignored on any child. Adds a collision shape to the physics engine for our CSG shape. This will always act like a static body. Note that the collision shape is still active even if the CSG shape itself is hidden. The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See Collision layers and masks in the documentation for more information. The physics layers this CSG shape scans for collisions. See Collision layers and masks in the documentation for more information. Returns true if this is a root shape and is thus the object that is rendered. Sets individual bits on the collision mask. Use this if you only need to change one layer's value. Returns an individual bit on the collision mask. Sets individual bits on the layer mask. Use this if you only need to change one layer's value. Returns an individual bit on the collision mask. Returns an with two elements, the first is the of this node and the second is the root of this node. Only works when this node is the root shape. This node allows you to create a sphere for use with the CSG system. Radius of the sphere. Number of vertical slices for the sphere. Number of horizontal slices for the sphere. If true the normals of the sphere are set to give a smooth effect making the sphere seem rounded. If false the sphere will have a flat shaded look. The material used to render the sphere. This node allows you to create a torus for use with the CSG system. The inner radius of the torus. The outer radius of the torus. The number of slices the torus is constructed of. The number of edges each ring of the torus is constructed of. If true the normals of the torus are set to give a smooth effect making the torus seem rounded. If false the torus will have a flat shaded look. The material used to render the torus. This class represents a C# script. It is the C# equivalent of the class and is only available in Mono-enabled Godot builds. See also . Returns a new instance of the script. Camera is a special node that displays what is visible from its current location. Cameras register themselves in the nearest 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 , and, without one, a scene registered in that (or higher viewports) can't be displayed. 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. 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. Perspective projection. Objects on the screen becomes smaller when they are far away. Orthogonal projection, also known as orthographic projection. Objects remain the same size on the screen no matter how far away they are. Frustum projection. This mode allows adjusting to create "tilted frustum" effects. Disables Doppler effect simulation (default). Simulate Doppler effect by tracking positions of objects that are changed in _process. Changes in the relative velocity of this camera compared to those objects affect how Audio is perceived (changing the Audio's pitch shift). Simulate Doppler effect by tracking positions of objects that are changed in _physics_process. Changes in the relative velocity of this camera compared to those objects affect how Audio is perceived (changing the Audio's pitch shift). The axis to lock during / adjustments. Can be either or . The culling mask that describes which 3D render layers are rendered by this camera. The to use for this camera. The horizontal (X) offset of the camera viewport. The vertical (Y) offset of the camera viewport. If not , this camera will simulate the Doppler effect for objects changed in particular _process methods. See for possible values. The camera's projection mode. In mode, objects' Z distance from the camera's local space scales their perceived size. If true, the ancestor is currently using this camera. The camera's field of view angle (in degrees). Only applicable in perspective mode. Since locks one axis, fov sets the other axis' field of view angle. For reference, the default vertical field of view value (75.0) 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 The camera's size measured as 1/2 the width or height. Only applicable in orthogonal mode. Since locks on axis, size sets the other axis' size length. The camera's frustum offset. This can be changed from the default to create "tilted frustum" effects such as Y-shearing. The distance to the near culling boundary for this camera relative to its local Z axis. The distance to the far culling boundary for this camera relative to its local Z axis. Returns a normal vector in worldspace, that is the result of projecting a point on the rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. Returns a normal vector from the screen point location directed along the camera. Orthogonal cameras are normalized. Perspective cameras account for perspective, screen width/height, etc. Returns a 3D position in worldspace, that is the result of projecting a point on the rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. Returns the 2D coordinate in the rectangle that maps to the given 3D point in worldspace. Note: When using this to position GUI elements over a 3D viewport, use to prevent them from appearing if the 3D point is behind the camera: # This code block is part of a script that inherits from Spatial. # `control` is a reference to a node inheriting from Control. control.visible = not get_viewport().get_camera().is_position_behind(global_transform.origin) control.rect_position = get_viewport().get_camera().unproject_position(global_transform.origin) Returns true if the given position is behind the camera. Note: A position which returns false may still be outside the camera's field of view. Returns the 3D point in worldspace that maps to the given 2D coordinate in the rectangle on a plane that is the given z_depth distance into the scene away from the camera. Sets the camera projection to perspective mode (see ), by specifying a fov (field of view) angle in degrees, and the z_near and z_far clip planes in world-space units. Sets the camera projection to orthogonal mode (see ), by specifying a size, and the z_near and z_far clip planes in world-space units. (As a hint, 2D games often use this projection, with values specified in pixels.) Sets the camera projection to frustum mode (see ), by specifying a size, an offset, and the z_near and z_far clip planes in world-space units. Makes this camera the current camera for the (see class description). If the camera node is outside the scene tree, it will attempt to become current once it's added. If this is the current camera, remove it from being current. If enable_next is true, request to make the next camera current, if any. Gets the camera transform. Subclassed cameras such as may provide different transforms than the transform. Returns the camera's frustum planes in world-space units as an array of s in the following order: near, far, left, top, right, bottom. Not to be confused with . Returns the camera's RID from the . Enables or disables the given layer in the . Returns true if the given layer in the is enabled, false otherwise. 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 -based nodes. This node is intended to be a simple helper to get things going quickly and it may happen that more functionality is desired to change how the camera works. To make your own custom camera node, inherit from and change the transform of the canvas by setting in (you can obtain the current by using ). Note that the node's position doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use to get the real position. The camera updates with the _physics_process callback. The camera updates with the _process callback. The camera's position is fixed so that the top-left corner is always at the origin. The camera's position takes into account vertical/horizontal offsets and the screen size. The camera's offset, useful for looking around or camera shake animations. The Camera2D's anchor point. See constants. If true, the camera rotates with the target. If true, the camera is the active camera for the current scene. Only one camera can be current, so setting a different camera current will disable this one. The camera's zoom relative to the viewport. Values larger than Vector2(1, 1) zoom out and smaller values zoom in. For an example, use Vector2(0.5, 0.5) for a 2× zoom-in, and Vector2(4, 4) for a 4× zoom-out. The custom node attached to the . If null or not a , uses the default viewport instead. The camera's process callback. See . Left scroll limit in pixels. The camera stops moving when reaching this value. Top scroll limit in pixels. The camera stops moving when reaching this value. Right scroll limit in pixels. The camera stops moving when reaching this value. Bottom scroll limit in pixels. The camera stops moving when reaching this value. If true, the camera smoothly stops when reaches its limits. If true, the camera only moves when reaching the horizontal drag margins. If false, the camera moves horizontally regardless of margins. If true, the camera only moves when reaching the vertical drag margins. If false, the camera moves vertically regardless of margins. If true, the camera smoothly moves towards the target at . Speed in pixels per second of the camera's smoothing effect when is true. The horizontal offset of the camera, relative to the drag margins. Note: Offset H is used only to force offset relative to margins. It's not updated in any way if drag margins are enabled and can be used to set initial offset. The vertical offset of the camera, relative to the drag margins. Note: Used the same as . Left margin needed to drag the camera. A value of 1 makes the camera move only when reaching the edge of the screen. Top margin needed to drag the camera. A value of 1 makes the camera move only when reaching the edge of the screen. Right margin needed to drag the camera. A value of 1 makes the camera move only when reaching the edge of the screen. Bottom margin needed to drag the camera. A value of 1 makes the camera move only when reaching the edge of the screen. If true, draws the camera's screen rectangle in the editor. If true, draws the camera's limits rectangle in the editor. If true, draws the camera's drag margin rectangle in the editor. Make this the current 2D camera for the scene (viewport and layer), in case there are many cameras in the scene. Removes any from the ancestor 's internal currently-assigned camera. Sets the specified camera limit. See also , , , and . Returns the specified camera limit. See also , , , and . Sets the specified margin. See also , , , and . Returns the specified margin. See also , , , and . Returns the camera position. Returns the location of the 's screen-center, relative to the origin. Forces the camera to update scroll immediately. Sets the camera's position immediately to its current smoothing destination. This has no effect if smoothing is disabled. Aligns the camera to the tracked node. A camera feed gives you access to a single physical camera attached to your device. When enabled, Godot will start capturing frames from the camera which can then be used. Note: Many cameras will return YCbCr images which are split into two textures and need to be combined in a shader. Godot does this automatically for you if you set the environment to show the camera image in the background. No image set for the feed. Feed supplies RGB images. Feed supplies YCbCr images that need to be converted to RGB. Feed supplies separate Y and CbCr images that need to be combined and converted to RGB. Unspecified position. Camera is mounted at the front of the device. Camera is mounted at the back of the device. If true, the feed is active. The transform applied to the camera's image. Returns the unique ID for this feed. Returns the camera's name. Returns the position of camera on the device. The keeps track of different cameras accessible in Godot. These are external cameras such as webcams or the cameras on your phone. It is notably used to provide AR modules with a video feed from the camera. The RGBA camera image. The YCbCr camera image. The Y component camera image. The CbCr component camera image. Returns the with this id. Returns the number of s registered. Returns an array of s. Adds a camera feed to the camera server. Removes a . This texture gives access to the camera texture provided by a . Note: Many cameras supply YCbCr images which need to be converted in a shader. The ID of the for which we want to display the image. Which image within the we want access to, important if the camera image is split in a Y and CbCr component. Convenience property that gives access to the active property of the . Base class of anything 2D. Canvas items are laid out in a tree; children inherit and extend their parent's transform. is extended by for anything GUI-related, and by for anything related to the 2D engine. Any can draw. For this, must be called, then will be received on idle time to request redraw. Because of this, canvas items don't need to be redrawn on every frame, improving the performance significantly. Several functions for drawing on the are provided (see draw_* functions). However, they can only be used inside the , signal or virtual functions. Canvas items are drawn in tree order. By default, children are on top of their parents so a root will be drawn behind everything. This behavior can be changed on a per-item basis. A can also be hidden, which will also hide its children. It provides many ways to change parameters such as modulation (for itself and its children) and self modulation (only for itself), as well as its blend mode. Ultimately, a transform notification can be requested, which will notify the node that its global position changed in case the parent tree changed. Note: Unless otherwise specified, all methods that have angle parameters must have angles specified as radians. To convert degrees to radians, use @GDScript.deg2rad. The 's transform has changed. This notification is only received if enabled by or . The is requested to draw. The 's visibility has changed. The has entered the canvas. The has exited the canvas. Mix blending mode. Colors are assumed to be independent of the alpha (opacity) value. Additive blending mode. Subtractive blending mode. Multiplicative blending mode. Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value. Disables blending mode. Colors including alpha are written as-is. Only applicable for render targets with a transparent background. No lighting will be applied. If true, this is drawn. The node is only visible if all of its antecedents are visible as well (in other words, must return true). Note: For controls that inherit , the correct way to make them visible is to call one of the multiple popup*() functions instead. The color applied to textures on this . The color applied to textures on this . This is not inherited by children s. If true, the object draws behind its parent. If true, the object draws on top of its parent. The rendering layers in which this responds to nodes. The material applied to textures on this . If true, the parent 's property is used as this one's material. Overridable function called by the engine (if defined) to draw the canvas item. Returns the canvas item RID used by for this item. Returns true if the node is present in the , its property is true and all its antecedents are also visible. If any antecedent is hidden, this node will not be visible in the scene tree. Show the if it's currently hidden. For controls that inherit , the correct way to make them visible is to call one of the multiple popup*() functions instead. Hide the if it's currently visible. Queue the for update. will be called on idle time to request redraw. If enable is true, the node won't inherit its transform from parent canvas items. Returns true if the node is set as top-level. See . Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. Draws interconnected line segments with a uniform color and width and optional antialiasing. Draws interconnected line segments with a uniform width, segment-by-segment coloring, and optional antialiasing. Colors assigned to line segments match by index between points and colors. Draws an arc between the given angles. The larger the value of point_count, the smoother the curve. Draws multiple, parallel lines with a uniform color. Note: width and antialiased are currently not implemented and have no effect. Draws multiple, parallel lines with a uniform width and segment-by-segment coloring. Colors assigned to line segments match by index between points and colors. Note: width and antialiased are currently not implemented and have no effect. Draws a rectangle. If filled is true, the rectangle will be filled with the color specified. If filled is false, the rectangle will be drawn as a stroke with the color and width specified. If antialiased is true, the lines will be antialiased. Note: width and antialiased are only effective if filled is false. Draws a colored circle. Draws a texture at a given position. If the parameter is null, then the default value is new Color(1, 1, 1, 1) Draws a textured rectangle at a given position, optionally modulated by a color. If transpose is true, the texture will have its X and Y coordinates swapped. If the parameter is null, then the default value is new Color(1, 1, 1, 1) Draws a textured rectangle region at a given position, optionally modulated by a color. If transpose is true, the texture will have its X and Y coordinates swapped. If the parameter is null, then the default value is new Color(1, 1, 1, 1) Draws a styled rectangle. Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle and 4 points for a quad. Draws a polygon of any amount of points, convex or concave. If the parameter is null, then the default value is new Vector2[] {} Draws a colored polygon of any amount of points, convex or concave. If the parameter is null, then the default value is new Vector2[] {} Draws text using the specified font at the position (bottom-left corner using the baseline of the font). The text will have its color multiplied by modulate. If clip_w is greater than or equal to 0, the text will be clipped if it exceeds the specified width. Example using the default project font: # If using this method in a script that redraws constantly, move the # `default_font` declaration to a member variable assigned in `_ready()` # so the Control is only created once. var default_font = Control.new().get_font("font") draw_string(default_font, Vector2(64, 64), "Hello world") See also . If the parameter is null, then the default value is new Color(1, 1, 1, 1) Draws a string character using a custom font. Returns the advance, depending on the character width and kerning with an optional next character. If the parameter is null, then the default value is new Color(1, 1, 1, 1) Draws a in 2D, using the provided texture. See for related documentation. If the parameter is null, then the default value is Transform2D.Identity If the parameter is null, then the default value is new Color(1, 1, 1, 1) Draws a in 2D with the provided texture. See for related documentation. Sets a custom transform for drawing via components. Anything drawn afterwards will be transformed by this. Sets a custom transform for drawing via matrix. Anything drawn afterwards will be transformed by this. Returns the transform matrix of this item. Returns the global transform matrix of this item. Returns the global transform matrix of this item in relation to the canvas. Returns this item's transform in relation to the viewport. Returns the viewport's boundaries as a . Returns the transform matrix of this item's canvas. Returns the mouse position relative to this item's position. Returns the global position of the mouse. Returns the of the canvas where this item is in. Returns the where this item is in. If enable is true, children will be updated with local transform data. Returns true if local transform notifications are communicated to children. If enable is true, children will be updated with global transform data. Returns true if global transform notifications are communicated to children. 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. Assigns screen_point as this node's new local transform. Transformations issued by event's inputs are applied in local space instead of global space. s provide a means of modifying the textures associated with a CanvasItem. They specialize in describing blend and lighting behaviors for textures. Use a to more fully customize a material's interactions with a . Render the material using both light and non-light sensitive material properties. Render the material as if there were no light. Render the material as if there were only light. Mix blending mode. Colors are assumed to be independent of the alpha (opacity) value. Additive blending mode. Subtractive blending mode. Multiplicative blending mode. Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value. The manner in which a material's rendering is applied to underlying textures. The manner in which material reacts to lighting. If true, enable spritesheet-based animation features when assigned to and nodes. The or should also be set to a positive value for the animation to play. This property (and other particles_anim_* properties that depend on it) has no effect on other types of nodes. The number of columns in the spritesheet assigned as for a or . Note: This property is only used and visible in the editor if is true. The number of rows in the spritesheet assigned as for a or . Note: This property is only used and visible in the editor if is true. If true, the particles animation will loop. Note: This property is only used and visible in the editor if is true. Canvas drawing layer. nodes that are direct or indirect children of a will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index 0, so a with index -1 will be drawn below, and one with index 1 will be drawn above. This is very useful for HUDs (in layer 1+ or above), or backgrounds (in layer -1 or below). Layer index for draw order. Lower values are drawn first. The layer's base offset. The layer's rotation in degrees. The layer's rotation in radians. The layer's scale. The layer's transform. The custom node assigned to the . If null, uses the default viewport instead. Sets the layer to follow the viewport in order to simulate a pseudo 3D effect. Scales the layer when using . Layers moving into the foreground should have increasing scales, while layers moving into the background should have decreasing scales. Returns the RID of the canvas used by this layer. tints the canvas elements using its assigned . The tint color to apply. Class representing a capsule-shaped . Radius of the capsule mesh. Height of the middle cylindrical part of the capsule (without the hemispherical ends). Note: The capsule's total height is equal to + 2 * . Number of radial segments on the capsule mesh. Number of rings along the height of the capsule. Capsule shape for collisions. The capsule's radius. The capsule's height. Capsule shape for 2D collisions. The capsule's radius. The capsule's height. CenterContainer keeps children controls centered. This container keeps all children to their minimum size, in the center. If true, centers children relative to the 's top left corner. By setting various properties on this object, you can control how individual characters will be displayed in a . The index of the current character (starting from 0). Setting this property won't affect drawing. The index of the current character (starting from 0). Setting this property won't affect drawing. The time elapsed since the was added to the scene tree (in seconds). Time stops when the project is paused, unless the 's is set to . Note: Time still passes while the is hidden. If true, the character will be drawn. If false, the character will be hidden. Characters around hidden characters will reflow to take the space of hidden characters. If this is not desired, set their to Color(1, 1, 1, 0) instead. The position offset the character will be drawn with (in pixels). The color the character will be drawn with. Contains the arguments passed in the opening BBCode tag. By default, arguments are strings; if their contents match a type such as , or , they will be converted automatically. Color codes in the form #rrggbb or #rgb will be converted to an opaque . String arguments may not contain spaces, even if they're quoted. If present, quotes will also be present in the final string. For example, the opening BBCode tag [example foo=hello bar=true baz=42 color=#ffffff] will map to the following : {"foo": "hello", "bar": true, "baz": 42, "color": Color(1, 1, 1, 1)} The Unicode codepoint the character will use. This only affects non-whitespace characters. @GDScript.ord can be useful here. For example, the following will replace all characters with asterisks: # `char_fx` is the CharFXTransform parameter from `_process_custom_fx()`. # See the RichTextEffect documentation for details. char_fx.character = ord("*") A checkbox allows the user to make a binary choice (choosing only one of two possible options). It's similar to in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckBox when toggling it has no immediate effect on something. For instance, it should be used when toggling it will only do something once a confirmation button is pressed. See also which contains common properties and methods associated with this node. CheckButton is a toggle button displayed as a check field. It's similar to in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckButton when toggling it has an immediate effect on something. For instance, it should be used if toggling it enables/disables a setting without requiring the user to press a confirmation button. See also which contains common properties and methods associated with this node. Circular shape for 2D collisions. This shape is useful for modeling balls or small characters and its collision detection with everything else is very fast. The circle's radius. This node extends to add collisions with and/or nodes. The camera cannot move through colliding objects. The camera updates with the _physics_process callback. The camera updates with the _process callback. The camera's collision margin. The camera can't get closer than this distance to a colliding object. The camera's process callback. See . The camera's collision mask. Only objects in at least one collision layer matching the mask will be detected. See Collision layers and masks in the documentation for more information. If true, the camera stops on contact with s. If true, the camera stops on contact with s. Sets the specified bit index to the value. Note: Bit indices range from 0-19. Returns true if the specified bit index is on. Note: Bit indices range from 0-19. Adds a collision exception so the camera does not collide with the specified . Adds a collision exception so the camera does not collide with the specified node. Removes a collision exception with the specified . Removes a collision exception with the specified node. Returns the distance the camera has been offset due to a collision. Removes all collision exceptions. CollisionObject is the base class for physics objects. It can hold any number of collision s. Each shape must be assigned to a shape owner. The CollisionObject can have any number of shape owners. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the shape_owner_* methods. If true, the 's shapes will respond to s. If true, the will continue to receive input events as the mouse is dragged across its shapes. Accepts unhandled s. click_position is the clicked location in world space and click_normal is the normal vector extending from the clicked surface of the at shape_idx. Connect to the input_event signal to easily pick up these events. Returns the object's . Creates a new shape owner for the given object. Returns owner_id of the new owner for future reference. Removes the given shape owner. Returns an of owner_id identifiers. You can use these ids in other methods that take owner_id as an argument. Sets the of the given shape owner. Returns the shape owner's . Returns the parent object of the given shape owner. If true, disables the given shape owner. If true, the shape owner and its shapes are disabled. Adds a to the shape owner. Returns the number of shapes the given shape owner contains. Returns the with the given id from the given shape owner. Returns the child index of the with the given id from the given shape owner. Removes a shape from the given shape owner. Removes all shapes from the shape owner. Returns the owner_id of the given shape. CollisionObject2D is the base class for 2D physics objects. It can hold any number of 2D collision s. Each shape must be assigned to a shape owner. The CollisionObject2D can have any number of shape owners. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the shape_owner_* methods. If true, this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events. Requires at least one collision_layer bit to be set. Accepts unhandled s. Requires to be true. shape_idx is the child index of the clicked . Connect to the input_event signal to easily pick up these events. Returns the object's . Creates a new shape owner for the given object. Returns owner_id of the new owner for future reference. Removes the given shape owner. Returns an of owner_id identifiers. You can use these ids in other methods that take owner_id as an argument. Sets the of the given shape owner. Returns the shape owner's . Returns the parent object of the given shape owner. If true, disables the given shape owner. If true, the shape owner and its shapes are disabled. If enable is true, collisions for the shape owner originating from this will not be reported to collided with s. Returns true if collisions for the shape owner originating from this will not be reported to collided with s. Sets the one_way_collision_margin of the shape owner identified by given owner_id to margin pixels. Returns the one_way_collision_margin of the shape owner identified by given owner_id. Adds a to the shape owner. Returns the number of shapes the given shape owner contains. Returns the with the given id from the given shape owner. Returns the child index of the with the given id from the given shape owner. Removes a shape from the given shape owner. Removes all shapes from the shape owner. Returns the owner_id of the given shape. Allows editing a collision polygon's vertices on a selected plane. Can also set a depth perpendicular to that plane. This class is only available in the editor. It will not appear in the scene tree at run-time. Creates a for gameplay. Properties modified during gameplay will have no effect. Length that the resulting collision extends in either direction perpendicular to its polygon. If true, no collision will be produced. Array of vertices which define the polygon. Note: The returned value is a copy of the original. Methods which mutate the size or properties of the return value will not impact the original polygon. To change properties of the polygon, assign it to a temporary variable and make changes before reassigning the polygon member. The collision margin for the generated . See for more details. Provides a 2D collision polygon to a parent. Polygons can be drawn in the editor or specified by a list of vertices. Collisions will include the polygon and its contained area. Collisions will only include the polygon edges. Collision build mode. Use one of the constants. The polygon's list of vertices. The final point will be connected to the first. The returned value is a clone of the , not a reference. If true, no collisions will be detected. If true, only edges that face up, relative to 's rotation, will collide with other objects. 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. Editor facility for creating and editing collision shapes in 3D space. You can use this node to represent all sorts of collision shapes, for example, add this to an to give it a detection shape, or add it to a to create a solid object. IMPORTANT: this is an Editor-only helper to create shapes, use to get the actual shape. The actual shape owned by this collision shape. A disabled collision shape has no effect in the world. If this method exists within a script it will be called whenever the shape resource has been modified. Sets the collision shape's shape to the addition of all its convexed siblings geometry. Editor facility for creating and editing collision shapes in 2D space. You can use this node to represent all sorts of collision shapes, for example, add this to an to give it a detection shape, or add it to a to create a solid object. IMPORTANT: this is an Editor-only helper to create shapes, use to get the actual shape. The actual shape owned by this collision shape. A disabled collision shape has no effect in the world. This property should be changed with . Sets whether this collision shape should only detect collision on one side (top or bottom). The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the shape at a high velocity. node displaying a color picker widget. It's useful for selecting a color from an RGB/RGBA colorspace. The currently selected color. If true, shows an alpha channel slider (transparency). If true, allows editing the color with Hue/Saturation/Value sliders. Note: Cannot be enabled if raw mode is on. If true, allows the color R, G, B component values to go beyond 1.0, which can be used for certain special operations that require it (like tinting without darkening or rendering sprites in HDR). Note: Cannot be enabled if HSV mode is on. If true, the color will apply only after the user releases the mouse button, otherwise it will apply immediately even in mouse motion event (which can cause performance issues). If true, the "add preset" button is enabled. If true, saved color presets are visible. Adds the given color to a list of color presets. The presets are displayed in the color picker and the user will be able to select them. Note: the presets list is only for this color picker. Removes the given color from the list of color presets of this color picker. Returns the list of colors in the presets of the color picker. Encapsulates a making it accessible by pressing a button. Pressing the button will toggle the visibility. See also which contains common properties and methods associated with this node. The currently selected color. If true, the alpha channel in the displayed will be visible. Returns the that this node toggles. Returns the control's which allows you to connect to popup signals. This allows you to handle events when the ColorPicker is shown or hidden. Displays a rectangle filled with a solid . If you need to display the border alone, consider using instead. The fill color. $ColorRect.color = Color(1, 0, 0, 1) # Set ColorRect's color to red. Concave polygon shape resource, which can be set into a or area. This shape is created by feeding a list of triangles. Note: when used for collision, is intended to work with static nodes like and will not work with or with a mode other than Static. Sets the faces (an array of triangles). Returns the faces (an array of triangles). Concave polygon 2D shape resource for physics. It is made out of segments and is optimal for complex polygonal concave collisions. However, it is not advised to use for nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions. The main difference between a and a is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex in order to speed up collision detection. The array of points that make up the 's line segments. The joint can rotate the bodies across an axis defined by the local x-axes of the . The twist axis is initiated as the X axis of the . Once the Bodies swing, the twist axis is calculated as the middle of the x-axes of the Joint in the local space of the two Bodies. See also . Swing is rotation from side to side, around the axis perpendicular to the twist axis. The swing span defines, how much rotation will not get corrected along the swing axis. Could be defined as looseness in the . If below 0.05, this behavior is locked. Twist is the rotation around the twist axis, this value defined how far the joint can twist. Twist is locked if below 0.05. The speed with which the swing or twist will take place. The higher, the faster. The ease with which the joint starts to twist. If it's too low, it takes more force to start twisting the joint. Defines, how fast the swing- and twist-speed-difference on both sides gets synced. Represents the size of the enum. Swing is rotation from side to side, around the axis perpendicular to the twist axis. The swing span defines, how much rotation will not get corrected along the swing axis. Could be defined as looseness in the . If below 0.05, this behavior is locked. Twist is the rotation around the twist axis, this value defined how far the joint can twist. Twist is locked if below 0.05. The speed with which the swing or twist will take place. The higher, the faster. The ease with which the joint starts to twist. If it's too low, it takes more force to start twisting the joint. Defines, how fast the swing- and twist-speed-difference on both sides gets synced. 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: [section] some_key=42 string_example="Hello World!" a_vector=Vector3( 1, 0, 2 ) 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 parse an INI-style file from the system, read its contents and store new values in it: var config = ConfigFile.new() var err = config.load("user://settings.cfg") if err == OK: # If not, something went wrong with the file loading # Look for the display/width pair, and default to 1024 if missing var screen_width = config.get_value("display", "width", 1024) # Store a variable if and only if it hasn't been defined yet if not config.has_section_key("audio", "mute"): config.set_value("audio", "mute", false) # Save the changes by overwriting the previous file config.save("user://settings.cfg") 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 (;). 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. Assigns a value to the specified key of the specified section. If either the section or the key do not exist, they are created. Passing a null value deletes the specified key if it exists, and deletes the section if it ends up empty once the key has been removed. Returns the current value for the specified section and key. If either the section or the key do not exist, the method returns the fallback default value. If default is not specified or set to null, an error is also raised. Returns true if the specified section exists. Returns true if the specified section-key pair exists. Returns an array of all defined section identifiers. Returns an array of all defined key identifiers in the specified section. Raises an error and returns an empty array if the section does not exist. Deletes the specified section along with all the key-value pairs inside. Raises an error if the section does not exist. Deletes the specified key in a section. Raises an error if either the section or the key do not exist. Loads the config file specified as a parameter. The file's contents are parsed and loaded in the object which the method was called on. Returns one of the code constants (OK on success). Parses the passed string as the contents of a config file. The string is parsed and loaded in the ConfigFile object which the method was called on. Returns one of the code constants (OK on success). Saves the contents of the object to the file specified as a parameter. The output file uses an INI-style structure. Returns one of the code constants (OK on success). Loads the encrypted config file specified as a parameter, using the provided key to decrypt it. The file's contents are parsed and loaded in the object which the method was called on. Returns one of the code constants (OK on success). Loads the encrypted config file specified as a parameter, using the provided password to decrypt it. The file's contents are parsed and loaded in the object which the method was called on. Returns one of the code constants (OK on success). Saves the contents of the object to the AES-256 encrypted file specified as a parameter, using the provided key to encrypt it. The output file uses an INI-style structure. Returns one of the code constants (OK on success). Saves the contents of the object to the AES-256 encrypted file specified as a parameter, using the provided password to encrypt it. The output file uses an INI-style structure. Returns one of the code constants (OK on success). Dialog for confirmation of actions. This dialog inherits from , but has by default an OK and Cancel button (in host OS order). To get cancel action, you can use: get_cancel().connect("pressed", self, "cancelled") . Returns the cancel button. Base node for containers. A contains other controls and automatically arranges them in a certain way. A Control can inherit this to create custom container classes. Notification for when sorting the children, it must be obeyed immediately. Queue resort of the contained children. This is called automatically anyway, but can be called upon request. Fit a child control in a given rect. This is mainly a helper for creating custom container classes. Base class for all UI-related nodes. features a bounding rectangle that defines its extents, an anchor position relative to its parent control or the current viewport, and margins that represent an offset to the anchor. The margins update automatically when the node, any of its parents, or the screen size change. For more information on Godot's UI system, anchors, margins, and containers, see the related tutorials in the manual. To build flexible UIs, you'll need a mix of UI elements that inherit from and nodes. User Interface nodes and input Godot sends input events to the scene's root node first, by calling . forwards the event down the node tree to the nodes under the mouse cursor, or on keyboard focus. To do so, it calls . Call so no other node receives the event. Once you accepted an input, it becomes handled so will not process it. Only one node can be in keyboard focus. Only the node in focus will receive keyboard events. To get the focus, call . nodes lose focus when another node grabs it, or if you hide the node in focus. Sets to to tell a node to ignore mouse or touch events. You'll need it if you place an icon on top of a button. resources change the Control's appearance. If you change the on a node, it affects all of its children. To override some of the theme's parameters, call one of the add_*_override methods, like . You can override the theme with the inspector. Note: Theme items are not properties. This means you can't access their values using and . Instead, use , , , , , and the add_*_override methods provided by this class. Sent when the node changes size. Use to get the new size. Sent when the mouse pointer enters the node. Sent when the mouse pointer exits the node. Sent when the node grabs focus. Sent when the node loses focus. Sent when the node's changes, right before Godot redraws the control. Happens when you call one of the add_*_override methods. Sent when an open modal dialog closes. See . Sent when this node is inside a which has begun being scrolled. Sent when this node is inside a which has stopped being scrolled. Snaps one of the 4 anchor's sides to the origin of the node's Rect, in the top left. Use it with one of the anchor_* member variables, like . To change all 4 anchors at once, use . Snaps one of the 4 anchor's sides to the end of the node's Rect, in the bottom right. Use it with one of the anchor_* member variables, like . To change all 4 anchors at once, use . The node cannot grab focus. Use with . The node can only grab focus on mouse clicks. Use with . The node can grab focus on mouse click or using the arrows and the Tab keys on the keyboard. Use with . The control will be resized to its minimum size. The control's width will not change. The control's height will not change. The control's size will not change. The control will receive mouse button input events through if clicked on. And the control will receive the mouse_entered and 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. The control will receive mouse button input events through if clicked on. And the control will receive the mouse_entered and mouse_exited signals. If this control does not handle the event, the parent control (if any) will be considered, and so on until there is no more parent control to potentially handle it. This also allows signals to fire in other controls. Even if no control handled it at all, the event will still be handled automatically, so unhandled input will not be fired. The control will not receive mouse button input events through . The control will also not receive the mouse_entered nor mouse_exited signals. This will not block other controls from receiving these events or firing the signals. Ignored events will not be handled automatically. Show the system's arrow mouse cursor when the user hovers the node. Use with . 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. Show the system's pointing hand mouse cursor when the user hovers the node. Show the system's cross mouse cursor when the user hovers the node. Show the system's wait mouse cursor, often an hourglass, when the user hovers the node. Show the system's busy mouse cursor when the user hovers the node. Often an hourglass. 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. 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. Show the system's forbidden mouse cursor when the user hovers the node. Often a crossed circle. 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. 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. 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. 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 . It tells the user they can resize the window or the panel both horizontally and vertically. 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. Show the system's vertical split mouse cursor when the user hovers the node. On Windows, it's the same as . Show the system's horizontal split mouse cursor when the user hovers the node. On Windows, it's the same as . Show the system's help mouse cursor when the user hovers the node, a question mark. 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. 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. The control will grow in both directions equally to make up if its minimum size is changed to be greater than its current size. Tells the parent to expand the bounds of this node to fill all the available space without pushing any other node. Use with and . Tells the parent 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 . Use with and . Sets the node's size flags to both fill and expand. See the 2 constants above for more information. Tells the parent to center the node in itself. It centers the control based on its bounding box, so it doesn't work with the fill or expand size flags. Use with and . Tells the parent to align the node with its end, either the bottom or the right edge. It doesn't work with the fill or expand size flags. Use with and . Snap all 4 anchors to the top-left of the parent control's bounds. Use with . Snap all 4 anchors to the top-right of the parent control's bounds. Use with . Snap all 4 anchors to the bottom-left of the parent control's bounds. Use with . Snap all 4 anchors to the bottom-right of the parent control's bounds. Use with . Snap all 4 anchors to the center of the left edge of the parent control's bounds. Use with . Snap all 4 anchors to the center of the top edge of the parent control's bounds. Use with . Snap all 4 anchors to the center of the right edge of the parent control's bounds. Use with . Snap all 4 anchors to the center of the bottom edge of the parent control's bounds. Use with . Snap all 4 anchors to the center of the parent control's bounds. Use with . Snap all 4 anchors to the left edge of the parent control. The left margin becomes relative to the left edge and the top margin relative to the top left corner of the node's parent. Use with . Snap all 4 anchors to the top edge of the parent control. The left margin becomes relative to the top left corner, the top margin relative to the top edge, and the right margin relative to the top right corner of the node's parent. Use with . Snap all 4 anchors to the right edge of the parent control. The right margin becomes relative to the right edge and the top margin relative to the top right corner of the node's parent. Use with . Snap all 4 anchors to the bottom edge of the parent control. The left margin becomes relative to the bottom left corner, the bottom margin relative to the bottom edge, and the right margin relative to the bottom right corner of the node's parent. Use with . Snap all 4 anchors to a vertical line that cuts the parent control in half. Use with . Snap all 4 anchors to a horizontal line that cuts the parent control in half. Use with . Snap all 4 anchors to the respective corners of the parent control. Set all 4 margins to 0 after you applied this preset and the will fit its parent control. This is equivalent to the "Full Rect" layout option in the editor. Use with . Anchors the left edge of the node to the origin, the center or the end of its parent control. It changes how the left margin updates when the node moves or changes size. You can use one of the constants for convenience. Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top margin updates when the node moves or changes size. You can use one of the constants for convenience. Anchors the right edge of the node to the origin, the center or the end of its parent control. It changes how the right margin updates when the node moves or changes size. You can use one of the constants for convenience. Anchors the bottom edge of the node to the origin, the center, or the end of its parent control. It changes how the bottom margin updates when the node moves or changes size. You can use one of the constants for convenience. Distance between the node's left edge and its parent control, based on . Margins are often controlled by one or multiple parent nodes, so you should not modify them manually if your node is a direct child of a . Margins update automatically when you move or resize the node. Distance between the node's top edge and its parent control, based on . Margins are often controlled by one or multiple parent nodes, so you should not modify them manually if your node is a direct child of a . Margins update automatically when you move or resize the node. Distance between the node's right edge and its parent control, based on . Margins are often controlled by one or multiple parent nodes, so you should not modify them manually if your node is a direct child of a . Margins update automatically when you move or resize the node. Distance between the node's bottom edge and its parent control, based on . Margins are often controlled by one or multiple parent nodes, so you should not modify them manually if your node is a direct child of a . Margins update automatically when you move or resize the node. 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. 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. The node's position, relative to its parent. It corresponds to the rectangle's top-left corner. The property is not affected by . The node's global position, relative to the world (usually to the top-left corner of the window). The size of the node's bounding rectangle, in pixels. nodes update this property automatically. The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes. The node's rotation around its pivot, in degrees. See to change the pivot's position. The node's scale, relative to its . Change this property to scale the node around its . The Control's will also scale according to this value. Note: This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the documentation instead of scaling Controls individually. Note: If the Control node is a child of a node, the scale will be reset to Vector2(1, 1) when the scene is instanced. To set the Control's scale when it's instanced, wait for one frame using yield(get_tree(), "idle_frame") then set its property. By default, the node's pivot is its top-left corner. When you change its , it will scale around this pivot. Set this property to / 2 to center the pivot in the node's rectangle. Enables whether rendering of based children should be clipped to this control's rectangle. If true, parts of a child which would be visibly outside of this control's rectangle will not be rendered. Changes the tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the property is not . You can change the time required for the tooltip to appear with gui/timers/tooltip_delay_sec option in Project Settings. The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding . The default tooltip includes a and whose theme properties can be customized using methods with the "TooltipPanel" and "TooltipLabel" respectively. For example: var style_box = StyleBoxFlat.new() style_box.set_bg_color(Color(1, 1, 0)) style_box.set_border_width_all(2) # We assume here that the `theme` property has been assigned a custom Theme beforehand. theme.set_stylebox("panel", "TooltipPanel", style_box) theme.set_color("font_color", "TooltipLabel", Color(0, 1, 1)) Tells Godot which node it should give keyboard 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 ui_left input action. The node must be a . If this property is not set, Godot will give focus to the closest to the left of this one. Tells Godot which node it should give keyboard 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 ui_top input action. The node must be a . If this property is not set, Godot will give focus to the closest to the bottom of this one. Tells Godot which node it should give keyboard 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 ui_right input action. The node must be a . If this property is not set, Godot will give focus to the closest to the bottom of this one. Tells Godot which node it should give keyboard 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 ui_down input action. The node must be a . If this property is not set, Godot will give focus to the closest to the bottom of this one. Tells Godot which node it should give keyboard focus to if the user presses Tab on a keyboard by default. You can change the key by editing the 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. Tells Godot which node it should give keyboard focus to if the user presses Shift+Tab on a keyboard by default. You can change the key by editing the 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. 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 signals. Controls whether the control will be able to receive mouse button input events through and how these events should be handled. Also controls whether the control can receive the mouse_entered, and mouse_exited signals. See the constants to learn what each does. The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors. Note: On Linux, shapes may vary depending on the cursor theme of the system. Enables whether input should propagate when you close the control as modal. If false, stops event handling at the viewport input event handling. The viewport first hides the modal and after marks the input as handled. Tells the parent nodes how they should resize and place the node on the X axis. Use one of the constants to change the flags. See the constants to learn what each does. Tells the parent nodes how they should resize and place the node on the Y axis. Use one of the constants to change the flags. See the constants to learn what each does. If the node and at least one of its neighbours uses the size flag, the parent will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbour a ratio of 1, this node will take two thirds of the available space. Changing this property replaces the current resource this node and all its children use. Virtual method to be implemented by the user. Returns whether should not be called for children controls outside this control's rectangle. Input will be clipped to the Rect of this . Similar to , but doesn't affect visibility. If not overridden, defaults to false. Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to 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 . Virtual method to be implemented by the user. Use this method to process and accept inputs on UI elements. See . Example: clicking a control. func _gui_input(event): if event is InputEventMouseButton: if event.button_index == BUTTON_LEFT and event.pressed: print("I've been clicked D:") The event won't trigger if: * clicking outside the control (see ); * control has set to ; * control is obstructed by another on top of it, which doesn't have set to ; * control's parent has set to or has accepted the event; * it happens outside parent's rectangle and the parent has either or enabled. Virtual method to be implemented by the user. Returns a node that should be used as a tooltip instead of the default one. The for_text includes the contents of the property. The returned node must be of type or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance).When null or a non-Control node is returned, the default tooltip will be used instead. The returned node will be added as child to a , so you should only provide the contents of that panel. That can be themed using for the type "TooltipPanel" (see for an example). Note: The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its to some non-zero value. Example of usage with a custom-constructed node: func _make_custom_tooltip(for_text): var label = Label.new() label.text = for_text return label Example of usage with a custom scene instance: func _make_custom_tooltip(for_text): var tooltip = preload("res://SomeTooltipScene.tscn").instance() tooltip.get_node("Label").text = for_text return tooltip Godot calls this method to test if data from a control's can be dropped at position. position is local to this control. This method should only be used to test the data. Process the data in . 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") Godot calls this method to pass you the data from a control's result. Godot first calls to test if data is allowed to drop at position where position is local to this control. func can_drop_data(position, data): return typeof(data) == TYPE_DICTIONARY and data.has("color") func drop_data(position, data): color = data["color"] Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns null if there is no data to drag. Controls that want to receive drop data should implement and . position is local to this control. Drag may be forced with . A preview that will follow the mouse that should represent the data can be set with . A good time to set the preview is in this method. func get_drag_data(position): var mydata = make_data() set_drag_preview(make_preview(mydata)) return mydata Virtual method to be implemented by the user. Returns whether the given point is inside this control. If not overridden, default behavior is checking if the point is within control's Rect. Note: If you want to check if a point is inside the control, you can use get_rect().has_point(point). Marks an input event as handled. Once you accept an input event, it stops propagating, even to nodes listening to or . Returns the minimum size for this control. See . Returns combined minimum size from and . Sets the anchors to a preset from enum. This is code equivalent of using the Layout menu in 2D editor. If keep_margins is true, control's position will also be updated. Sets the margins to a preset from enum. This is code equivalent of using the Layout menu in 2D editor. Use parameter resize_mode with constants from to better determine the resulting size of the . Constant size will be ignored if used with presets that change size, e.g. PRESET_LEFT_WIDE. Use parameter margin to determine the gap between the and the edges. Sets both anchor preset and margin preset. See and . Sets the anchor identified by margin constant from enum to value anchor. A setter method for , , and . If keep_margin is true, margins aren't updated after this operation. If push_opposite_anchor is true 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 push_opposite_anchor was false, the left anchor would get value 0.5. Returns the anchor identified by margin constant from enum. A getter method for , , and . Sets the margin identified by margin constant from enum to given offset. A setter method for , , and . Works the same as , but instead of keep_margin argument and automatic update of margin, it allows to set the margin offset yourself (see ). Sets and at the same time. Equivalent of changing . Sets and at the same time. Sets the to given position. If keep_margins is true, control's anchors will be updated instead of margins. Sets the size (see ). If keep_margins is true, control's anchors will be updated instead of margins. Sets the to given position. If keep_margins is true, control's anchors will be updated instead of margins. Sets the rotation (in radians). Returns the anchor identified by margin constant from enum. A getter method for , , and . Returns and . See also . Returns and . Returns the rotation (in radians). Returns the width/height occupied in the parent control. Returns the position and size of the control relative to the top-left corner of the parent Control. See and . Returns the position and size of the control relative to the top-left corner of the screen. See and . Displays a control as modal. Control must be a subwindow. Modal controls capture the input signals until closed or the area outside them is accessed. When a modal control loses focus, or the ESC key is pressed, they automatically hide. Modal controls are used extensively for popup dialogs and menus. If exclusive is true, other controls will not receive input and clicking outside this control will not close it. Returns true if this is the current focused control. See . Steal the focus from another control and become the focused control (see ). Give up the focus. No other control will be able to receive keyboard input. Finds the previous (above in the tree) that can receive the focus. Finds the next (below in the tree) that can receive the focus. Returns the control that has the keyboard focus or null if none. Overrides the icon with given name in the resource the control uses. If icon is null or invalid, the override is cleared and the icon from assigned is used. Overrides the with given name in the resource the control uses. If shader is null or invalid, the override is cleared and the shader from assigned is used. Overrides the with given name in the resource the control uses. If stylebox is empty or invalid, the override is cleared and the from assigned is used. Example of modifying a property in a StyleBox by duplicating it: # The snippet below assumes the child node MyButton has a StyleBoxFlat assigned. # Resources are shared across instances, so we need to duplicate it # to avoid modifying the appearance of all other buttons. var new_stylebox_normal = $MyButton.get_stylebox("normal").duplicate() new_stylebox_normal.border_width_top = 3 new_stylebox_normal.border_color = Color(0, 1, 0.5) $MyButton.add_stylebox_override("normal", new_stylebox_normal) # Remove the stylebox override: $MyButton.add_stylebox_override("normal", null) Overrides the font with given name in the resource the control uses. If font is null or invalid, the override is cleared and the font from assigned is used. Overrides the with given name in the resource the control uses. Note: Unlike other theme overrides, there is no way to undo a color override without manually assigning the previous color. Example of overriding a label's color and resetting it later: # Override the child node "MyLabel"'s font color to orange. $MyLabel.add_color_override("font_color", Color(1, 0.5, 0)) # Reset the color by creating a new node to get the default value: var default_label_color = Label.new().get_color("font_color") $MyLabel.add_color_override("font_color", default_label_color) Overrides an integer constant with given name in the resource the control uses. If the constant is 0, the override is cleared and the constant from assigned is used. Returns an icon from assigned with given name and associated with of given node_type. Returns a from assigned with given name and associated with of given node_type. Returns a font from assigned with given name and associated with of given node_type. Returns a color from assigned with given name and associated with of given node_type. func _ready(): modulate = get_color("font_color", "Button") #get the color defined for button fonts Returns a constant from assigned with given name and associated with of given node_type. Returns true if icon with given name has a valid override in this node. Returns true if with given name has a valid override in this node. Returns true if with given name has a valid override in this node. Returns true if font with given name has a valid override in this node. Returns true if with given name has a valid override in this node. Returns true if constant with given name has a valid override in this node. Returns true if icon with given name and associated with of given node_type exists in assigned . Returns true if with given name and associated with of given node_type exists in assigned . Returns true if font with given name and associated with of given node_type exists in assigned . Returns true if with given name and associated with of given node_type exists in assigned . Returns true if constant with given name and associated with of given node_type exists in assigned . Returns the parent control node. Returns the tooltip, which will appear when the cursor is resting over this control. See . If the parameter is null, then the default value is new Vector2(0, 0) Returns the mouse cursor shape the control displays on mouse hover. See . If the parameter is null, then the default value is new Vector2(0, 0) Sets the anchor identified by margin constant from enum to at neighbor node path. A setter method for , , and . Returns the focus neighbour identified by margin constant from enum. A getter method for , , and . Forces drag and bypasses and by passing data and preview. Drag will start even if the mouse is neither over nor pressed on this control. The methods and must be implemented on controls that want to receive drop data. Creates an that attempts to click the control. If the event is received, the control acquires focus. func _process(delta): grab_click_focus() #when clicking another Control node, this node will be clicked instead Forwards the handling of this control's drag and drop to target control. Forwarding can be implemented in the target control similar to the methods , , and but with two differences: 1. The function name must be suffixed with _fw 2. The function must take an extra argument that is the control doing the forwarding # ThisControl.gd extends Control func _ready(): set_drag_forwarding(target_control) # TargetControl.gd extends Control func can_drop_data_fw(position, data, from_control): return true func drop_data_fw(position, data, from_control): my_handle_data(data) func get_drag_data_fw(position, from_control): set_drag_preview(my_preview) return my_data() Shows the given control at the mouse pointer. A good time to call this method is in . 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. export (Color, RGBA) 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.rect_size = Vector2(50, 50) set_drag_preview(cpb) return color Moves the mouse cursor to to_position, relative to of this . Invalidates the size cache in this node and in parent nodes up to toplevel. Intended to be used with when the return value is changed. Setting directly calls this method automatically. Convex polygon shape resource, which can be added to a or area. The list of 3D points forming the convex polygon shape. Convex polygon shape for 2D physics. A convex polygon, whatever its shape, is internally decomposed into as many convex polygons as needed to ensure all collision checks against it are always done on convex polygons (which are faster to check). The main difference between a and a is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex in order to speed up collision detection. The polygon's list of vertices. Can be in either clockwise or counterclockwise order. Based on the set of points provided, this creates and assigns the property using the convex hull algorithm. Removing all unneeded points. See for details. The Crypto class allows you to access some more advanced cryptographic functionalities in Godot. For now, this includes generating cryptographically secure random bytes, and RSA keys and self-signed X509 certificates generation. More functionalities are planned for future releases. extends Node var crypto = Crypto.new() var key = CryptoKey.new() var cert = X509Certificate.new() func _ready(): # Generate new RSA key. key = crypto.generate_rsa(4096) # Generate new self-signed certificate with the given key. cert = crypto.generate_self_signed_certificate(key, "CN=mydomain.com,O=My Game Company,C=IT") # Save key and certificate in the user folder. key.save("user://generated.key") cert.save("user://generated.crt") Note: Not available in HTML5 exports. Generates a of cryptographically secure random bytes with given size. Generates an RSA that can be used for creating self-signed certificates and passed to . Generates a self-signed from the given and issuer_name. The certificate validity will be defined by not_before and not_after (first valid date and last valid date). The issuer_name must contain at least "CN=" (common name, i.e. the domain name), "O=" (organization, i.e. your company name), "C=" (country, i.e. 2 lettered ISO-3166 code of the country the organization is based in). A small example to generate an RSA key and a X509 self-signed certificate. var crypto = Crypto.new() # Generate 4096 bits RSA key. var key = crypto.generate_rsa(4096) # Generate self-signed certificate using the given key. var cert = crypto.generate_self_signed_certificate(key, "CN=example.com,O=A Game Company,C=IT") The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other . They can be used to generate a self-signed via and as private key in along with the appropriate certificate. Note: Not available in HTML5 exports. Saves a key to the given path (should be a "*.key" file). Loads a key from path ("*.key" file). A 6-sided 3D texture typically used for faking reflections. It can be used to make an object look as if it's reflecting its surroundings. This usually delivers much better performance than other reflection methods. Generate mipmaps, to enable smooth zooming out of the texture. Repeat (instead of clamp to edge). Turn on magnifying filter, to enable smooth zooming in of the texture. Default flags. Generate mipmaps, repeat, and filter are enabled. Identifier for the left face of the . Identifier for the right face of the . Identifier for the bottom face of the . Identifier for the top face of the . Identifier for the front face of the . Identifier for the back face of the . Store the without any compression. Store the with strong compression that reduces image quality. Store the with moderate compression that doesn't reduce image quality. The render flags for the . See the constants for details. The 's storage mode. See constants. The lossy storage quality of the if the storage mode is set to . Returns the 's width. Returns the 's height. Sets an for a side of the using one of the constants. Returns an for a side of the using one of the constants. Generate an axis-aligned cuboid . The cube's UV layout is arranged in a 3×2 layout that allows texturing each face individually. To apply the same texture on all faces, change the material's UV property to Vector3(3, 2, 1). Note: When using a large textured (e.g. as a floor), you may stumble upon UV jittering issues depending on the camera angle. To solve this, increase , and until you no longer notice UV jittering. Size of the cuboid mesh. Number of extra edge loops inserted along the X axis. Number of extra edge loops inserted along the Y axis. Number of extra edge loops inserted along the Z axis. A curve that can be saved and re-used for other objects. By default, it ranges between 0 and 1 on the Y axis and positions points relative to the 0.5 Y position. The tangent on this side of the point is user-defined. The curve calculates the tangent on this side of the point as the slope halfway towards the adjacent point. The total number of available tangent modes. The minimum value the curve can reach. The maximum value the curve can reach. The number of points to include in the baked (i.e. cached) curve data. Returns the number of points describing the curve. Adds a point to the curve. For each side, if the *_mode is , the *_tangent angle (in degrees) uses the slope of the curve halfway to the adjacent point. Allows custom assignments to the *_tangent angle if *_mode is set to . Removes the point at index from the curve. Removes all points from the curve. Returns the curve coordinates for the point at index. Assigns the vertical position y to the point at index. Sets the offset from 0.5. Returns the Y value for the point that would exist at the X position offset along the curve. Returns the Y value for the point that would exist at the X position offset along the curve using the baked cache. Bakes the curve's points if not already baked. Returns the left tangent angle (in degrees) for the point at index. Returns the right tangent angle (in degrees) for the point at index. Returns the left for the point at index. Returns the right for the point at index. Sets the left tangent angle for the point at index to tangent. Sets the right tangent angle for the point at index to tangent. Sets the left for the point at index to mode. Sets the right for the point at index to mode. Removes points that are closer than CMP_EPSILON (0.00001) units to their neighbor on the curve. Recomputes the baked cache of points for the curve. This class describes a Bézier curve in 2D space. It is mainly used to give a shape to a , but can be manually sampled for other purposes. It keeps a cache of precalculated points along the curve, to speed up further calculations. The distance in pixels between two adjacent cached points. Changing it forces the cache to be recomputed the next time the or function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. Returns the number of points describing the curve. Adds a point to a curve at position, with control points in and out. If at_position is given, the point is inserted before the point number at_position, moving that point (and every point after) after the inserted point. If at_position is not given, or is an illegal value (at_position <0 or at_position >= [method get_point_count]), the point will be appended at the end of the point list. If the parameter is null, then the default value is new Vector2(0, 0) If the parameter is null, then the default value is new Vector2(0, 0) Sets the position for the vertex idx. If the index is out of bounds, the function sends an error to the console. Returns the position of the vertex idx. If the index is out of bounds, the function sends an error to the console, and returns (0, 0). Sets the position of the control point leading to the vertex idx. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. Returns the position of the control point leading to the vertex idx. The returned position is relative to the vertex idx. If the index is out of bounds, the function sends an error to the console, and returns (0, 0). Sets the position of the control point leading out of the vertex idx. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. Returns the position of the control point leading out of the vertex idx. The returned position is relative to the vertex idx. If the index is out of bounds, the function sends an error to the console, and returns (0, 0). Deletes the point idx from the curve. Sends an error to the console if idx is out of bounds. Removes all points from the curve. Returns the position between the vertex idx and the vertex idx + 1, where t controls if the point is the first vertex (t = 0.0), the last vertex (t = 1.0), or in between. Values of t outside the range (0.0 >= t <=1) give strange, but predictable results. If idx is out of bounds it is truncated to the first or last vertex, and t is ignored. If the curve has no points, the function sends an error to the console, and returns (0, 0). Returns the position at the vertex fofs. It calls using the integer part of fofs as idx, and its fractional part as t. Returns the total length of the curve, based on the cached points. Given enough density (see ), it should be approximate enough. Returns a point within the curve at position offset, where offset is measured as a pixel distance along the curve. To do that, it finds the two cached points where the offset lies between, then interpolates the values. This interpolation is cubic if cubic is set to true, or linear if set to false. Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise enough). Returns the cache of points as a . Returns the closest baked point (in curve's local space) to to_point. to_point must be in this curve's local space. Returns the closest offset to to_point. This offset is meant to be used in . to_point must be in this curve's local space. Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts. This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough. max_stages controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care! tolerance_degrees controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided. This class describes a Bézier curve in 3D space. It is mainly used to give a shape to a , but can be manually sampled for other purposes. It keeps a cache of precalculated points along the curve, to speed up further calculations. The distance in meters between two adjacent cached points. Changing it forces the cache to be recomputed the next time the or function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. If true, the curve will bake up vectors used for orientation. This is used when is set to . Changing it forces the cache to be recomputed. Returns the number of points describing the curve. Adds a point to a curve at position, with control points in and out. If at_position is given, the point is inserted before the point number at_position, moving that point (and every point after) after the inserted point. If at_position is not given, or is an illegal value (at_position <0 or at_position >= [method get_point_count]), the point will be appended at the end of the point list. If the parameter is null, then the default value is new Vector3(0, 0, 0) If the parameter is null, then the default value is new Vector3(0, 0, 0) Sets the position for the vertex idx. If the index is out of bounds, the function sends an error to the console. Returns the position of the vertex idx. If the index is out of bounds, the function sends an error to the console, and returns (0, 0, 0). Sets the tilt angle in radians for the point idx. If the index is out of bounds, the function sends an error to the console. The tilt controls the rotation along the look-at axis an object traveling the path would have. In the case of a curve controlling a , this tilt is an offset over the natural tilt the calculates. Returns the tilt angle in radians for the point idx. If the index is out of bounds, the function sends an error to the console, and returns 0. Sets the position of the control point leading to the vertex idx. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. Returns the position of the control point leading to the vertex idx. The returned position is relative to the vertex idx. If the index is out of bounds, the function sends an error to the console, and returns (0, 0, 0). Sets the position of the control point leading out of the vertex idx. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. Returns the position of the control point leading out of the vertex idx. The returned position is relative to the vertex idx. If the index is out of bounds, the function sends an error to the console, and returns (0, 0, 0). Deletes the point idx from the curve. Sends an error to the console if idx is out of bounds. Removes all points from the curve. Returns the position between the vertex idx and the vertex idx + 1, where t controls if the point is the first vertex (t = 0.0), the last vertex (t = 1.0), or in between. Values of t outside the range (0.0 >= t <=1) give strange, but predictable results. If idx is out of bounds it is truncated to the first or last vertex, and t is ignored. If the curve has no points, the function sends an error to the console, and returns (0, 0, 0). Returns the position at the vertex fofs. It calls using the integer part of fofs as idx, and its fractional part as t. Returns the total length of the curve, based on the cached points. Given enough density (see ), it should be approximate enough. Returns a point within the curve at position offset, where offset is measured as a distance in 3D units along the curve. To do that, it finds the two cached points where the offset lies between, then interpolates the values. This interpolation is cubic if cubic is set to true, or linear if set to false. Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise enough). Returns an up vector within the curve at position offset, where offset is measured as a distance in 3D units along the curve. To do that, it finds the two cached up vectors where the offset lies between, then interpolates the values. If apply_tilt is true, an interpolated tilt is applied to the interpolated up vector. If the curve has no up vectors, the function sends an error to the console, and returns (0, 1, 0). Returns the cache of points as a . Returns the cache of tilts as a . Returns the cache of up vectors as a . If is false, the cache will be empty. Returns the closest baked point (in curve's local space) to to_point. to_point must be in this curve's local space. Returns the closest offset to to_point. This offset is meant to be used in or . to_point must be in this curve's local space. Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts. This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough. max_stages controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care! tolerance_degrees controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided. Renders a given provided to it. Simplifies the task of drawing curves and/or saving them as image files. The width of the texture. The curve rendered onto the texture. Class representing a cylindrical . This class can be used to create cones by setting either the or properties to 0.0. Top radius of the cylinder. Bottom radius of the cylinder. Full height of the cylinder. Number of radial segments on the cylinder. Number of edge rings along the height of the cylinder. Cylinder shape for collisions. The cylinder's radius. The cylinder's height. This class is used to store the state of a DTLS server. Upon it converts connected to accepting them via as DTLS clients. Under the hood, this class is used to store the DTLS state and cookies of the server. The reason of why the state and cookies are needed is outside of the scope of this documentation. Below a small example of how to use it: # server.gd extends Node var dtls := DTLSServer.new() var server := UDPServer.new() var peers = [] func _ready(): server.listen(4242) var key = load("key.key") # Your private key. var cert = load("cert.crt") # Your X509 certificate. dtls.setup(key, cert) func _process(delta): while server.is_connection_available(): var peer : PacketPeerUDP = server.take_connection() var dtls_peer : PacketPeerDTLS = dtls.take_connection(peer) if dtls_peer.get_status() != PacketPeerDTLS.STATUS_HANDSHAKING: continue # It is normal that 50% of the connections fails due to cookie exchange. print("Peer connected!") peers.append(dtls_peer) for p in peers: p.poll() # Must poll to update the state. if p.get_status() == PacketPeerDTLS.STATUS_CONNECTED: while p.get_available_packet_count() > 0: print("Received message from client: %s" % p.get_packet().get_string_from_utf8()) p.put_packet("Hello DTLS client".to_utf8()) # client.gd extends Node var dtls := PacketPeerDTLS.new() var udp := PacketPeerUDP.new() var connected = false func _ready(): udp.connect_to_host("127.0.0.1", 4242) dtls.connect_to_peer(udp, false) # Use true in production for certificate validation! func _process(delta): dtls.poll() if dtls.get_status() == PacketPeerDTLS.STATUS_CONNECTED: if !connected: # Try to contact server dtls.put_packet("The answer is... 42!".to_utf8()) while dtls.get_available_packet_count() > 0: print("Connected: %s" % dtls.get_packet().get_string_from_utf8()) connected = true Setup the DTLS server to use the given private_key and provide the given certificate to clients. You can pass the optional chain parameter to provide additional CA chain information along with the certificate. Try to initiate the DTLS handshake with the given udp_peer which must be already connected (see ). Note: You must check that the state of the return PacketPeerUDP is , as it is normal that 50% of the new connections will be invalid due to cookie exchange. Damped spring constraint for 2D physics. This resembles a spring joint that always wants to go back to a given length. The spring joint's maximum length. The two attached bodies cannot stretch it past this value. When the bodies attached to the spring joint move they stretch or squash it. The joint always tries to resize towards this length. The higher the value, the less the bodies attached to the joint will deform it. The joint applies an opposing force to the bodies, the product of the stiffness multiplied by the size difference from its resting length. The spring joint's damping ratio. A value between 0 and 1. When the two bodies move into different directions the system tries to align them to the spring axis again. A high damping value forces the attached bodies to align faster. A directional light is a type of node that models an infinite number of parallel rays covering the entire scene. It is used for lights with strong intensity that are located far away from the scene to model sunlight or moonlight. The worldspace location of the DirectionalLight transform (origin) is ignored. Only the basis is used to determine light direction. Renders the entire scene's shadow map from an orthogonal point of view. This is the fastest directional shadow mode. May result in blurrier shadows on close objects. Splits the view frustum in 2 areas, each with its own shadow map. This shadow mode is a compromise between and in terms of performance. Splits the view frustum in 4 areas, each with its own shadow map. This is the slowest directional shadow mode. Keeps the shadow stable when the camera moves, at the cost of lower effective shadow resolution. Tries to achieve maximum shadow resolution. May result in saw effect on shadow edges. This mode typically works best in games where the camera will often move at high speeds, such as most racing games. The light's shadow rendering algorithm. See . The distance from camera to shadow split 1. Relative to . Only used when is SHADOW_PARALLEL_2_SPLITS or SHADOW_PARALLEL_4_SPLITS. The distance from shadow split 1 to split 2. Relative to . Only used when is SHADOW_PARALLEL_2_SPLITS or SHADOW_PARALLEL_4_SPLITS. The distance from shadow split 2 to split 3. Relative to . Only used when is SHADOW_PARALLEL_4_SPLITS. If true, shadow detail is sacrificed in exchange for smoother transitions between splits. Can be used to fix special cases of self shadowing when objects are perpendicular to the light. Amount of extra bias for shadow splits that are far away. If self-shadowing occurs only on the splits far away, increasing this value can fix them. Optimizes shadow rendering for detail versus movement. See . The maximum distance for shadow splits. DynamicFont renders vector font files (such as TTF or OTF) dynamically at runtime instead of using a prerendered texture atlas like . This trades the faster loading time of s for the ability to change font parameters like size and spacing during runtime. is used for referencing the font file paths. DynamicFont also supports defining one or more fallback fonts, which will be used when displaying a character not supported by the main font. DynamicFont uses the FreeType library for rasterization. var dynamic_font = DynamicFont.new() dynamic_font.font_data = load("res://BarlowCondensed-Bold.ttf") dynamic_font.size = 64 $"Label".set("custom_fonts/font", dynamic_font) Note: DynamicFont doesn't support features such as kerning, right-to-left typesetting, ligatures, text shaping, variable fonts and optional font features yet. If you wish to "bake" an optional font feature into a TTF font file, you can use FontForge to do so. In FontForge, use File > Generate Fonts, click Options, choose the desired features then generate the font. Spacing at the top. Spacing at the bottom. Spacing for each character. Spacing for the space character. The font size in pixels. The font outline's thickness in pixels (not relative to the font size). The font outline's color. Note: It's recommended to leave this at the default value so that you can adjust it in individual controls. For example, if the outline is made black here, it won't be possible to change its color using a Label's font outline modulate theme item. If true, mipmapping is used. This improves the font's appearance when downscaling it if font oversampling is disabled or ineffective. If true, filtering is used. This makes the font blurry instead of pixelated when scaling it if font oversampling is disabled or ineffective. It's recommended to enable this when using the font in a control whose size changes over time, unless a pixel art aesthetic is desired. Extra spacing at the top in pixels. Extra spacing at the bottom in pixels. Extra spacing for each character in pixels. This can be a negative number to make the distance between characters smaller. Extra spacing for the space character (in addition to ) in pixels. This can be a negative number to make the distance between words smaller. The font data. Returns a string containing all the characters available in the main and all the fallback fonts. If a given character is included in more than one font, it appears only once in the returned string. Sets the spacing for type (see ) to value in pixels (not relative to the font size). Returns the spacing for the given type (see ). Adds a fallback font. Sets the fallback font at index idx. Returns the fallback font at index idx. Removes the fallback font at index idx. Returns the number of fallback fonts. Used with to describe the location of a vector font file for dynamic rendering at runtime. Disables font hinting (smoother but less crisp). Use the light font hinting mode. Use the default font hinting mode (crisper but less smooth). If true, the font is rendered with anti-aliasing. This property applies both to the main font and its outline (if it has one). The font hinting mode used by FreeType. See for options. The path to the vector font file. Utility class which holds a reference to the internal identifier of an instance, as given by . This ID can then be used to retrieve the object instance with @GDScript.instance_from_id. This class is used internally by the editor inspector and script debugger, but can also be used in plugins to pass and display objects as their IDs. The identifier stored in this instance. The object instance can be retrieved with @GDScript.instance_from_id. Resource for environment nodes (like ) that define multiple environment operations (such as background or , ambient light, fog, depth-of-field...). These parameters affect the final render of the scene. The order of these operations is: - Depth of Field Blur - Glow - Tonemap (Auto Exposure) - Adjustments These effects will only apply when the 's intended usage is "3D" or "3D Without Effects". This can be configured for the root Viewport with , or for specific Viewports via the property. No blur for the screen-space ambient occlusion effect (fastest). 1×1 blur for the screen-space ambient occlusion effect. 2×2 blur for the screen-space ambient occlusion effect. 3×3 blur for the screen-space ambient occlusion effect (slowest). Linear tonemapper operator. Reads the linear data and passes it on unmodified. Reinhardt tonemapper operator. Performs a variation on rendered pixels' colors by this formula: color = color / (1 + color). Filmic tonemapper operator. Academy Color Encoding System tonemapper operator. Additive glow blending mode. Mostly used for particles, glows (bloom), lens flare, bright sources. Screen glow blending mode. Increases brightness, used frequently with bloom. Soft light glow blending mode. Modifies contrast, exposes shadows and highlights (vivid bloom). Replace glow blending mode. Replaces all pixels' color by the glow value. This can be used to simulate a full-screen blur effect by tweaking the glow parameters to match the original image's brightness. Keeps on screen every pixel drawn in the background. This is the fastest background mode, but it can only be safely used in fully-interior scenes (no visible sky or sky reflections). If enabled in a scene where the background is visible, "ghost trail" artifacts will be visible when moving the camera. Clears the background using the clear color defined in . Clears the background using a custom clear color. Displays a user-defined sky in the background. Clears the background using a custom clear color and allows defining a sky for shading and reflection. This mode is slightly faster than and should be preferred in scenes where reflections can be visible, but the sky itself never is (e.g. top-down camera). Displays a in the background. Displays a camera feed in the background. Represents the size of the enum. Low quality for the screen-space ambient occlusion effect (fastest). Low quality for the screen-space ambient occlusion effect. Low quality for the screen-space ambient occlusion effect (slowest). Low depth-of-field blur quality (fastest). Medium depth-of-field blur quality. High depth-of-field blur quality (slowest). The background mode. See for possible values. The resource defined as background. The resource's custom field of view. The resource's rotation expressed as a . The resource's rotation expressed as Euler angles in radians. The resource's rotation expressed as Euler angles in degrees. The displayed for clear areas of the scene. Only effective when using the or background modes). The power of the light emitted by the background. The maximum layer ID to display. Only effective when using the background mode. The ID of the camera feed to show in the background. The ambient light's . The ambient light's energy. The higher the value, the stronger the light. Defines the amount of light that the sky brings on the scene. A value of 0 means that the sky's light emission has no effect on the scene illumination, thus all ambient illumination is provided by the ambient light. On the contrary, a value of 1 means that all the light that affects the scene is provided by the sky, thus the ambient light parameter has no effect on the scene. If true, fog effects are enabled. and/or must be set to true to actually display fog. The fog's . The depth fog's when looking towards the sun. The intensity of the depth fog color transition when looking towards the sun. The sun's direction is determined automatically using the DirectionalLight node in the scene. If true, the depth fog effect is enabled. When enabled, fog will appear in the distance (relative to the camera). The fog's depth starting distance from the camera. The fog's depth end distance from the camera. If this value is set to 0, it will be equal to the current camera's value. The fog depth's intensity curve. A number of presets are available in the Inspector by right-clicking the curve. Enables fog's light transmission effect. If true, light will be more visible in the fog to simulate light scattering as in real life. The intensity of the fog light transmittance effect. Amount of light that the fog transmits. If true, the height fog effect is enabled. When enabled, fog will appear in a defined height range, regardless of the distance from the camera. This can be used to simulate "deep water" effects with a lower performance cost compared to a dedicated shader. The Y coordinate where the height fog will be the least intense. If this value is greater than , fog will be displayed from top to bottom. Otherwise, it will be displayed from bottom to top. The Y coordinate where the height fog will be the most intense. If this value is greater than , fog will be displayed from bottom to top. Otherwise, it will be displayed from top to bottom. The height fog's intensity. A number of presets are available in the Inspector by right-clicking the curve. The tonemapping mode to use. Tonemapping is the process that "converts" HDR values to be suitable for rendering on a LDR display. (Godot doesn't support rendering on HDR displays yet.) The default exposure used for tonemapping. The white reference value for tonemapping. Only effective if the isn't set to . If true, enables the tonemapping auto exposure mode of the scene renderer. If true, the renderer will automatically determine the exposure setting to adapt to the scene's illumination and the observed light. The scale of the auto exposure effect. Affects the intensity of auto exposure. The minimum luminance value for the auto exposure. The maximum luminance value for the auto exposure. The speed of the auto exposure effect. Affects the time needed for the camera to perform auto exposure. If true, screen-space reflections are enabled. Screen-space reflections are more accurate than reflections from s or s, but are slower and can't reflect surfaces occluded by others. The maximum number of steps for screen-space reflections. Higher values are slower. The fade-in distance for screen-space reflections. Affects the area from the reflected material to the screen-space reflection). The fade-out distance for screen-space reflections. Affects the area from the screen-space reflection to the "global" reflection. The depth tolerance for screen-space reflections. If true, screen-space reflections will take the material roughness into account. If true, the screen-space ambient occlusion effect is enabled. This darkens objects' corners and cavities to simulate ambient light not reaching the entire object as in real life. This works well for small, dynamic objects, but baked lighting or ambient occlusion textures will do a better job at displaying ambient occlusion on large static objects. This is a costly effect and should be disabled first when running into performance issues. The primary screen-space ambient occlusion radius. The primary screen-space ambient occlusion intensity. See also . The secondary screen-space ambient occlusion radius. If set to a value higher than 0, enables the secondary screen-space ambient occlusion effect which can be used to improve the effect's appearance (at the cost of performance). The secondary screen-space ambient occlusion intensity. See also . The screen-space ambient occlusion bias. This should be kept high enough to prevent "smooth" curves from being affected by ambient occlusion. The screen-space ambient occlusion intensity in direct light. In real life, ambient occlusion only applies to indirect light, which means its effects can't be seen in direct light. Values higher than 0 will make the SSAO effect visible in direct light. The screen-space ambient occlusion intensity on materials that have an AO texture defined. Values higher than 0 will make the SSAO effect visible in areas darkened by AO textures. The screen-space ambient occlusion color. The screen-space ambient occlusion quality. Higher qualities will make better use of small objects for ambient occlusion, but are slower. The screen-space ambient occlusion blur quality. See for possible values. The screen-space ambient occlusion edge sharpness. If true, enables the depth-of-field far blur effect. The distance from the camera where the far blur effect affects the rendering. The length of the transition between the no-blur area and far blur. The amount of far blur for the depth-of-field effect. The depth-of-field far blur's quality. Higher values can mitigate the visible banding effect seen at higher strengths, but are much slower. If true, enables the depth-of-field near blur effect. Distance from the camera where the near blur effect affects the rendering. The length of the transition between the near blur and no-blur area. The amount of near blur for the depth-of-field effect. The depth-of-field near blur's quality. Higher values can mitigate the visible banding effect seen at higher strengths, but are much slower. If true, the glow effect is enabled. If true, the 1st level of glow is enabled. This is the most "local" level (least blurry). If true, the 2th level of glow is enabled. If true, the 3th level of glow is enabled. If true, the 4th level of glow is enabled. If true, the 5th level of glow is enabled. If true, the 6th level of glow is enabled. If true, the 7th level of glow is enabled. This is the most "global" level (blurriest). The glow intensity. When using the GLES2 renderer, this should be increased to 1.5 to compensate for the lack of HDR rendering. The glow strength. When using the GLES2 renderer, this should be increased to 1.3 to compensate for the lack of HDR rendering. The bloom's intensity. If set to a value higher than 0, this will make glow visible in areas darker than the . The glow blending mode. The lower threshold of the HDR glow. When using the GLES2 renderer (which doesn't support HDR), this needs to be below 1.0 for glow to be visible. A value of 0.9 works well in this case. The higher threshold of the HDR glow. Areas brighter than this threshold will be clamped for the purposes of the glow effect. The bleed scale of the HDR glow. Smooths out the blockiness created by sampling higher levels, at the cost of performance. Note: When using the GLES2 renderer, this is only available if the GPU supports the GL_EXT_gpu_shader4 extension. If true, enables the adjustment_* properties provided by this resource. If false, modifications to the adjustment_* properties will have no effect on the rendered scene. The global brightness value of the rendered scene. Effective only if adjustment_enabled is true. The global contrast value of the rendered scene (default value is 1). Effective only if adjustment_enabled is true. The global color saturation value of the rendered scene (default value is 1). Effective only if adjustment_enabled is true. Applies the provided resource to affect the global color aspect of the rendered scene. Effective only if adjustment_enabled is true. Enables or disables the glow level at index idx. Each level relies on the previous level. This means that enabling higher glow levels will slow down the glow effect rendering, even if previous levels aren't enabled. Returns true if the glow level idx is specified, false otherwise. An expression can be made of any arithmetic operation, built-in math function call, method call of a passed instance, or built-in type construction call. An example expression text using the built-in math functions could be sqrt(pow(3,2) + pow(4,2)). In the following example we use a node to write our expression and show the result. onready var expression = Expression.new() func _ready(): $LineEdit.connect("text_entered", self, "_on_text_entered") func _on_text_entered(command): var error = expression.parse(command, []) if error != OK: print(expression.get_error_text()) return var result = expression.execute([], null, true) if not expression.has_execute_failed(): $LineEdit.text = str(result) Parses the expression and returns an code. You can optionally specify names of variables that may appear in the expression with input_names, so that you can bind them when it gets executed. If the parameter is null, then the default value is new string[] {} Executes the expression that was previously parsed by and returns the result. Before you use the returned object, you should check if the method failed by calling . If you defined input variables in , you can specify their values in the inputs array, in the same order. If the parameter is null, then the default value is new Godot.Collections.Array {} Returns true if has failed. Returns the error text if has failed. Enable support for the OpenGL ES external texture extension as defined by OES_EGL_image_external. Note: This is only supported for Android platforms. External texture size. Returns the external texture name. FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks. The FileDialog automatically sets its window title according to the . If you want to use a custom title, disable this by setting to false. The dialog allows selecting one, and only one file. The dialog allows selecting multiple files. The dialog only allows selecting a directory, disallowing the selection of any file. The dialog allows selecting one file or directory. The dialog will warn when a file exists. The dialog only allows accessing files under the path (res://). The dialog only allows accessing files under user data path (user://). The dialog allows accessing files on the whole file system. If true, changing the Mode property will set the window title accordingly (e.g. setting mode to will change the window title to "Open a File"). The dialog's open or save mode, which affects the selection behavior. See enum Mode constants. The file system access scope. See enum Access constants. Warning: Currently, in sandboxed environments such as HTML5 builds or sandboxed macOS apps, FileDialog cannot access the host file system. See godot-proposals#1123. The available file type filters. For example, this shows only .png and .gd files: set_filters(PoolStringArray(["*.png ; PNG Images","*.gd ; GDScript Files"])). If true, the dialog will show hidden files. The current working directory of the file dialog. The currently selected file of the file dialog. The currently selected file path of the file dialog. Clear all the added filters in the dialog. Adds filter as a custom filter; filter should be of the form "filename.extension ; Description". For example, "*.png ; PNG Images". Returns the vertical box container of the dialog, custom controls can be added to it. Returns the LineEdit for the selected file. Clear currently selected items in the dialog. Invalidate and update the current dialog content list. Font contains a Unicode-compatible character set, as well as the ability to draw it with variable width, ascent, descent and kerning. For creating fonts from TTF files (or other font formats), see the editor support for fonts. Note: If a DynamicFont doesn't contain a character used in a string, the character in question will be replaced with codepoint 0xfffd if it's available in the DynamicFont. If this replacement character isn't available in the DynamicFont, the character will be hidden without displaying any replacement character in the string. Note: If a BitmapFont doesn't contain a character used in a string, the character in question will be hidden without displaying any replacement character in the string. Draw string into a canvas item using the font at a given position, with modulate color, and optionally clipping the width. position specifies the baseline, not the top. To draw from the top, ascent must be added to the Y axis. See also . If the parameter is null, then the default value is new Color(1, 1, 1, 1) If the parameter is null, then the default value is new Color(1, 1, 1, 1) Returns the font ascent (number of pixels above the baseline). Returns the font descent (number of pixels below the baseline). Returns the total font height (ascent plus descent) in pixels. Returns the size of a character, optionally taking kerning into account if the next character is provided. Note that the height returned is the font height (see ) and has no relation to the glyph height. Returns the size of a string, taking kerning and advance into account. Note that the height returned is the font height (see ) and has no relation to the string. Returns the size that the string would have with word wrapping enabled with a fixed width. Returns true if the font has an outline. Draw character char into a canvas item using the font at a given position, with modulate color, and optionally kerning if next is passed. clipping the width. position specifies the baseline, not the top. To draw from the top, ascent must be added to the Y axis. The width used by the character is returned, making this function useful for drawing strings character by character. If the parameter is null, then the default value is new Color(1, 1, 1, 1) After editing a font (changing size, ascent, char rects, etc.). Call this function to propagate changes to controls that might use it. In GDScript, functions are not first-class objects. This means it is impossible to store them directly as variables, return them from another function, or pass them as arguments. However, by creating a using the @GDScript.funcref function, a reference to a function in a given object can be created, passed around and called. The name of the referenced function. Calls the referenced function previously set in or @GDScript.funcref. Calls the referenced function previously set in or @GDScript.funcref. Contrarily to , this method does not support a variable number of arguments but expects all parameters to be passed via a single . The object containing the referenced function. This object must be of a type actually inheriting from , not a built-in type such as , or . Returns whether the object still exists and has the function assigned. A GDNative library can implement s, global functions to call with the class, or low-level engine extensions through interfaces such as . The library must be compiled for each platform and architecture that the project will run on. This resource in INI-style format, as in .gdnlib files. If true, Godot loads only one copy of the library and each script that references the library will share static data like static or global variables. If false, Godot loads a separate copy of the library into memory for each script that references it. If true, Godot loads the library at startup rather than the first time a script uses the library, calling {prefix}gdnative_singleton after initializing the library (where {prefix} is the value of ). The library remains loaded as long as Godot is running. Note: A singleton library cannot be . The prefix this library's entry point functions begin with. For example, a GDNativeLibrary would declare its gdnative_init function as godot_gdnative_init by default. On platforms that require statically linking libraries (currently only iOS), each library must have a different symbol_prefix. If true, the editor will temporarily unload the library whenever the user switches away from the editor window, allowing the user to recompile the library without restarting Godot. Note: If the library defines tool scripts that run inside the editor, reloadable must be false. Otherwise, the editor will attempt to unload the tool scripts while they're in use and crash. Returns the path to the dynamic library file for the current platform and architecture. Returns paths to all dependency libraries for the current platform and architecture. A script implemented in the GDScript programming language. The script extends the functionality of all objects that instance it. creates a new instance of the script. extends an existing object, if that object's class matches one of the script's base classes. Returns a new instance of the script. For example: var MyClass = load("myclass.gd") var instance = MyClass.new() assert(instance.get_script() == MyClass) Returns byte code for the script source code. Calling @GDScript.yield within a function will cause that function to yield and return its current state as an object of this type. The yielded function call can then be resumed later by calling on this state object. Resume execution of the yielded function call. If handed an argument, return the argument from the @GDScript.yield call in the yielded function call. You can pass e.g. an to hand multiple arguments. This function returns what the resumed function call returns, possibly another function state if yielded again. Check whether the function call may be resumed. This is not the case if the function state was already resumed. If extended_check is enabled, it also checks if the associated script and object still exist. The extended check is done in debug mode as part of , but you can use this if you know you may be trying to resume without knowing for sure the object and/or script have survived up to that point. s are used to provide high-quality real-time indirect light to scenes. They precompute the effect of objects that emit light and the effect of static geometry to simulate the behavior of complex light in real-time. s need to be baked before using, however, once baked, dynamic objects will receive light from them. Further, lights can be fully dynamic or baked. Having s in a scene can be expensive, the quality of the probe can be turned down in exchange for better performance in the using . Note: Meshes should have sufficiently thick walls to avoid light leaks (avoid one-sided walls). For interior levels, enclose your level geometry in a sufficiently large box and bridge the loops to close the mesh. Note: Due to a renderer limitation, emissive s cannot emit light when used in a . Only emissive s can emit light in a . Use 64 subdivisions. This is the lowest quality setting, but the fastest. Use it if you can, but especially use it on lower-end hardware. Use 128 subdivisions. This is the default quality setting. Use 256 subdivisions. Use 512 subdivisions. This is the highest quality setting, but the slowest. On lower-end hardware this could cause the GPU to stall. Represents the size of the enum. Number of times to subdivide the grid that the operates on. A higher number results in finer detail and thus higher visual quality, while lower numbers result in better performance. The size of the area covered by the . If you make the extents larger without increasing the subdivisions with , the size of each cell will increase and result in lower detailed lighting. The maximum brightness that the will recognize. Brightness will be scaled within this range. Energy multiplier. Makes the lighting contribution from the brighter. How much light propagates through the probe internally. A higher value allows light to spread further. Offsets the lookup of the light contribution from the . This can be used to avoid self-shadowing, but may introduce light leaking at higher values. This and should be played around with to minimize self-shadowing and light leaking. Note: bias should usually be above 1.0 as that is the size of the voxels. Offsets the lookup into the based on the object's normal direction. Can be used to reduce some self-shadowing artifacts. If true, ignores the sky contribution when calculating lighting. If true, the data for this will be compressed. Compression saves space, but results in far worse visual quality. The resource that holds the data for this . Bakes the effect from all s marked with and s marked with either or . If create_visual_debug is true, after baking the light, this will generate a that has a cube representing each solid cell with each cube colored to the cell's albedo color. This can be used to visualize the 's data and debug any issues that may be occurring. Calls with create_visual_debug enabled. The first 3 DOF axes are linear axes, which represent translation of Bodies, and the latter 3 DOF axes represent the angular motion. Each axis can be either locked, or limited. The minimum difference between the pivot points' axes. The maximum difference between the pivot points' axes. A factor applied to the movement across the axes. The lower, the slower the movement. The amount of restitution on the axes' movement. The lower, the more momentum gets lost. The amount of damping that happens at the linear motion across the axes. The velocity the linear motor will try to reach. The maximum force the linear motor will apply while trying to reach the velocity target. The minimum rotation in negative direction to break loose and rotate around the axes. The minimum rotation in positive direction to break loose and rotate around the axes. The speed of all rotations across the axes. The amount of rotational damping across the axes. The lower, the more dampening occurs. The amount of rotational restitution across the axes. The lower, the more restitution occurs. The maximum amount of force that can occur, when rotating around the axes. When rotating across the axes, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. Target speed for the motor at the axes. Maximum acceleration for the motor at the axes. Represents the size of the enum. If enabled, linear motion is possible within the given limits. If enabled, rotational motion is possible within the given limits. If enabled, there is a rotational motor across these axes. If enabled, there is a linear motor across these axes. Represents the size of the enum. If true, the linear motion across the X axis is limited. The maximum difference between the pivot points' X axis. The minimum difference between the pivot points' X axis. A factor applied to the movement across the X axis. The lower, the slower the movement. The amount of restitution on the X axis movement. The lower, the more momentum gets lost. The amount of damping that happens at the X motion. If true, then there is a linear motor on the X axis. It will attempt to reach the target velocity while staying within the force limits. The speed that the linear motor will attempt to reach on the X axis. The maximum force the linear motor can apply on the X axis while trying to reach the target velocity. If true, rotation across the X axis is limited. The minimum rotation in positive direction to break loose and rotate around the X axis. The minimum rotation in negative direction to break loose and rotate around the X axis. The speed of all rotations across the X axis. The amount of rotational restitution across the X axis. The lower, the more restitution occurs. The amount of rotational damping across the X axis. The lower, the longer an impulse from one side takes to travel to the other side. The maximum amount of force that can occur, when rotating around the X axis. When rotating across the X axis, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. If true, a rotating motor at the X axis is enabled. Target speed for the motor at the X axis. Maximum acceleration for the motor at the X axis. If true, the linear motion across the Y axis is limited. The maximum difference between the pivot points' Y axis. The minimum difference between the pivot points' Y axis. A factor applied to the movement across the Y axis. The lower, the slower the movement. The amount of restitution on the Y axis movement. The lower, the more momentum gets lost. The amount of damping that happens at the Y motion. If true, then there is a linear motor on the Y axis. It will attempt to reach the target velocity while staying within the force limits. The speed that the linear motor will attempt to reach on the Y axis. The maximum force the linear motor can apply on the Y axis while trying to reach the target velocity. If true, rotation across the Y axis is limited. The minimum rotation in positive direction to break loose and rotate around the Y axis. The minimum rotation in negative direction to break loose and rotate around the Y axis. The speed of all rotations across the Y axis. The amount of rotational restitution across the Y axis. The lower, the more restitution occurs. The amount of rotational damping across the Y axis. The lower, the more dampening occurs. The maximum amount of force that can occur, when rotating around the Y axis. When rotating across the Y axis, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. If true, a rotating motor at the Y axis is enabled. Target speed for the motor at the Y axis. Maximum acceleration for the motor at the Y axis. If true, the linear motion across the Z axis is limited. The maximum difference between the pivot points' Z axis. The minimum difference between the pivot points' Z axis. A factor applied to the movement across the Z axis. The lower, the slower the movement. The amount of restitution on the Z axis movement. The lower, the more momentum gets lost. The amount of damping that happens at the Z motion. If true, then there is a linear motor on the Z axis. It will attempt to reach the target velocity while staying within the force limits. The speed that the linear motor will attempt to reach on the Z axis. The maximum force the linear motor can apply on the Z axis while trying to reach the target velocity. If true, rotation across the Z axis is limited. The minimum rotation in positive direction to break loose and rotate around the Z axis. The minimum rotation in negative direction to break loose and rotate around the Z axis. The speed of all rotations across the Z axis. The amount of rotational restitution across the Z axis. The lower, the more restitution occurs. The amount of rotational damping across the Z axis. The lower, the more dampening occurs. The maximum amount of force that can occur, when rotating around the Z axis. When rotating across the Z axis, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. If true, a rotating motor at the Z axis is enabled. Target speed for the motor at the Z axis. Maximum acceleration for the motor at the Z axis. Base node for geometry-based visual instances. Shares some common functionality like visibility and custom materials. Will allow the GeometryInstance to be used when baking lights using a or . Unused in this class, exposed for consistency with . Represents the size of the enum. Will not cast any shadows. Will cast shadows from all visible faces in the GeometryInstance. Will take culling into account, so faces not being rendered will not be taken into account when shadow casting. Will cast shadows from all visible faces in the GeometryInstance. Will not take culling into account, so all faces will be taken into account when shadow casting. Will only show the shadows casted from this object. In other words, the actual mesh will not be visible, only the shadows casted from the mesh will be. The generated lightmap texture will have the original size. The generated lightmap texture will be twice as large, on each axis. The generated lightmap texture will be 4 times as large, on each axis. The generated lightmap texture will be 8 times as large, on each axis. The material override for the whole geometry. If a material is assigned to this property, it will be used instead of any material set in any material slot of the mesh. The selected shadow casting flag. See for possible values. The extra distance added to the GeometryInstance's bounding box () to increase its cull box. If true, this GeometryInstance will be used when baking lights using a or . When disabled, the mesh will be taken into account when computing indirect lighting, but the resulting lightmap will not be saved. Useful for emissive only materials or shadow casters. Scale factor for the generated baked lightmap. Useful for adding detail to certain mesh instances. The GeometryInstance's min LOD distance. Note: This property currently has no effect. The GeometryInstance's min LOD margin. Note: This property currently has no effect. The GeometryInstance's max LOD distance. Note: This property currently has no effect. The GeometryInstance's max LOD margin. Note: This property currently has no effect. Sets the specified. See for options. Returns the that have been set for this object. Overrides the bounding box of this node with a custom one. To remove it, set an with all fields set to zero. Given a set of colors, this resource will interpolate them in order. This means that if you have color 1, color 2 and color 3, the ramp will interpolate from color 1 to color 2 and from color 2 to color 3. The ramp will initially have 2 colors (black and white), one (black) at ramp lower offset 0 and the other (white) at the ramp higher offset 1. Gradient's offsets returned as a . Gradient's colors returned as a . Adds the specified color to the end of the ramp, with the specified offset. Removes the color at the index point. Sets the offset for the ramp color at index point. Returns the offset of the ramp color at index point. Sets the color of the ramp color at index point. Returns the color of the ramp color at index point. Returns the interpolated color specified by offset. Returns the number of colors in the ramp. GradientTexture uses a to fill the texture data. The gradient will be filled from left to right using colors obtained from the gradient. This means the texture does not necessarily represent an exact copy of the gradient, but instead an interpolation of samples obtained from the gradient at fixed steps (see ). The that will be used to fill the texture. The number of color samples that will be obtained from the . GraphEdit manages the showing of GraphNodes it contains, as well as connections and disconnections between them. Signals are sent for each of these two events. Disconnection between GraphNode slots is disabled by default. It is greatly advised to enable low-processor usage mode (see ) when using GraphEdits. If true, enables disconnection of existing connections in the GraphEdit by dragging the right end. The scroll offset. The snapping distance in pixels. If true, enables snapping. The current zoom value. If true, the minimap is visible. The size of the minimap rectangle. The map itself is based on the size of the grid area and is scaled to fit this rectangle. The opacity of the minimap rectangle. Create a connection between the from_port slot of the from GraphNode and the to_port slot of the to GraphNode. If the connection already exists, no connection is created. Returns true if the from_port slot of the from GraphNode is connected to the to_port slot of the to GraphNode. Removes the connection between the from_port slot of the from GraphNode and the to_port slot of the to GraphNode. If the connection does not exist, no connection is removed. Sets the coloration of the connection between from's from_port and to's to_port with the color provided in the activity theme property. Returns an Array containing the list of connections. A connection consists in a structure of the form { from_port: 0, from: "GraphNode name 0", to_port: 1, to: "GraphNode name 1" }. Removes all connections between nodes. Makes possible to disconnect nodes when dragging from the slot at the right if it has the specified type. Removes the possibility to disconnect nodes when dragging from the slot at the right if it has the specified type. Makes possible to disconnect nodes when dragging from the slot at the left if it has the specified type. Removes the possibility to disconnect nodes when dragging from the slot at the left if it has the specified type. Makes possible the connection between two different slot types. The type is defined with the method. Makes it not possible to connect between two different slot types. The type is defined with the method. Returns whether it's possible to connect slots of the specified types. Gets the that contains the zooming and grid snap controls in the top left of the graph. Warning: The intended usage of this function is to allow you to reposition or add your own custom controls to the container. This is an internal control and as such should not be freed. If you wish to hide this or any of its children, use their property instead. Sets the specified node as the one selected. A GraphNode is a container. Each GraphNode can have several input and output slots, sometimes referred to as ports, allowing connections between GraphNodes. To add a slot to GraphNode, add any -derived child node to it. After adding at least one child to GraphNode new sections will be automatically created in the Inspector called 'Slot'. When 'Slot' is expanded you will see list with index number for each slot. You can click on each of them to expand further. In the Inspector you can enable (show) or disable (hide) slots. By default, all slots are disabled so you may not see any slots on your GraphNode initially. You can assign a type to each slot. Only slots of the same type will be able to connect to each other. You can also assign colors to slots. A tuple of input and output slots is defined for each GUI element included in the GraphNode. Input connections are on the left and output connections are on the right side of GraphNode. Only enabled slots are counted as connections. No overlay is shown. Show overlay set in the breakpoint theme property. Show overlay set in the position theme property. The text displayed in the GraphNode's title bar. The offset of the GraphNode, relative to the scroll offset of the . Note: You cannot use position directly, as is a . If true, the close button will be visible. Note: Pressing it will only emit the close_request signal, the GraphNode needs to be removed manually. If true, the user can resize the GraphNode. Note: Dragging the handle will only emit the resize_request signal, the GraphNode needs to be resized manually. If true, the GraphNode is selected. If true, the GraphNode is a comment node. Sets the overlay shown above the GraphNode. See . Sets properties of the slot with ID idx. If enable_left/right, a port will appear and the slot will be able to be connected from this side. type_left/right is an arbitrary type of the port. Only ports with the same type values can be connected. color_left/right is the tint of the port's icon on this side. custom_left/right is a custom texture for this side's port. Note: This method only sets properties of the slot. To create the slot, add a -derived child to the GraphNode. Disables input and output slot whose index is idx. Disables all input and output slots of the GraphNode. Returns true if left (input) slot idx is enabled, false otherwise. Returns the (integer) type of left (input) idx slot. Returns the color set to idx left (input) slot. Returns true if right (output) slot idx is enabled, false otherwise. Returns the (integer) type of right (output) idx slot. Returns the color set to idx right (output) slot. Returns the number of enabled output slots (connections) of the GraphNode. Returns the number of enabled input slots (connections) to the GraphNode. Returns the position of the output connection idx. Returns the type of the output connection idx. Returns the color of the output connection idx. Returns the position of the input connection idx. Returns the type of the input connection idx. Returns the color of the input connection idx. GridContainer will arrange its Control-derived children in a grid like structure, the grid columns are specified using the property and the number of rows will be equal to the number of children in the container divided by the number of columns. For example, if the container has 5 children, and 2 columns, there will be 3 rows in the container. Notice that grid layout will preserve the columns and rows for every size of the container, and that empty columns will be expanded automatically. Note: GridContainer only works with child nodes inheriting from Control. It won't rearrange child nodes inheriting from Node2D. The number of columns in the . If modified, reorders its Control-derived children to accommodate the new layout. GridMap lets you place meshes on a grid interactively. It works both from the editor and from scripts, which can help you create in-game level editors. GridMaps use a which contains a list of tiles. Each tile is a mesh with materials plus optional collision and navigation shapes. A GridMap contains a collection of cells. Each grid cell refers to a tile in the . All cells in the map have the same dimensions. Internally, a GridMap is split into a sparse collection of octants for efficient rendering and physics processing. Every octant has the same dimensions and can contain several cells. Note: GridMap doesn't extend and therefore can't be hidden or cull masked based on . If you make a light not affect the first layer, the whole GridMap won't be lit by the light in question. Invalid cell item that can be used in to clear cells (or represent an empty cell in ). The assigned . Controls whether this GridMap will be baked in a or not. The dimensions of the grid's cells. This does not affect the size of the meshes. See . The size of each octant measured in number of cells. This applies to all three axis. If true, grid items are centered on the X axis. If true, grid items are centered on the Y axis. If true, grid items are centered on the Z axis. The scale of the cell items. This does not affect the size of the grid cells themselves, only the items in them. This can be used to make cell items overlap their neighbors. The physics layers this GridMap is in. GridMaps act as static bodies, meaning they aren't affected by gravity or other forces. They only affect other physics bodies that collide with them. The physics layers this GridMap detects collisions in. See Collision layers and masks in the documentation for more information. Sets an individual bit on the . Returns an individual bit on the . Sets an individual bit on the . Returns an individual bit on the . Sets the mesh index for the cell referenced by its grid-based X, Y and Z coordinates. A negative item index such as will clear the cell. Optionally, the item's orientation can be passed. For valid orientation values, see Basis.get_orthogonal_index. The item index located at the grid-based X, Y and Z coordinates. If the cell is empty, will be returned. The orientation of the cell at the grid-based X, Y and Z coordinates. -1 is returned if the cell is empty. Returns the coordinates of the grid cell containing the given point. pos should be in the GridMap's local coordinate space. Returns the position of a grid cell in the GridMap's local coordinate space. Clear all cells. Returns an array of with the non-empty cell coordinates in the grid map. Returns an array of and references corresponding to the non-empty cells in the grid. The transforms are specified in world space. Returns an array of es and references of all bake meshes that exist within the current GridMap. Groove constraint for 2D physics. This is useful for making a body "slide" through a segment placed in another. The groove's length. The groove is from the joint's origin towards along the joint's local Y axis. The body B's initial anchor position defined by the joint's origin and a local offset along the joint's Y axis (along the groove). Horizontal box container. See . Horizontal version of , which goes from left (min) to right (max). Horizontal separator. See . Even though it looks horizontal, it is used to separate objects vertically. Horizontal slider. See . This one goes from left (min) to right (max). Note: The Range.changed and Range.value_changed signals are part of the class which this class inherits from. Horizontal split container. See . This goes from left to right. Hyper-text transfer protocol client (sometimes called "User Agent"). Used to make HTTP requests to download web content, upload files and other data or to communicate with various services, among other use cases. See the node for a higher-level alternative. Note: This client only needs to connect to a host once (see ) to send multiple requests. Because of this, methods that take URLs usually take just the part after the host instead of the full URL, as the client is already connected to a host. See for a full example and to get started. A should be reused between multiple requests or to connect to different hosts instead of creating one client per request. Supports SSL and SSL server certificate verification. HTTP status codes in the 2xx range indicate success, 3xx redirection (i.e. "try again, but over here"), 4xx something was wrong with the request, and 5xx something went wrong on the server's side. For more information on HTTP, see https://developer.mozilla.org/en-US/docs/Web/HTTP (or read RFC 2616 to get it straight from the source: https://tools.ietf.org/html/rfc2616). Note: When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to CORS. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the Access-Control-Allow-Origin: * HTTP header. Note: SSL/TLS support is currently limited to TLS 1.0, TLS 1.1, and TLS 1.2. Attempting to connect to a TLS 1.3-only server will return an error. Status: Disconnected from the server. Status: Currently resolving the hostname for the given URL into an IP. Status: DNS failure: Can't resolve the hostname for the given URL. Status: Currently connecting to server. Status: Can't connect to the server. Status: Connection established. Status: Currently sending request. Status: HTTP body received. Status: Error in HTTP connection. Status: Error in SSL handshake. HTTP GET method. The GET method requests a representation of the specified resource. Requests using GET should only retrieve data. HTTP HEAD method. The HEAD method asks for a response identical to that of a GET request, but without the response body. This is useful to request metadata like HTTP headers or to check if a resource exists. HTTP POST method. The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server. This is often used for forms and submitting data or uploading files. HTTP PUT method. The PUT method asks to replace all current representations of the target resource with the request payload. (You can think of POST as "create or update" and PUT as "update", although many services tend to not make a clear distinction or change their meaning). HTTP DELETE method. The DELETE method requests to delete the specified resource. HTTP OPTIONS method. The OPTIONS method asks for a description of the communication options for the target resource. Rarely used. HTTP TRACE method. The TRACE method performs a message loop-back test along the path to the target resource. Returns the entire HTTP request received in the response body. Rarely used. HTTP CONNECT method. The CONNECT method establishes a tunnel to the server identified by the target resource. Rarely used. HTTP PATCH method. The PATCH method is used to apply partial modifications to a resource. Represents the size of the enum. HTTP status code 100 Continue. Interim response that indicates everything so far is OK and that the client should continue with the request (or ignore this status if already finished). HTTP status code 101 Switching Protocol. Sent in response to an Upgrade request header by the client. Indicates the protocol the server is switching to. HTTP status code 102 Processing (WebDAV). Indicates that the server has received and is processing the request, but no response is available yet. HTTP status code 200 OK. The request has succeeded. Default response for successful requests. Meaning varies depending on the request. GET: The resource has been fetched and is transmitted in the message body. HEAD: The entity headers are in the message body. POST: The resource describing the result of the action is transmitted in the message body. TRACE: The message body contains the request message as received by the server. HTTP status code 201 Created. The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request. HTTP status code 202 Accepted. The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing. HTTP status code 203 Non-Authoritative Information. This response code means returned meta-information set is not exact set as available from the origin server, but collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead of this response. HTTP status code 204 No Content. There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones. HTTP status code 205 Reset Content. The server has fulfilled the request and desires that the client resets the "document view" that caused the request to be sent to its original state as received from the origin server. HTTP status code 206 Partial Content. This response code is used because of a range header sent by the client to separate download into multiple streams. HTTP status code 207 Multi-Status (WebDAV). A Multi-Status response conveys information about multiple resources in situations where multiple status codes might be appropriate. HTTP status code 208 Already Reported (WebDAV). Used inside a DAV: propstat response element to avoid enumerating the internal members of multiple bindings to the same collection repeatedly. HTTP status code 226 IM Used (WebDAV). The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance. HTTP status code 300 Multiple Choice. The request has more than one possible responses and there is no standardized way to choose one of the responses. User-agent or user should choose one of them. HTTP status code 301 Moved Permanently. Redirection. This response code means the URI of requested resource has been changed. The new URI is usually included in the response. HTTP status code 302 Found. Temporary redirection. This response code means the URI of requested resource has been changed temporarily. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests. HTTP status code 303 See Other. The server is redirecting the user agent to a different resource, as indicated by a URI in the Location header field, which is intended to provide an indirect response to the original request. HTTP status code 304 Not Modified. A conditional GET or HEAD request has been received and would have resulted in a 200 OK response if it were not for the fact that the condition evaluated to false. HTTP status code 305 Use Proxy. Deprecated. Do not use. HTTP status code 306 Switch Proxy. Deprecated. Do not use. HTTP status code 307 Temporary Redirect. The target resource resides temporarily under a different URI and the user agent MUST NOT change the request method if it performs an automatic redirection to that URI. HTTP status code 308 Permanent Redirect. The target resource has been assigned a new permanent URI and any future references to this resource ought to use one of the enclosed URIs. HTTP status code 400 Bad Request. The request was invalid. The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, invalid request contents, or deceptive request routing). HTTP status code 401 Unauthorized. Credentials required. The request has not been applied because it lacks valid authentication credentials for the target resource. HTTP status code 402 Payment Required. This response code is reserved for future use. Initial aim for creating this code was using it for digital payment systems, however this is not currently used. HTTP status code 403 Forbidden. The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to give proper response. Unlike 401, the client's identity is known to the server. HTTP status code 404 Not Found. The server can not find requested resource. Either the URL is not recognized or the endpoint is valid but the resource itself does not exist. May also be sent instead of 403 to hide existence of a resource if the client is not authorized. HTTP status code 405 Method Not Allowed. The request's HTTP method is known by the server but has been disabled and cannot be used. For example, an API may forbid DELETE-ing a resource. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code. HTTP status code 406 Not Acceptable. The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request. Used when negotiation content. HTTP status code 407 Proxy Authentication Required. Similar to 401 Unauthorized, but it indicates that the client needs to authenticate itself in order to use a proxy. HTTP status code 408 Request Timeout. The server did not receive a complete request message within the time that it was prepared to wait. HTTP status code 409 Conflict. The request could not be completed due to a conflict with the current state of the target resource. This code is used in situations where the user might be able to resolve the conflict and resubmit the request. HTTP status code 410 Gone. The target resource is no longer available at the origin server and this condition is likely permanent. HTTP status code 411 Length Required. The server refuses to accept the request without a defined Content-Length header. HTTP status code 412 Precondition Failed. One or more conditions given in the request header fields evaluated to false when tested on the server. HTTP status code 413 Entity Too Large. The server is refusing to process a request because the request payload is larger than the server is willing or able to process. HTTP status code 414 Request-URI Too Long. The server is refusing to service the request because the request-target is longer than the server is willing to interpret. HTTP status code 415 Unsupported Media Type. The origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource. HTTP status code 416 Requested Range Not Satisfiable. None of the ranges in the request's Range header field overlap the current extent of the selected resource or the set of ranges requested has been rejected due to invalid ranges or an excessive request of small or overlapping ranges. HTTP status code 417 Expectation Failed. The expectation given in the request's Expect header field could not be met by at least one of the inbound servers. HTTP status code 418 I'm A Teapot. Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot". The resulting entity body MAY be short and stout. HTTP status code 421 Misdirected Request. The request was directed at a server that is not able to produce a response. This can be sent by a server that is not configured to produce responses for the combination of scheme and authority that are included in the request URI. HTTP status code 422 Unprocessable Entity (WebDAV). The server understands the content type of the request entity (hence a 415 Unsupported Media Type status code is inappropriate), and the syntax of the request entity is correct (thus a 400 Bad Request status code is inappropriate) but was unable to process the contained instructions. HTTP status code 423 Locked (WebDAV). The source or destination resource of a method is locked. HTTP status code 424 Failed Dependency (WebDAV). The method could not be performed on the resource because the requested action depended on another action and that action failed. HTTP status code 426 Upgrade Required. The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol. HTTP status code 428 Precondition Required. The origin server requires the request to be conditional. HTTP status code 429 Too Many Requests. The user has sent too many requests in a given amount of time (see "rate limiting"). Back off and increase time between requests or try again later. HTTP status code 431 Request Header Fields Too Large. The server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields. HTTP status code 451 Response Unavailable For Legal Reasons. The server is denying access to the resource as a consequence of a legal demand. HTTP status code 500 Internal Server Error. The server encountered an unexpected condition that prevented it from fulfilling the request. HTTP status code 501 Not Implemented. The server does not support the functionality required to fulfill the request. HTTP status code 502 Bad Gateway. The server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while attempting to fulfill the request. Usually returned by load balancers or proxies. HTTP status code 503 Service Unavailable. The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. Try again later. HTTP status code 504 Gateway Timeout. The server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to access in order to complete the request. Usually returned by load balancers or proxies. HTTP status code 505 HTTP Version Not Supported. The server does not support, or refuses to support, the major version of HTTP that was used in the request message. HTTP status code 506 Variant Also Negotiates. The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process. HTTP status code 507 Insufficient Storage. The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. HTTP status code 508 Loop Detected. The server terminated an operation because it encountered an infinite loop while processing a request with "Depth: infinity". This status indicates that the entire operation failed. HTTP status code 510 Not Extended. The policy for accessing the resource has not been met in the request. The server should send back all the information necessary for the client to issue an extended request. HTTP status code 511 Network Authentication Required. The client needs to authenticate to gain network access. If true, execution will block until all data is read from the response. The connection to use for this client. The size of the buffer used and maximum bytes to read per iteration. See . Connects to a host. This needs to be done before any requests are sent. The host should not have http:// prepended but will strip the protocol identifier if provided. If no port is specified (or -1 is used), it is automatically set to 80 for HTTP and 443 for HTTPS (if use_ssl is enabled). verify_host will check the SSL identity of the host if set to true. Sends a raw request to the connected host. The URL parameter is just the part after the host, so for http://somehost.com/index.php, it is index.php. Headers are HTTP request headers. For available HTTP methods, see . Sends the body data raw, as a byte array and does not encode it in any way. Sends a request to the connected host. The URL parameter is just the part after the host, so for http://somehost.com/index.php, it is index.php. Headers are HTTP request headers. For available HTTP methods, see . To create a POST request with query strings to push to the server, do: var fields = {"username" : "user", "password" : "pass"} var query_string = http_client.query_string_from_dict(fields) var headers = ["Content-Type: application/x-www-form-urlencoded", "Content-Length: " + str(query_string.length())] var result = http_client.request(http_client.METHOD_POST, "index.php", headers, query_string) Note: The request_data parameter is ignored if method is . This is because GET methods can't contain request data. As a workaround, you can pass request data as a query string in the URL. See String.http_escape for an example. Closes the current connection, allowing reuse of this . If true, this has a response available. If true, this has a response that is chunked. Returns the response's HTTP status code. Returns the response headers. Returns all response headers as a Dictionary of structure { "key": "value1; value2" } where the case-sensitivity of the keys and values is kept like the server delivers it. A value is a simple String, this string can have more than one value where "; " is used as separator. Example: { "content-length": 12, "Content-Type": "application/json; charset=UTF-8", } Returns the response's body length. Note: Some Web servers may not send a body length. In this case, the value returned will be -1. If using chunked transfer encoding, the body length will also be -1. Reads one chunk from the response. Returns a constant. Need to call in order to get status updates. This needs to be called in order to have any request processed. Check results with . Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary, e.g.: var fields = {"username": "user", "password": "pass"} var query_string = http_client.query_string_from_dict(fields) # Returns "username=user&password=pass" Furthermore, if a key has a null value, only the key itself is added, without equal sign and value. If the value is an array, for each value in it a pair with the same key is added. var fields = {"single": 123, "not_valued": null, "multiple": [22, 33, 44]} var query_string = http_client.query_string_from_dict(fields) # Returns "single=123&not_valued&multiple=22&multiple=33&multiple=44" A node with the ability to send HTTP requests. Uses internally. Can be used to make HTTP requests, i.e. download or upload files or web content via HTTP. Example of contacting a REST API and printing one of its returned fields: func _ready(): # Create an HTTP request node and connect its completion signal. var http_request = HTTPRequest.new() add_child(http_request) http_request.connect("request_completed", self, "_http_request_completed") # Perform a GET request. The URL below returns JSON as of writing. var error = http_request.request("https://httpbin.org/get") if error != OK: push_error("An error occurred in the HTTP request.") # Perform a POST request. The URL below returns JSON as of writing. # Note: Don't make simultaneous requests using a single HTTPRequest node. # The snippet below is provided for reference only. var body = {"name": "Godette"} error = http_request.request("https://httpbin.org/post", [], true, HTTPClient.METHOD_POST, body) if error != OK: push_error("An error occurred in the HTTP request.") # Called when the HTTP request is completed. func _http_request_completed(result, response_code, headers, body): var response = parse_json(body.get_string_from_utf8()) # Will print the user agent string used by the HTTPRequest node (as recognized by httpbin.org). print(response.headers["User-Agent"]) Example of loading and displaying an image using HTTPRequest: func _ready(): # Create an HTTP request node and connect its completion signal. var http_request = HTTPRequest.new() add_child(http_request) http_request.connect("request_completed", self, "_http_request_completed") # Perform the HTTP request. The URL below returns a PNG image as of writing. var error = http_request.request("https://via.placeholder.com/512") if error != OK: push_error("An error occurred in the HTTP request.") # Called when the HTTP request is completed. func _http_request_completed(result, response_code, headers, body): var image = Image.new() var error = image.load_png_from_buffer(body) if error != OK: push_error("Couldn't load the image.") var texture = ImageTexture.new() texture.create_from_image(image) # Display the image in a TextureRect node. var texture_rect = TextureRect.new() add_child(texture_rect) texture_rect.texture = texture Note: When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to CORS. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the Access-Control-Allow-Origin: * HTTP header. Note: SSL/TLS support is currently limited to TLS 1.0, TLS 1.1, and TLS 1.2. Attempting to connect to a TLS 1.3-only server will return an error. Request successful. Request failed while connecting. Request failed while resolving. Request failed due to connection (read/write) error. Request failed on SSL handshake. Request does not have a response (yet). Request exceeded its maximum size limit, see . Request failed (currently unused). HTTPRequest couldn't open the download file. HTTPRequest couldn't write to the download file. Request reached its maximum redirect limit, see . The file to download into. Will output any received file into it. The size of the buffer used and maximum bytes to read per iteration. See . Set this to a lower value (e.g. 4096 for 4 KiB) when downloading small files to decrease memory usage at the cost of download speeds. If true, multithreading is used to improve performance. Maximum allowed size for response bodies. Maximum number of allowed redirects. Creates request on the underlying . If there is no configuration errors, it tries to connect using and passes parameters onto . Returns if request is successfully created. (Does not imply that the server has responded), if not in the tree, if still processing previous request, if given string is not a valid URL format, or if not using thread and the cannot connect to host. Note: The request_data parameter is ignored if method is . This is because GET methods can't contain request data. As a workaround, you can pass request data as a query string in the URL. See String.http_escape for an example. If the parameter is null, then the default value is new string[] {} Cancels the current request. Returns the current status of the underlying . See . Returns the amount of bytes this HTTPRequest downloaded. Returns the response body length. Note: Some Web servers may not send a body length. In this case, the value returned will be -1. If using chunked transfer encoding, the body length will also be -1. The HashingContext class provides an interface for computing cryptographic hashes over multiple iterations. This is useful for example when computing hashes of big files (so you don't have to load them all in memory), network streams, and data streams in general (so you don't have to hold buffers). The enum shows the supported hashing algorithms. const CHUNK_SIZE = 1024 func hash_file(path): var ctx = HashingContext.new() var file = File.new() # Start a SHA-256 context. ctx.start(HashingContext.HASH_SHA256) # Check that file exists. if not file.file_exists(path): return # Open the file to hash. file.open(path, File.READ) # Update the context after reading each chunk. while not file.eof_reached(): ctx.update(file.get_buffer(CHUNK_SIZE)) # Get the computed hash. var res = ctx.finish() # Print the result as hex string and array. printt(res.hex_encode(), Array(res)) Note: Not available in HTML5 exports. Hashing algorithm: MD5. Hashing algorithm: SHA-1. Hashing algorithm: SHA-256. Starts a new hash computation of the given type (e.g. to start computation of a SHA-256). Updates the computation with the given chunk of data. Closes the current context, and return the computed hash. Height map shape resource, which can be added to a or . Width of the height map data. Changing this will resize the . Depth of the height map data. Changing this will resize the . Height map data, pool array must be of * size. A HingeJoint normally uses the Z axis of body A as the hinge axis, another axis can be specified when adding it manually though. See also . The speed with which the two bodies get pulled together when they move in different directions. The maximum rotation. Only active if is true. The minimum rotation. Only active if is true. The speed with which the rotation across the axis perpendicular to the hinge gets corrected. The lower this value, the more the rotation gets slowed down. Target speed for the motor. Maximum acceleration for the motor. Represents the size of the enum. If true, the hinges maximum and minimum rotation, defined by and has effects. When activated, a motor turns the hinge. Represents the size of the enum. The speed with which the two bodies get pulled together when they move in different directions. If true, the hinges maximum and minimum rotation, defined by and has effects. The maximum rotation. Only active if is true. The minimum rotation. Only active if is true. The speed with which the rotation across the axis perpendicular to the hinge gets corrected. The lower this value, the more the rotation gets slowed down. When activated, a motor turns the hinge. Target speed for the motor. Maximum acceleration for the motor. Sets the value of the specified parameter. Returns the value of the specified parameter. If true, enables the specified flag. Returns the value of the specified flag. IP contains support functions for the Internet Protocol (IP). TCP/IP support is in different classes (see and ). IP provides DNS hostname resolution support, both blocking and threaded. Maximum number of concurrent DNS resolver queries allowed, is returned if exceeded. Invalid ID constant. Returned if is exceeded. DNS hostname resolver status: No status. DNS hostname resolver status: Waiting. DNS hostname resolver status: Done. DNS hostname resolver status: Error. Address type: None. Address type: Internet protocol version 4 (IPv4). Address type: Internet protocol version 6 (IPv6). Address type: Any. Returns a given hostname's IPv4 or IPv6 address when resolved (blocking-type method). The address type returned depends on the constant given as ip_type. Creates a queue item to resolve a hostname to an IPv4 or IPv6 address depending on the constant given as ip_type. Returns the queue ID if successful, or on error. Returns a queued hostname's status as a constant, given its queue id. Returns a queued hostname's IP address, given its queue id. Returns an empty string on error or if resolution hasn't happened yet (see ). Removes a given item id from the queue. This should be used to free a queue after it has completed to enable more queries to happen. Returns all the user's current IPv4 and IPv6 addresses as an array. Returns all network adapters as an array. Each adapter is a dictionary of the form: { "index": "1", # Interface index. "name": "eth0", # Interface name. "friendly": "Ethernet One", # A friendly name (might be empty). "addresses": ["192.168.1.101"], # An array of IP addresses associated to this interface. } Removes all of a hostname's cached references. If no hostname is given, all cached IP addresses are removed. Native image datatype. Contains image data which can be converted to an and provides commonly used image processing methods. The maximum width and height for an are and . An cannot be assigned to a texture property of an object directly (such as ), and has to be converted manually to an first. Note: The maximum image size is 16384×16384 pixels due to graphics hardware limitations. Larger images may fail to import. The maximal width allowed for resources. The maximal height allowed for resources. Image does not have alpha. Image stores alpha in a single bit. Image uses alpha. Source texture (before compression) is a regular texture. Default for all textures. Source texture (before compression) is in sRGB space. Source texture (before compression) is a normal texture (e.g. it can be compressed into two channels). Performs nearest-neighbor interpolation. If the image is resized, it will be pixelated. Performs bilinear interpolation. If the image is resized, it will be blurry. This mode is faster than , but it results in lower quality. Performs cubic interpolation. If the image is resized, it will be blurry. This mode often gives better results compared to , at the cost of being slower. Performs bilinear separately on the two most-suited mipmap levels, then linearly interpolates between them. It's slower than , but produces higher-quality results with much less aliasing artifacts. If the image does not have mipmaps, they will be generated and used internally, but no mipmaps will be generated on the resulting image. Note: If you intend to scale multiple copies of the original image, it's better to call ] on it in advance, to avoid wasting processing power in generating them again and again. On the other hand, if the image already has mipmaps, they will be used, and a new set will be generated for the resulting image. Performs Lanczos interpolation. This is the slowest image resizing mode, but it typically gives the best results, especially when downscalng images. Use S3TC compression. Use PVRTC2 compression. Use PVRTC4 compression. Use ETC compression. Use ETC2 compression. Texture format with a single 8-bit depth representing luminance. OpenGL texture format with two values, luminance and alpha each stored with 8 bits. OpenGL texture format RED with a single component and a bitdepth of 8. OpenGL texture format RG with two components and a bitdepth of 8 for each. OpenGL texture format RGB with three components, each with a bitdepth of 8. Note: When creating an , an sRGB to linear color space conversion is performed. OpenGL texture format RGBA with four components, each with a bitdepth of 8. Note: When creating an , an sRGB to linear color space conversion is performed. OpenGL texture format RGBA with four components, each with a bitdepth of 4. OpenGL texture format GL_RGB5_A1 where 5 bits of depth for each component of RGB and one bit for alpha. OpenGL texture format GL_R32F where there's one component, a 32-bit floating-point value. OpenGL texture format GL_RG32F where there are two components, each a 32-bit floating-point values. OpenGL texture format GL_RGB32F where there are three components, each a 32-bit floating-point values. OpenGL texture format GL_RGBA32F where there are four components, each a 32-bit floating-point values. OpenGL texture format GL_R32F where there's one component, a 16-bit "half-precision" floating-point value. OpenGL texture format GL_RG32F where there are two components, each a 16-bit "half-precision" floating-point value. OpenGL texture format GL_RGB32F where there are three components, each a 16-bit "half-precision" floating-point value. OpenGL texture format GL_RGBA32F where there are four components, each a 16-bit "half-precision" floating-point value. A special OpenGL texture format where the three color components have 9 bits of precision and all three share a single 5-bit exponent. The S3TC texture format that uses Block Compression 1, and is the smallest variation of S3TC, only providing 1 bit of alpha and color data being premultiplied with alpha. Note: When creating an , an sRGB to linear color space conversion is performed. The S3TC texture format that uses Block Compression 2, and color data is interpreted as not having been premultiplied by alpha. Well suited for images with sharp alpha transitions between translucent and opaque areas. Note: When creating an , an sRGB to linear color space conversion is performed. The S3TC texture format also known as Block Compression 3 or BC3 that contains 64 bits of alpha channel data followed by 64 bits of DXT1-encoded color data. Color data is not premultiplied by alpha, same as DXT3. DXT5 generally produces superior results for transparent gradients compared to DXT3. Note: When creating an , an sRGB to linear color space conversion is performed. Texture format that uses Red Green Texture Compression, normalizing the red channel data using the same compression algorithm that DXT5 uses for the alpha channel. Texture format that uses Red Green Texture Compression, normalizing the red and green channel data using the same compression algorithm that DXT5 uses for the alpha channel. Texture format that uses BPTC compression with unsigned normalized RGBA components. Note: When creating an , an sRGB to linear color space conversion is performed. Texture format that uses BPTC compression with signed floating-point RGB components. Texture format that uses BPTC compression with unsigned floating-point RGB components. Texture format used on PowerVR-supported mobile platforms, uses 2-bit color depth with no alpha. More information can be found here. Note: When creating an , an sRGB to linear color space conversion is performed. Same as PVRTC2, but with an alpha component. Similar to PVRTC2, but with 4-bit color depth and no alpha. Same as PVRTC4, but with an alpha component. Ericsson Texture Compression format 1, also referred to as "ETC1", and is part of the OpenGL ES graphics standard. This format cannot store an alpha channel. Ericsson Texture Compression format 2 (R11_EAC variant), which provides one channel of unsigned data. Ericsson Texture Compression format 2 (SIGNED_R11_EAC variant), which provides one channel of signed data. Ericsson Texture Compression format 2 (RG11_EAC variant), which provides two channels of unsigned data. Ericsson Texture Compression format 2 (SIGNED_RG11_EAC variant), which provides two channels of signed data. Ericsson Texture Compression format 2 (RGB8 variant), which is a follow-up of ETC1 and compresses RGB888 data. Note: When creating an , an sRGB to linear color space conversion is performed. Ericsson Texture Compression format 2 (RGBA8variant), which compresses RGBA8888 data with full alpha support. Note: When creating an , an sRGB to linear color space conversion is performed. Ericsson Texture Compression format 2 (RGB8_PUNCHTHROUGH_ALPHA1 variant), which compresses RGBA data to make alpha either fully transparent or fully opaque. Note: When creating an , an sRGB to linear color space conversion is performed. Represents the size of the enum. Holds all the image's color data in a given format. See constants. Returns the image's width. Returns the image's height. Returns the image's size (width and height). Returns true if the image has generated mipmaps. Returns the image's format. See constants. Returns a copy of the image's raw data. Converts the image's format. See constants. Returns the offset where the image's mipmap with index mipmap is stored in the data dictionary. Resizes the image to the nearest power of 2 for the width and height. If square is true then set width and height to be the same. New pixels are calculated using the interpolation mode defined via constants. Resizes the image to the given width and height. New pixels are calculated using the interpolation mode defined via constants. Shrinks the image by a factor of 2. Stretches the image and enlarges it by a factor of 2. No interpolation is done. Crops the image to the given width and height. If the specified size is larger than the current size, the extra area is filled with black pixels. Flips the image horizontally. Flips the image vertically. Generates mipmaps for the image. Mipmaps are precalculated and lower resolution copies of the image. Mipmaps are automatically used if the image needs to be scaled down when rendered. This improves image quality and the performance of the rendering. Returns an error if the image is compressed, in a custom format or if the image's width/height is 0. Removes the image's mipmaps. Creates an empty image of given size and format. See constants. If use_mipmaps is true then generate mipmaps for this image. See the . Creates a new image of given size and format. See constants. Fills the image with the given raw data. If use_mipmaps is true then loads mipmaps for this image from data. See . Returns true if the image has no data. Loads an image from file path. See Supported image formats for a list of supported image formats and limitations. Warning: This method should only be used in the editor or in cases when you need to load external images at run-time, such as images located at the user:// directory, and may not work in exported projects. See also description for usage examples. Saves the image as a PNG file to path. Saves the image as an EXR file to path. If grayscale is true and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return if Godot was compiled without the TinyEXR module. Returns if the image has data for alpha values. Returns if all the alpha values are stored in a single bit. Returns if no data for alpha values is found. Returns true if all the image's pixels have an alpha value of 0. Returns false if any pixel has an alpha value higher than 0. Compresses the image to use less memory. Can not directly access pixel data while the image is compressed. Returns error if the chosen compression mode is not available. See and constants. Decompresses the image if it is compressed. Returns an error if decompress function is not available. Returns true if the image is compressed. Blends low-alpha pixels with nearby pixels. Multiplies color values with alpha values. Resulting color values for a pixel are (color * alpha)/256. Converts the raw data from the sRGB colorspace to a linear scale. Converts the image's data to represent coordinates on a 3D plane. This is used when the image represents a normalmap. A normalmap can add lots of detail to a 3D surface without increasing the polygon count. Converts a standard RGBE (Red Green Blue Exponent) image to an sRGB image. Converts a bumpmap to a normalmap. A bumpmap provides a height offset per-pixel, while a normalmap provides a normal direction per pixel. Copies src_rect from src image to this image at coordinates dst. Blits src_rect area from src image to this image at the coordinates given by dst. src pixel is copied onto dst if the corresponding mask pixel's alpha value is not 0. src image and mask image must have the same size (width and height) but they can have different formats. Alpha-blends src_rect from src image to this image at coordinates dest. Alpha-blends src_rect from src image to this image using mask image at coordinates dst. Alpha channels are required for both src and mask. dst pixels and src pixels will blend if the corresponding mask pixel's alpha value is not 0. src image and mask image must have the same size (width and height) but they can have different formats. Fills the image with a given . Returns a enclosing the visible portion of the image, considering each pixel with a non-zero alpha channel as visible. Returns a new image that is a copy of the image's area specified with rect. Copies src image to this image. Locks the data for reading and writing access. Sends an error to the console if the image is not locked when reading or writing a pixel. Unlocks the data and prevents changes. Returns the color of the pixel at src if the image is locked. If the image is unlocked, it always returns a with the value (0, 0, 0, 1.0). This is the same as , but with a Vector2 argument instead of two integer arguments. Returns the color of the pixel at (x, y) if the image is locked. If the image is unlocked, it always returns a with the value (0, 0, 0, 1.0). This is the same as , but two integer arguments instead of a Vector2 argument. Sets the of the pixel at (dst.x, dst.y) if the image is locked. Note that the dst values must be integers. Example: var img = Image.new() img.create(img_width, img_height, false, Image.FORMAT_RGBA8) img.lock() img.set_pixelv(Vector2(x, y), color) # Works img.unlock() img.set_pixelv(Vector2(x, y), color) # Does not have an effect Sets the of the pixel at (x, y) if the image is locked. Example: var img = Image.new() img.create(img_width, img_height, false, Image.FORMAT_RGBA8) img.lock() img.set_pixel(x, y, color) # Works img.unlock() img.set_pixel(x, y, color) # Does not have an effect Loads an image from the binary contents of a PNG file. Loads an image from the binary contents of a JPEG file. Loads an image from the binary contents of a WebP file. Loads an image from the binary contents of a TGA file. Loads an image from the binary contents of a BMP file. Note: Godot's BMP module doesn't support 16-bit per pixel images. Only 1-bit, 4-bit, 8-bit, 24-bit, and 32-bit per pixel images are supported. A based on an . For an image to be displayed, an has to be created from it using the method: var texture = ImageTexture.new() var image = Image.new() image.load("res://icon.png") texture.create_from_image(image) $Sprite.texture = texture This way, textures can be created at run-time by loading images both from within the editor and externally. Warning: Prefer to load imported textures with @GDScript.load over loading them from within the filesystem dynamically with , as it may not work in exported projects: var texture = load("res://icon.png") $Sprite.texture = texture This is because images have to be imported as first to be loaded with @GDScript.load. If you'd still like to load an image file just like any other , import it as an resource instead, and then load it normally using the @GDScript.load method. But do note that the image data can still be retrieved from an imported texture as well using the method, which returns a copy of the data: var texture = load("res://icon.png") var image : Image = texture.get_data() An 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 . Note: The maximum texture size is 16384×16384 pixels due to graphics hardware limitations. data is stored raw and unaltered. data is compressed with a lossy algorithm. You can set the storage quality with . data is compressed with a lossless algorithm. The storage type (raw, lossy, or compressed). The storage quality for . Create a new with width and height. format is a value from , flags is any combination of . Initializes the texture by allocating and setting the data from an with flags from . An sRGB to linear color space conversion can take place, according to . Returns the format of the texture, one of . Loads an image from a file path and creates a texture from it. Note: the method is deprecated and will be removed in Godot 4.0, use and instead. Replaces the texture's data with a new . Note: The texture has to be initialized first with the method before it can be updated. The new image dimensions, format, and mipmaps configuration should match the existing texture's image configuration, otherwise it has to be re-created with the method. Use this method over if you need to update the texture frequently, which is faster than allocating additional memory for a new texture each time. Resizes the texture to the specified dimensions. Draws simple geometry from code. Uses a drawing mode similar to OpenGL 1.x. See also , and for procedural geometry generation. Note: ImmediateGeometry3D is best suited to small amounts of mesh data that change every frame. It will be slow when handling large amounts of mesh data. If mesh data doesn't change often, use , or instead. Note: Godot uses clockwise winding order for front faces of triangle primitive modes. Note: In case of missing points when handling large amounts of mesh data, try increasing its buffer size limit under . Begin drawing (and optionally pass a texture override). When done call . For more information on how this works, search for glBegin() and glEnd() references. For the type of primitive, see the enum. The next vertex's normal. The next vertex's tangent (and binormal facing). The current drawing color. The next vertex's UV. The next vertex's second layer UV. Adds a vertex in local coordinate space with the currently set color/uv/etc. Simple helper to draw an UV sphere with given latitude, longitude and radius. Ends a drawing context and displays the results. Clears everything that was drawn using begin/end. A singleton that deals with inputs. This includes key presses, mouse buttons and movement, joypads, and input actions. Actions and their events can be set in the Input Map tab in the Project > Project Settings, or with the class. Makes the mouse cursor visible if it is hidden. Makes the mouse cursor hidden if it is visible. Captures the mouse. The mouse will be hidden and its position locked at the center of the screen. Note: If you want to process the mouse's movement in this mode, you need to use . Makes the mouse cursor visible but confines it to the game window. Arrow cursor. Standard, default pointing cursor. I-beam cursor. Usually used to show where the text cursor will appear when the mouse is clicked. Pointing hand cursor. Usually used to indicate the pointer is over a link or other interactable item. Cross cursor. Typically appears over regions in which a drawing operation can be performed or for selections. Wait cursor. Indicates that the application is busy performing an operation. This cursor shape denotes that the application is still usable during the operation. Busy cursor. Indicates that the application is busy performing an operation. This cursor shape denotes that the application isn't usable during the operation (e.g. something is blocking its main thread). Drag cursor. Usually displayed when dragging something. Can drop cursor. Usually displayed when dragging something to indicate that it can be dropped at the current position. Forbidden cursor. Indicates that the current action is forbidden (for example, when dragging something) or that the control at a position is disabled. Vertical resize mouse cursor. A double-headed vertical arrow. It tells the user they can resize the window or the panel vertically. Horizontal resize mouse cursor. A double-headed horizontal arrow. It tells the user they can resize the window or the panel horizontally. Window resize mouse cursor. 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. Window resize mouse cursor. The cursor is a double-headed arrow that goes from the top left to the bottom right, the opposite of . It tells the user they can resize the window or the panel both horizontally and vertically. Move cursor. Indicates that something can be moved. Vertical split mouse cursor. On Windows, it's the same as . Horizontal split mouse cursor. On Windows, it's the same as . Help cursor. Usually a question mark. Returns true if you are pressing the key. You can pass a constant. Returns true if you are pressing the mouse button specified with . Returns true if you are pressing the joypad button (see ). Returns true if you are pressing the action event. Note that if an action has multiple buttons assigned and more than one of them is pressed, releasing one button will release the action, even if some other button assigned to this action is still pressed. Returns true when the user starts pressing the action event, meaning it's true only on the frame that the user pressed down the button. This is useful for code that needs to run only once when an action is pressed, instead of every frame while it's pressed. Returns true when the user stops pressing the action event, meaning it's true only on the frame that the user released the button. Returns a value between 0 and 1 representing the intensity of the given action. In a joypad, for example, the further away the axis (analog sticks or L2, R2 triggers) is from the dead zone, the closer the value will be to 1. If the action is mapped to a control that has no axis as the keyboard, the value returned will be 0 or 1. Adds a new mapping entry (in SDL2 format) to the mapping database. Optionally update already connected devices. Removes all mappings from the internal database that match the given GUID. Notifies the singleton that a connection has changed, to update the state for the device index. This is used internally and should not have to be called from user scripts. See joy_connection_changed for the signal emitted when this is triggered internally. Returns true if the system knows the specified device. This means that it sets all button and axis indices exactly as defined in . Unknown joypads are not expected to match these constants, but you can still retrieve events from them. Returns the current value of the joypad axis at given index (see ). Returns the name of the joypad at the specified device index. Returns a SDL2-compatible device GUID on platforms that use gamepad remapping. Returns "Default Gamepad" otherwise. Returns an containing the device IDs of all currently connected joypads. Returns the strength of the joypad vibration: x is the strength of the weak motor, and y is the strength of the strong motor. Returns the duration of the current vibration effect in seconds. Receives a gamepad button from and returns its equivalent name as a string. Returns the index of the provided button name. Receives a axis and returns its equivalent name as a string. Returns the index of the provided axis name. Starts to vibrate the joypad. Joypads usually come with two rumble motors, a strong and a weak one. weak_magnitude is the strength of the weak motor (between 0 and 1) and strong_magnitude is the strength of the strong motor (between 0 and 1). duration is the duration of the effect in seconds (a duration of 0 will try to play the vibration indefinitely). Note: Not every hardware is compatible with long effect durations; it is recommended to restart an effect if it has to be played for more than a few seconds. Stops the vibration of the joypad. Vibrate Android and iOS devices. Note: It needs VIBRATE permission for Android at export settings. iOS does not support duration. Returns the gravity of the device's accelerometer sensor, if the device has one. Otherwise, the method returns . Note: This method only works on Android and iOS. On other platforms, it always returns . On Android the unit of measurement for each axis is m/s² while on iOS it's a multiple of the Earth's gravitational acceleration g (~9.81 m/s²). Returns the acceleration of the device's accelerometer sensor, if the device has one. Otherwise, the method returns . Note this method returns an empty when running from the editor even when your device has an accelerometer. You must export your project to a supported device to read values from the accelerometer. Note: This method only works on iOS, Android, and UWP. On other platforms, it always returns . On Android the unit of measurement for each axis is m/s² while on iOS and UWP it's a multiple of the Earth's gravitational acceleration g (~9.81 m/s²). Returns the magnetic field strength in micro-Tesla for all axes of the device's magnetometer sensor, if the device has one. Otherwise, the method returns . Note: This method only works on Android, iOS and UWP. On other platforms, it always returns . Returns the rotation rate in rad/s around a device's X, Y, and Z axes of the gyroscope sensor, if the device has one. Otherwise, the method returns . Note: This method only works on Android and iOS. On other platforms, it always returns . Returns the mouse speed for the last time the cursor was moved, and this until the next frame where the mouse moves. This means that even if the mouse is not moving, this function will still return the value of the last motion. Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. Sets the mouse mode. See the constants for more information. Returns the mouse mode. See the constants for more information. Sets the mouse position to the specified vector. This will simulate pressing the specified action. The strength can be used for non-boolean actions, it's ranged between 0 and 1 representing the intensity of the given action. Note: This method will not cause any calls. It is intended to be used with and . If you want to simulate _input, use instead. If the specified action is already pressed, this will release it. Sets the default cursor shape to be used in the viewport instead of . Note: If you want to change the default cursor shape for 's nodes, use instead. Note: This method generates an to update cursor immediately. Returns the currently assigned cursor shape (see ). Sets a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified. Passing null to the image parameter resets to the system cursor. See for the list of shapes. image's size must be lower than 256×256. hotspot must be within image's size. Note: s aren't supported as custom mouse cursors. If using an , only the first frame will be displayed. Note: Only images imported with the Lossless, Lossy or Uncompressed compression modes are supported. The Video RAM compression mode can't be used for custom cursors. If the parameter is null, then the default value is new Vector2(0, 0) Feeds an to the game. Can be used to artificially trigger input events from code. Also generates calls. Example: var a = InputEventAction.new() a.action = "ui_cancel" a.pressed = true Input.parse_input_event(a) Enables or disables the accumulation of similar input events sent by the operating system. When input accumulation is enabled, all input events generated during a frame will be merged and emitted when the frame is done rendering. Therefore, this limits the number of input method calls per second to the rendering FPS. Input accumulation is enabled by default. It can be disabled to get slightly more precise/reactive input at the cost of increased CPU usage. In applications where drawing freehand lines is required, input accumulation should generally be disabled while the user is drawing the line to get results that closely follow the actual input. Base class of all sort of input event. See . The event's device ID. Note: This device ID will always be -1 for emulated mouse input from a touchscreen. This can be used to distinguish emulated mouse input from physical mouse input. Returns true if this input event matches a pre-defined action of any type. Returns true if the given action is being pressed (and is not an echo event for events, unless allow_echo is true). Not relevant for events of type or . Returns true if the given action is released (i.e. not pressed). Not relevant for events of type or . Returns a value between 0.0 and 1.0 depending on the given actions' state. Useful for getting the value of events of type . Returns true if this input event is pressed. Not relevant for events of type or . Returns true if this input event is an echo event (only for events of type ). Returns a representation of the event. Returns true if the given input event is checking for the same key (), button () or action (). Returns true if this input event's type is one that can be assigned to an input action. Returns true if the given input event and this input event can be added together (only for events of type ). The given input event's position, global position and speed will be copied. The resulting relative is a sum of both events. Both events' modifiers have to be identical. Returns a copy of the given input event which has been offset by local_ofs and transformed by xform. Relevant for events of type , , , , and . If the parameter is null, then the default value is new Vector2(0, 0) Contains a generic action which can be targeted from several types of inputs. Actions can be created from the Input Map tab in the Project > Project Settings menu. See . The action's name. Actions are accessed via this . If true, the action's state is pressed. If false, the action's state is released. The action's strength between 0 and 1. This value is considered as equal to 0 if pressed is false. The event strength allows faking analog joypad motion events, by specifying how strongly the joypad axis is bent or pressed. The local gesture position relative to the . If used in , the position is relative to the current that received this gesture. Input event type for gamepad buttons. For gamepad analog sticks and joysticks, see . Button identifier. One of the button constants. Represents the pressure the user puts on the button with his finger, if the controller supports it. Ranges from 0 to 1. If true, the button's state is pressed. If false, the button's state is released. Stores information about joystick motions. One represents one axis at a time. Axis identifier. Use one of the axis constants. Current position of the joystick on the given axis. The value ranges from -1.0 to 1.0. A value of 0 means the axis is in its resting position. Stores key presses on the keyboard. Supports key presses, key releases and events. If true, the key's state is pressed. If false, the key's state is released. The key scancode, which corresponds to one of the constants. To get a human-readable representation of the , use OS.get_scancode_string(event.scancode) where event is the . The key Unicode identifier (when relevant). Unicode identifiers for the composite characters and complex scripts may not be available unless IME input mode is active. See for more information. If true, the key was already pressed before this event. It means the user is holding the key down. Returns the scancode combined with modifier keys such as Shift or Alt. See also . To get a human-readable representation of the with modifiers, use OS.get_scancode_string(event.get_scancode_with_modifiers()) where event is the . Stores general mouse events information. The mouse button mask identifier, one of or a bitwise combination of the button masks. The local mouse position relative to the . If used in , the position is relative to the current which is under the mouse. The global mouse position relative to the current when used in , otherwise is at 0,0. Contains mouse click information. See . The amount (or delta) of the event. When used for high-precision scroll events, this indicates the scroll amount (vertical or horizontal). This is only supported on some platforms; the reported sensitivity varies depending on the platform. May be 0 if not supported. The mouse button identifier, one of the button or button wheel constants. If true, the mouse button's state is pressed. If false, the mouse button's state is released. If true, the mouse button's state is a double-click. Contains mouse and pen motion information. Supports relative, absolute positions and speed. See . Note: By default, this event is only emitted once per frame rendered at most. If you need more precise input reporting, call with false to make events emitted as often as possible. If you use InputEventMouseMotion to draw lines, consider implementing Bresenham's line algorithm as well to avoid visible gaps in lines if the user is moving the mouse quickly. Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from -1.0 to 1.0 for both axes. Represents the pressure the user puts on the pen. Ranges from 0.0 to 1.0. The mouse position relative to the previous position (position at the last frame). Note: Since is only emitted when the mouse moves, the last event won't have a relative position of Vector2(0, 0) when the user stops moving the mouse. The mouse speed in pixels per second. Contains screen drag information. See . The drag event index in the case of a multi-drag event. The drag position. The drag position relative to its start position. The drag speed. Stores multi-touch press/release information. Supports touch press, touch release and for multi-touch count and order. The touch index in the case of a multi-touch event. One index = one finger. The touch position. If true, the touch's state is pressed. If false, the touch's state is released. Contains keys events information with modifiers support like Shift or Alt. See . State of the Alt modifier. State of the Shift modifier. State of the Ctrl modifier. State of the Meta modifier. State of the Command modifier. Manages all which can be created/modified from the project settings menu Project > Project Settings > Input Map or in code with and . See . Returns true if the has a registered action with the given name. Returns an array of all actions in the . Adds an empty action to the with a configurable deadzone. An can then be added to this action with . Removes an action from the . Sets a deadzone value for the action. Adds an to an action. This will trigger the action. Returns true if the action has the given associated with it. Removes an from an action. Removes all events from an action. Returns an array of s associated with a given action. Returns true if the given event is part of an existing action. This method ignores keyboard modifiers if the given is not pressed (for proper release detection). See if you don't want this behavior. Clears all in the and load it anew from . Turning on the option Load As Placeholder for an instanced scene in the editor causes it to be replaced by an InstancePlaceholder when running the game. This makes it possible to delay actually loading the scene until calling . This is useful to avoid loading large scenes all at once by loading parts of it selectively. The InstancePlaceholder does not have a transform. This causes any child nodes to be positioned relatively to the Viewport from point (0,0), rather than their parent as displayed in the editor. Replacing the placeholder with a scene with a transform will transform children relatively to their parent again. Not thread-safe. Use if calling from a thread. Replaces this placeholder by the scene handed as an argument, or the original scene if no argument is given. As for all resources, the scene is loaded only if it's not loaded already. By manually loading the scene beforehand, delays caused by this function can be avoided. Gets the path to the resource file that is loaded by default when calling . Not thread-safe. Use if calling from a thread. Deprecated (will be removed in Godot 4.0). InterpolatedCamera is a which smoothly moves to match a target node's position and rotation. If it is not or does not have a valid target set, InterpolatedCamera acts like a normal Camera. The target's . How quickly the camera moves toward its target. Higher values will result in tighter camera motion. If true, and a target is set, the camera will move automatically. Sets the node to move toward and orient with. This control provides a selectable list of items that may be in a single (or multiple columns) with option of text, icons, or both text and icon. Tooltips are supported and may be different for every item in the list. Selectable items in the list may be selected or deselected and multiple selection may be enabled. Selection with right mouse button may also be enabled to allow use of popup context menus. Items may also be "activated" by double-clicking them or by pressing Enter. Item text only supports single-line strings, newline characters (e.g. \n) in the string won't produce a newline. Text wrapping is enabled in mode, but column's width is adjusted to fully fit its content by default. You need to set greater than zero to wrap the text. Only allow selecting a single item. Allows selecting multiple items by holding Ctrl or Shift. Icon is drawn above the text. Icon is drawn to the left of the text. Allows single or multiple item selection. See the constants. If true, the currently selected item can be selected again. If true, right mouse button click can select items. Maximum lines of text allowed in each item. Space will be reserved even when there is not enough lines of text to display. Note: This property takes effect only when is . To make the text wrap, should be greater than zero. If true, the control will automatically resize the height to fit its content. Maximum columns the list will have. If greater than zero, the content will be split among the specified columns. A value of zero means unlimited columns, i.e. all items will be put in the same row. Whether all columns will have the same width. If true, the width is equal to the largest column width of all columns. The width all columns will be adjusted to. A value of zero disables the adjustment, each item will have a width equal to the width of its content and the columns will have an uneven width. The icon position, whether above or to the left of the text. See the constants. The scale of icon applied after and transposing takes effect. The size all icons will be adjusted to. If either X or Y component is not greater than zero, icon size won't be affected. Adds an item to the item list with specified text. Specify an icon, or use null as the icon for a list item with no icon. If selectable is true, the list item will be selectable. Adds an item to the item list with no text, only an icon. Sets text of the item associated with the specified index. Returns the text associated with the specified index. Sets (or replaces) the icon's associated with the specified index. Returns the icon associated with the specified index. Sets whether the item icon will be drawn transposed. Returns true if the item icon will be drawn transposed, i.e. the X and Y axes are swapped. Sets the region of item's icon used. The whole icon will be used if the region has no area. Returns the region of item's icon used. The whole icon will be used if the region has no area. Sets a modulating of the item associated with the specified index. Returns a modulating item's icon at the specified index. Allows or disallows selection of the item associated with the specified index. Returns true if the item at the specified index is selectable. Disables (or enables) the item at the specified index. Disabled items cannot be selected and do not trigger activation signals (when double-clicking or pressing Enter). Returns true if the item at the specified index is disabled. Sets a value (of any type) to be stored with the item associated with the specified index. Returns the metadata value of the specified index. Sets the background color of the item specified by idx index to the specified . Returns the custom background color of the item specified by idx index. Sets the foreground color of the item specified by idx index to the specified . Returns the custom foreground color of the item specified by idx index. Sets whether the tooltip hint is enabled for specified item index. Returns true if the tooltip is enabled for specified item index. Sets the tooltip hint for the item associated with the specified index. Returns the tooltip hint associated with the specified index. Select the item at the specified index. Note: This method does not trigger the item selection signal. Ensures the item associated with the specified index is not selected. Ensures there are no items selected. Returns true if the item at the specified index is currently selected. Returns an array with the indexes of the selected items. Moves item from index from_idx to to_idx. Returns the number of items currently in the list. Removes the item specified by idx index from the list. Removes all items from the list. Sorts items in the list by their text. Returns true if one or more items are selected. Returns the item index at the given position. When there is no item at that point, -1 will be returned if exact is true, and the closest item index will be returned otherwise. Ensure current selection is visible, adjusting the scroll position as necessary. Returns the ID associated with the list. Returned by , contains the decoded JSON or error information if the JSON source wasn't successfully parsed. You can check if the JSON source was successfully parsed with if json_result.error == OK. The error type if the JSON source was not successfully parsed. See the constants. The error message if the JSON source was not successfully parsed. See the constants. The line number where the error occurred if the JSON source was not successfully parsed. A Variant containing the parsed JSON. Use @GDScript.typeof or the is keyword to check if it is what you expect. For example, if the JSON source starts with curly braces ({}), a will be returned. If the JSON source starts with brackets ([]), an will be returned. Note: The JSON specification does not define integer or float types, but only a number type. Therefore, parsing a JSON text will convert all numerical values to types. Note: JSON objects do not preserve key order like Godot dictionaries, thus, you should not rely on keys being in a certain order if a dictionary is constructed from JSON. In contrast, JSON arrays retain the order of their elements: var p = JSON.parse('["hello", "world", "!"]') if typeof(p.result) == TYPE_ARRAY: print(p.result[0]) # Prints "hello" else: push_error("Unexpected results.") The JavaScript singleton is implemented only in the HTML5 export. It's used to access the browser's JavaScript context. This allows interaction with embedding pages or calling third-party JavaScript APIs. Note: This singleton can be disabled at build-time to improve security. By default, the JavaScript singleton is enabled. Official export templates also have the JavaScript singleton enabled. See Compiling for the Web in the documentation for more information. Execute the string code as JavaScript code within the browser window. This is a call to the actual global JavaScript function eval(). If use_global_execution_context is true, the code will be evaluated in the global execution context. Otherwise, it is evaluated in the execution context of a function within the engine's runtime environment. Joints are used to bind together two physics bodies. They have a solver priority and can define if the bodies of the two attached nodes should be able to collide with each other. The node attached to the first side (A) of the joint. The node attached to the second side (B) of the joint. The priority used to define which solver is executed first for multiple joints. The lower the value, the higher the priority. If true, the two bodies of the nodes are not able to collide with each other. Base node for all joint constraints in 2D physics. Joints take 2 bodies and apply a custom constraint. The first body attached to the joint. Must derive from . The second body attached to the joint. Must derive from . When and move in different directions the bias controls how fast the joint pulls them back to their original position. The lower the bias the more the two bodies can pull on the joint. If true, and can not collide. Kinematic bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a character or a rigid body, these are the same as a static body. However, they have two main uses: Simulated motion: When these bodies are moved manually, either from code or from an (with set to "physics"), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc). Kinematic characters: KinematicBody also has an API for moving objects (the and methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but don't require advanced physics. Lock the body's X axis movement. Lock the body's Y axis movement. Lock the body's Z axis movement. Extra margin used for collision recovery in motion functions (see , , ). 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 kinematic bodies. Moves the body along the vector rel_vec. The body will stop if it collides. Returns a , which contains information about the collision. If test_only is true, the body does not move but the would-be collision information is given. Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a or , 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. This method should be used in (or in a method called by ), as it uses the physics step's delta value automatically in calculations. Otherwise, the simulation will run at an incorrect speed. linear_velocity is the velocity vector (typically meters per second). Unlike in , you should not multiply it by delta — the physics engine handles applying the velocity. up_direction is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of Vector3(0, 0, 0), everything is considered a wall. If stop_on_slope is true, body will not slide on slopes when you include gravity in linear_velocity and the body is standing still. If the body collides, it will change direction a maximum of max_slides times before it stops. floor_max_angle is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees. If infinite_inertia is true, body will be able to push nodes, but it won't also detect any collisions with them. If false, it will interact with nodes like with . Returns the linear_velocity vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use . If the parameter is null, then the default value is new Vector3(0, 0, 0) Moves the body while keeping it attached to slopes. Similar to . As long as the snap vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting snap to (0, 0, 0) or by using instead. If the parameter is null, then the default value is new Vector3(0, 0, 0) Checks for collisions without moving the body. Virtually sets the node's position, scale and rotation to that of the given , then tries to move the body along the vector rel_vec. Returns true if a collision would occur. Returns true if the body collided with the floor on the last call of or . Otherwise, returns false. Returns true if the body collided with the ceiling on the last call of or . Otherwise, returns false. Returns true if the body collided with a wall on the last call of or . Otherwise, returns false. Returns the surface normal of the floor at the last collision point. Only valid after calling or and when returns true. Returns the linear velocity of the floor at the last collision point. Only valid after calling or and when returns true. Locks or unlocks the specified axis depending on the value of lock. See also , and . Returns true if the specified axis is locked. See also , and . Returns the number of times the body collided and changed direction during the last call to or . Returns a , which contains information about a collision that occurred during the last call to or . Since the body can collide several times in a single call to , you must specify the index of the collision in the range 0 to ( - 1). Kinematic bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a character or a rigid body, these are the same as a static body. However, they have two main uses: Simulated motion: When these bodies are moved manually, either from code or from an (with set to "physics"), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc). Kinematic characters: KinematicBody2D also has an API for moving objects (the and methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but don't require advanced physics. Extra margin used for collision recovery in motion functions (see , , ). 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 kinematic bodies. If true, the body's movement will be synchronized to the physics frame. This is useful when animating movement via , for example on moving platforms. Do not use together with or functions. Moves the body along the vector rel_vec. The body will stop if it collides. Returns a , which contains information about the collision. If test_only is true, the body does not move but the would-be collision information is given. Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a or , 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. This method should be used in (or in a method called by ), as it uses the physics step's delta value automatically in calculations. Otherwise, the simulation will run at an incorrect speed. linear_velocity is the velocity vector in pixels per second. Unlike in , you should not multiply it by delta — the physics engine handles applying the velocity. up_direction is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of Vector2(0, 0), everything is considered a wall. This is useful for topdown games. If stop_on_slope is true, body will not slide on slopes when you include gravity in linear_velocity and the body is standing still. If the body collides, it will change direction a maximum of max_slides times before it stops. floor_max_angle is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees. If infinite_inertia is true, body will be able to push nodes, but it won't also detect any collisions with them. If false, it will interact with nodes like with . Returns the linear_velocity vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use . If the parameter is null, then the default value is new Vector2(0, 0) Moves the body while keeping it attached to slopes. Similar to . As long as the snap vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting snap to (0, 0) or by using instead. If the parameter is null, then the default value is new Vector2(0, 0) Checks for collisions without moving the body. Virtually sets the node's position, scale and rotation to that of the given , then tries to move the body along the vector rel_vec. Returns true if a collision would occur. Returns true if the body collided with the floor on the last call of or . Otherwise, returns false. Returns true if the body collided with the ceiling on the last call of or . Otherwise, returns false. Returns true if the body collided with a wall on the last call of or . Otherwise, returns false. Returns the surface normal of the floor at the last collision point. Only valid after calling or and when returns true. Returns the linear velocity of the floor at the last collision point. Only valid after calling or and when returns true. Returns the number of times the body collided and changed direction during the last call to or . Returns a , which contains information about a collision that occurred during the last call to or . Since the body can collide several times in a single call to , you must specify the index of the collision in the range 0 to ( - 1). Example usage: for i in get_slide_count(): var collision = get_slide_collision(i) print("Collided with: ", collision.collider.name) Contains collision data for collisions. When a is moved using , it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision object is returned. This object contains information about the collision, including the colliding object, the remaining motion, and the collision position. This information can be used to calculate a collision response. The point of collision, in global coordinates. The colliding body's shape's normal at the point of collision. The distance the moving object traveled before collision. The moving object's remaining movement vector. The moving object's colliding shape. The colliding body. The colliding body's unique instance ID. See . The colliding body's shape. The colliding shape's index. See . The colliding object's velocity. The colliding body's metadata. See . Contains collision data for collisions. When a is moved using , it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision2D object is returned. This object contains information about the collision, including the colliding object, the remaining motion, and the collision position. This information can be used to calculate a collision response. The point of collision, in global coordinates. The colliding body's shape's normal at the point of collision. The distance the moving object traveled before collision. The moving object's remaining movement vector. The moving object's colliding shape. The colliding body. The colliding body's unique instance ID. See . The colliding body's shape. The colliding shape's index. See . The colliding object's velocity. The colliding body's metadata. See . Label displays plain text on the screen. 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 formatting. For that, use instead. Note: Contrarily to most other s, Label's defaults to (i.e. it doesn't react to mouse input events). This implies that a label won't display any configured , unless you change its mouse filter. Align rows to the left (default). Align rows centered. Align rows to the right. Expand row whitespaces to fit the width. Align the whole text to the top. Align the whole text to the center. Align the whole text to the bottom. Align the whole text by spreading the rows. The text to display on screen. Controls the text's horizontal align. Supports left, center, right, and fill, or justify. Set it to one of the constants. Controls the text's vertical align. Supports top, center, bottom, and fill. Set it to one of the constants. If true, wraps the text inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. If true, the Label only shows the text that fits inside its bounding rectangle. It also lets you scale the node down freely. If true, all the text displays as UPPERCASE. Restricts the number of characters to display. Set to -1 to disable. Limits the amount of visible characters. If you set percent_visible to 0.5, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box. The node ignores the first lines_skipped lines before it starts to display text. Limits the lines of text the node shows on screen. Returns the font size in pixels. Returns the amount of lines of text the Label has. Returns the number of lines shown. Useful if the 's height cannot currently display all lines. Returns the total number of printable characters in the text (excluding spaces and newlines). Deprecated (will be removed in Godot 4.0). A capable of storing many smaller textures with offsets. You can dynamically add pieces (s) to this using different offsets. Adds texture to this , starting on offset ofs. Sets the offset of the piece with the index idx to ofs. Sets the of the piece with index idx to texture. Sets the size of this . Clears the . Returns the number of pieces currently in this . Returns the offset of the piece with the index idx. Returns the of the piece with the index idx. Light is the abstract base class for light nodes. As it can't be instanced, it shouldn't be used directly. Other types of light nodes inherit from it. Light contains the common variables and parameters used for lighting. Light is ignored when baking. Note: Hiding a light does not affect baking. Only indirect lighting will be baked (default). Both direct and indirect light will be baked. Note: You should hide the light if you don't want it to appear twice (dynamic and baked). Constant for accessing . Constant for accessing . Constant for accessing . Constant for accessing or . Constant for accessing or . Constant for accessing . Constant for accessing . Constant for accessing . Constant for accessing . Constant for accessing . Constant for accessing . Constant for accessing . Constant for accessing . Constant for accessing . Constant for accessing . Represents the size of the enum. The light's color. An overbright color can be used to achieve a result equivalent to increasing the light's . The light's strength multiplier (this is not a physical unit). For and , changing this value will only change the light color's intensity, not the light's radius. Secondary multiplier used with indirect light (light bounces). This works on both and . If true, the light's effect is reversed, darkening areas and casting bright shadows. The intensity of the specular blob in objects affected by the light. At 0, the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface. The light's bake mode. See . The light will affect objects in the selected layers. If true, the light will cast shadows. The color of shadows cast by this light. Used to adjust shadow appearance. Too small a value results in self-shadowing ("shadow acne"), while too large a value causes shadows to separate from casters ("peter-panning"). Adjust as needed. Attempts to reduce gap. If true, reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double-sided shadows with . If true, the light only appears in the editor and will not be visible at runtime. Sets the value of the specified parameter. Returns the value of the specified parameter. Casts light in a 2D environment. Light is defined by a (usually grayscale) texture, a color, an energy value, a mode (see constants), and various other parameters (range and shadows-related). Note: Light2D can also be used as a mask. No filter applies to the shadow map. See . Percentage closer filtering (3 samples) applies to the shadow map. See . Percentage closer filtering (5 samples) applies to the shadow map. See . Percentage closer filtering (7 samples) applies to the shadow map. See . Percentage closer filtering (9 samples) applies to the shadow map. See . Percentage closer filtering (13 samples) applies to the shadow map. See . Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light. Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect. Mix the value of pixels corresponding to the Light2D to the values of pixels under it by linear interpolation. The light texture of the Light2D is used as a mask, hiding or revealing parts of the screen underneath depending on the value of each pixel of the light (mask) texture. If true, Light2D will emit light. If true, Light2D will only appear when editing the scene. used for the Light2D's appearance. The offset of the Light2D's texture. The texture's scale factor. The Light2D's . The Light2D's energy value. The larger the value, the stronger the light. The Light2D's mode. See constants for values. The height of the Light2D. Used with 2D normal mapping. Minimum z value of objects that are affected by the Light2D. Maximum z value of objects that are affected by the Light2D. Minimum layer value of objects that are affected by the Light2D. Maximum layer value of objects that are affected by the Light2D. The layer mask. Only objects with a matching mask will be affected by the Light2D. If true, the Light2D will cast shadows. of shadows cast by the Light2D. Shadow buffer size. Smooth shadow gradient length. Shadow filter type. See for possible values. Smoothing value for shadows. The shadow mask. Used with to cast shadows. Only occluders with a matching light mask will cast shadows. Occludes light cast by a Light2D, casting shadows. The LightOccluder2D must be provided with an in order for the shadow to be computed. The used to compute the shadow. The LightOccluder2D's light mask. The LightOccluder2D will cast shadows only from Light2D(s) that have the same light mask(s). A line through several points in 2D space. Note: By default, Godot can only draw up to 4,096 polygon points at a time. To increase this limit, open the Project Settings and increase and . Takes the left pixels of the texture and renders it over the whole line. Tiles the texture over the line. The texture must be imported with Repeat enabled for it to work properly. Stretches the texture across the line. Import the texture with Repeat disabled for best results. Don't draw a line cap. Draws the line cap as a box. Draws the line cap as a circle. The line's joints will be pointy. If sharp_limit is greater than the rotation of a joint, it becomes a bevel joint instead. The line's joints will be bevelled/chamfered. The line's joints will be rounded. The points that form the lines. The line is drawn between every point set in this array. Points are interpreted as local vectors. The line's width. The line's width varies with the curve. The original width is simply multiply by the value of the Curve. The line's color. Will not be used if a gradient is set. The gradient is drawn through the whole line from start to finish. The default color will not be used if a gradient is set. The texture used for the line's texture. Uses texture_mode for drawing style. The style to render the texture on the line. Use constants. The style for the points between the start and the end. Controls the style of the line's first point. Use constants. Controls the style of the line's last point. Use constants. The direction difference in radians between vector points. This value is only used if joint mode is set to . The smoothness of the rounded joints and caps. This is only used if a cap or joint is set as round. If true, the line's border will be anti-aliased. Overwrites the position in point i with the supplied position. Returns point i's position. Returns the Line2D's amount of points. Adds a point at the position. Appends the point at the end of the line. If at_position is given, the point is inserted before the point number at_position, moving that point (and every point after) after the inserted point. If at_position is not given, or is an illegal value (at_position < 0 or at_position >= [method get_point_count]), the point will be appended at the end of the point list. Removes the point at index i from the line. Removes all points from the line. LineEdit provides a single-line string editor, used for text fields. It features many built-in shortcuts which will always be available (Ctrl here maps to Command on macOS): - Ctrl + C: Copy - Ctrl + X: Cut - Ctrl + V or Ctrl + Y: Paste/"yank" - Ctrl + Z: Undo - Ctrl + Shift + Z: Redo - Ctrl + U: Delete text from the cursor position to the beginning of the line - Ctrl + K: Delete text from the cursor position to the end of the line - Ctrl + A: Select all text - Up/Down arrow: Move the cursor to the beginning/end of the line On macOS, some extra keyboard shortcuts are available: - Ctrl + F: Like the right arrow key, move the cursor one character right - Ctrl + B: Like the left arrow key, move the cursor one character left - Ctrl + P: Like the up arrow key, move the cursor to the previous line - Ctrl + N: Like the down arrow key, move the cursor to the next line - Ctrl + D: Like the Delete key, delete the character on the right side of cursor - Ctrl + H: Like the Backspace key, delete the character on the left side of the cursor - Command + Left arrow: Like the Home key, move the cursor to the beginning of the line - Command + Right arrow: Like the End key, move the cursor to the end of the line Aligns the text on the left-hand side of the . Centers the text in the middle of the . Aligns the text on the right-hand side of the . Stretches whitespaces to fit the 's width. Cuts (copies and clears) the selected text. Copies the selected text. Pastes the clipboard text over the selected text (or at the cursor's position). Non-printable escape characters are automatically stripped from the OS clipboard via String.strip_escapes. Erases the whole text. Selects the whole text. Undoes the previous action. Reverse the last undo action. Represents the size of the enum. String value of the . Note: Changing text using this property won't emit the text_changed signal. Text alignment as defined in the enum. Maximum amount of characters that can be entered inside the . If 0, there is no limit. If false, existing text cannot be modified and new text cannot be added. If true, every character is replaced with the secret character (see ). The character to use to mask secret input (defaults to "*"). Only a single character can be used as the secret character. If true, the width will increase to stay longer than the . It will not compress if the is shortened. If true, the context menu will appear when right-clicked. If true, the native virtual keyboard is shown when focused on platforms that support it. If true, the will show a clear button if text is not empty, which can be used to clear the text quickly. If false, using shortcuts will be disabled. If false, it's impossible to select the text using mouse nor keyboard. Sets the icon that will appear in the right end of the if there's no , or always, if is set to false. Text shown when the is empty. It is not the 's default value (see ). Opacity of the . From 0 to 1. If true, the caret (visual cursor) blinks. Duration (in seconds) of a caret's blinking cycle. The cursor's position inside the . When set, the text may scroll to accommodate it. Erases the 's . Selects characters inside between from and to. By default, from is at the beginning and to at the end. text = "Welcome" select() # Will select "Welcome". select(4) # Will select "ome". select(2, 5) # Will select "lco". Selects the whole . Clears the current selection. Returns the scroll offset due to , as a number of characters. Adds text after the cursor. If the resulting value is longer than , nothing happens. Deletes one character at the cursor's current position (equivalent to pressing the Delete key). Deletes a section of the going from position from_column to to_column. Both parameters should be within the text's length. Executes a given action as defined in the enum. Returns the of this . By default, this menu is displayed when right-clicking on the . Line shape for 2D collisions. It works like a 2D plane and will not allow any physics body to go to the negative side. Not recommended for rigid bodies, and usually not recommended for static bodies either because it forces checks against it on every frame. The line's normal. The line's distance from the origin. This kind of button is primarily used when the interaction with the button causes a context change (like linking to a web page). See also which contains common properties and methods associated with this node. The LinkButton will always show an underline at the bottom of its text. The LinkButton will show an underline at the bottom of its text when the mouse cursor is over it. The LinkButton will never show an underline at the bottom of its text. The button's text that will be displayed inside the button's area. Determines when to show the underline. See for options. Once added to the scene tree and enabled using , this node will override the location sounds are heard from. This can be used to listen from a location different from the . Note: There is no 2D equivalent for this node yet. Enables the listener. This will override the current camera's listener. Disables the listener to use the current camera's listener instead. Returns true if the listener was made current using , false otherwise. Note: There may be more than one Listener marked as "current" in the scene tree, but only the one that was made current last will be used. Returns the listener's global orthonormalized . is the abstract base class for a Godot project's game loop. It is inherited by , which is the default game loop implementation used in Godot projects, though it is also possible to write and use one's own subclass instead of the scene tree. Upon the application start, a implementation must be provided to the OS; otherwise, the application will exit. This happens automatically (and a is created) unless a main is provided from the command line (with e.g. godot -s my_loop.gd, which should then be a implementation. Here is an example script implementing a simple : extends MainLoop var time_elapsed = 0 var keys_typed = [] var quit = false func _initialize(): print("Initialized:") print(" Starting time: %s" % str(time_elapsed)) func _idle(delta): time_elapsed += delta # Return true to end the main loop. return quit func _input_event(event): # Record keys. if event is InputEventKey and event.pressed and !event.echo: keys_typed.append(OS.get_scancode_string(event.scancode)) # Quit on Escape press. if event.scancode == KEY_ESCAPE: quit = true # Quit on any mouse click. if event is InputEventMouseButton: quit = true func _finalize(): print("Finalized:") print(" End time: %s" % str(time_elapsed)) print(" Keys typed: %s" % var2str(keys_typed)) Notification received from the OS when the mouse enters the game window. Implemented on desktop and web platforms. Notification received from the OS when the mouse leaves the game window. Implemented on desktop and web platforms. Notification received from the OS when the game window is focused. Implemented on all platforms. Notification received from the OS when the game window is unfocused. Implemented on all platforms. Notification received from the OS when a quit request is sent (e.g. closing the window with a "Close" button or Alt+F4). Implemented on desktop platforms. Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android). Specific to the Android platform. Notification received from the OS when an unfocus request is sent (e.g. another OS window wants to take the focus). No supported platforms currently send this notification. Notification received from the OS when the application is exceeding its allocated memory. Specific to the iOS platform. 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 . Notification received from the OS when a request for "About" information is sent. Specific to the macOS platform. Notification received from Godot's crash handler when the engine is about to crash. Implemented on desktop platforms if the crash handler is enabled. 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. Notification received from the OS when the app is resumed. Specific to the Android platform. Notification received from the OS when the app is paused. Specific to the Android platform. Called when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated. Called before the program exits. Called when the user performs an action in the system global menu (e.g. the Mac OS menu bar). Called each idle frame with the time since the last idle frame as argument (in seconds). Equivalent to . If implemented, the method must return a boolean value. true ends the main loop, while false lets it proceed to the next frame. Called once during initialization. Called whenever an is received by the main loop. Deprecated callback, does not do anything. Use to parse text input. Will be removed in Godot 4.0. Called each physics frame with the time since the last physics frame as argument (delta, in seconds). Equivalent to . If implemented, the method must return a boolean value. true ends the main loop, while false lets it proceed to the next frame. Should not be called manually, override instead. Will be removed in Godot 4.0. Should not be called manually, override instead. Will be removed in Godot 4.0. Should not be called manually, override instead. Will be removed in Godot 4.0. Should not be called manually, override instead. Will be removed in Godot 4.0. Should not be called manually, override instead. Will be removed in Godot 4.0. Should not be called manually, override instead. Will be removed in Godot 4.0. Adds a top, left, bottom, and right margin to all nodes that are direct children of the container. To control the 's margin, use the margin_* theme properties listed below. Note: Be careful, margin values are different than the constant margin values. If you want to change the custom margin values of the by code, you should use the following examples: # This code sample assumes the current script is extending MarginContainer. var margin_value = 100 add_constant_override("margin_top", margin_value) add_constant_override("margin_left", margin_value) add_constant_override("margin_bottom", margin_value) add_constant_override("margin_right", margin_value) Material is a base used for coloring and shading geometry. All materials inherit from it and almost all derived nodes carry a Material. A few flags and parameters are shared between all material types and are configured here. Maximum value for the parameter. Minimum value for the parameter. Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects. Note: this only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). Sets the to be used for the next pass. This renders the object again using a different material. Note: only applies to s and s with type "Spatial". Special button that brings up a when clicked. New items can be created inside this using get_popup().add_item("My Item Name"). You can also create them directly from the editor. To do so, select the node, then in the toolbar at the top of the 2D editor, click Items then click Add in the popup. You will be able to give each item new properties. See also which contains common properties and methods associated with this node. If true, when the cursor hovers above another within the same parent which also has switch_on_hover enabled, it will close the current and open the other one. Returns the contained in this button. If true, shortcuts are disabled and cannot be used to trigger the button. Mesh is a type of that contains vertex array-based geometry, divided in surfaces. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials. Blend shapes are normalized. Blend shapes are relative to base weight. Render array as points (one vertex equals one point). Render array as lines (every two vertices a line is created). Render array as line strip. Render array as line loop (like line strip, but closed). Render array as triangles (every three vertices a triangle is created). Render array as triangle strips. Render array as triangle fans. Mesh array contains vertices. All meshes require a vertex array so this should always be present. Mesh array contains normals. Mesh array contains tangents. Mesh array contains colors. Mesh array contains UVs. Mesh array contains second UV. Mesh array contains bones. Mesh array contains bone weights. Mesh array uses indices. Used internally to calculate other ARRAY_COMPRESS_* enum values. Do not use. Flag used to mark a compressed (half float) vertex array. Flag used to mark a compressed (half float) normal array. Flag used to mark a compressed (half float) tangent array. Flag used to mark a compressed (half float) color array. Flag used to mark a compressed (half float) UV coordinates array. Flag used to mark a compressed (half float) UV coordinates array for the second UV coordinates. Flag used to mark a compressed bone array. Flag used to mark a compressed (half float) weight array. Flag used to mark a compressed index array. Flag used to mark that the array contains 2D vertices. Flag used to mark that the array uses 16-bit bones instead of 8-bit. Used to set flags , , , , , and quickly. Array of vertices. Array of normals. Array of tangents as an array of floats, 4 floats per tangent. Array of colors. Array of UV coordinates. Array of second set of UV coordinates. Array of bone data. Array of weights. Array of indices. Represents the size of the enum. Sets a hint to be used for lightmap resolution in . Overrides . Returns the smallest enclosing this mesh in local space. Not affected by custom_aabb. See also . Note: This is only implemented for and . Returns the amount of surfaces that the holds. Returns the arrays for the vertices, normals, uvs, etc. that make up the requested surface (see ). Returns the blend shape arrays for the requested surface. Sets a for a given surface. Surface will be rendered using this material. Returns a in a given surface. Surface is rendered using this material. Calculate a from the mesh. Calculate a from the mesh. Calculate an outline mesh at a defined offset (margin) from the original mesh. Note: This method typically returns the vertices in reverse order (e.g. clockwise to counterclockwise). Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle. Generate a from the mesh. MeshDataTool provides access to individual vertices in a . 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 . When you are finished editing the data commit the data to a mesh with . Below is an example of how MeshDataTool may be used. var mesh = ArrayMesh.new() mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, CubeMesh.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.surface_remove(0) mdt.commit_to_surface(mesh) var mi = MeshInstance.new() mi.mesh = mesh add_child(mi) See also , and for procedural geometry generation. Note: Godot uses clockwise winding order for front faces of triangle primitive modes. Clears all data currently in MeshDataTool. Uses specified surface of given to populate data for MeshDataTool. Requires with primitive type . Adds a new surface to specified with edited data. Returns the 's format. Format is an integer made up of format flags combined together. For example, a mesh containing both vertices and normals would return a format of 3 because is 1 and is 2. See for a list of format flags. Returns the total number of vertices in . Returns the number of edges in this . Returns the number of faces in this . Sets the position of the given vertex. Returns the vertex at given index. Sets the normal of the given vertex. Returns the normal of the given vertex. Sets the tangent of the given vertex. Returns the tangent of the given vertex. Sets the UV of the given vertex. Returns the UV of the given vertex. Sets the UV2 of the given vertex. Returns the UV2 of the given vertex. Sets the color of the given vertex. Returns the color of the given vertex. Sets the bones of the given vertex. Returns the bones of the given vertex. Sets the bone weights of the given vertex. Returns bone weights of the given vertex. Sets the metadata associated with the given vertex. Returns the metadata associated with the given vertex. Returns an array of edges that share the given vertex. Returns an array of faces that share the given vertex. Returns index of specified vertex connected to given edge. Vertex argument can only be 0 or 1 because edges are comprised of two vertices. Returns array of faces that touch given edge. Sets the metadata of the given edge. Returns meta information assigned to given edge. Returns the specified vertex of the given face. Vertex argument must be 2 or less because faces contain three vertices. Returns specified edge associated with given face. Edge argument must 2 or less because a face only has three edges. Sets the metadata of the given face. Returns the metadata associated with the given face. Calculates and returns the face normal of the given face. Sets the material to be used by newly-constructed . Returns the material assigned to the . MeshInstance is a node that takes a resource and adds it to the current scenario by creating an instance of it. This is the class most often used to get 3D geometry rendered and can be used to instance a single in many places. This allows to reuse geometry and save on resources. When a has to be instanced more than thousands of times at close proximity, consider using a in a instead. The resource for the instance. Sets the skin to be used by this instance. to the associated with the instance. If true, normals are transformed when software skinning is used. Set to false when normals are not needed for better performance. See for details about how software skinning is enabled. Returns the number of surface materials. Sets the for a surface of the resource. Returns the for a surface of the resource. Returns the that will be used by the when drawing. This can return the , the surface override defined in this , or the surface defined in the . For example, if is used, all surfaces will return the override material. This helper creates a child node with a collision shape calculated from the mesh geometry. It's mainly used for testing. This helper creates a child node with a collision shape calculated from the mesh geometry. It's mainly used for testing. This helper creates a child node with gizmos at every vertex calculated from the mesh geometry. It's mainly used for testing. Node used for displaying a in 2D. Can be constructed from an existing via a tool in the editor toolbar. Select "Sprite" then "Convert to Mesh2D", select settings in popup and press "Create Mesh2D". The that will be drawn by the . The that will be used if using the default . Can be accessed as TEXTURE in CanvasItem shader. The normal map that will be used if using the default . Note: Godot expects the normal map to use X+, Y-, and Z+ coordinates. See this page for a comparison of normal map coordinates expected by popular engines. A library of meshes. Contains a list of resources, each with a name and ID. Each item can also include collision and navigation shapes. This resource is used in . Creates a new item in the library with the given ID. You can get an unused ID from . Sets the item's name. This name is shown in the editor. It can also be used to look up the item later using . Sets the item's mesh. Sets the item's navigation mesh. Sets the transform to apply to the item's navigation mesh. Sets an item's collision shapes. The array should consist of objects, each followed by a that will be applied to it. For shapes that should not have a transform, use . Sets a texture to use as the item's preview icon in the editor. Returns the item's name. Returns the item's mesh. Returns the item's navigation mesh. Returns the transform applied to the item's navigation mesh. Returns an item's collision shapes. The array consists of each followed by its . When running in the editor, returns a generated item preview (a 3D rendering in isometric perspective). When used in a running project, returns the manually-defined item preview which can be set using . Returns an empty if no preview was manually set in a running project. Removes the item. Returns the first item with the given name. Clears the library. Returns the list of item IDs in use. Gets an unused ID for a new item. Simple texture that uses a mesh to draw itself. It's limited because flags can't be changed and region drawing is not supported. Sets the mesh used to draw. It must be a mesh using 2D vertices. Sets the base texture that the Mesh will use to draw. Sets the size of the image, needed for reference. This is a generic mobile VR implementation where you need to provide details about the phone and HMD used. It does not rely on any existing framework. This is the most basic interface we have. For the best effect, you need a mobile phone with a gyroscope and accelerometer. Note that even though there is no positional tracking, the camera will assume the headset is at a height of 1.85 meters. You can change this by setting . You can initialise this interface as follows: var interface = ARVRServer.find_interface("Native mobile") if interface and interface.initialize(): get_viewport().arvr = true The height at which the camera is placed in relation to the ground (i.e. node). The interocular distance, also known as the interpupillary distance. The distance between the pupils of the left and right eye. The width of the display in centimeters. The distance between the display and the lenses inside of the device in centimeters. The oversample setting. Because of the lens distortion we have to render our buffers at a higher resolution then the screen can natively handle. A value between 1.5 and 2.0 often provides good results but at the cost of performance. The k1 lens factor is one of the two constants that define the strength of the lens used and directly influences the lens distortion effect. The k2 lens factor, see k1. MultiMesh provides low-level mesh instancing. Drawing thousands of nodes can be slow, since each object is submitted to the GPU then drawn individually. MultiMesh is much faster as it can draw thousands of instances with a single draw call, resulting in less API overhead. As a drawback, if the instances are too far away of each other, performance may be reduced as every single instance will always render (they are spatially indexed as one, for the whole object). Since instances may have any behavior, the AABB used for visibility must be provided by the user. Use this when using 2D transforms. Use this when using 3D transforms. Use when you are not using per-instance custom data. Compress custom_data into 8 bits when passing to shader. This uses less memory and can be faster, but loses precision and range. Floats packed into 8 bits can only represent values between 0 and 1, numbers outside that range will be clamped. The passed into will use 4 floats. Use this for highest precision. Use when you are not using per-instance s. Compress data into 8 bits when passing to shader. This uses less memory and can be faster, but the loses precision. The passed into will use 4 floats. Use this for highest precision . Format of colors in color array that gets passed to shader. Format of transform used to transform mesh, either 2D or 3D. Format of custom data in custom data array that gets passed to shader. Number of instances that will get drawn. This clears and (re)sizes the buffers. By default, all instances are drawn but you can limit this with . Limits the number of instances drawn, -1 draws all instances. Changing this does not change the sizes of the buffers. Mesh to be drawn. Sets the for a specific instance. Sets the for a specific instance. Returns the of a specific instance. Returns the of a specific instance. Sets the color of a specific instance by multiplying the mesh's existing vertex colors. For the color to take effect, ensure that is non-null on the and is true on the material. Gets a specific instance's color. Sets custom data for a specific instance. Although is used, it is just a container for 4 floating point numbers. The format of the number can change depending on the used. Returns the custom data that has been set for a specific instance. Sets all data related to the instances in one go. This is especially useful when loading the data from disk or preparing the data from GDNative. All data is packed in one large float array. An array may look like this: Transform for instance 1, color data for instance 1, custom data for instance 1, transform for instance 2, color data for instance 2, etc... is stored as 12 floats, is stored as 8 floats, COLOR_8BIT / CUSTOM_DATA_8BIT is stored as 1 float (4 bytes as is) and COLOR_FLOAT / CUSTOM_DATA_FLOAT is stored as 4 floats. Returns the visibility axis-aligned bounding box in local space. See also . is a specialized node to instance s based on a resource. This is useful to optimize the rendering of a high amount of instances of a given mesh (for example trees in a forest or grass strands). The resource that will be used and shared among all instances of the . is a specialized node to instance a resource in 2D. Usage is the same as . The that will be drawn by the . The that will be used if using the default . Can be accessed as TEXTURE in CanvasItem shader. The normal map that will be used if using the default . Note: Godot expects the normal map to use X+, Y-, and Z+ coordinates. See this page for a comparison of normal map coordinates expected by popular engines. This class implements most of the logic behind the high-level multiplayer API. See also . By default, has a reference to this class that is used to provide multiplayer capabilities (i.e. RPC/RSET) across the whole scene. It is possible to override the MultiplayerAPI instance used by specific Nodes by setting the property, effectively allowing to run both client and server in the same scene. Note: The high-level multiplayer API protocol is an implementation detail and isn't meant to be used by non-Godot servers. It may change without notice. Used with or to disable a method or property for all RPC calls, making it unavailable. Default for all methods. Used with or to set a method to be called or a property to be changed only on the remote end, not locally. Analogous to the remote keyword. Calls and property changes are accepted from all remote peers, no matter if they are node's master or puppets. Used with or to set a method to be called or a property to be changed only on the network master for this node. Analogous to the master keyword. Only accepts calls or property changes from the node's network puppets, see . Used with or to set a method to be called or a property to be changed only on puppets for this node. Analogous to the puppet keyword. Only accepts calls or property changes from the node's network master, see . Deprecated. Use instead. Analogous to the slave keyword. Behave like but also make the call or property change locally. Analogous to the remotesync keyword. Deprecated. Use instead. Analogous to the sync keyword. Behave like but also make the call or property change locally. Analogous to the mastersync keyword. Behave like but also make the call or property change locally. Analogous to the puppetsync keyword. If true (or if the has set to true), the MultiplayerAPI will allow encoding and decoding of object during RPCs/RSETs. Warning: Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. If true, the MultiplayerAPI's refuses new incoming connections. The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with ) and will set root node's network mode to master, or it will become a regular peer with root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals. The root node to use for RPCs. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed. This effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene. Sends the given raw bytes to a specific peer identified by id (see ). Default ID is 0, i.e. broadcast to all peers. Returns true if there is a set. Returns the unique peer ID of this MultiplayerAPI's . Returns true if this MultiplayerAPI's is in server mode (listening for connections). Returns the sender's peer ID for the RPC currently being executed. Note: If not inside an RPC this method will return 0. Method used for polling the MultiplayerAPI. You only need to worry about this if you are using override or you set to false. By default, will poll its MultiplayerAPI for you. Note: This method results in RPCs and RSETs being called, so they will be executed in the same context of this function (e.g. _process, physics, ). Clears the current MultiplayerAPI network state (you shouldn't call this unless you know what you are doing). Returns the peer IDs of all connected peers of this MultiplayerAPI's . Returns the documentation string that was previously set with godot_nativescript_set_class_documentation. Returns the documentation string that was previously set with godot_nativescript_set_method_documentation. Returns the documentation string that was previously set with godot_nativescript_set_signal_documentation. Returns the documentation string that was previously set with godot_nativescript_set_property_documentation. Constructs a new object of the base type with a script of this type already attached. Note: Any arguments passed to this function will be ignored and not passed to the native constructor function. This will change with in a future API extension. Provides navigation and pathfinding within a collection of es. By default, these will be automatically collected from child nodes, but they can also be added on the fly with . In addition to basic pathfinding, this class also assists with aligning navigation agents with the meshes they are navigating on. Defines which direction is up. By default, this is (0, 1, 0), which is the world's "up" direction. Adds a . Returns an ID for use with or . If given, a is applied to the polygon. The optional owner is used as return value for . Sets the transform applied to the with the given ID. Removes the with the given ID. Returns the path between two given points. Points are in local coordinate space. If optimize is true (the default), the agent properties associated with each (radius, height, etc.) are considered in the path calculation, otherwise they are ignored. Returns the navigation point closest to the given line segment. When enabling use_collision, only considers intersection points between segment and navigation meshes. If multiple intersection points are found, the one closest to the segment start point is returned. Returns the navigation point closest to the point given. Points are in local coordinate space. Returns the surface normal at the navigation point closest to the point given. Useful for rotating a navigation agent according to the navigation mesh it moves on. Returns the owner of the which contains the navigation point closest to the point given. This is usually a . For meshes added via , returns the owner that was given (or null if the owner parameter was omitted). Navigation2D provides navigation and pathfinding within a 2D area, specified as a collection of resources. By default, these are automatically collected from child nodes, but they can also be added on the fly with . Adds a . Returns an ID for use with or . If given, a is applied to the polygon. The optional owner is used as return value for . Sets the transform applied to the with the given ID. Removes the with the given ID. Returns the path between two given points. Points are in local coordinate space. If optimize is true (the default), the path is smoothed by merging path segments where possible. Returns the navigation point closest to the point given. Points are in local coordinate space. Returns the owner of the which contains the navigation point closest to the point given. This is usually a . For polygons added via , returns the owner that was given (or null if the owner parameter was omitted). There are two ways to create polygons. Either by using the method, or using the method. Using : var polygon = NavigationPolygon.new() var outline = PoolVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)]) polygon.add_outline(outline) polygon.make_polygons_from_outlines() $NavigationPolygonInstance.navpoly = polygon Using and indices of the vertices array. var polygon = NavigationPolygon.new() var vertices = PoolVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)]) polygon.set_vertices(vertices) var indices = PoolIntArray(0, 3, 1) polygon.add_polygon(indices) $NavigationPolygonInstance.navpoly = polygon Sets the vertices that can be then indexed to create polygons with the method. Returns a containing all the vertices being used to create the polygons. Adds a polygon using the indices of the vertices you get when calling . Returns the count of all polygons. Returns a containing the indices of the vertices of a created polygon. Clears the array of polygons, but it doesn't clear the array of outlines and vertices. Appends a that contains the vertices of an outline to the internal array that contains all the outlines. You have to call in order for this array to be converted to polygons that the engine will use. Adds a that contains the vertices of an outline to the internal array that contains all the outlines at a fixed position. You have to call in order for this array to be converted to polygons that the engine will use. Returns the number of outlines that were created in the editor or by script. Changes an outline created in the editor or by script. You have to call for the polygons to update. Returns a containing the vertices of an outline that was created in the editor or by script. Removes an outline created in the editor or by script. You have to call for the polygons to update. Clears the array of the outlines, but it doesn't clear the vertices and the polygons that were created by them. Creates polygons from the outlines added in the editor or by script. A PacketPeer implementation that should be passed to after being initialized as either a client or server. Events can then be handled by connecting to signals. ENet's purpose is to provide a relatively thin, simple and robust network communication layer on top of UDP (User Datagram Protocol). Note: ENet only uses UDP, not TCP. When forwarding the server port to make your server accessible on the public Internet, you only need to forward the server port in UDP. You can use the class to try to forward the server port automatically when starting the server. No compression. This uses the most bandwidth, but has the upside of requiring the fewest CPU resources. ENet's built-in range encoding. FastLZ compression. This option uses less CPU resources compared to , at the expense of using more bandwidth. Zlib compression. This option uses less bandwidth compared to , at the expense of using more CPU resources. Zstandard compression. The compression method used for network packets. These have different tradeoffs of compression speed versus bandwidth, you may need to test which one works best for your use case if you use compression at all. Set the default channel to be used to transfer data. By default, this value is -1 which means that ENet will only use 2 channels: one for reliable packets, and one for unreliable packets. The channel 0 is reserved and cannot be used. Setting this member to any value between 0 and (excluded) will force ENet to use that channel for sending data. See for more information about ENet channels. The number of channels to be used by ENet. Channels are used to separate different kinds of data. In reliable or ordered mode, for example, the packet delivery order is ensured on a per-channel basis. This is done to combat latency and reduces ordering restrictions on packets. The delivery status of a packet in one channel won't stall the delivery of other packets in another channel. Enforce ordered packets when using (thus behaving similarly to ). This is the only way to use ordering with the RPC system. Enable or disable the server feature that notifies clients of other peers' connection/disconnection, and relays messages between them. When this option is false, clients won't be automatically notified of other peers and won't be able to send them packets through the server. Enable or disable certificate verification when true. When enabled, the client or server created by this peer, will use instead of raw UDP sockets for communicating with the remote peer. This will make the communication encrypted with DTLS at the cost of higher resource usage and potentially larger packet size. Note: When creating a DTLS server, make sure you setup the key/certificate pair via and . For DTLS clients, have a look at the option, and configure the certificate accordingly via . Create server that listens to connections via port. The port needs to be an available, unused port between 0 and 65535. Note that ports below 1024 are privileged and may require elevated permissions depending on the platform. To change the interface the server listens on, use . The default IP is the wildcard "*", which listens on all available interfaces. max_clients is the maximum number of clients that are allowed at once, any number up to 4095 may be used, although the achievable number of simultaneous clients may be far lower and depends on the application. For additional details on the bandwidth parameters, see . Returns if a server was created, if this NetworkedMultiplayerENet instance already has an open connection (in which case you need to call first) or if the server could not be created. Create client that connects to a server at address using specified port. The given address needs to be either a fully qualified domain name (e.g. "www.example.com") or an IP address in IPv4 or IPv6 format (e.g. "192.168.1.1"). The port is the port the server is listening on. The in_bandwidth and out_bandwidth parameters can be used to limit the incoming and outgoing bandwidth to the given number of bytes per second. The default of 0 means unlimited bandwidth. Note that ENet will strategically drop packets on specific sides of a connection between peers to ensure the peer's bandwidth is not overwhelmed. The bandwidth parameters also determine the window size of a connection which limits the amount of reliable packets that may be in transit at any given time. Returns if a client was created, if this NetworkedMultiplayerENet instance already has an open connection (in which case you need to call first) or if the client could not be created. If client_port is specified, the client will also listen to the given port; this is useful for some NAT traversal techniques. Closes the connection. Ignored if no connection is currently established. If this is a server it tries to notify all clients before forcibly disconnecting them. If this is a client it simply closes the connection to the server. Disconnect the given peer. If "now" is set to true, the connection will be closed immediately without flushing queued messages. The IP used when creating a server. This is set to the wildcard "*" by default, which binds to all available interfaces. The given IP needs to be in IPv4 or IPv6 address format, for example: "192.168.1.1". Configure the to use when is true. Remember to also call to setup your . Configure the to use when is true. For servers, you must also setup the via . Returns the IP address of the given peer. Returns the remote port of the given peer. Sets the timeout parameters for a peer.The timeout parameters control how and when a peer will timeout from a failure to acknowledge reliable traffic. Timeout values are expressed in milliseconds. The timeout_limit is a factor that, multiplied by a value based on the average round trip time, will determine the timeout limit for a reliable packet. When that limit is reached, the timeout will be doubled, and the peer will be disconnected if that limit has reached timeout_min. The timeout_max parameter, on the other hand, defines a fixed timeout for which any packet must be acknowledged or the peer will be dropped. Returns the channel of the next packet that will be retrieved via . Returns the channel of the last packet fetched via . Manages the connection to network peers. Assigns unique IDs to each client connected to the server. See also . Note: The high-level multiplayer API protocol is an implementation detail and isn't meant to be used by non-Godot servers. It may change without notice. Packets are sent to the server and then redistributed to other peers. Packets are sent to the server alone. The ongoing connection disconnected. A connection attempt is ongoing. The connection attempt succeeded. Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than . Use for non-critical data, and always consider whether the order matters. Packets are not acknowledged, no resend attempts are made for lost packets. Packets are received in the order they were sent in. Potentially faster than . Use for non-critical data or data that would be outdated if received late due to resend attempt(s) anyway, for example movement and positional data. Packets must be received and resend attempts should be made until the packets are acknowledged. Packets must be received in the order they were sent in. Most reliable transfer mode, but potentially the slowest due to the overhead. Use for critical data that must be transmitted and arrive in order, for example an ability being triggered or a chat message. Consider carefully if the information really is critical, and use sparingly. If true, this refuses new connections. The manner in which to send packets to the target_peer. See . Sets the peer to which packets will be sent. The id can be one of: to send to all connected peers, to send to the peer acting as server, a valid peer ID to send to that specific peer, a negative peer ID to send to all peers except that one. By default, the target peer is . Returns the ID of the who sent the most recent packet. Waits up to 1 second to receive a new network event. Returns the current state of the connection. See . Returns the ID of this . Also known as 9-slice panels, NinePatchRect produces clean panels of any size, based on a small texture. To do so, it splits the texture in a 3×3 grid. When you scale the node, it tiles the texture's sides horizontally or vertically, the center on both axes but it doesn't scale or tile the corners. Stretches the center texture across the NinePatchRect. This may cause the texture to be distorted. Repeats the center texture across the NinePatchRect. This won't cause any visible distortion. The texture must be seamless for this to work without displaying artifacts between edges. Note: Only supported when using the GLES3 renderer. When using the GLES2 renderer, this will behave like . Repeats the center texture across the NinePatchRect, but will also stretch the texture to make sure each tile is visible in full. This may cause the texture to be distorted, but less than . The texture must be seamless for this to work without displaying artifacts between edges. Note: Only supported when using the GLES3 renderer. When using the GLES2 renderer, this will behave like . The node's texture resource. If true, draw the panel's center. Else, only draw the 9-slice's borders. Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one. If the rect is empty, NinePatchRect will use the whole texture. The width of the 9-slice's left column. A margin of 16 means the 9-slice's left corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. The height of the 9-slice's top row. A margin of 16 means the 9-slice's top corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. The width of the 9-slice's right column. A margin of 16 means the 9-slice's right corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. The height of the 9-slice's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. The stretch mode to use for horizontal stretching/tiling. See for possible values. The stretch mode to use for vertical stretching/tiling. See for possible values. Sets the size of the margin identified by the given constant to value in pixels. Returns the size of the margin identified by the given constant. A 2D game object, with a transform (position, rotation, and scale). All 2D nodes, including physics objects and sprites, inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control of the node's render order. Position, relative to the node's parent. Rotation in radians, relative to the node's parent. Rotation in degrees, relative to the node's parent. The node's scale. Unscaled value: (1, 1). Local . Global position. Global rotation in radians. Global rotation in degrees. Global scale. Global . Z index. Controls the order in which the nodes render. A node with a higher Z index will display in front of others. Must be between and (inclusive). If true, the node's Z index is relative to its parent's Z index. If this node's Z index is 2 and its parent's effective Z index is 3, then this node's effective Z index will be 2 + 3 = 5. Applies a rotation to the node, in radians, starting from its current rotation. Applies a local translation on the node's X axis based on the 's delta. If scaled is false, normalizes the movement. Applies a local translation on the node's Y axis based on the 's delta. If scaled is false, normalizes the movement. Translates the node by the given offset in local coordinates. Adds the offset vector to the node's global position. Multiplies the current scale by the ratio vector. Rotates the node so it points towards the point, which is expected to use global coordinates. Returns the angle between the node and the point in radians. Transforms the provided global position into a position in local coordinate space. The output will be local relative to the it is called on. e.g. It is appropriate for determining the positions of child nodes, but it is not appropriate for determining its own position relative to its parent. Transforms the provided local position into a position in global coordinate space. The input is expected to be local relative to the it is called on. e.g. Applying this method to the positions of child nodes will correctly transform their positions into the global coordinate space, but applying it to a node's own position will give an incorrect result, as it will incorporate the node's own transformation into its global position. Returns the relative to this node's parent. Uses an to fill the texture data. You can specify the texture size but keep in mind that larger textures will take longer to generate and seamless noise only works with square sized textures. NoiseTexture can also generate normalmap textures. The class uses s to generate the texture data internally, so may return null if the generation process has not completed yet. In that case, you need to wait for the texture to be generated before accessing the data: var texture = preload("res://noise.tres") yield(texture, "changed") var image = texture.get_data() Width of the generated texture. Height of the generated texture. Whether the texture can be tiled without visible seams or not. Seamless textures take longer to generate. Note: Seamless noise has a lower contrast compared to non-seamless noise. This is due to the way noise uses higher dimensions for generating seamless noise. If true, the resulting texture contains a normal map created from the original noise interpreted as a bump map. Strength of the bump maps used in this texture. A higher value will make the bump maps appear larger while a lower value will make them appear softer. The instance used to generate the noise. Editor facility that helps you draw a 2D polygon used as resource for . Culling is disabled. See . Culling is performed in the clockwise direction. See . Culling is performed in the counterclockwise direction. See . If true, closes the polygon. A closed OccluderPolygon2D occludes the light coming from any direction. An opened OccluderPolygon2D occludes the light only at its outline's direction. The culling mode to use. A array with the index for polygon's vertices positions. Note: The returned value is a copy of the underlying array, rather than a reference. An Omnidirectional light is a type of that emits light in all directions. The light is attenuated by distance and this attenuation can be configured by changing its energy, radius, and attenuation parameters. Note: By default, only 32 OmniLights may affect a single mesh resource at once. Consider splitting your level into several meshes to decrease the likelihood that more than 32 lights will affect the same mesh resource. Splitting the level mesh will also improve frustum culling effectiveness, leading to greater performance. If you need to use more lights per mesh, you can increase at the cost of shader compilation times. Shadows are rendered to a dual-paraboloid texture. Faster than , but lower-quality. Shadows are rendered to a cubemap. Slower than , but higher-quality. Use more detail vertically when computing the shadow. Use more detail horizontally when computing the shadow. The light's radius. Note that the effectively lit area may appear to be smaller depending on the in use. No matter the in use, the light will never reach anything outside this radius. The light's attenuation (drop-off) curve. A number of presets are available in the Inspector by right-clicking the curve. See . See . This resource allows you to configure and sample a fractal noise space. Here is a brief usage example that configures an OpenSimplexNoise and gets samples at various positions and dimensions: var noise = OpenSimplexNoise.new() # Configure noise.seed = randi() noise.octaves = 4 noise.period = 20.0 noise.persistence = 0.8 # Sample print("Values:") print(noise.get_noise_2d(1.0, 1.0)) print(noise.get_noise_3d(0.5, 3.0, 15.0)) print(noise.get_noise_4d(0.5, 1.9, 4.7, 0.0)) Seed used to generate random values, different seeds will generate different noise maps. Number of OpenSimplex noise layers that are sampled to get the fractal noise. Higher values result in more detailed noise but take more time to generate. Note: The maximum allowed value is 9. Period of the base octave. A lower period results in a higher-frequency noise (more value changes across the same distance). Contribution factor of the different octaves. A persistence value of 1 means all the octaves have the same contribution, a value of 0.5 means each octave contributes half as much as the previous one. Difference in period between . Generate a noise image in format with the requested width and height, based on the current noise parameters. Generate a tileable noise image in format, based on the current noise parameters. Generated seamless images are always square (size × size). Note: Seamless noise has a lower contrast compared to non-seamless noise. This is due to the way noise uses higher dimensions for generating seamless noise. Returns the 1D noise value [-1,1] at the given x-coordinate. Note: This method actually returns the 2D noise value [-1,1] with fixed y-coordinate value 0.0. Returns the 2D noise value [-1,1] at the given position. Returns the 3D noise value [-1,1] at the given position. Returns the 4D noise value [-1,1] at the given position. Returns the 2D noise value [-1,1] at the given position. Returns the 3D noise value [-1,1] at the given position. OptionButton is a type button that provides a selectable list of items when pressed. The item selected becomes the "current" item and is displayed as the button text. See also which contains common properties and methods associated with this node. The index of the currently selected item, or -1 if no item is selected. Adds an item, with text label and (optionally) id. If no id is passed, the item index will be used as the item's ID. New items are appended at the end. Adds an item, with a texture icon, text label and (optionally) id. If no id is passed, the item index will be used as the item's ID. New items are appended at the end. Sets the text of the item at index idx. Sets the icon of the item at index idx. Sets whether the item at index idx is disabled. Disabled items are drawn differently in the dropdown and are not selectable by the user. If the current selected item is set as disabled, it will remain selected. Sets the ID of the item at index idx. Sets the metadata of an item. Metadata may be of any type and can be used to store extra information about an item, such as an external string ID. Returns the text of the item at index idx. Returns the icon of the item at index idx. Returns the ID of the item at index idx. Returns the index of the item with the given id. Retrieves the metadata of an item. Metadata may be any type and can be used to store extra information about an item, such as an external string ID. Returns true if the item at index idx is disabled. Returns the amount of items in the OptionButton, including separators. Adds a separator to the list of items. Separators help to group items. Separator also takes up an index and is appended at the end. Clears all the items in the . Selects an item by index and makes it the current item. This will work even if the item is disabled. Returns the ID of the selected item, or 0 if no item is selected. Gets the metadata of the selected item. Metadata for items can be set using . Removes the item at index idx. Returns the contained in this button. The is used to create packages that can be loaded into a running project using . var packer = PCKPacker.new() packer.pck_start("test.pck") packer.add_file("res://text.txt", "text.txt") packer.flush() The above creates package test.pck, then adds a file named text.txt at the root of the package. Creates a new PCK file with the name pck_name. The .pck file extension isn't added automatically, so it should be part of pck_name (even though it's not required). Adds the source_path file to the current PCK package at the pck_path internal path (should start with res://). Writes the files specified using all calls since the last flush. If verbose is true, a list of files added will be printed to the console for easier debugging. Optimized translation. Uses real-time compressed translations, which results in very small dictionaries. Generates and sets an optimized translation from the given resource. PacketPeer is an abstraction and base class for packet-based protocols (such as UDP). It provides an API for sending and receiving packets both as raw data or variables. This makes it easy to transfer data over a protocol, without having to encode data as low-level bytes or having to worry about network ordering. Maximum buffer size allowed when encoding Variants. Raise this value to support heavier memory allocations. The method allocates memory on the stack, and the buffer used will grow automatically to the closest power of two to match the size of the Variant. If the Variant is bigger than encode_buffer_max_size, the method will error out with . Deprecated. Use get_var and put_var parameters instead. If true, the PacketPeer will allow encoding and decoding of object via and . Warning: Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. Gets a Variant. If allow_objects (or ) is true, decoding objects is allowed. Warning: Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. Sends a Variant as a packet. If full_objects (or ) is true, encoding objects is allowed (and can potentially include code). Gets a raw packet. Sends a raw packet. Returns the error state of the last packet received (via and ). Returns the number of packets currently available in the ring-buffer. This class represents a DTLS peer connection. It can be used to connect to a DTLS server, and is returned by . A status representing a that is disconnected. A status representing a that is currently performing the handshake with a remote peer. A status representing a that is connected to a remote peer. A status representing a in a generic error state. An error status that shows a mismatch in the DTLS certificate domain presented by the host and the domain requested for validation. Poll the connection to check for incoming packets. Call this frequently to update the status and keep the connection working. Connects a peer beginning the DTLS handshake using the underlying which must be connected (see ). If validate_certs is true, will validate that the certificate presented by the remote peer and match it with the for_hostname argument. You can specify a custom to use for validation via the valid_certificate argument. Returns the status of the connection. See for values. Disconnects this peer, terminating the DTLS session. PacketStreamPeer provides a wrapper for working using packets over a stream. This allows for using packet based code with StreamPeers. PacketPeerStream implements a custom protocol over the StreamPeer, so the user should not read or write to the wrapped StreamPeer directly. The wrapped object. UDP packet peer. Can be used to send raw UDP packets as well as Variants. Makes this listen on the port binding to bind_address with a buffer size recv_buf_size. If bind_address is set to "*" (default), the peer will listen on all available addresses (both IPv4 and IPv6). If bind_address is set to "0.0.0.0" (for IPv4) or "::" (for IPv6), the peer will listen on all available addresses matching that IP type. If bind_address is set to any valid address (e.g. "192.168.1.101", "::1", etc), the peer will only listen on the interface with that addresses (or fail if no interface with the given address exists). Closes the UDP socket the is currently listening on. Waits for a packet to arrive on the listening port. See . Note: can't be interrupted once it has been called. This can be worked around by allowing the other party to send a specific "death pill" packet like this: # Server socket.set_dest_address("127.0.0.1", 789) socket.put_packet("Time to stop".to_ascii()) # Client while socket.wait() == OK: var data = socket.get_packet().get_string_from_ascii() if data == "Time to stop": return Returns whether this is listening. Calling this method connects this UDP peer to the given host/port pair. UDP is in reality connectionless, so this option only means that incoming packets from different addresses are automatically discarded, and that outgoing packets are always sent to the connected address (future calls to are not allowed). This method does not send any data to the remote peer, to do that, use or as usual. See also . Note: Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like SSL or DTLS if you feel like your application is transferring sensitive information. Returns true if the UDP socket is open and has been connected to a remote address. See . Returns the IP of the remote peer that sent the last packet(that was received with or ). Returns the port of the remote peer that sent the last packet(that was received with or ). Sets the destination address and port for sending packets and variables. A hostname will be resolved using DNS if needed. Note: must be enabled before sending packets to a broadcast address (e.g. 255.255.255.255). Enable or disable sending of broadcast packets (e.g. set_dest_address("255.255.255.255", 4343). This option is disabled by default. Note: Some Android devices might require the CHANGE_WIFI_MULTICAST_STATE permission and this option to be enabled to receive broadcast packets too. Joins the multicast group specified by multicast_address using the interface identified by interface_name. You can join the same multicast group with multiple interfaces. Use to know which are available. Note: Some Android devices might require the CHANGE_WIFI_MULTICAST_STATE permission for multicast to work. Removes the interface identified by interface_name from the multicast group specified by multicast_address. Panel is a that displays an opaque background. It's commonly used as a parent and container for other types of nodes. Panel container type. This container fits controls inside of the delimited area of a stylebox. It's useful for giving controls an outline. A resource referenced in an that is used to draw a background. The Panorama sky functions similar to skyboxes in other engines, except it uses an equirectangular sky map instead of a cube map. Using an HDR panorama is strongly recommended for accurate, high-quality reflections. Godot supports the Radiance HDR (.hdr) and OpenEXR (.exr) image formats for this purpose. You can use this tool to convert a cube map to an equirectangular sky map. to be applied to the PanoramaSky. A ParallaxBackground uses one or more child nodes to create a parallax effect. Each can move at a different speed using . This creates an illusion of depth in a 2D game. If not used with a , you must manually calculate the . The ParallaxBackground's scroll value. Calculated automatically when using a , but can be used to manually manage scrolling when no camera is present. The base position offset for all children. The base motion scale for all children. Top-left limits for scrolling to begin. If the camera is outside of this limit, the background will stop scrolling. Must be lower than to work. Bottom-right limits for scrolling to end. If the camera is outside of this limit, the background will stop scrolling. Must be higher than to work. If true, elements in child aren't affected by the zoom level of the camera. A ParallaxLayer must be the child of a node. Each ParallaxLayer can be set to move at different speeds relative to the camera movement or the value. This node's children will be affected by its scroll offset. Note: Any changes to this node's position and scale made after it enters the scene will be ignored. Multiplies the ParallaxLayer's motion. If an axis is set to 0, it will not scroll. The ParallaxLayer's offset relative to the parent ParallaxBackground's . The ParallaxLayer's mirroring. Useful for creating an infinite scrolling background. If an axis is set to 0, the will not be mirrored. 3D particle node used to create a variety of particle systems and effects. features an emitter that generates some number of particles at a given rate. Use the process_material property to add a to configure particle appearance and behavior. Alternatively, you can add a which will be applied to all particles. Note: only work when using the GLES3 renderer. If using the GLES2 renderer, use instead. You can convert to by selecting the node, clicking the Particles menu at the top of the 3D editor viewport then choosing Convert to CPUParticles. Note: After working on a Particles node, remember to update its by selecting it, clicking the Particles menu at the top of the 3D editor viewport then choose Generate Visibility AABB. Otherwise, particles may suddenly disappear depending on the camera position and angle. Maximum number of draw passes supported. Particles are drawn in the order emitted. Particles are drawn in order of remaining lifetime. Particles are drawn in order of depth. If true, particles are being emitted. The number of particles emitted in one emission cycle (corresponding to the ). Note: Changing will reset the particle emission, therefore removing all particles that were already emitted before changing . The amount of time each particle will exist (in seconds). If true, only amount particles will be emitted. Amount of time to preprocess the particles before animation starts. Lets you start the animation some time after particles have started emitting. Speed scaling ratio. A value of 0 can be used to pause the particles. Time ratio between each emission. If 0, particles are emitted continuously. If 1, all particles are emitted simultaneously. Emission randomness ratio. The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. If true, results in fractional delta calculation which has a smoother particles display effect. The that determines the node's region which needs to be visible on screen for the particle system to be active. Grow the box if particles suddenly appear/disappear when the node enters/exits the screen. The can be grown via code or with the Particles → Generate AABB editor tool. Note: If the in use is configured to cast shadows, you may want to enlarge this AABB to ensure the shadow is updated when particles are off-screen. If true, particles use the parent node's coordinate space. If false, they use global coordinates. Particle draw order. Uses values. for processing particles. Can be a or a . The number of draw passes when rendering particles. that is drawn for the first draw pass. that is drawn for the second draw pass. that is drawn for the third draw pass. that is drawn for the fourth draw pass. Sets the that is drawn at index pass. Returns the that is drawn at index pass. Restarts the particle emission, clearing existing particles. Returns the axis-aligned bounding box that contains all the particles that are active in the current frame. 2D particle node used to create a variety of particle systems and effects. features an emitter that generates some number of particles at a given rate. Use the process_material property to add a to configure particle appearance and behavior. Alternatively, you can add a which will be applied to all particles. Note: only work when using the GLES3 renderer. If using the GLES2 renderer, use instead. You can convert to by selecting the node, clicking the Particles menu at the top of the 2D editor viewport then choosing Convert to CPUParticles2D. Note: After working on a Particles node, remember to update its by selecting it, clicking the Particles menu at the top of the 2D editor viewport then choose Generate Visibility Rect. Otherwise, particles may suddenly disappear depending on the camera position and angle. Note: Unlike , currently ignore the texture region defined in s. Particles are drawn in the order emitted. Particles are drawn in order of remaining lifetime. If true, particles are being emitted. The number of particles emitted in one emission cycle (corresponding to the ). Note: Changing will reset the particle emission, therefore removing all particles that were already emitted before changing . The amount of time each particle will exist (in seconds). If true, only one emission cycle occurs. If set true during a cycle, emission will stop at the cycle's end. Particle system starts as if it had already run for this many seconds. Particle system's running speed scaling ratio. A value of 0 can be used to pause the particles. How rapidly particles in an emission cycle are emitted. If greater than 0, there will be a gap in emissions before the next cycle begins. Emission lifetime randomness ratio. The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. If true, results in fractional delta calculation which has a smoother particles display effect. The that determines the node's region which needs to be visible on screen for the particle system to be active. Grow the rect if particles suddenly appear/disappear when the node enters/exits the screen. The can be grown via code or with the Particles → Generate Visibility Rect editor tool. If true, particles use the parent node's coordinate space. If false, they use global coordinates. Particle draw order. Uses values. for processing particles. Can be a or a . Particle texture. If null, particles will be squares. Normal map to be used for the property. Note: Godot expects the normal map to use X+, Y-, and Z+ coordinates. See this page for a comparison of normal map coordinates expected by popular engines. Returns a rectangle containing the positions of all existing particles. Restarts all the existing particles. ParticlesMaterial defines particle properties and behavior. It is used in the process_material of and emitter nodes. Some of this material's properties are applied to each particle when emitted, while others can have a applied to vary values over the lifetime of the particle. When a randomness ratio is applied to a property it is used to scale that property by a random amount. The random ratio is used to interpolate between 1.0 and a random number less than one, the result is multiplied by the property to obtain the randomized property. For example a random ratio of 0.4 would scale the original property between 0.4-1.0 of its original value. Use with to set . Use with to set . Use with to set . Represents the size of the enum. All particles will be emitted from a single point. Particles will be emitted in the volume of a sphere. Particles will be emitted in the volume of a box. Particles will be emitted at a position determined by sampling a random point on the . Particle color will be modulated by . Particles will be emitted at a position determined by sampling a random point on the . Particle velocity and rotation will be set based on . Particle color will be modulated by . Represents the size of the enum. Use with , , and to set initial velocity properties. Use with , , and to set angular velocity properties. Use with , , and to set orbital velocity properties. Use with , , and to set linear acceleration properties. Use with , , and to set radial acceleration properties. Use with , , and to set tangential acceleration properties. Use with , , and to set damping properties. Use with , , and to set angle properties. Use with , , and to set scale properties. Use with , , and to set hue variation properties. Use with , , and to set animation speed properties. Use with , , and to set animation offset properties. Represents the size of the enum. Particle lifetime randomness ratio. Emitter will emit amount divided by trail_divisor particles. The remaining particles will be used as trail(s). Trail particles' size will vary along this . Trail particles' color will vary along this . Particles will be emitted inside this region. Use constants for values. The sphere's radius if emission_shape is set to . The box's extents if emission_shape is set to . Particles will be emitted at positions determined by sampling this texture at a random position. Used with and . Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. Particle velocity and rotation will be set by sampling this texture at the same point as the . Used only in . Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. Particle color will be modulated by color determined by sampling this texture at the same point as the . The number of emission points if emission_shape is set to or . Align Y axis of particle with the direction of its velocity. If true, particles rotate around Y axis by . If true, particles will not move on the z axis. Unit vector specifying the particles' emission direction. Each particle's initial direction range from +spread to -spread degrees. Applied to X/Z plane and Y/Z planes. Amount of in Y/Z plane. A value of 1 restricts particles to X/Z plane. Gravity applied to every particle. Initial velocity magnitude for each particle. Direction comes from and the node's orientation. Initial velocity randomness ratio. Initial angular velocity applied to each particle. Sets the speed of rotation of the particle. Only applied when or are true or the being used to draw the particle is using . Angular velocity randomness ratio. Each particle's angular velocity will vary along this . Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. Only available when is true. Orbital velocity randomness ratio. Each particle's orbital velocity will vary along this . Linear acceleration applied to each particle in the direction of motion. Linear acceleration randomness ratio. Each particle's linear acceleration will vary along this . Radial acceleration applied to each particle. Makes particle accelerate away from origin. Radial acceleration randomness ratio. Each particle's radial acceleration will vary along this . Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. Tangential acceleration randomness ratio. Each particle's tangential acceleration will vary along this . The rate at which particles lose velocity. Damping randomness ratio. Damping will vary along this . Initial rotation applied to each particle, in degrees. Only applied when or are true or the being used to draw the particle is using . Rotation randomness ratio. Each particle's rotation will be animated along this . Initial scale applied to each particle. Scale randomness ratio. Each particle's scale will vary along this . Each particle's initial color. If the 's texture is defined, it will be multiplied by this color. To have particle display color in a make sure to set to true. Each particle's color will vary along this . Initial hue variation applied to each particle. Hue variation randomness ratio. Each particle's hue will vary along this . Particle animation speed. Animation speed randomness ratio. Each particle's animation speed will vary along this . Particle animation offset. Animation offset randomness ratio. Each particle's animation offset will vary along this . Sets the specified . Returns the value of the specified parameter. Sets the randomness ratio for the specified . Returns the randomness ratio associated with the specified parameter. Sets the for the specified . Returns the used by the specified parameter. If true, enables the specified flag. See for options. Returns true if the specified flag is enabled. Can have child nodes moving along the . See for more information on the usage. Note that the path is considered as relative to the moved nodes (children of ). As such, the curve should usually start with a zero vector (0, 0, 0). A describing the path. Can have child nodes moving along the . See for more information on usage. Note: The path is considered as relative to the moved nodes (children of ). As such, the curve should usually start with a zero vector ((0, 0)). A describing the path. This node takes its parent , and returns the coordinates of a point within it, given a distance from the first vertex. It is useful for making other nodes follow a path, without coding the movement pattern. For that, the nodes must be children of this node. The descendant nodes will then move accordingly when setting an offset in this node. Forbids the PathFollow to rotate. Allows the PathFollow to rotate in the Y axis only. Allows the PathFollow to rotate in both the X, and Y axes. Allows the PathFollow to rotate in any axis. Uses the up vector information in a to enforce orientation. This rotation mode requires the 's property to be set to true. The distance from the first vertex, measured in 3D units along the path. This sets this node's position to a point within the path. The distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. This is just another way of expressing the offset within the path, as the offset supplied is multiplied internally by the path's length. The node's offset along the curve. The node's offset perpendicular to the curve. Allows or forbids rotation on one or more axes, depending on the constants being used. If true, the position between two cached points is interpolated cubically, and linearly otherwise. The points along the of the are precomputed before use, for faster calculations. The point at the requested offset is then calculated interpolating between two adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached points may not follow the curve closely enough. There are two answers to this problem: either increase the number of cached points and increase memory consumption, or make a cubic interpolation between two points at the cost of (slightly) slower calculations. If true, any offset outside the path's length will wrap around, instead of stopping at the ends. Use it for cyclic paths. This node takes its parent , and returns the coordinates of a point within it, given a distance from the first vertex. It is useful for making other nodes follow a path, without coding the movement pattern. For that, the nodes must be children of this node. The descendant nodes will then move accordingly when setting an offset in this node. The distance along the path in pixels. The distance along the path as a number in the range 0.0 (for the first vertex) to 1.0 (for the last). This is just another way of expressing the offset within the path, as the offset supplied is multiplied internally by the path's length. The node's offset along the curve. The node's offset perpendicular to the curve. If true, this node rotates to follow the path, making its descendants rotate. If true, the position between two cached points is interpolated cubically, and linearly otherwise. The points along the of the are precomputed before use, for faster calculations. The point at the requested offset is then calculated interpolating between two adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached points may not follow the curve closely enough. There are two answers to this problem: either increase the number of cached points and increase memory consumption, or make a cubic interpolation between two points at the cost of (slightly) slower calculations. If true, any offset outside the path's length will wrap around, instead of stopping at the ends. Use it for cyclic paths. How far to look ahead of the curve to calculate the tangent if the node is rotating. E.g. shorter lookaheads will lead to faster rotations. This class provides access to a number of different monitors related to performance, such as memory usage, draw calls, and FPS. These are the same as the values displayed in the Monitor tab in the editor's Debugger panel. By using the method of this class, you can access this data from your code. Note: A few of these monitors are only available in debug mode and will always return 0 when used in a release build. Note: Many of these monitors are not updated in real-time, so there may be a short delay between changes. Number of frames per second. Time it took to complete one frame, in seconds. Time it took to complete one physics frame, in seconds. Static memory currently used, in bytes. Not available in release builds. Dynamic memory currently used, in bytes. Not available in release builds. Available static memory. Not available in release builds. Available dynamic memory. Not available in release builds. Largest amount of memory the message queue buffer has used, in bytes. The message queue is used for deferred functions calls and notifications. Number of objects currently instanced (including nodes). Number of resources currently used. Number of nodes currently instanced in the scene tree. This also includes the root node. Number of orphan nodes, i.e. nodes which are not parented to a node of the scene tree. 3D objects drawn per frame. Vertices drawn per frame. 3D only. Material changes per frame. 3D only. Shader changes per frame. 3D only. Render surface changes per frame. 3D only. Draw calls per frame. 3D only. Items or joined items drawn per frame. Draw calls per frame. The amount of video memory used, i.e. texture and vertex memory combined. The amount of texture memory used. The amount of vertex memory used. Unimplemented in the GLES2 and GLES3 rendering backends, always returns 0. Number of active nodes in the game. Number of collision pairs in the 2D physics engine. Number of islands in the 2D physics engine. Number of active and nodes in the game. Number of collision pairs in the 3D physics engine. Number of islands in the 3D physics engine. Output latency of the . Represents the size of the enum. Returns the value of one of the available monitors. You should provide one of the constants as the argument, like this: print(Performance.get_monitor(Performance.TIME_FPS)) # Prints the FPS to the console Provides direct access to a physics body in the , allowing safe changes to physics properties. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body. See . The timestep (delta) used for the simulation. The inverse of the mass of the body. The inverse of the inertia of the body. The rate at which the body stops rotating, if there are not any other forces moving it. The rate at which the body stops moving, if there are not any other forces moving it. The total gravity vector being currently applied to this body. The body's rotational velocity. The body's linear velocity. If true, this body is currently sleeping (not active). The body's transformation matrix. Adds a constant directional force without affecting rotation. Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. Adds a constant rotational force. Applies a directional impulse without affecting rotation. Applies a rotational impulse to the body. 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). The offset uses the rotation of the global coordinate system, but is centered at the object's origin. Returns the number of contacts this body has with other bodies. Note: By default, this returns 0 unless bodies are configured to monitor contacts. See . Returns the local position of the contact point. Returns the local normal at the contact point. Returns the local shape index of the collision. Returns the collider's . Returns the contact position in the collider. Returns the collider's object id. Returns the collider object. This depends on how it was created (will return a scene node if such was used to create it). Returns the collider's shape index. Returns the collided shape's metadata. This metadata is different from , and is set with . Returns the linear velocity vector at the collider's contact point. Calls the built-in force integration code. Returns the current state of the space, useful for queries. Direct access object to a space in the . It's used mainly to do queries against objects and areas residing in a given space. Checks whether a point is inside any solid shape. The shapes the point is inside of are returned in an array containing dictionaries with the following fields: collider: The colliding object. collider_id: The colliding object's ID. metadata: The intersecting shape's metadata. This metadata is different from , and is set with . rid: The intersecting object's . shape: The shape index of the colliding shape. Additionally, the method can take an exclude array of objects or s that are to be excluded from collisions, a collision_mask bitmask representing the physics layers to check in, or booleans to determine if the ray should collide with s or s, respectively. Note: s and s in Segments build mode are not solid shapes. Therefore, they will not be detected. If the parameter is null, then the default value is new Godot.Collections.Array {} If the parameter is null, then the default value is new Godot.Collections.Array {} Intersects a ray in a given space. The returned object is a dictionary with the following fields: collider: The colliding object. collider_id: The colliding object's ID. metadata: The intersecting shape's metadata. This metadata is different from , and is set with . normal: The object's surface normal at the intersection point. position: The intersection point. rid: The intersecting object's . shape: The shape index of the colliding shape. If the ray did not intersect anything, then an empty dictionary is returned instead. Additionally, the method can take an exclude array of objects or s that are to be excluded from collisions, a collision_mask bitmask representing the physics layers to check in, or booleans to determine if the ray should collide with s or s, respectively. If the parameter is null, then the default value is new Godot.Collections.Array {} Checks the intersections of a shape, given through a object, against the space. Note: This method does not take into account the motion property of the object. The intersected shapes are returned in an array containing dictionaries with the following fields: collider: The colliding object. collider_id: The colliding object's ID. metadata: The intersecting shape's metadata. This metadata is different from , and is set with . rid: The intersecting object's . shape: The shape index of the colliding shape. The number of intersections can be limited with the max_results parameter, to reduce the processing time. Checks how far a can move without colliding. All the parameters for the query, including the shape and the motion, are supplied through a object. Returns an array with the safe and unsafe proportions (between 0 and 1) of the motion. The safe proportion is the maximum fraction of the motion that can be made without a collision. The unsafe proportion is the minimum fraction of the distance that must be moved for a collision. If no collision is detected a result of [1.0, 1.0] will be returned. Note: Any s that the shape is already colliding with e.g. inside of, will be ignored. Use to determine the s that the shape is already colliding with. Checks the intersections of a shape, given through a object, against the space. The resulting array contains a list of points where the shape intersects another. Like with , the number of returned results can be limited to save processing time. Checks the intersections of a shape, given through a object, against the space. If it collides with more than one shape, the nearest one is selected. If the shape did not intersect anything, then an empty dictionary is returned instead. Note: This method does not take into account the motion property of the object. The returned object is a dictionary containing the following fields: collider_id: The colliding object's ID. linear_velocity: The colliding object's velocity . If the object is an , the result is (0, 0). metadata: The intersecting shape's metadata. This metadata is different from , and is set with . normal: The object's surface normal at the intersection point. point: The intersection point. rid: The intersecting object's . shape: The shape index of the colliding shape. Physics2DServer is the server responsible for all 2D physics. It can create many kinds of physics objects, but does not insert them on the node tree. Constant to get the number of objects that are not sleeping. Constant to get the number of possible collisions. Constant to get the number of space regions where a collision could occur. The value of the first parameter and area callback function receives, when an object enters one of its shapes. The value of the first parameter and area callback function receives, when an object exits one of its shapes. Sets the resting length of the spring joint. The joint will always try to go to back this length when pulled apart. Sets the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length. Sets the damping ratio of the spring joint. A value of 0 indicates an undamped spring, while 1 causes the system to reach equilibrium as fast as possible (critical damping). Constant for static bodies. Constant for kinematic bodies. Constant for rigid bodies. Constant for rigid bodies in character mode. In this mode, a body can not rotate, and only its linear velocity is affected by physics. This is the constant for creating line shapes. A line shape is an infinite line with an origin point, and a normal. Thus, it can be used for front/behind checks. This is the constant for creating segment shapes. A segment shape is a line from a point A to a point B. It can be checked for intersections. This is the constant for creating circle shapes. A circle shape only has a radius. It can be used for intersections and inside/outside checks. This is the constant for creating rectangle shapes. A rectangle shape is defined by a width and a height. It can be used for intersections and inside/outside checks. This is the constant for creating capsule shapes. A capsule shape is defined by a radius and a length. It can be used for intersections and inside/outside checks. This is the constant for creating convex polygon shapes. A polygon is defined by a list of points. It can be used for intersections and inside/outside checks. Unlike the property, polygons modified with do not verify that the points supplied form is a convex polygon. This is the constant for creating concave polygon shapes. A polygon is defined by a list of points. It can be used for intersections checks, but not for inside/outside checks. This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. Constant to set/get the maximum distance a shape can be from another before they are considered separated. Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. Constant to set/get the threshold linear velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. Constant to set/get the threshold angular velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision. Constant to create pin joints. Constant to create groove joints. Constant to create damped spring joints. Disables continuous collision detection. This is the fastest way to detect body collisions, but can miss small, fast-moving objects. Enables continuous collision detection by raycasting. It is faster than shapecasting, but less precise. Enables continuous collision detection by shapecasting. It is the slowest CCD method, and the most precise. Constant to set/get the current transform matrix of the body. Constant to set/get the current linear velocity of the body. Constant to set/get the current angular velocity of the body. Constant to sleep/wake up a body, or to get whether it is sleeping. Constant to set/get whether the body can sleep. Constant to set/get a body's bounce factor. Constant to set/get a body's friction. Constant to set/get a body's mass. Constant to set/get a body's inertia. Constant to set/get a body's gravity multiplier. Constant to set/get a body's linear dampening factor. Constant to set/get a body's angular dampening factor. Represents the size of the enum. This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects. This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one. This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one. Constant to set/get gravity strength in an area. Constant to set/get gravity vector/center in an area. Constant to set/get whether the gravity vector of an area is a direction, or a center point. Constant to set/get the falloff factor for point gravity of an area. The greater this value is, the faster the strength of gravity decreases with the square of distance. This constant was used to set/get the falloff factor for point gravity. It has been superseded by . Constant to set/get the linear dampening factor of an area. Constant to set/get the angular dampening factor of an area. Constant to set/get the priority (order of processing) of an area. Sets the shape data that defines its shape and size. The data to be passed depends on the kind of shape created . Returns a shape's type (see ). Returns the shape data. Creates a space. A space is a collection of parameters for the physics engine that can be assigned to an area or a body. It can be assigned to an area with , or to a body with . Marks a space as active. It will not have an effect, unless it is assigned to an area or body. Returns whether the space is active. Sets the value for a space parameter. See for a list of available parameters. Returns the value of a space parameter. Returns the state of a space, a . This object can be used to make collision/intersection queries. Creates an . After creating an with this method, assign it to a space using to use the created in the physics world. Assigns a space to the area. Returns the space assigned to the area. Sets the space override mode for the area. See for a list of available modes. Returns the space override mode for the area. Adds a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. If the parameter is null, then the default value is Transform2D.Identity Substitutes a given area shape by another. The old shape is selected by its index, the new one by its . Sets the transform matrix for an area shape. Disables a given shape in an area. Returns the number of shapes assigned to an area. Returns the of the nth shape of an area. Returns the transform matrix of a shape within an area. Removes a shape from an area. It does not delete the shape, so it can be reassigned later. Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later. Assigns the area to one or many physics layers. Sets which physics layers the area will monitor. Sets the value for an area parameter. See for a list of available parameters. Sets the transform matrix for an area. Returns an area parameter value. See for a list of available parameters. Returns the transform matrix for an area. Assigns the area to a descendant of , so it can exist in the node tree. Gets the instance ID of the object the area is assigned to. Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters: 1: or , depending on whether the object entered or exited the area. 2: of the object that entered/exited the area. 3: Instance ID of the object that entered/exited the area. 4: The shape index of the object that entered/exited the area. 5: The shape index of the area where the object entered/exited. Creates a physics body. Assigns a space to the body (see ). Returns the of the space assigned to a body. Sets the body mode using one of the constants. Returns the body mode. 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. If the parameter is null, then the default value is Transform2D.Identity Substitutes a given body shape by another. The old shape is selected by its index, the new one by its . Sets the transform matrix for a body shape. Sets metadata of a shape within a body. This metadata is different from , and can be retrieved on shape queries. Returns the number of shapes assigned to a body. Returns the of the nth shape of a body. Returns the transform matrix of a body shape. Returns the metadata of a shape of a body. Removes a shape from a body. The shape is not deleted, so it can be reused afterwards. Removes all shapes from a body. Disables shape in body if disable is true. Enables one way collision on body if enable is true. Assigns the area to a descendant of , so it can exist in the node tree. Gets the instance ID of the object the area is assigned to. Sets the continuous collision detection mode using one of the constants. Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. Returns the continuous collision detection mode. Sets the physics layer or layers a body belongs to. Returns the physics layer or layers a body belongs to. Sets the physics layer or layers a body can collide with. Returns the physics layer or layers a body can collide with. Sets a body parameter. See for a list of available parameters. Returns the value of a body parameter. See for a list of available parameters. Sets a body state using one of the constants. Note that the method doesn't take effect immediately. The state will change on the next physics frame. Returns a body state. Adds a positioned impulse to the applied force and torque. Both the force and the offset from the body origin are in global coordinates. Adds a positioned force to the applied force and torque. As with , both the force and the offset from the body origin are in global coordinates. A force differs from an impulse in that, while the two are forces, the impulse clears itself after being applied. Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. Adds a body to the list of bodies exempt from collisions. Removes a body from the list of bodies exempt from collisions. Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0. Returns the maximum contacts that can be reported. See . Sets whether a body uses a callback function to calculate its own physics (see ). Returns whether a body uses a callback function to calculate its own physics (see ). Sets the function used to calculate physics for an object, if that object allows it (see ). Returns true if a collision would result from moving in the given direction from a given point in space. Margin increases the size of the shapes involved in the collision detection. can be passed to return additional information in. Returns the of the body. Sets a joint parameter. See for a list of available parameters. Returns the value of a joint parameter. Creates a pin joint between two bodies. If not specified, the second body is assumed to be the joint itself. Creates a groove joint between two bodies. If not specified, the bodies are assumed to be the joint itself. Creates a damped spring joint between two bodies. If not specified, the second body is assumed to be the joint itself. Sets a damped spring joint parameter. See for a list of available parameters. Returns the value of a damped spring joint parameter. Returns a joint's type (see ). Destroys any of the objects created by Physics2DServer. If the passed is not one of the objects that can be created by Physics2DServer, an error will be sent to the console. Activates or deactivates the 2D physics engine. Returns information about the current state of the 2D physics engine. See for a list of available states. This class contains the shape and other parameters for 2D intersection/collision queries. See also . The physics layer(s) the query will take into account (as a bitmask). See Collision layers and masks in the documentation for more information. The list of objects or object s that will be excluded from collisions. The collision margin for the shape. The motion of the shape being queried for. The queried shape's . See also . The queried shape's transform matrix. If true, the query will take s into account. If true, the query will take s into account. Sets the that will be used for collision/intersection queries. The result of a 2D shape query in . See also . Returns the number of objects that intersected with the shape. Returns the of the object that intersected with the shape at index idx. Returns the instance ID of the that intersected with the shape at index idx. Returns the that intersected with the shape at index idx. Returns the child index of the object's that intersected with the shape at index idx. PhysicsBody is an abstract base class for implementing a physics body. All *Body types inherit from it. The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the property. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See Collision layers and masks in the documentation for more information. The physics layers this area scans for collisions. See Collision layers and masks in the documentation for more information. Sets individual bits on the bitmask. Use this if you only need to change one layer's value. Returns an individual bit on the . Sets individual bits on the bitmask. Use this if you only need to change one layer's value. Returns an individual bit on the . Returns an array of nodes that were added as collision exceptions for this body. Adds a body to the list of bodies that this body can't collide with. Removes a body from the list of bodies that this body can't collide with. PhysicsBody2D is an abstract base class for implementing a physics body. All *Body2D types inherit from it. Both and . Returns when accessed. Updates and when modified. The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the property. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See Collision layers and masks in the documentation for more information. The physics layers this area scans for collisions. See Collision layers and masks in the documentation for more information. Sets individual bits on the bitmask. Use this if you only need to change one layer's value. Returns an individual bit on the . Sets individual bits on the bitmask. Use this if you only need to change one layer's value. Returns an individual bit on the . Returns an array of nodes that were added as collision exceptions for this body. Adds a body to the list of bodies that this body can't collide with. Removes a body from the list of bodies that this body can't collide with. Provides direct access to a physics body in the , allowing safe changes to physics properties. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body. See . The timestep (delta) used for the simulation. The inverse of the mass of the body. The rate at which the body stops rotating, if there are not any other forces moving it. The rate at which the body stops moving, if there are not any other forces moving it. The inverse of the inertia of the body. The total gravity vector being currently applied to this body. The body's rotational velocity. The body's linear velocity. If true, this body is currently sleeping (not active). The body's transformation matrix. Adds a constant directional force without affecting rotation. This is equivalent to add_force(force, Vector3(0,0,0)). Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. Adds a constant rotational force without affecting position. Applies a single directional impulse without affecting rotation. This is equivalent to apply_impulse(Vector3(0, 0, 0), impulse). 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. The position uses the rotation of the global coordinate system, but is centered at the object's origin. Apply a torque impulse (which will be affected by the body mass and shape). This will rotate the body around the vector j passed as parameter. Returns the number of contacts this body has with other bodies. Note: By default, this returns 0 unless bodies are configured to monitor contacts. See . Returns the local position of the contact point. Returns the local normal at the contact point. Impulse created by the contact. Only implemented for Bullet physics. Returns the local shape index of the collision. Returns the collider's . Returns the contact position in the collider. Returns the collider's object id. Returns the collider object. Returns the collider's shape index. Returns the linear velocity vector at the collider's contact point. Calls the built-in force integration code. Returns the current state of the space, useful for queries. Direct access object to a space in the . It's used mainly to do queries against objects and areas residing in a given space. Intersects a ray in a given space. The returned object is a dictionary with the following fields: collider: The colliding object. collider_id: The colliding object's ID. normal: The object's surface normal at the intersection point. position: The intersection point. rid: The intersecting object's . shape: The shape index of the colliding shape. If the ray did not intersect anything, then an empty dictionary is returned instead. Additionally, the method can take an exclude array of objects or s that are to be excluded from collisions, a collision_mask bitmask representing the physics layers to check in, or booleans to determine if the ray should collide with s or s, respectively. If the parameter is null, then the default value is new Godot.Collections.Array {} Checks the intersections of a shape, given through a object, against the space. The intersected shapes are returned in an array containing dictionaries with the following fields: collider: The colliding object. collider_id: The colliding object's ID. rid: The intersecting object's . shape: The shape index of the colliding shape. The number of intersections can be limited with the max_results parameter, to reduce the processing time. Checks how far a can move without colliding. All the parameters for the query, including the shape, are supplied through a object. Returns an array with the safe and unsafe proportions (between 0 and 1) of the motion. The safe proportion is the maximum fraction of the motion that can be made without a collision. The unsafe proportion is the minimum fraction of the distance that must be moved for a collision. If no collision is detected a result of [1.0, 1.0] will be returned. Note: Any s that the shape is already colliding with e.g. inside of, will be ignored. Use to determine the s that the shape is already colliding with. Checks the intersections of a shape, given through a object, against the space. The resulting array contains a list of points where the shape intersects another. Like with , the number of returned results can be limited to save processing time. Checks the intersections of a shape, given through a object, against the space. If it collides with more than one shape, the nearest one is selected. The returned object is a dictionary containing the following fields: collider_id: The colliding object's ID. linear_velocity: The colliding object's velocity . If the object is an , the result is (0, 0, 0). normal: The object's surface normal at the intersection point. point: The intersection point. rid: The intersecting object's . shape: The shape index of the colliding shape. If the shape did not intersect anything, then an empty dictionary is returned instead. Provides a means of modifying the collision properties of a . The body's friction. Values range from 0 (frictionless) to 1 (maximum friction). If true, the physics engine will use the friction of the object marked as "rough" when two objects collide. If false, the physics engine will use the lowest friction of all colliding objects instead. If true for both colliding objects, the physics engine will use the highest friction. The body's bounciness. Values range from 0 (no bounce) to 1 (full bounciness). If true, subtracts the bounciness from the colliding object's bounciness instead of adding it. PhysicsServer is the server responsible for all 3D physics. It can create many kinds of physics objects, but does not insert them on the node tree. Constant to get the number of objects that are not sleeping. Constant to get the number of possible collisions. Constant to get the number of space regions where a collision could occur. The value of the first parameter and area callback function receives, when an object enters one of its shapes. The value of the first parameter and area callback function receives, when an object exits one of its shapes. Constant for static bodies. Constant for kinematic bodies. Constant for rigid bodies. Constant for rigid bodies in character mode. In this mode, a body can not rotate, and only its linear velocity is affected by physics. The is a . The is a . The is a . The is a . The is a . The is a . The is a . The is a . The is a . This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. The strength with which the pinned objects try to stay in positional relation to each other. The higher, the stronger. The strength with which the pinned objects try to stay in velocity relation to each other. The higher, the stronger. If above 0, this value is the maximum value for an impulse that this Joint puts on its ends. Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. Constant to set/get the maximum distance a shape can be from another before they are considered separated. Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. Constant to set/get the threshold linear velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. Constant to set/get the threshold angular velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision. Swing is rotation from side to side, around the axis perpendicular to the twist axis. The swing span defines, how much rotation will not get corrected along the swing axis. Could be defined as looseness in the . If below 0.05, this behavior is locked. Twist is the rotation around the twist axis, this value defined how far the joint can twist. Twist is locked if below 0.05. The speed with which the swing or twist will take place. The higher, the faster. The ease with which the Joint twists, if it's too low, it takes more force to twist the joint. Defines, how fast the swing- and twist-speed-difference on both sides gets synced. The is a . The is a . The is a . The is a . The is a . Constant to set/get the current transform matrix of the body. Constant to set/get the current linear velocity of the body. Constant to set/get the current angular velocity of the body. Constant to sleep/wake up a body, or to get whether it is sleeping. Constant to set/get whether the body can sleep. Constant to set/get a body's bounce factor. Constant to set/get a body's friction. Constant to set/get a body's mass. Constant to set/get a body's gravity multiplier. Constant to set/get a body's linear dampening factor. Constant to set/get a body's angular dampening factor. Represents the size of the enum. The minimum difference between the pivot points' axes. The maximum difference between the pivot points' axes. A factor that gets applied to the movement across the axes. The lower, the slower the movement. The amount of restitution on the axes movement. The lower, the more velocity-energy gets lost. The amount of damping that happens at the linear motion across the axes. The velocity that the joint's linear motor will attempt to reach. The maximum force that the linear motor can apply while trying to reach the target velocity. The minimum rotation in negative direction to break loose and rotate around the axes. The minimum rotation in positive direction to break loose and rotate around the axes. A factor that gets multiplied onto all rotations across the axes. The amount of rotational damping across the axes. The lower, the more dampening occurs. The amount of rotational restitution across the axes. The lower, the more restitution occurs. The maximum amount of force that can occur, when rotating around the axes. When correcting the crossing of limits in rotation across the axes, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. Target speed for the motor at the axes. Maximum acceleration for the motor at the axes. The maximum difference between the pivot points on their X axis before damping happens. The minimum difference between the pivot points on their X axis before damping happens. A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. The amount of restitution once the limits are surpassed. The lower, the more velocityenergy gets lost. The amount of damping once the slider limits are surpassed. A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. The amount of restitution inside the slider limits. The amount of damping inside the slider limits. A factor applied to the movement across axes orthogonal to the slider. The amount of restitution when movement is across axes orthogonal to the slider. The amount of damping when movement is across axes orthogonal to the slider. The upper limit of rotation in the slider. The lower limit of rotation in the slider. A factor applied to the all rotation once the limit is surpassed. The amount of restitution of the rotation when the limit is surpassed. The amount of damping of the rotation when the limit is surpassed. A factor that gets applied to the all rotation in the limits. The amount of restitution of the rotation in the limits. The amount of damping of the rotation in the limits. A factor that gets applied to the all rotation across axes orthogonal to the slider. The amount of restitution of the rotation across axes orthogonal to the slider. The amount of damping of the rotation across axes orthogonal to the slider. Represents the size of the enum. The speed with which the two bodies get pulled together when they move in different directions. The maximum rotation across the Hinge. The minimum rotation across the Hinge. The speed with which the rotation across the axis perpendicular to the hinge gets corrected. The lower this value, the more the rotation gets slowed down. Target speed for the motor. Maximum acceleration for the motor. If set there is linear motion possible within the given limits. If set there is rotational motion possible. If set there is a rotational motor across these axes. If set there is a linear motor on this axis that targets a specific velocity. If true, the Hinge has a maximum and a minimum rotation. If true, a motor turns the Hinge. This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects. This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one. This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one. Constant to set/get gravity strength in an area. Constant to set/get gravity vector/center in an area. Constant to set/get whether the gravity vector of an area is a direction, or a center point. Constant to set/get the falloff factor for point gravity of an area. The greater this value is, the faster the strength of gravity decreases with the square of distance. This constant was used to set/get the falloff factor for point gravity. It has been superseded by . Constant to set/get the linear dampening factor of an area. Constant to set/get the angular dampening factor of an area. Constant to set/get the priority (order of processing) of an area. Creates a shape of a type from . Does not assign it to a body or an area. To do so, you must use or . Sets the shape data that defines its shape and size. The data to be passed depends on the kind of shape created . Returns the type of shape (see constants). Returns the shape data. Creates a space. A space is a collection of parameters for the physics engine that can be assigned to an area or a body. It can be assigned to an area with , or to a body with . Marks a space as active. It will not have an effect, unless it is assigned to an area or body. Returns whether the space is active. Sets the value for a space parameter. A list of available parameters is on the constants. Returns the value of a space parameter. Returns the state of a space, a . This object can be used to make collision/intersection queries. Creates an . Assigns a space to the area. Returns the space assigned to the area. Sets the space override mode for the area. The modes are described in the constants. Returns the space override mode for the area. Adds a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. If the parameter is null, then the default value is new Transform() Substitutes a given area shape by another. The old shape is selected by its index, the new one by its . Sets the transform matrix for an area shape. Returns the number of shapes assigned to an area. Returns the of the nth shape of an area. Returns the transform matrix of a shape within an area. Removes a shape from an area. It does not delete the shape, so it can be reassigned later. Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later. Assigns the area to one or many physics layers. Sets which physics layers the area will monitor. Sets the value for an area parameter. A list of available parameters is on the constants. Sets the transform matrix for an area. Returns an area parameter value. A list of available parameters is on the constants. Returns the transform matrix for an area. Assigns the area to a descendant of , so it can exist in the node tree. Gets the instance ID of the object the area is assigned to. Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters: 1: or , depending on whether the object entered or exited the area. 2: of the object that entered/exited the area. 3: Instance ID of the object that entered/exited the area. 4: The shape index of the object that entered/exited the area. 5: The shape index of the area where the object entered/exited. Sets object pickable with rays. If true, area collides with rays. Creates a physics body. The first parameter can be any value from constants, for the type of body created. Additionally, the body can be created in sleeping state to save processing time. Assigns a space to the body (see ). Returns the of the space assigned to a body. Sets the body mode, from one of the constants. Returns the body mode. Sets the physics layer or layers a body belongs to. Returns the physics layer or layers a body belongs to. Sets the physics layer or layers a body can collide with. Returns the physics layer or layers a body can collide with. - 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. If the parameter is null, then the default value is new Transform() Substitutes a given body shape by another. The old shape is selected by its index, the new one by its . Sets the transform matrix for a body shape. Returns the number of shapes assigned to a body. Returns the of the nth shape of a body. Returns the transform matrix of a body shape. Removes a shape from a body. The shape is not deleted, so it can be reused afterwards. Removes all shapes from a body. Assigns the area to a descendant of , so it can exist in the node tree. Gets the instance ID of the object the area is assigned to. If true, the continuous collision detection mode is enabled. Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. If true, the continuous collision detection mode is enabled. Sets a body parameter. A list of available parameters is on the constants. Returns the value of a body parameter. A list of available parameters is on the constants. Sets a body state (see constants). Returns a body state. Gives the body a push at a position in the direction of the impulse. Gives the body a push to rotate it. Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. Adds a body to the list of bodies exempt from collisions. Removes a body from the list of bodies exempt from collisions. Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0. Returns the maximum contacts that can be reported. See . Sets whether a body uses a callback function to calculate its own physics (see ). Returns whether a body uses a callback function to calculate its own physics (see ). Sets the function used to calculate physics for an object, if that object allows it (see ). Sets the body pickable with rays if enabled is set. If true, the body can be detected by rays. Returns the of the body. Creates a . Sets a pin_joint parameter (see constants). Gets a pin_joint parameter (see constants). Sets position of the joint in the local space of body a of the joint. Returns position of the joint in the local space of body a of the joint. Sets position of the joint in the local space of body b of the joint. Returns position of the joint in the local space of body b of the joint. Creates a . Sets a hinge_joint parameter (see constants). Gets a hinge_joint parameter (see ). Sets a hinge_joint flag (see constants). Gets a hinge_joint flag (see constants). Creates a . Gets a slider_joint parameter (see constants). Gets a slider_joint parameter (see constants). Creates a . Sets a cone_twist_joint parameter (see constants). Gets a cone_twist_joint parameter (see constants). Returns the type of the Joint. Sets the priority value of the Joint. Gets the priority value of the Joint. Creates a . Sets a generic_6_DOF_joint parameter (see constants). Gets a generic_6_DOF_joint parameter (see constants). Sets a generic_6_DOF_joint flag (see constants). Gets a generic_6_DOF_joint flag (see constants). Destroys any of the objects created by PhysicsServer. If the passed is not one of the objects that can be created by PhysicsServer, an error will be sent to the console. Activates or deactivates the 3D physics engine. Returns an Info defined by the input given. This class contains the shape and other parameters for 3D intersection/collision queries. See also . The physics layer(s) the query will take into account (as a bitmask). See Collision layers and masks in the documentation for more information. The list of objects or object s that will be excluded from collisions. The collision margin for the shape. The queried shape's . See also . The queried shape's transform matrix. If true, the query will take s into account. If true, the query will take s into account. Sets the that will be used for collision/intersection queries. The result of a 3D shape query in . See also . Returns the number of objects that intersected with the shape. Returns the of the object that intersected with the shape at index idx. Returns the instance ID of the that intersected with the shape at index idx. Returns the that intersected with the shape at index idx. Returns the child index of the object's that intersected with the shape at index idx. Pin joint for 3D rigid bodies. It pins 2 bodies (rigid or static) together. See also . The force with which the pinned objects stay in positional relation to each other. The higher, the stronger. The force with which the pinned objects stay in velocity relation to each other. The higher, the stronger. If above 0, this value is the maximum value for an impulse that this Joint produces. The force with which the pinned objects stay in positional relation to each other. The higher, the stronger. The force with which the pinned objects stay in velocity relation to each other. The higher, the stronger. If above 0, this value is the maximum value for an impulse that this Joint produces. Sets the value of the specified parameter. Returns the value of the specified parameter. Pin Joint for 2D rigid bodies. It pins two bodies (rigid or static) together. The higher this value, the more the bond to the pinned partner can flex. Class representing a planar . 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, use instead. Note: When using a large textured (e.g. as a floor), you may stumble upon UV jittering issues depending on the camera angle. To solve this, increase and until you no longer notice UV jittering. Size of the generated plane. Number of subdivision along the X axis. Number of subdivision along the Z axis. An infinite plane shape for 3D collisions. Note that the 's normal matters; anything "below" the plane will collide with it. If the is used in a , it will cause colliding objects placed "below" it to teleport "above" the plane. The used by the for collision. Returns a new instance of the script. The PointMesh is made from a single point. Instead of relying on triangles, points are rendered as a single rectangle on the screen with a constant size. They are intended to be used with Particle systems, but can be used as a cheap way to render constant size billboarded sprites (for example in a point cloud). PointMeshes, must be used with a material that has a point size. Point size can be accessed in a shader with POINT_SIZE, or in a by setting and the variable . When using PointMeshes, properties that normally alter vertices will be ignored, including billboard mode, grow, and cull face. A Polygon2D is defined by a set of points. Each point is connected to the next, with the final point being connected to the first, resulting in a closed polygon. Polygon2Ds can be filled with color (solid or gradient) or filled with a given texture. Note: By default, Godot can only draw up to 4,096 polygon points at a time. To increase this limit, open the Project Settings and increase and . The polygon's fill color. If texture is defined, it will be multiplied by this color. It will also be the default color for vertices not set in vertex_colors. The offset applied to each vertex. If true, polygon edges will be anti-aliased. The polygon's fill texture. Use uv to set texture coordinates. Amount to offset the polygon's texture. If (0, 0) the texture's origin (its top-left corner) will be placed at the polygon's position. Amount to multiply the uv coordinates when using a texture. Larger values make the texture smaller, and vice versa. The texture's rotation in degrees. The texture's rotation in radians. If true, polygon will be inverted, containing the area outside the defined points and extending to the invert_border. Added padding applied to the bounding box when using invert. Setting this value too small may result in a "Bad Polygon" error. The polygon's list of vertices. The final point will be connected to the first. Note: This returns a copy of the rather than a reference. Texture coordinates for each vertex of the polygon. There should be one uv per polygon vertex. If there are fewer, undefined vertices will use (0, 0). Color for each vertex. Colors are interpolated between vertices, resulting in smooth gradients. There should be one per polygon vertex. If there are fewer, undefined vertices will use color. Adds a bone with the specified path and weights. Returns the number of bones in this . Returns the path to the node associated with the specified bone. Returns the height values of the specified bone. Removes the specified bone from this . Removes all bones from this . Sets the path to the node associated with the specified bone. Sets the weight values for the specified bone. Popup is a base used to show dialogs and popups. It's a subwindow and modal by default (see ) and has helpers for custom popup behavior. All popup methods ensure correct placement within the viewport. Notification sent right after the popup is shown. Notification sent right after the popup is hidden. If true, the popup will not be hidden when a click event occurs outside of it, or when it receives the ui_cancel action event. Note: Enabling this property doesn't affect the Close or Cancel buttons' behavior in dialogs that inherit from this class. As a workaround, you can use or and hide the buttons in question by setting their property to false. Shrink popup to keep to the minimum size of content. Popup (show the control in modal form) in the center of the screen relative to its current canvas transform, at the current size, or at a size determined by size. If the parameter is null, then the default value is new Vector2(0, 0) Popup (show the control in modal form) in the center of the screen relative to the current canvas transform, scaled at a ratio of size of the screen. Popup (show the control in modal form) in the center of the screen relative to the current canvas transform, ensuring the size is never smaller than minsize. If the parameter is null, then the default value is new Vector2(0, 0) Popup (show the control in modal form) in the center of the screen relative to the current canvas transform, clamping the size to size, then ensuring the popup is no larger than the viewport size multiplied by fallback_ratio. If the parameter is null, then the default value is new Vector2(0, 0) Popup (show the control in modal form). If the parameter is null, then the default value is new Rect2(0, 0, 0, 0) PopupDialog is a base class for popup dialogs, along with . is a that displays a list of options. They are popular in toolbars or context menus. If true, hides the when an item is selected. If true, hides the when a checkbox or radio button is selected. If true, hides the when a state item is selected. Sets the delay time in seconds for the submenu item to popup on mouse hovering. If the popup menu is added as a child of another (acting as a submenu), it will inherit the delay time of the parent menu item. If true, allows navigating with letter keys. Adds a new item with text label. An id can optionally be provided, as well as an accelerator (accel). If no id is provided, one will be created from the index. If no accel is provided then the default 0 will be assigned to it. See for more info on accelerators. Adds a new item with text label and icon texture. An id can optionally be provided, as well as an accelerator (accel). If no id is provided, one will be created from the index. If no accel is provided then the default 0 will be assigned to it. See for more info on accelerators. Adds a new checkable item with text label. An id can optionally be provided, as well as an accelerator (accel). If no id is provided, one will be created from the index. If no accel is provided then the default 0 will be assigned to it. See for more info on accelerators. Note: Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See for more info on how to control it. Adds a new checkable item with text label and icon texture. An id can optionally be provided, as well as an accelerator (accel). If no id is provided, one will be created from the index. If no accel is provided then the default 0 will be assigned to it. See for more info on accelerators. Note: Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See for more info on how to control it. Adds a new radio check button with text label. An id can optionally be provided, as well as an accelerator (accel). If no id is provided, one will be created from the index. If no accel is provided then the default 0 will be assigned to it. See for more info on accelerators. Note: Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See for more info on how to control it. Same as , but uses a radio check button. Adds a new multistate item with text label. Contrarily to normal binary items, multistate items can have more than two states, as defined by max_states. Each press or activate of the item will increase the state by one. The default value is defined by default_state. An id can optionally be provided, as well as an accelerator (accel). If no id is provided, one will be created from the index. If no accel is provided then the default 0 will be assigned to it. See for more info on accelerators. Adds a . An id can optionally be provided. If no id is provided, one will be created from the index. Adds a new item and assigns the specified and icon texture to it. Sets the label of the checkbox to the 's name. An id can optionally be provided. If no id is provided, one will be created from the index. Adds a new checkable item and assigns the specified to it. Sets the label of the checkbox to the 's name. An id can optionally be provided. If no id is provided, one will be created from the index. Note: Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See for more info on how to control it. Adds a new checkable item and assigns the specified and icon texture to it. Sets the label of the checkbox to the 's name. An id can optionally be provided. If no id is provided, one will be created from the index. Note: Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See for more info on how to control it. Adds a new radio check button and assigns a to it. Sets the label of the checkbox to the 's name. An id can optionally be provided. If no id is provided, one will be created from the index. Note: Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See for more info on how to control it. Same as , but uses a radio check button. Adds an item that will act as a submenu of the parent node when clicked. The submenu argument is the name of the child node that will be shown when the item is clicked. An id can optionally be provided. If no id is provided, one will be created from the index. Sets the text of the item at index idx. Replaces the icon of the specified idx. Sets the checkstate status of the item at index idx. Sets the id of the item at index idx. Sets the accelerator of the item at index idx. Accelerators are special combinations of keys that activate the item, no matter which control is focused. Sets the metadata of an item, which may be of any type. You can later get it with , which provides a simple way of assigning context data to items. Enables/disables the item at index idx. When it is disabled, it can't be selected and its action can't be invoked. Sets the submenu of the item at index idx. The submenu is the name of a child node that would be shown when the item is clicked. Mark the item at index idx as a separator, which means that it would be displayed as a line. If false, sets the type of the item to plain text. Sets whether the item at index idx has a checkbox. If false, sets the type of the item to plain text. Note: Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. Sets the type of the item at the specified index idx to radio button. If false, sets the type of the item to plain text. Sets the tooltip of the item at the specified index idx. Sets a for the specified item idx. Sets the state of a multistate item. See for details. Disables the of the specified index idx. Toggles the check state of the item of the specified index idx. Cycle to the next state of a multistate item. See for details. Returns the text of the item at index idx. Returns the icon of the item at index idx. Returns true if the item at index idx is checked. Returns the id of the item at index idx. id can be manually assigned, while index can not. Returns the index of the item containing the specified id. Index is automatically assigned to each item by the engine. Index can not be set manually. Returns the accelerator of the item at index idx. Accelerators are special combinations of keys that activate the item, no matter which control is focused. Returns the metadata of the specified item, which might be of any type. You can set it with , which provides a simple way of assigning context data to items. Returns true if the item at index idx is disabled. When it is disabled it can't be selected, or its action invoked. See for more info on how to disable an item. Returns the submenu name of the item at index idx. See for more info on how to add a submenu. Returns true if the item is a separator. If it is, it will be displayed as a line. See for more info on how to add a separator. Returns true if the item at index idx is checkable in some way, i.e. if it has a checkbox or radio button. Note: Checkable items just display a checkmark or radio button, but don't have any built-in checking behavior and must be checked/unchecked manually. Returns true if the item at index idx has radio button-style checkability. Note: This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups. Returns true if the specified item's shortcut is disabled. Returns the tooltip associated with the specified index index idx. Returns the associated with the specified idx item. Returns the number of items in the . Removes the item at index idx from the menu. Note: The indices of items after the removed item will be shifted by one. Adds a separator between items. Separators also occupy an index, which you can set by using the id parameter. A label can optionally be provided, which will appear at the center of the separator. Removes all items from the . Hides the when the window loses focus. Returns true if the popup will be hidden when the window loses focus or not. Class for displaying popups with a panel background. In some cases it might be simpler to use than , since it provides a configurable background. If you are making windows, better check . Generic 2D position hint for editing. It's just like a plain , but it displays as a cross in the 2D editor at all times. You can set cross' visual size by using the gizmo in the 2D editor while the node is selected. Generic 3D position hint for editing. It's just like a plain , but it displays as a cross in the 3D editor at all times. Base class for all primitive meshes. Handles applying a to a primitive mesh. Examples include , , , , , , and . The current of the primitive mesh. Overrides the with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn. This gives the same result as using in . Returns mesh arrays used to constitute surface of . The result can be passed to to create a new surface. For example: var c := CylinderMesh.new() var arr_mesh := ArrayMesh.new() arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, c.get_mesh_arrays()) Class representing a prism-shaped . Displacement of the upper edge along the X axis. 0.0 positions edge straight above the bottom-left edge. Size of the prism. Number of added edge loops along the X axis. Number of added edge loops along the Y axis. Number of added edge loops along the Z axis. ProceduralSky provides a way to create an effective background quickly by defining procedural parameters for the sun, the sky and the ground. The sky and ground are very similar, they are defined by a color at the horizon, another color, and finally an easing curve to interpolate between these two colors. Similarly, the sun is described by a position in the sky, a color, and an easing curve. However, the sun also defines a minimum and maximum angle, these two values define at what distance the easing curve begins and ends from the sun, and thus end up defining the size of the sun in the sky. The ProceduralSky is updated on the CPU after the parameters change. It is stored in a texture and then displayed as a background in the scene. This makes it relatively unsuitable for real-time updates during gameplay. However, with a small enough texture size, it can still be updated relatively frequently, as it is updated on a background thread when multi-threading is available. Sky texture will be 256x128. Sky texture will be 512x256. Sky texture will be 1024x512. This is the default size. Sky texture will be 2048x1024. Sky texture will be 4096x2048. Represents the size of the enum. Color of the sky at the top. Color of the sky at the horizon. How quickly the fades into the . Amount of energy contribution from the sky. Color of the ground at the bottom. Color of the ground at the horizon. How quickly the fades into the . Amount of energy contribution from the ground. The sun's color. The sun's height using polar coordinates. The direction of the sun using polar coordinates. Distance from sun where it goes from solid to starting to fade. Distance from center of sun where it fades out completely. How quickly the sun fades away between and . Amount of energy contribution from the sun. Size of that the ProceduralSky will generate. The size is set using . General-purpose progress bar. Shows fill percentage from right to left. If true, the fill percentage is displayed on the bar. Contains global variables accessible from everywhere. Use , or to access them. Variables stored in project.godot are also loaded into ProjectSettings, making this object very useful for reading custom game configuration options. When naming a Project Settings property, use the full path to the setting including the category. For example, "application/config/name" for the project name. Category and property names can be viewed in the Project Settings dialog. Feature tags: Project settings can be overridden for specific platforms and configurations (debug, release, ...) using feature tags. Overriding: Any project setting can be overridden by creating a file named override.cfg in the project's root directory. This can also be used in exported projects by placing this file in the same directory as the project binary. Overriding will still take the base project settings' feature tags in account. Therefore, make sure to also override the setting with the desired feature tags if you want them to override base project settings on all platforms and configurations. Returns true if a configuration value is present. Sets the value of a setting. Example: ProjectSettings.set_setting("application/config/name", "Example") Returns the value of a setting. Example: print(ProjectSettings.get_setting("application/config/name")) Sets the order of a configuration value (influences when saved to the config file). Returns the order of a configuration value (influences when saved to the config file). Sets the specified property's initial value. This is the value the property reverts to. Adds a custom property info to a property. The dictionary must contain: - name: (the property's name) - type: (see ) - optionally hint: (see ) and hint_string: Example: 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) Clears the whole configuration (not recommended, may break things). Returns the localized path (starting with res://) corresponding to the absolute, native OS path. See also . Returns the absolute, native OS path corresponding to the localized path (starting with res:// or user://). The returned path will vary depending on the operating system and user preferences. See File paths in Godot projects to see what those paths convert to. See also . Note: with res:// will not work in an exported project. Instead, prepend the executable's base directory to the path when running from an exported project: 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().plus_file("hello.txt") Saves the configuration to the project.godot file. Note: This method is intended to be used by editor plugins, as modified can't be loaded back in the running app. If you want to change project settings in exported projects, use to save override.cfg file. Loads the contents of the .pck or .zip file specified by pack into the resource filesystem (res://). Returns true on success. Note: If a file from pack shares the same path as a file already in the resource filesystem, any attempts to load that file will use the file from pack unless replace_files is set to false. Note: The optional 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. Returns true if the specified property exists and its initial value differs from the current value. Returns the specified property's initial value. Returns null if the property does not exist. Saves the configuration to a custom file. The file extension must be .godot (to save in text-based format) or .binary (to save in binary format). You can also save override.cfg file, which is also text, but can be used in exported projects unlike other formats. General-purpose proximity detection node. Class representing a square . This flat mesh does not have a thickness. By default, this mesh is aligned on the X and Y axes; this default rotation is more suited for use with billboarded materials. Unlike , this mesh doesn't provide subdivision options. Size on the X and Y axes. RandomNumberGenerator is a class for generating pseudo-random numbers. It currently uses PCG32. Note: The underlying algorithm is an implementation detail. As a result, it should not be depended upon for reproducible random streams across Godot versions. To generate a random float number (within a given range) based on a time-dependant seed: var rng = RandomNumberGenerator.new() func _ready(): rng.randomize() var my_random_number = rng.randf_range(-10.0, 10.0) Note: The default values of and properties are pseudo-random, and changes when calling . The 0 value documented here is a placeholder, and not the actual default seed. Initializes the random number generator state based on the given seed value. A given seed will give a reproducible sequence of pseudo-random numbers. Note: The RNG does not have an avalanche effect, and can output similar random streams given similar seeds. Consider using a hash function to improve your seed quality if they're sourced externally. Note: Setting this property produces a side effect of changing the internal , so make sure to initialize the seed before modifying the : var rng = RandomNumberGenerator.new() rng.seed = hash("Godot") rng.state = 100 # Restore to some previously saved state. Warning: the getter of this property returns the previous , and not the initial seed value, which is going to be fixed in Godot 4.0. The current state of the random number generator. Save and restore this property to restore the generator to a previous state: var rng = RandomNumberGenerator.new() print(rng.randf()) var saved_state = rng.state # Store current state. print(rng.randf()) # Advance internal state. rng.state = saved_state # Restore the state. print(rng.randf()) # Prints the same value as in previous. Note: Do not set state to arbitrary values, since the random number generator requires the state to have certain qualities to behave properly. It should only be set to values that came from the state property itself. To initialize the random number generator with arbitrary input, use instead. Generates a pseudo-random 32-bit unsigned integer between 0 and 4294967295 (inclusive). Generates a pseudo-random float between 0.0 and 1.0 (inclusive). Generates a normally-distributed pseudo-random number, using Box-Muller transform with the specified mean and a standard deviation. This is also called Gaussian distribution. Generates a pseudo-random float between from and to (inclusive). Generates a pseudo-random 32-bit signed integer between from and to (inclusive). Setups a time-based seed to generator. Range is a base class for nodes that change a floating-point value between a minimum and a maximum, using step and page, for example a . Minimum value. Range is clamped if value is less than min_value. Maximum value. Range is clamped if value is greater than max_value. If greater than 0, value will always be rounded to a multiple of step. If rounded is also true, value will first be rounded to a multiple of step then rounded to the nearest integer. Page size. Used mainly for . ScrollBar's length is its size multiplied by page over the difference between min_value and max_value. Range's current value. The value mapped between 0 and 1. If true, and min_value is greater than 0, value will be represented exponentially rather than linearly. If true, value will always be rounded to the nearest integer. If true, may be greater than . If true, may be less than . Binds two ranges together along with any ranges previously grouped with either of them. When any of range's member variables change, it will share the new value with all other ranges in its group. Stops range from sharing its member variables with any other. A RayCast represents a line from its origin to its destination position, cast_to. It is used to query the 3D space in order to find the closest object along the path of the ray. RayCast can ignore some objects by adding them to the exception list via add_exception or by setting proper filtering with collision layers and masks. RayCast can be configured to report collisions with s () and/or s (). Only enabled raycasts will be able to query the space and report collisions. RayCast calculates intersection every physics frame (see ), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame), use after adjusting the raycast. If true, collisions will be reported. If true, collisions will be ignored for this RayCast's immediate parent. The ray's destination point, relative to the RayCast's position. The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See Collision layers and masks in the documentation for more information. If true, collision with s will be reported. If true, collision with s will be reported. Returns whether any object is intersecting with the ray's vector (considering the vector length). Updates the collision information for the ray. Use this method to update the collision information immediately instead of waiting for the next _physics_process call, for example if the ray or its parent has changed state. Note: enabled is not required for this to work. Returns the first object that the ray intersects, or null if no object is intersecting the ray (i.e. returns false). Returns the shape ID of the first object that the ray intersects, or 0 if no object is intersecting the ray (i.e. returns false). Returns the collision point at which the ray intersects the closest object. Note: This point is in the global coordinate system. Returns the normal of the intersecting object's shape at the collision point. Adds a collision exception so the ray does not report collisions with the specified . Adds a collision exception so the ray does not report collisions with the specified node. Removes a collision exception so the ray does report collisions with the specified . Removes a collision exception so the ray does report collisions with the specified node. Removes all collision exceptions for this ray. Sets the bit index passed to the value passed. Note: Bit indexes range from 0-19. Returns true if the bit index passed is turned on. Note: Bit indices range from 0-19. A RayCast represents a line from its origin to its destination position, cast_to. It is used to query the 2D space in order to find the closest object along the path of the ray. RayCast2D can ignore some objects by adding them to the exception list via add_exception, by setting proper filtering with collision layers, or by filtering object types with type masks. RayCast2D can be configured to report collisions with s () and/or s (). Only enabled raycasts will be able to query the space and report collisions. RayCast2D calculates intersection every physics frame (see ), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame) use after adjusting the raycast. If true, collisions will be reported. If true, the parent node will be excluded from collision detection. The ray's destination point, relative to the RayCast's position. The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See Collision layers and masks in the documentation for more information. If true, collision with s will be reported. If true, collision with s will be reported. Returns whether any object is intersecting with the ray's vector (considering the vector length). Updates the collision information for the ray. Use this method to update the collision information immediately instead of waiting for the next _physics_process call, for example if the ray or its parent has changed state. Note: enabled is not required for this to work. Returns the first object that the ray intersects, or null if no object is intersecting the ray (i.e. returns false). Returns the shape ID of the first object that the ray intersects, or 0 if no object is intersecting the ray (i.e. returns false). Returns the collision point at which the ray intersects the closest object. Note: this point is in the global coordinate system. Returns the normal of the intersecting object's shape at the collision point. Adds a collision exception so the ray does not report collisions with the specified . Adds a collision exception so the ray does not report collisions with the specified node. Removes a collision exception so the ray does report collisions with the specified . Removes a collision exception so the ray does report collisions with the specified node. Removes all collision exceptions for this ray. Sets or clears individual bits on the collision mask. This makes selecting the areas scanned easier. Returns an individual bit on the collision mask. Ray shape for 3D collisions, which can be set into a or . A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. The ray's length. If true, allow the shape to return the correct normal. Ray shape for 2D collisions. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. The ray's length. If true, allow the shape to return the correct normal. Rectangle shape for 2D collisions. This shape is useful for modeling box-like 2D objects. The rectangle's half extents. The width and height of this shape is twice the half extents. Base class for any object that keeps a reference count. and many other helper objects inherit this class. Unlike other types, References keep an internal reference counter so that they are automatically released when no longer in use, and only then. References therefore do not need to be freed manually with . In the vast majority of use cases, instantiating and using -derived types is all you need to do. The methods provided in this class are only for advanced users, and can cause issues if misused. Note: In C#, references will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free references that are no longer in use. This means that unused references will linger on for a while before being removed. Initializes the internal reference counter. Use this only if you really know what you are doing. Returns whether the initialization was successful. Increments the internal reference counter. Use this only if you really know what you are doing. Returns true if the increment was successful, false otherwise. Decrements the internal reference counter. Use this only if you really know what you are doing. Returns true if the decrement was successful, false otherwise. A rectangle box that displays only a border color around its rectangle. has no fill . If you need to display a rectangle filled with a solid color, consider using instead. Sets the border of the . Sets the border width of the . The border grows both inwards and outwards with respect to the rectangle box. If set to true, the will only be visible while in editor. Otherwise, will be visible in game. Capture its surroundings as a dual paraboloid image, and stores versions of it with increasing levels of blur to simulate different material roughnesses. The is used to create high-quality reflections at the cost of performance. It can be combined with s and Screen Space Reflections to achieve high quality reflections. s render all objects within their , so updating them can be quite expensive. It is best to update them once with the important static objects and then leave them. Note: By default Godot will only render 16 reflection probes. If you need more, increase the number of atlas subdivisions. This setting can be found in . Update the probe once on the next frame. Update the probe every frame. This is needed when you want to capture dynamic objects. However, it results in an increased render time. Use whenever possible. Sets how frequently the probe is updated. Can be or . Defines the reflection intensity. Intensity modulates the strength of the reflection. Sets the max distance away from the probe an object can be before it is culled. The size of the reflection probe. The larger the extents the more space covered by the probe which will lower the perceived resolution. It is best to keep the extents only as large as you need them. Sets the origin offset to be used when this reflection probe is in box project mode. If true, enables box projection. This makes reflections look more correct in rectangle-shaped rooms by offsetting the reflection center depending on the camera's location. If true, computes shadows in the reflection probe. This makes the reflection probe slower to render; you may want to disable this if using the . Sets the cull mask which determines what objects are drawn by this probe. Every with a layer included in this cull mask will be rendered by the probe. It is best to only include large objects which are likely to take up a lot of space in the reflection in order to save on rendering cost. If true, reflections will ignore sky contribution. Ambient lighting is then controlled by the interior_ambient_* properties. Sets the ambient light color to be used when this probe is set to . Sets the energy multiplier for this reflection probe's ambient light contribution when set to . Sets the contribution value for how much the reflection affects the ambient light for this reflection probe when set to . Useful so that ambient light matches the color of the room. A regular expression (or regex) is a compact language that can be used to recognise strings that follow a specific pattern, such as URLs, email addresses, complete sentences, etc. For instance, a regex of ab[0-9] would find any string that is ab followed by any number from 0 to 9. For a more in-depth look, you can easily find various tutorials and detailed explanations on the Internet. To begin, the RegEx object needs to be compiled with the search pattern using before it can be used. var regex = RegEx.new() regex.compile("\\w-(\\d+)") The search pattern must be escaped first for GDScript before it is escaped for the expression. For example, compile("\\d+") would be read by RegEx as \d+. Similarly, compile("\"(?:\\\\.|[^\"])*\"") would be read as "(?:\\.|[^"])*". Using , you can find the pattern within the given text. If a pattern is found, is returned and you can retrieve details of the results using methods such as and . var regex = RegEx.new() regex.compile("\\w-(\\d+)") var result = regex.search("abc n-0123") if result: print(result.get_string()) # Would print n-0123 The results of capturing groups () can be retrieved by passing the group number to the various methods in . Group 0 is the default and will always refer to the entire pattern. In the above example, calling result.get_string(1) would give you 0123. This version of RegEx also supports named capturing groups, and the names can be used to retrieve the results. If two or more groups have the same name, the name would only refer to the first one with a match. var regex = RegEx.new() regex.compile("d(?<digit>[0-9]+)|x(?<digit>[0-9a-f]+)") var result = regex.search("the number is x2f") if result: print(result.get_string("digit")) # Would print 2f If you need to process multiple results, generates a list of all non-overlapping results. This can be combined with a for loop for convenience. for result in regex.search_all("d01, d03, d0c, x3f and x42"): print(result.get_string("digit")) # Would print 01 03 0 3f 42 Example of splitting a string using a RegEx: var regex = RegEx.new() regex.compile("\\S+") # Negated whitespace character class. var results = [] for result in regex.search_all("One Two \n\tThree"): results.push_back(result.get_string()) # The `results` array now contains "One", "Two", "Three". Note: Godot's regex implementation is based on the PCRE2 library. You can view the full pattern reference here. Tip: You can use Regexr to test regular expressions online. This method resets the state of the object, as if it was freshly created. Namely, it unassigns the regular expression of this object. Compiles and assign the search pattern to use. Returns if the compilation is successful. If an error is encountered, details are printed to standard output and an error is returned. Searches the text for the compiled pattern. Returns a container of the first matching result if found, otherwise null. The region to search within can be specified without modifying where the start and end anchor would be. Searches the text for the compiled pattern. Returns an array of containers for each non-overlapping result. If no results were found, an empty array is returned instead. The region to search within can be specified without modifying where the start and end anchor would be. Searches the text for the compiled pattern and replaces it with the specified string. Escapes and backreferences such as $1 and $name are expanded and resolved. By default, only the first instance is replaced, but it can be changed for all instances (global replacement). The region to search within can be specified without modifying where the start and end anchor would be. Returns whether this object has a valid search pattern assigned. Returns the original search pattern that was compiled. Returns the number of capturing groups in compiled pattern. Returns an array of names of named capturing groups in the compiled pattern. They are ordered by appearance. Contains the results of a single match returned by and . It can be used to find the position and range of the match and its capturing groups, and it can extract its substring for you. The source string used with the search pattern to find this matching result. A dictionary of named groups and its corresponding group number. Only groups that were matched are included. If multiple groups have the same name, that name would refer to the first matching one. An of the match and its capturing groups. Returns the number of capturing groups. Returns the substring of the match from the source string. Capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. Returns an empty string if the group did not match or doesn't exist. If the parameter is null, then the default value is (object)0 Returns the starting position of the match within the source string. The starting position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. Returns -1 if the group did not match or doesn't exist. If the parameter is null, then the default value is (object)0 Returns the end position of the match within the source string. The end position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. Returns -1 if the group did not match or doesn't exist. If the parameter is null, then the default value is (object)0 RemoteTransform pushes its own to another derived Node (called the remote node) in the scene. It can be set to update another Node's position, rotation and/or scale. It can use either global or local coordinates. The to the remote node, relative to the RemoteTransform's position in the scene. If true, global coordinates are used. If false, local coordinates are used. If true, the remote node's position is updated. If true, the remote node's rotation is updated. If true, the remote node's scale is updated. caches the remote node. It may not notice if the remote node disappears; forces it to update the cache again. RemoteTransform2D pushes its own to another derived Node (called the remote node) in the scene. It can be set to update another Node's position, rotation and/or scale. It can use either global or local coordinates. The to the remote node, relative to the RemoteTransform2D's position in the scene. If true, global coordinates are used. If false, local coordinates are used. If true, the remote node's position is updated. If true, the remote node's rotation is updated. If true, the remote node's scale is updated. caches the remote node. It may not notice if the remote node disappears; forces it to update the cache again. Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Since they inherit from , resources are reference-counted and freed when no longer in use. They are also cached once loaded from disk, so that any further attempts to load a resource from a given path will return the same reference (all this in contrast to a , which is not reference-counted and can be instanced from disk as many times as desired). Resources can be saved externally on disk or bundled into another object, such as a or another resource. Note: In C#, resources will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free resources that are no longer in use. This means that unused resources will linger on for a while before being removed. If true, the resource will be made unique in each instance of its local scene. It can thus be modified in a scene instance without impacting other instances of that same scene. The path to the resource. In case it has its own file, it will return its filepath. If it's tied to the scene, it will return the scene's path, followed by the resource's index. The name of the resource. This is an optional identifier. If is not empty, its value will be displayed to represent the current resource in the editor inspector. For built-in scripts, the will be displayed as the tab name in the script editor. Virtual function which can be overridden to customize the behavior value of . Sets the path of the resource, potentially overriding an existing cache entry for this path. This differs from setting , as the latter would error out if another resource was already cached for the given path. Returns the RID of the resource (or an empty RID). Many resources (such as , , etc) are high-level abstractions of resources stored in a server, so this function will return the original RID. If is enabled and the resource was loaded from a instantiation, returns the local scene where this resource's unique copy is in use. Otherwise, returns null. This method is called when a resource with enabled is loaded from a instantiation. Its behavior can be customized by overriding from script. For most resources, this method performs no base logic. performs custom logic to properly set the proxy texture and flags in the local viewport. Emits the changed signal. If external objects which depend on this resource should be updated, this method must be called manually whenever the state of this resource has changed (such as modification of properties). The method is equivalent to: emit_signal("changed") Note: This method is called automatically for built-in resources. Duplicates the resource, returning a new resource. By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing true to the subresources argument which will copy the subresources. Note: If subresources is true, this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared. Godot loads resources in the editor or in exported games using ResourceFormatLoaders. They are queried automatically via the singleton, or when a resource with internal dependencies is loaded. Each file type may load as a different resource type, so multiple ResourceFormatLoaders are registered in the engine. Extending this class allows you to define your own loader. Be sure to respect the documented return types and values. You should give it a global class name with class_name for it to be registered. Like built-in ResourceFormatLoaders, it will be called automatically when loading resources of its handled type(s). You may also implement a . Note: You can also extend if the resource type you need exists but Godot is unable to load its format. Choosing one way over another depends on if the format is suitable or not for the final exported game. For example, it's better to import .png textures as .stex () first, so they can be loaded with better efficiency on the graphics card. If implemented, gets the dependencies of a given resource. If add_types is true, paths should be appended ::TypeName, where TypeName is the class name of the dependency. Note: Custom resource types defined by scripts aren't known by the , so you might just return "Resource" for them. Gets the list of extensions for files this loader is able to read. Gets the class name of the resource associated with the given path. If the loader cannot handle it, it should return "". Note: Custom resource types defined by scripts aren't known by the , so you might just return "Resource" for them. Tells which resource class this loader can load. Note: Custom resource types defined by scripts aren't known by the , so you might just handle "Resource" for them. Loads a resource when the engine finds this loader to be compatible. If the loaded resource is the result of an import, original_path will target the source file. Returns a object on success, or an constant in case of failure. If implemented, renames dependencies within the given resource and saves it. renames is a dictionary { String => String } mapping old dependency paths to new paths. Returns on success, or an constant in case of failure. The engine can save resources when you do it from the editor, or when you use the singleton. This is accomplished thanks to multiple s, each handling its own format and called automatically by the engine. By default, Godot saves resources as .tres (text-based), .res (binary) or another built-in format, but you can choose to create your own format by extending this class. Be sure to respect the documented return types and values. You should give it a global class name with class_name for it to be registered. Like built-in ResourceFormatSavers, it will be called automatically when saving resources of its recognized type(s). You may also implement a . Returns the list of extensions available for saving the resource object, provided it is recognized (see ). Returns whether the given resource object can be saved by this saver. Saves the given resource object to a file at the target path. flags is a bitmask composed with constants. Returns on success, or an constant in case of failure. Interactive loader. This object is returned by when performing an interactive load. It allows loading resources with high granularity, which makes it mainly useful for displaying loading bars or percentages. Returns the loaded resource if the load operation completed successfully, null otherwise. Polls the loading operation, i.e. loads a data chunk up to the next stage. Returns if the poll is successful but the load operation has not finished yet (intermediate stage). This means will have to be called again until the last stage is completed. Returns if the load operation has completed successfully. The loaded resource can be obtained by calling . Returns another code if the poll has failed. Polls the loading operation successively until the resource is completely loaded or a fails. Returns if the load operation has completed successfully. The loaded resource can be obtained by calling . Returns another code if a poll has failed, aborting the operation. Returns the load stage. The total amount of stages can be queried with . Returns the total amount of stages (calls to ) needed to completely load this resource. This node is used to preload sub-resources inside a scene, so when the scene is loaded, all the resources are ready to use and can be retrieved from the preloader. GDScript has a simplified @GDScript.preload built-in method which can be used in most situations, leaving the use of for more advanced scenarios. Adds a resource to the preloader with the given name. If a resource with the given name already exists, the new resource will be renamed to "name N" where N is an incrementing number starting from 2. Removes the resource associated to name from the preloader. Renames a resource inside the preloader from name to newname. Returns true if the preloader contains a resource associated to name. Returns the resource associated to name. Returns the list of resources inside the preloader. A custom effect for use with . Note: For a to be usable, a BBCode tag must be defined as a member variable called bbcode in the script. # The RichTextEffect will be usable like this: `[example]Some text[/example]` var bbcode = "example" Note: As soon as a contains at least one , it will continuously process the effect unless the project is paused. This may impact battery life negatively. Override this method to modify properties in char_fx. The method must return true if the character could be transformed successfully. If the method returns false, it will skip transformation to avoid displaying broken text. Rich text can contain custom text, fonts, images and some basic formatting. The label manages these as an internal tag stack. It also adapts itself to given width/heights. Note: Assignments to clear the tag stack and reconstruct it from the property's contents. Any edits made to will erase previous edits made from other manual sources such as and the push_* / methods. Note: RichTextLabel doesn't support entangled BBCode tags. For example, instead of using [b]bold[i]bold italic[/b]italic[/i], use [b]bold[i]bold italic[/i][/b][i]italic[/i]. Note: Unlike , RichTextLabel doesn't have a property to horizontally align text to the center. Instead, enable and surround the text in a [center] tag as follows: [center]Example[/center]. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the property. Makes text left aligned. Makes text centered. Makes text right aligned. Makes text fill width. Each list item has a number marker. Each list item has a letter marker. Each list item has a filled circle marker. If true, the label uses BBCode formatting. Note: Trying to alter the 's text with will reset this to false. Use instead to preserve BBCode formatting. The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited. Note: It is unadvised to use the += operator with bbcode_text (e.g. bbcode_text += "some string") as it replaces the whole text and can cause slowdowns. Use for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call. The restricted number of characters to display in the label. If -1, all characters will be displayed. Note: Setting this property updates based on current . The range of characters to display, as a between 0.0 and 1.0. When assigned an out of range value, it's the same as assigning 1.0. Note: Setting this property updates based on current . If true, the label underlines meta tags such as [url]{text}[/url]. The number of spaces associated with a single tab length. Does not affect \t in text tags, only indent tags. The raw text of the label. When set, clears the tag stack and adds a raw text tag to the top of it. Does not parse BBCodes. Does not modify . If true, the label's height will be automatically updated to fit its content. Note: This property is used as a workaround to fix issues with in s, but it's unreliable in some cases and will be removed in future versions. If true, the scrollbar is visible. Setting this to false does not block scrolling completely. See . If true, the window scrolls down to display new content automatically. If true, the label allows text selection. If true, the label uses the custom font color. The currently installed custom effects. This is an array of s. To add a custom effect, it's more convenient to use . Adds raw non-BBCode-parsed text to the tag stack. Adds an image's opening and closing tags to the tag stack, optionally providing a width and height to resize the image. If width or height is set to 0, the image size will be adjusted in order to keep the original aspect ratio. Adds a newline tag to the tag stack. Removes a line of content from the label. Returns true if the line exists. The line argument is the index of the line to remove, it can take values in the interval [0, get_line_count() - 1]. Adds a [font] tag to the tag stack. Overrides default fonts for its duration. Adds a [font] tag with a normal font to the tag stack. Adds a [font] tag with a bold font to the tag stack. This is the same as adding a [b] tag if not currently in a [i] tag. Adds a [font] tag with a bold italics font to the tag stack. Adds a [font] tag with a italics font to the tag stack. This is the same as adding a [i] tag if not currently in a [b] tag. Adds a [font] tag with a monospace font to the tag stack. Adds a [color] tag to the tag stack. Adds an [align] tag based on the given align value. See for possible values. Adds an [indent] tag to the tag stack. Multiplies level by current to determine new margin length. Adds a [list] tag to the tag stack. Similar to the BBCodes [ol] or [ul], but supports more list types. Not fully implemented! Adds a [meta] tag to the tag stack. Similar to the BBCode [url=something]{text}[/url], but supports non- metadata types. Adds a [u] tag to the tag stack. Adds a [s] tag to the tag stack. Adds a [table=columns] tag to the tag stack. Edits the selected column's expansion options. If expand is true, the column expands in proportion to its expansion ratio versus the other columns' ratios. For example, 2 columns with ratios 3 and 4 plus 70 pixels in available width would expand 30 and 40 pixels, respectively. If expand is false, the column will not contribute to the total ratio. Adds a [cell] tag to the tag stack. Must be inside a [table] tag. See for details. Terminates the current tag. Use after push_* methods to close BBCodes manually. Does not need to follow add_* methods. Clears the tag stack and sets to an empty string. Returns the vertical scrollbar. Scrolls the window's top line to match line. The assignment version of . Clears the tag stack and inserts the new content. Returns if parses bbcode successfully. Parses bbcode and adds tags to the tag stack as needed. Returns the result of the parsing, if successful. Note: Using this method, you can't close a tag that was opened in a previous call. This is done to improve performance, especially when updating large RichTextLabels since rebuilding the whole BBCode every time would be slower. If you absolutely need to close a tag in a future method call, append the instead of using . Returns the total number of characters from text tags. Does not include BBCodes. Returns the total number of newlines in the tag stack's text tags. Considers wrapped text as one line. Returns the number of visible lines. Returns the height of the content. Parses BBCode parameter expressions into a dictionary. Installs a custom effect. effect should be a valid . This is the node that implements full 3D physics. This means that you do not control a RigidBody directly. Instead, you can apply forces to it (gravity, impulses, etc.), and the physics simulation will calculate the resulting movement, collision, bouncing, rotating, etc. A RigidBody has 4 behavior s: Rigid, Static, Character, and Kinematic. Note: Don't change a RigidBody's position every frame or very often. Sporadic changes work fine, but physics runs at a different granularity (fixed Hz) than usual rendering (process callback) and maybe even in a separate thread, so changing this from a process loop may result in strange behavior. If you need to directly affect the body's state, use , which allows you to directly access the physics state. If you need to override the default physics behavior, you can write a custom force integration function. See . With Bullet physics (the default), the center of mass is the RigidBody3D center. With GodotPhysics, the center of mass is the average of the centers. Rigid body mode. This is the "natural" state of a rigid body. It is affected by forces, and can move, rotate, and be affected by user code. Static mode. The body behaves like a , and can only move by user code. Character body mode. This behaves like a rigid body, but can not rotate. Kinematic body mode. The body behaves like a , and can only move by user code. The body mode. See for possible values. The body's mass. The body's weight based on its mass and the global 3D gravity. Global values are set in Project > Project Settings > Physics > 3d. The body's friction, from 0 (frictionless) to 1 (max friction). Deprecated, use instead via . The body's bounciness. Values range from 0 (no bounce) to 1 (full bounciness). Deprecated, use instead via . The physics material override for the body. If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. This is multiplied by the global 3D gravity setting found in Project > Project Settings > Physics > 3d to produce RigidBody's gravity. For example, a value of 1 will be normal gravity, 2 will apply double gravity, and 0.5 will apply half gravity to this object. If true, internal force integration will be disabled (like gravity or air friction) for this body. Other than collision response, the body will only move as determined by the function, if defined. If true, continuous collision detection is used. Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. Continuous collision detection is more precise, and misses fewer impacts by small, fast-moving objects. Not using continuous collision detection is faster to compute, but can miss small, fast-moving objects. The maximum number of contacts that will be recorded. Requires to be set to true. Note: The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner). If true, the RigidBody will emit signals when it collides with another RigidBody. See also . If true, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the or methods. If true, the body can enter sleep mode when there is no movement. See . Note: A RigidBody3D will never enter sleep mode automatically if its is . It can still be put to sleep manually by setting its property to true. Lock the body's movement in the X axis. Lock the body's movement in the Y axis. Lock the body's movement in the Z axis. Lock the body's rotation in the X axis. Lock the body's rotation in the Y axis. Lock the body's rotation in the Z axis. The body's linear velocity. Can be used sporadically, but don't set this every frame, because physics may run in another thread and runs at a different granularity. Use as your process loop for precise control of the body state. The body's linear damp. Cannot be less than -1.0. If this value is different from -1.0, any linear damp derived from the world or areas will be overridden. See for more details about damping. RigidBody's rotational velocity. Damps RigidBody's rotational forces. See for more details about damping. Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it works in addition to the usual physics behavior, but the property allows you to disable the default behavior and do fully custom force integration for a body. Returns the inverse inertia tensor basis. This is used to calculate the angular acceleration resulting from a torque applied to the RigidBody. Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. Adds a constant directional force (i.e. acceleration) without affecting rotation. This is equivalent to add_force(force, Vector3(0,0,0)). Adds a constant directional force (i.e. acceleration). The position uses the rotation of the global coordinate system, but is centered at the object's origin. Adds a constant rotational force (i.e. a motor) without affecting position. Applies a directional impulse without affecting rotation. This is equivalent to apply_impulse(Vector3(0,0,0), impulse). 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. The position uses the rotation of the global coordinate system, but is centered at the object's origin. Applies a torque impulse which will be affected by the body mass and shape. This will rotate the body around the impulse vector passed. Locks the specified linear or rotational axis. Returns true if the specified linear or rotational axis is locked. Returns a list of the bodies colliding with this one. Requires to be set to true and to be set high enough to detect all the collisions. Note: 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. This node implements simulated 2D physics. You do not control a RigidBody2D directly. Instead, you apply forces to it (gravity, impulses, etc.) and the physics simulation calculates the resulting movement based on its mass, friction, and other physical properties. A RigidBody2D has 4 behavior s: Rigid, Static, Character, and Kinematic. Note: You should not change a RigidBody2D's position or linear_velocity every frame or even very often. If you need to directly affect the body's state, use , which allows you to directly access the physics state. Please also keep in mind that physics bodies manage their own transform which overwrites the ones you set. So any direct or indirect transformation (including scaling of the node or its parent) will be visible in the editor only, and immediately reset at runtime. If you need to override the default physics behavior or add a transformation at runtime, you can write a custom force integration. See . The center of mass is always located at the node's origin without taking into account the centroid offsets. Rigid mode. The body behaves as a physical object. It collides with other bodies and responds to forces applied to it. This is the default mode. Static mode. The body behaves like a and does not move. Character mode. Similar to , but the body can not rotate. Kinematic mode. The body behaves like a , and must be moved by code. Continuous collision detection disabled. This is the fastest way to detect body collisions, but can miss small, fast-moving objects. Continuous collision detection enabled using raycasting. This is faster than shapecasting but less precise. Continuous collision detection enabled using shapecasting. This is the slowest CCD method and the most precise. The body's mode. See for possible values. The body's mass. The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body. The moment of inertia is usually computed automatically from the mass and the shapes, but this function allows you to set a custom value. Set 0 inertia to return to automatically computing it. The body's weight based on its mass and the Default Gravity value in Project > Project Settings > Physics > 2d. The body's friction. Values range from 0 (frictionless) to 1 (maximum friction). Deprecated, use instead via . The body's bounciness. Values range from 0 (no bounce) to 1 (full bounciness). Deprecated, use instead via . The physics material override for the body. If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. Multiplies the gravity applied to the body. The body's gravity is calculated from the Default Gravity value in Project > Project Settings > Physics > 2d and/or any additional gravity vector applied by s. If true, internal force integration is disabled for this body. Aside from collision response, the body will only move as determined by the function. Continuous collision detection mode. Continuous collision detection tries to predict where a moving body will collide instead of moving it and correcting its movement after collision. Continuous collision detection is slower, but more precise and misses fewer collisions with small, fast-moving objects. Raycasting and shapecasting methods are available. See for details. The maximum number of contacts that will be recorded. Requires to be set to true. Note: The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end). If true, the body will emit signals when it collides with another RigidBody2D. See also . If true, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the or methods. If true, the body can enter sleep mode when there is no movement. See . Note: A RigidBody2D will never enter sleep mode automatically if its is . It can still be put to sleep manually by setting its property to true. The body's linear velocity. Damps the body's . If -1, the body will use the Default Linear Damp in Project > Project Settings > Physics > 2d. See for more details about damping. The body's rotational velocity. Damps the body's . If -1, the body will use the Default Angular Damp defined in Project > Project Settings > Physics > 2d. See for more details about damping. The body's total applied force. The body's total applied torque. Allows you to read and safely modify the simulation state for the object. Use this instead of if you need to directly change the body's position or other physics properties. By default, it works in addition to the usual physics behavior, but allows you to disable the default behavior and write custom force integration for a body. 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. Applies a directional impulse without affecting rotation. 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). The position uses the rotation of the global coordinate system, but is centered at the object's origin. Applies a rotational impulse to the body. Adds a constant directional force without affecting rotation. Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. Adds a constant rotational force. Returns true if a collision would result from moving in the given vector. margin increases the size of the shapes involved in the collision detection, and result is an object of type , which contains additional information about the collision (should there be one). Returns a list of the bodies colliding with this one. Requires to be set to true and to be set high enough to detect all the collisions. Note: 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. Maintains a list of resources, nodes, exported, and overridden properties, and built-in scripts associated with a scene. This class cannot be instantiated directly, it is retrieved for a given scene as the result of . If passed to , blocks edits to the scene state. If passed to , provides inherited scene resources to the local scene. Note: Only available in editor builds. If passed to , provides local scene resources to the local scene. Only the main scene should receive the main edit state. Note: Only available in editor builds. Returns the number of nodes in the scene. The idx argument used to query node data in other get_node_* methods in the interval [0, get_node_count() - 1]. Returns the type of the node at idx. Returns the name of the node at idx. Returns the path to the node at idx. If for_parent is true, returns the path of the idx node's parent instead. Returns the path to the owner of the node at idx, relative to the root node. Returns true if the node at idx is an . Returns the path to the represented scene file if the node at idx is an . Returns a for the node at idx (i.e. the whole branch starting at this node, with its child nodes and resources), or null if the node is not an instance. Returns the list of group names associated with the node at idx. Returns the node's index, which is its position relative to its siblings. This is only relevant and saved in scenes for cases where new nodes are added to an instanced or inherited scene among siblings from the base scene. Despite the name, this index is not related to the idx argument used here and in other methods. Returns the number of exported or overridden properties for the node at idx. The prop_idx argument used to query node property data in other get_node_property_* methods in the interval [0, get_node_property_count() - 1]. Returns the name of the property at prop_idx for the node at idx. Returns the value of the property at prop_idx for the node at idx. Returns the number of signal connections in the scene. The idx argument used to query connection metadata in other get_connection_* methods in the interval [0, get_connection_count() - 1]. Returns the path to the node that owns the signal at idx, relative to the root node. Returns the name of the signal at idx. Returns the path to the node that owns the method connected to the signal at idx, relative to the root node. Returns the method connected to the signal at idx. Returns the connection flags for the signal at idx. See constants. Returns the list of bound parameters for the signal at idx. As one of the most important classes, the manages the hierarchy of nodes in a scene as well as scenes themselves. Nodes can be added, retrieved 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 to organize your nodes into groups: every node can be assigned 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 group's members at once. is the default implementation used by scenes, and is thus in charge of the game loop. Fill the window with the content stretched to cover excessive space. Content may appear stretched. Retain the same aspect ratio by padding with black bars on either axis. This prevents distortion. Expand vertically. Left/right black bars may appear if the window is too wide. Expand horizontally. Top/bottom black bars may appear if the window is too tall. Expand in both directions, retaining the same aspect ratio. This prevents distortion while avoiding black bars. Call a group with no flags (default). Call a group in reverse scene order. Call a group immediately (calls are normally made on idle). Call a group only once even if the call is executed many times. No stretching. Render stretching in higher resolution (interpolated). Keep the specified display resolution. No interpolation. Content may appear pixelated. If true, collision shapes will be visible when running the game from the editor for debugging purposes. If true, navigation polygons will be visible when running the game from the editor for debugging purposes. If true, the is paused. Doing so will have the following behavior: - 2D and 3D physics will be stopped. - , and will not be called anymore in nodes. If true, the 's refuses new incoming connections. If true, font oversampling is used. The root of the edited scene. The current scene. The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the will become a network server (check with ) and will set the root node's network mode to master, or it will become a regular peer with the root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to 's signals. The 's root . The default instance for this . If true (default value), enables automatic polling of the for this SceneTree during idle_frame. If false, you need to manually call to process network packets and deliver RPCs/RSETs. This allows running RPCs/RSETs in a different loop (e.g. physics, thread, specific time step) and for manual protection when accessing the from threads. Returns true if the given group exists. If true, the application automatically accepts quitting. Enabled by default. For mobile platforms, see . If true, the application quits automatically on going back (e.g. on Android). Enabled by default. To handle 'Go Back' button when this option is disabled, use . Marks the most recent as handled. Returns true if the most recent was marked as handled with . Returns a which will SceneTreeTimer.timeout after the given time in seconds elapsed in this . If pause_mode_process is set to false, pausing the will also pause the timer. Commonly used to create a one-shot delay timer as in the following example: func some_function(): print("start") yield(get_tree().create_timer(1.0), "timeout") print("end") The timer will be automatically freed after its time elapses. Returns the number of nodes in this . Returns the current frame number, i.e. the total frame count since the application started. Quits the application at the end of the current iteration. A process exit_code can optionally be passed as an argument. If this argument is 0 or greater, it will override the defined before quitting the application. Configures screen stretching to the given , , minimum size and shrink ratio. Queues the given object for deletion, delaying the call to to after the current frame. Calls method on each member of the given group, respecting the given . You can pass arguments to method by specifying them at the end of the method call. Note: method may only have 5 arguments at most (8 arguments passed to this method in total). Note: Group call flags are used to control the method calling behavior. If the flag is present in the flags argument, methods will be called immediately. If this flag isn't present in flags, methods will be called with a one-frame delay in a way similar to . Sends the given notification to all members of the group, respecting the given . Sets the given property to value on all members of the given group, respecting the given . Calls method on each member of the given group. You can pass arguments to method by specifying them at the end of the method call. Note: method may only have 5 arguments at most (7 arguments passed to this method in total). Note: will always call methods with an one-frame delay, in a way similar to . To call methods immediately, use with the flag. Sends the given notification to all members of the group. Sets the given property to value on all members of the given group. Returns a list of all nodes assigned to the given group. Changes the running scene to the one at the given path, after loading it into a and creating a new instance. Returns on success, if the path cannot be loaded into a , or if that scene cannot be instantiated. Note: The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the call. Changes the running scene to a new instance of the given . Returns on success or if the scene cannot be instantiated. Note: The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the call. Reloads the currently active scene. Returns on success, if no was defined yet, if cannot be loaded into a , or if the scene cannot be instantiated. Returns true if this 's is in server mode (listening for connections). Returns true if there is a set. Returns the peer IDs of all connected peers of this 's . Returns the unique peer ID of this 's . Returns the sender's peer ID for the most recently received RPC call. A one-shot timer managed by the scene tree, which emits timeout on completion. See also . As opposed to , it does not require the instantiation of a node. Commonly used to create a one-shot delay timer as in the following example: func some_function(): print("Timer started.") yield(get_tree().create_timer(1.0), "timeout") print("Timer ended.") The time remaining. A class stored as a resource. A script extends the functionality of all objects that instance it. The new method of a script subclass creates a new instance. extends an existing object, if that object's class matches one of the script's base classes. The script source code or an empty string if source code is not available. When set, does not reload the class implementation automatically. Returns true if the script can be instanced. Returns true if base_object is an instance of this script. Returns true if the script contains non-empty source code. Reloads the script's class implementation. Returns an error code. Returns the script directly inherited by this script. Returns the script's base type. Returns true if the script, or a base class, defines a signal with the given name. Returns the list of properties in this . Returns the list of methods in this . Returns the list of user signals defined in this . Returns a dictionary containing constant names and their values. Returns the default value of the specified property. Returns true if the script is a tool script. A tool script can run in the editor. Scrollbars are a -based , that display a draggable area (the size of the page). Horizontal () and Vertical () versions are available. Overrides the step used when clicking increment and decrement buttons or when using arrow keys when the is focused. A ScrollContainer node meant to contain a child. ScrollContainers will automatically create a scrollbar child (, , or both) when needed and will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the of the Control relative to the ScrollContainer. Works great with a control. You can set EXPAND on the children's size flags, so they will upscale to the ScrollContainer's size if it's larger (scroll is invisible for the chosen dimension). If true, the ScrollContainer will automatically scroll to focused children (including indirect children) to make sure they are fully visible. If true, enables horizontal scrolling. The current horizontal scroll value. If true, enables vertical scrolling. The current vertical scroll value. Returns the horizontal scrollbar of this . Returns the vertical scrollbar of this . Segment shape for 2D collisions. Consists of two points, a and b. The segment's first point position. The segment's second point position. Separator is a used for separating other controls. It's purely a visual decoration. Horizontal () and Vertical () versions are available. This class allows you to define a custom shader program that can be used by a . Shaders allow you to write your own custom behavior for rendering objects or updating particle information. For a detailed explanation and usage, please see the tutorials linked below. Mode used to draw all 3D objects. Mode used to draw all 2D objects. Mode used to calculate particle information on a per-particle basis. Not used for drawing. Returns the shader's code as the user has written it, not the full generated code used internally. Returns the shader's custom defines. Custom defines can be used in Godot to add GLSL preprocessor directives (e.g: extensions) required for the shader logic. Note: Custom defines are not validated by the Godot shader parser, so care should be taken when using them. Returns the shader mode for the shader, either , or . Sets the default texture to be used with a texture uniform. The default is used if a texture is not set in the . Note: param must match the name of the uniform in the code exactly. Returns the texture that is set as default for the specified parameter. Note: param must match the name of the uniform in the code exactly. Returns true if the shader has this param defined as a uniform in its code. Note: param must match the name of the uniform in the code exactly. A material that uses a custom program to render either items to screen or process particles. You can create multiple materials for the same shader but configure different values for the uniforms defined in the shader. Note: Due to a renderer limitation, emissive s cannot emit light when used in a . Only emissive s can emit light in a . The program used to render this material. Changes the value set for this material of a uniform in the shader. Note: param must match the name of the uniform in the code exactly. Returns the current value set for this material of a uniform in the shader. Returns true if the property identified by name can be reverted to a default value. Returns the default value of the material property with given name. Base class for all 3D shape resources. Nodes that inherit from this can be used as shapes for a or objects. The collision margin for the shape. Used in Bullet Physics only. 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. Returns the used to draw the debug collision for this . Base class for all 2D shapes. All 2D shape types inherit from this. The shape's custom solver bias. Returns true if this shape is colliding with another. This method needs the transformation matrix for this shape (local_xform), the shape to check collisions with (with_shape), and the transformation matrix of that shape (shape_xform). Returns whether this shape would collide with another, if a given movement was applied. This method needs the transformation matrix for this shape (local_xform), the movement to test on this shape (local_motion), the shape to check collisions with (with_shape), the transformation matrix of that shape (shape_xform), and the movement to test onto the other object (shape_motion). Returns a list of the points where this shape touches another. If there are no collisions the list is empty. This method needs the transformation matrix for this shape (local_xform), the shape to check collisions with (with_shape), and the transformation matrix of that shape (shape_xform). Returns a list of the points where this shape would touch another, if a given movement was applied. If there are no collisions the list is empty. This method needs the transformation matrix for this shape (local_xform), the movement to test on this shape (local_motion), the shape to check collisions with (with_shape), the transformation matrix of that shape (shape_xform), and the movement to test onto the other object (shape_motion). Draws a solid shape onto a with the API filled with the specified color. The exact drawing method is specific for each shape and cannot be configured. A shortcut for binding input. Shortcuts are commonly used for interacting with a element from a . The shortcut's . Generally the is a keyboard key, though it can be any . If true, this shortcut is valid. Returns true if the shortcut's equals event. Returns the shortcut's as a . Skeleton provides a hierarchical interface for managing bones, including pose, rest and animation (see ). It can also use ragdoll physics. The overall transform of a bone with respect to the skeleton is determined by the following hierarchical order: rest pose, custom pose and pose. Note that "global pose" below refers to the overall transform of the bone with respect to skeleton, so it not the actual global/world transform of the bone. Adds a bone, with name name. will become the bone index. Returns the bone index that matches name as its name. Returns the name of the bone at index index. Returns the bone index which is the parent of the bone at bone_idx. If -1, then bone has no parent. Note: The parent bone returned will always be less than bone_idx. Sets the bone index parent_idx as the parent of the bone at bone_idx. If -1, then bone has no parent. Note: parent_idx must be less than bone_idx. Returns the amount of bones in the skeleton. Returns the rest transform for a bone bone_idx. Sets the rest transform for bone bone_idx. Deprecated soon. Deprecated soon. Deprecated soon. Clear all the bones in this skeleton. Returns the pose transform of the specified bone. Pose is applied on top of the custom pose, which is applied on top the rest pose. Sets the pose transform for bone bone_idx. Returns the overall transform of the specified bone, with respect to the skeleton. Being relative to the skeleton frame, this is not the actual "global" transform of the bone. Returns the overall transform of the specified bone, with respect to the skeleton, but without any global pose overrides. Being relative to the skeleton frame, this is not the actual "global" transform of the bone. Returns the custom pose of the specified bone. Custom pose is applied on top of the rest pose. If the parameter is null, then the default value is new Godot.Collections.Array {} Skeleton2D parents a hierarchy of objects. It is a requirement of . Skeleton2D holds a reference to the rest pose of its children and acts as a single point of access to its bones. Returns the number of nodes in the node hierarchy parented by Skeleton2D. Returns a from the node hierarchy parented by Skeleton2D. The object to return is identified by the parameter idx. Bones are indexed by descending the node hierarchy from top to bottom, adding the children of each branch before moving to the next sibling. Returns the of a Skeleton2D instance. SkeletonIK is used to place the end bone of a bone chain at a certain point in 3D by rotating all bones in the chain accordingly. A typical scenario for IK in games is to place a characters feet on the ground or a characters hands on a currently hold object. SkeletonIK uses FabrikInverseKinematic internally to solve the bone chain and applies the results to the bones_global_pose_override property for all affected bones in the chain. If fully applied this overwrites any bone transform from s or bone custom poses set by users. The applied amount can be controlled with the interpolation property. # Apply IK effect automatically on every new frame (not the current) skeleton_ik_node.start() # Apply IK effect only on the current frame skeleton_ik_node.start(true) # Stop IK effect and reset bones_global_pose_override on Skeleton skeleton_ik_node.stop() # Apply full IK effect skeleton_ik_node.set_interpolation(1.0) # Apply half IK effect skeleton_ik_node.set_interpolation(0.5) # Apply zero IK effect (a value at or below 0.01 also removes bones_global_pose_override on Skeleton) skeleton_ik_node.set_interpolation(0.0) The name of the current root bone, the first bone in the IK chain. The name of the current tip bone, the last bone in the IK chain placed at the transform (or if defined). Interpolation value for how much the IK results are applied to the current skeleton bone chain. A value of 1.0 will overwrite all skeleton bone transforms completely while a value of 0.0 will visually disable the SkeletonIK. A value at or below 0.01 also calls . First target of the IK chain where the tip bone is placed and, if is true, how the tip bone is rotated. If a path is available the nodes transform is used instead and this property is ignored. If true overwrites the rotation of the tip bone with the rotation of the (or if defined). If true, instructs the IK solver to consider the secondary magnet target (pole target) when calculating the bone chain. Use the magnet position (pole target) to control the bending of the IK chain. Secondary target position (first is property or ) for the IK chain. Use magnet position (pole target) to control the bending of the IK chain. Only works if the bone chain has more than 2 bones. The middle chain bone position will be linearly interpolated with the magnet position. Target node for the IK chain. If available, the node's current is used instead of the property. The minimum distance between bone and goal target. If the distance is below this value, the IK solver stops further iterations. Number of iteration loops used by the IK solver to produce more accurate (and elegant) bone chain results. Returns the parent Node that was present when SkeletonIK entered the . Returns null if the parent node was not a Node when SkeletonIK entered the . Returns true if SkeletonIK is applying IK effects on continues frames to the bones. Returns false if SkeletonIK is stopped or was used with the one_time parameter set to true. Starts applying IK effects on each frame to the bones but will only take effect starting on the next frame. If one_time is true, this will take effect immediately but also reset on the next frame. Stops applying IK effects on each frame to the bones and also calls to remove existing overrides on all bones. The base class for and . Radiance texture size is 32×32 pixels. Radiance texture size is 64×64 pixels. Radiance texture size is 128×128 pixels. Radiance texture size is 256×256 pixels. Radiance texture size is 512×512 pixels. Radiance texture size is 1024×1024 pixels. Note: is not exposed in the inspector as it is known to cause GPU hangs on certain systems. Radiance texture size is 2048×2048 pixels. Note: is not exposed in the inspector as it is known to cause GPU hangs on certain systems. Represents the size of the enum. The 's radiance map size. The higher the radiance map size, the more detailed the lighting from the will be. See constants for values. Note: You will only benefit from high radiance sizes if you have perfectly sharp reflective surfaces in your project and are not using s or s. For most projects, keeping to the default value is the best compromise between visuals and performance. Be careful when using high radiance size values as these can cause crashes on low-end GPUs. Base class for GUI sliders. Note: The Range.changed and Range.value_changed signals are part of the class which this class inherits from. If true, the slider can be interacted with. If false, the value can be changed only by code. If true, the value can be changed using the mouse wheel. Number of ticks displayed on the slider, including border ticks. Ticks are uniformly-distributed value markers. If true, the slider will display ticks for minimum and maximum values. Slides across the X axis of the pivot object. See also . The maximum difference between the pivot points on their X axis before damping happens. The minimum difference between the pivot points on their X axis before damping happens. A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. The amount of restitution once the limits are surpassed. The lower, the more velocityenergy gets lost. The amount of damping once the slider limits are surpassed. A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. The amount of restitution inside the slider limits. The amount of damping inside the slider limits. A factor applied to the movement across axes orthogonal to the slider. The amount of restitution when movement is across axes orthogonal to the slider. The amount of damping when movement is across axes orthogonal to the slider. The upper limit of rotation in the slider. The lower limit of rotation in the slider. A factor applied to the all rotation once the limit is surpassed. The amount of restitution of the rotation when the limit is surpassed. The amount of damping of the rotation when the limit is surpassed. A factor applied to the all rotation in the limits. The amount of restitution of the rotation in the limits. The amount of damping of the rotation in the limits. A factor applied to the all rotation across axes orthogonal to the slider. The amount of restitution of the rotation across axes orthogonal to the slider. The amount of damping of the rotation across axes orthogonal to the slider. Represents the size of the enum. The maximum difference between the pivot points on their X axis before damping happens. The minimum difference between the pivot points on their X axis before damping happens. A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. The amount of restitution once the limits are surpassed. The lower, the more velocity-energy gets lost. The amount of damping that happens once the limit defined by and is surpassed. A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. The amount of restitution inside the slider limits. The amount of damping inside the slider limits. A factor applied to the movement across axes orthogonal to the slider. The amount of restitution when movement is across axes orthogonal to the slider. The amount of damping when movement is across axes orthogonal to the slider. The upper limit of rotation in the slider. The lower limit of rotation in the slider. A factor applied to the all rotation once the limit is surpassed. Makes all rotation slower when between 0 and 1. The amount of restitution of the rotation when the limit is surpassed. Does not affect damping. The amount of damping of the rotation when the limit is surpassed. A lower damping value allows a rotation initiated by body A to travel to body B slower. A factor applied to the all rotation in the limits. The amount of restitution of the rotation in the limits. The amount of damping of the rotation in the limits. A factor applied to the all rotation across axes orthogonal to the slider. The amount of restitution of the rotation across axes orthogonal to the slider. The amount of damping of the rotation across axes orthogonal to the slider. A deformable physics body. Used to create elastic or deformable objects such as cloth, rubber, or other flexible materials. The physics layers this SoftBody is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See Collision layers and masks in the documentation for more information. The physics layers this SoftBody scans for collisions. See Collision layers and masks in the documentation for more information. to a this SoftBody should avoid clipping. Increasing this value will improve the resulting simulation, but can affect performance. Use with care. The SoftBody's mass. If true, the will respond to s. Sets individual bits on the collision mask. Use this if you only need to change one layer's value. Returns an individual bit on the collision mask. Sets individual bits on the layer mask. Use this if you only need to change one layer's value. Returns an individual bit on the collision mask. Returns an array of nodes that were added as collision exceptions for this body. Adds a body to the list of bodies that this body can't collide with. Removes a body from the list of bodies that this body can't collide with. Most basic 3D game object, with a 3D and visibility settings. All other 3D game objects inherit from Spatial. Use as a parent node to move, scale, rotate and show/hide children in a 3D project. Affine operations (rotate, scale, translate) happen in parent's local coordinate system, unless the object is set as top-level. Affine operations in this coordinate system correspond to direct affine operations on the 's transform. The word local below refers to this coordinate system. The coordinate system that is attached to the object itself is referred to as object-local coordinate system. Note: Unless otherwise specified, all methods that have angle parameters must have angles specified as radians. To convert degrees to radians, use @GDScript.deg2rad. Spatial nodes receives this notification when their global transform changes. This means that either the current or a parent node changed its transform. In order for to work, users first need to ask for it, with . The notification is also sent if the node is in the editor context and it has a valid gizmo. Spatial nodes receives this notification when they are registered to new resource. Spatial nodes receives this notification when they are unregistered from current resource. Spatial nodes receives this notification when their visibility changes. World space (global) of this node. Local translation of this node. Rotation part of the local transformation in degrees, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). Rotation part of the local transformation in radians, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). Note: 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 data structure not because the rotation is a vector, but only because exists as a convenient data-structure to store 3 floating-point numbers. Therefore, applying affine operations on the rotation "vector" is not meaningful. Scale part of the local transformation. Local space of this node, with respect to the parent node. If true, this node is drawn. The node is only visible if all of its antecedents are visible as well (in other words, must return true). The for this node. Used for example in as custom visualization and editing handles in Editor. Returns the parent , or an empty if no parent exists or parent is not of type . Sets whether the node ignores notification that its transformation (global or local) changed. Makes the node ignore its parents transformations. Node transformations are only in global space. Returns whether this node is set as Toplevel, that is whether it ignores its parent nodes transformations. Sets whether the node uses a scale of (1, 1, 1) or its local transformation scale. Changes to the local transformation scale are preserved. Returns whether this node uses a scale of (1, 1, 1) or its local transformation scale. Returns the current resource this node is registered to. 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. Updates the of this node. Returns true if the node is present in the , its property is true and all its antecedents are also visible. If any antecedent is hidden, this node will not be visible in the scene tree. Enables rendering of this node. Changes to true. Disables rendering of this node. Changes to false. Sets whether the node notifies about its local transformation changes. will not propagate this by default. Returns whether node notifies about its local transformation changes. will not propagate this by default. Sets whether the node notifies about its global and local transformation changes. will not propagate this by default, unless it is in the editor context and it has a valid gizmo. Returns whether the node notifies about its global and local transformation changes. will not propagate this by default. Rotates the local transformation around axis, a unit , by specified angle in radians. Rotates the global (world) transformation around axis, a unit , by specified angle in radians. The rotation axis is in global coordinate system. Scales the global (world) transformation by the given scale factors. Moves the global (world) transformation by offset. The offset is in global coordinate system. Rotates the local transformation around axis, a unit , by specified angle in radians. The rotation axis is in object-local coordinate system. Scales the local transformation by given 3D scale factors in object-local coordinate system. Changes the node's position by the given offset in local space. Rotates the local transformation around the X axis by angle in radians. Rotates the local transformation around the Y axis by angle in radians. Rotates the local transformation around the Z axis by angle in radians. Changes the node's position by the given offset . Note that the translation offset is affected by the node's scale, so if scaled by e.g. (10, 1, 1), a translation by an offset of (2, 0, 0) would actually add 20 (2 * 10) to the X coordinate. Resets this node's transformations (like scale, skew and taper) preserving its rotation and translation by performing Gram-Schmidt orthonormalization on this node's . Reset all transformations for this node (sets its to the identity matrix). Rotates itself so that the local -Z axis points towards the target position. The transform will first be rotated around the given up vector, and then fully aligned to the target by a further rotation around an axis perpendicular to both the target and up vectors. Operations take place in global space. Moves the node to the specified position, and then rotates itself to point toward the target as per . Operations take place in global space. Transforms global_point from world space to this node's local space. Transforms local_point from this node's local space to world space. This provides a default material with a wide variety of rendering features and properties without the need to write shader code. See the tutorial below for details. Adds the emission color to the color from the emission texture. Multiplies the emission color by the color from the emission texture. Default diffuse scattering algorithm. Diffuse scattering ignores roughness. Extends Lambert to cover more than 90 degrees when roughness increases. Attempts to use roughness to emulate microsurfacing. Uses a hard cut for lighting, with smoothing affected by roughness. Default specular blob. Older specular algorithm, included for compatibility. Older specular algorithm, included for compatibility. Toon blob which changes size based on roughness. No specular blob. Constant for setting . Constant for setting . Constant for setting . Constant for setting . Constant for setting . Constant for setting . Constant for setting . Constant for setting . Constant for setting . Constant for setting . Constant for setting . Constant for setting . Represents the size of the enum. No lighting is used on the object. Color comes directly from ALBEDO. Lighting is calculated per-vertex rather than per-pixel. This can be used to increase the speed of the shader at the cost of quality. Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it. Set ALBEDO to the per-vertex color specified in the mesh. Vertex color is in sRGB space and needs to be converted to linear. Only applies in the GLES3 renderer. Uses point size to alter the size of primitive points. Also changes the albedo texture lookup to use POINT_COORD instead of UV. Object is scaled by depth so that it always appears the same size on screen. Shader will keep the scale set for the mesh. Otherwise the scale is lost when billboarding. Only applies when is . Use triplanar texture lookup for all texture lookups that would normally use UV. Use triplanar texture lookup for all texture lookups that would normally use UV2. Use UV2 coordinates to look up from the . Use UV2 coordinates to look up from the . Use alpha scissor. Set by . Use world coordinates in the triplanar texture lookup instead of local coordinates. Forces the shader to convert albedo from sRGB space to linear space. Disables receiving shadows from other objects. Disables receiving ambient light. Ensures that normals appear correct, even with non-uniform scaling. Enables the shadow to opacity feature. Represents the size of the enum. Default cull mode. The back of the object is culled when not visible. The front of the object is culled when not visible. No culling is performed. Use UV with the detail texture. Use UV2 with the detail texture. Do not use distance fade. Smoothly fades the object out based on each pixel's distance from the camera using the alpha channel. Smoothly fades the object out based on each pixel's distance from the camera using a dither approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware this can be faster than . Smoothly fades the object out based on the object's distance from the camera using a dither approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware this can be faster than . Billboard mode is disabled. The object's Z axis will always face the camera. The object's X axis will always face the camera. Used for particle systems when assigned to and nodes. Enables particles_anim_* properties. The or should also be set to a positive value for the animation to play. Default depth draw mode. Depth is drawn only for opaque objects. Depth draw is calculated for both opaque and transparent objects. No depth draw. For transparent objects, an opaque pass is made first with the opaque parts, then transparency is drawn. Used to read from the red channel of a texture. Used to read from the green channel of a texture. Used to read from the blue channel of a texture. Used to read from the alpha channel of a texture. Currently unused. Default blend mode. The color of the object is blended over the background based on the object's alpha value. The color of the object is added to the background. The color of the object is subtracted from the background. The color of the object is multiplied by the background. Texture specifying per-pixel color. Texture specifying per-pixel metallic value. Texture specifying per-pixel roughness value. Texture specifying per-pixel emission color. Texture specifying per-pixel normal vector. Texture specifying per-pixel rim value. Texture specifying per-pixel clearcoat value. Texture specifying per-pixel flowmap direction for use with . Texture specifying per-pixel ambient occlusion value. Texture specifying per-pixel depth. Texture specifying per-pixel subsurface scattering. Texture specifying per-pixel transmission color. Texture specifying per-pixel refraction strength. Texture specifying per-pixel detail mask blending value. Texture specifying per-pixel detail color. Texture specifying per-pixel detail normal. Represents the size of the enum. If true, transparency is enabled on the body. See also . If true, enables the "shadow to opacity" render mode where lighting modifies the alpha so shadowed areas are opaque and non-shadowed areas are transparent. Useful for overlaying shadows onto a camera feed in AR. If true, the object is unaffected by lighting. If true, lighting is calculated per vertex rather than per pixel. This may increase performance on low-end devices. If true, depth testing is disabled and the object will be drawn in render order. If true, render point size can be changed. Note: this is only effective for objects whose geometry is point-based rather than triangle-based. See also . If true, triplanar mapping is calculated in world space rather than object local space. See also . If true, the object is rendered at the same size regardless of distance. Forces a conversion of the from sRGB space to linear space. If true, the object receives no shadow that would otherwise be cast onto it. If true, the object receives no ambient light. If true, the shader will compute extra operations to make sure the normal stays correct when using a non-uniform scale. Only enable if using non-uniform scaling. If true, the vertex color is used as albedo color. If true, the model's vertex colors are processed as sRGB mode. The algorithm used for diffuse light scattering. See . The method for rendering the specular blob. See . The material's blend mode. Note: Values other than Mix force the object into the transparent pipeline. See . Which side of the object is not drawn when backfaces are rendered. See . Determines when depth rendering takes place. See . See also . Currently unimplemented in Godot. The point size in pixels. See . Controls how the object faces the camera. See . Note: Billboard mode is not suitable for VR because the left-right vector of the camera is not horizontal when the screen is attached to your head instead of on the table. See GitHub issue #41567 for details. If true, the shader will keep the scale set for the mesh. Otherwise the scale is lost when billboarding. Only applies when is . If true, enables the vertex grow setting. See . Grows object vertices in the direction of their normals. If true, the shader will discard all pixels that have an alpha value less than . Threshold at which the alpha scissor will discard values. The number of horizontal frames in the particle sprite sheet. Only enabled when using . See . The number of vertical frames in the particle sprite sheet. Only enabled when using . See . If true, particle animations are looped. Only enabled when using . See . The material's base color. Texture to multiply by . Used for basic texturing of objects. A high value makes the material appear more like a metal. Non-metals use their albedo as the diffuse color and add diffuse to the specular reflection. With non-metals, the reflection appears on top of the albedo color. Metals use their albedo as a multiplier to the specular reflection and set the diffuse color to black resulting in a tinted reflection. Materials work better when fully metal or fully non-metal, values between 0 and 1 should only be used for blending between metal and non-metal sections. To alter the amount of reflection use . Sets the size of the specular lobe. The specular lobe is the bright spot that is reflected from light sources. Note: unlike , this is not energy-conserving, so it should be left at 0.5 in most cases. See also . Texture used to specify metallic for an object. This is multiplied by . Specifies the channel of the in which the metallic information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. Surface reflection. A value of 0 represents a perfect mirror while a value of 1 completely blurs the reflection. See also . Texture used to control the roughness per-pixel. Multiplied by . Specifies the channel of the in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. If true, the body emits light. Emitting light makes the object appear brighter. The object can also cast light on other objects if a or is used and this object is used in baked lighting. The emitted light's color. See . The emitted light's strength. See . Sets how interacts with . Can either add or multiply. See for options. Use UV2 to read from the . Texture that specifies how much surface emits light at a given point. If true, normal mapping is enabled. The strength of the normal map's effect. Texture used to specify the normal at a given pixel. The normal_texture only uses the red and green channels. The normal read from normal_texture is oriented around the surface normal provided by the . Note: Godot expects the normal map to use X+, Y-, and Z+ coordinates. See this page for a comparison of normal map coordinates expected by popular engines. If true, rim effect is enabled. Rim lighting increases the brightness at glancing angles on an object. Note: Rim lighting is not visible if the material has set to true. Sets the strength of the rim lighting effect. The amount of to blend light and albedo color when rendering rim effect. If 0 the light color is used, while 1 means albedo color is used. An intermediate value generally works best. Texture used to set the strength of the rim lighting effect per-pixel. Multiplied by . If true, clearcoat rendering is enabled. Adds a secondary transparent pass to the lighting calculation resulting in an added specular blob. This makes materials appear as if they have a clear layer on them that can be either glossy or rough. Note: Clearcoat rendering is not visible if the material has set to true. Sets the strength of the clearcoat effect. Setting to 0 looks the same as disabling the clearcoat effect. Sets the roughness of the clearcoat pass. A higher value results in a smoother clearcoat while a lower value results in a rougher clearcoat. Texture that defines the strength of the clearcoat effect and the glossiness of the clearcoat. Strength is specified in the red channel while glossiness is specified in the green channel. If true, anisotropy is enabled. Changes the shape of the specular blob and aligns it to tangent space. Mesh tangents are needed for this to work. If the mesh does not contain tangents the anisotropy effect will appear broken. The strength of the anisotropy effect. Texture that offsets the tangent map for anisotropy calculations. If true, ambient occlusion is enabled. Ambient occlusion darkens areas based on the . Amount that ambient occlusion affects lighting from lights. If 0, ambient occlusion only affects ambient light. If 1, ambient occlusion affects lights just as much as it affects ambient light. This can be used to impact the strength of the ambient occlusion effect, but typically looks unrealistic. Texture that defines the amount of ambient occlusion for a given point on the object. If true, use UV2 coordinates to look up from the . Specifies the channel of the in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. If true, depth mapping is enabled (also called "parallax mapping" or "height mapping"). See also . Note: Depth mapping is not supported if triplanar mapping is used on the same material. The value of will be ignored if is enabled. Scales the depth offset effect. A higher number will create a larger depth. If true, the shader will read depth texture at multiple points along the view ray to determine occlusion and parrallax. This can be very performance demanding, but results in more realistic looking depth mapping. Number of layers to use when using and the view direction is parallel to the surface of the object. A higher number will be more performance demanding while a lower number may not look as crisp. Number of layers to use when using and the view direction is perpendicular to the surface of the object. A higher number will be more performance demanding while a lower number may not look as crisp. If true, direction of the tangent is flipped before using in the depth effect. This may be necessary if you have encoded your tangents in a way that is conflicting with the depth effect. If true, direction of the binormal is flipped before using in the depth effect. This may be necessary if you have encoded your binormals in a way that is conflicting with the depth effect. Texture used to determine depth at a given pixel. Depth is always stored in the red channel. If true, subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges. The strength of the subsurface scattering effect. Texture used to control the subsurface scattering strength. Stored in the red texture channel. Multiplied by . If true, the transmission effect is enabled. The color used by the transmission effect. Represents the light passing through an object. Texture used to control the transmission effect per-pixel. Added to . If true, the refraction effect is enabled. Distorts transparency based on light from behind the object. The strength of the refraction effect. Texture that controls the strength of the refraction per-pixel. Multiplied by . Specifies the channel of the in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. If true, enables the detail overlay. Detail is a second texture that gets mixed over the surface of the object based on . This can be used to add variation to objects, or to blend between two different albedo/normal textures. Texture used to specify how the detail textures get blended with the base textures. Specifies how the should blend with the current ALBEDO. See for options. Specifies whether to use UV or UV2 for the detail layer. See for options. Texture that specifies the color of the detail overlay. Texture that specifies the per-pixel normal of the detail overlay. Note: Godot expects the normal map to use X+, Y-, and Z+ coordinates. See this page for a comparison of normal map coordinates expected by popular engines. How much to scale the UV coordinates. This is multiplied by UV in the vertex function. How much to offset the UV coordinates. This amount will be added to UV in the vertex function. This can be used to offset a texture. If true, instead of using UV textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing. A lower number blends the texture more softly while a higher number blends the texture more sharply. How much to scale the UV2 coordinates. This is multiplied by UV2 in the vertex function. How much to offset the UV2 coordinates. This amount will be added to UV2 in the vertex function. This can be used to offset a texture. If true, instead of using UV2 textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing. A lower number blends the texture more softly while a higher number blends the texture more sharply. If true, the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object. Distance over which the fade effect takes place. The larger the distance the longer it takes for an object to fade. Specifies which type of fade to use. Can be any of the s. Distance at which the object starts to become visible. If the object is less than this distance away, it will be invisible. Note: If distance_fade_min_distance is greater than distance_fade_max_distance, the behavior will be reversed. The object will start to fade away at distance_fade_max_distance and will fully disappear once it reaches distance_fade_min_distance. Distance at which the object appears fully opaque. Note: If distance_fade_max_distance is less than distance_fade_min_distance, the behavior will be reversed. The object will start to fade away at distance_fade_max_distance and will fully disappear once it reaches distance_fade_min_distance. If true, enables the specified flag. Flags are optional behaviour that can be turned on and off. Only one flag can be enabled at a time with this function, the flag enumerators cannot be bit-masked together to enable or disable multiple flags at once. Flags can also be enabled by setting the corresponding member to true. See enumerator for options. Returns true, if the specified flag is enabled. See enumerator for options. If true, enables the specified . Many features that are available in s need to be enabled before use. This way the cost for using the feature is only incurred when specified. Features can also be enabled by setting the corresponding member to true. Returns true, if the specified is enabled. Sets the to be used by the specified . This function is called when setting members ending in *_texture. Returns the associated with the specified . Class representing a spherical . Radius of sphere. Full height of the sphere. Number of radial segments on the sphere. Number of segments along the height of the sphere. If true, a hemisphere is created rather than a full sphere. Note: To get a regular hemisphere, the height and radius of the sphere must be equal. Sphere shape for 3D collisions, which can be set into a or . This shape is useful for modeling sphere-like 3D objects. The sphere's radius. The shape's diameter is double the radius. SpinBox is a numerical input text field. It allows entering integers and floats. Example: var spin_box = SpinBox.new() add_child(spin_box) var line_edit = spin_box.get_line_edit() line_edit.context_menu_enabled = false spin_box.align = LineEdit.ALIGN_RIGHT The above code will create a , disable context menu on it and set the text alignment to right. See class for more options over the . Note: relies on an underlying node. To theme a 's background, add theme items for and customize them. Sets the text alignment of the . If true, the will be editable. Otherwise, it will be read only. Adds the specified prefix string before the numerical value of the . Adds the specified suffix string after the numerical value of the . Applies the current value of this . Returns the instance from this . You can use it to access properties and methods of . Container for splitting two s vertically or horizontally, with a grabber that allows adjusting the split offset or ratio. The split dragger is visible when the cursor hovers it. The split dragger is never visible. The split dragger is never visible and its space collapsed. The initial offset of the splitting between the two s, with 0 being at the end of the first . If true, the area of the first will be collapsed and the dragger will be disabled. Determines the dragger's visibility. See for details. Clamps the value to not go outside the currently possible minimal and maximum values. A Spotlight is a type of node that emits lights in a specific direction, in the shape of a cone. The light is attenuated through the distance. This attenuation can be configured by changing the energy, radius and attenuation parameters of . Note: By default, only 32 SpotLights may affect a single mesh resource at once. Consider splitting your level into several meshes to decrease the likelihood that more than 32 lights will affect the same mesh resource. Splitting the level mesh will also improve frustum culling effectiveness, leading to greater performance. If you need to use more lights per mesh, you can increase at the cost of shader compilation times. The maximal range that can be reached by the spotlight. Note that the effectively lit area may appear to be smaller depending on the in use. No matter the in use, the light will never reach anything outside this range. The spotlight's light energy attenuation curve. The spotlight's angle in degrees. The spotlight's angular attenuation curve. The SpringArm node is a node that casts a ray (or collision shape) along its z axis and moves all its direct children to the collision point, minus a margin. The most common use case for this is to make a 3rd person camera that reacts to collisions in the environment. The SpringArm will either cast a ray, or if a shape is given, it will cast the shape in the direction of its z axis. If you use the SpringArm as a camera controller for your player, you might need to exclude the player's collider from the SpringArm's collision check. The layers against which the collision check shall be done. See Collision layers and masks in the documentation for more information. The to use for the SpringArm. When the shape is set, the SpringArm will cast the on its z axis instead of performing a ray cast. The maximum extent of the SpringArm. This is used as a length for both the ray and the shape cast used internally to calculate the desired position of the SpringArm's child nodes. To know more about how to perform a shape cast or a ray cast, please consult the documentation. When the collision check is made, a candidate length for the SpringArm is given. The margin is then subtracted to this length and the translation is applied to the child objects of the SpringArm. This margin is useful for when the SpringArm has a as a child node: without the margin, the would be placed on the exact point of collision, while with the margin the would be placed close to the point of collision. Returns the spring arm's current length. Adds the object with the given to the list of objects excluded from the collision check. Removes the given from the list of objects excluded from the collision check. Clears the list of objects excluded from the collision check. A node that displays a 2D texture. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation. object to draw. The normal map gives depth to the Sprite. Note: Godot expects the normal map to use X+, Y-, and Z+ coordinates. See this page for a comparison of normal map coordinates expected by popular engines. If true, texture is centered. The texture's drawing offset. If true, texture is flipped horizontally. If true, texture is flipped vertically. The number of columns in the sprite sheet. The number of rows in the sprite sheet. Current frame to display from sprite sheet. or must be greater than 1. Coordinates of the frame to display from sprite sheet. This is as an alias for the property. or must be greater than 1. If true, texture is cut from a larger atlas texture. See . The region of the atlas texture to display. must be true. If true, the outermost pixels get blurred out. Returns true, if the pixel at the given position is opaque and false in other case. Note: It also returns false, if the sprite's texture is null or if the given position is invalid. Returns a representing the Sprite's boundary in local coordinates. Can be used to detect if the Sprite was clicked. Example: func _input(event): if event is InputEventMouseButton and event.pressed and event.button_index == BUTTON_LEFT: if get_rect().has_point(to_local(event.position)): print("A click!") A node that displays a 2D texture in a 3D environment. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation. object to draw. If is used, this will be overridden. The number of columns in the sprite sheet. The number of rows in the sprite sheet. Current frame to display from sprite sheet. or must be greater than 1. Coordinates of the frame to display from sprite sheet. This is as an alias for the property. or must be greater than 1. If true, texture will be cut from a larger atlas texture. See . The region of the atlas texture to display. must be true. A node that displays 2D texture information in a 3D environment. If set, the texture's transparency and the opacity are used to make those parts of the sprite invisible. If set, lights in the environment affect the sprite. If set, texture can be seen from the back as well, if not, it is invisible when looking at it from behind. Represents the size of the enum. If true, texture will be centered. The texture's drawing offset. If true, texture is flipped horizontally. If true, texture is flipped vertically. A color value that gets multiplied on, could be used for mood-coloring or to simulate the color of light. The objects' visibility on a scale from 0 fully invisible to 1 fully visible. The size of one pixel's width on the sprite to scale it in 3D. The direction in which the front of the texture faces. If true, the texture's transparency and the opacity are used to make those parts of the sprite invisible. If true, the in the has effects on the sprite. If true, texture can be seen from the back as well, if false, it is invisible when looking at it from behind. If true, the specified flag will be enabled. Returns the value of the specified flag. Returns the rectangle representing this sprite. Sprite frame library for . Contains frames and animation data for playback. Note: You can associate a set of normal maps by creating additional resources with a _normal suffix. For example, having 2 resources run and run_normal will make it so the run animation uses the normal map. Compatibility property, always equals to an empty array. Adds a new animation to the library. If true, the named animation exists. Removes the given animation. Changes the animation's name to newname. Returns an array containing the names associated to each animation. Values are placed in alphabetical order. The animation's speed in frames per second. The animation's speed in frames per second. If true, the animation will loop. Returns true if the given animation is configured to loop when it finishes playing. Otherwise, returns false. Adds a frame to the given animation. Returns the number of frames in the animation. Returns the animation's selected frame. Sets the texture of the given frame. Removes the animation's selected frame. Removes all frames from the given animation. Removes all animations. A "default" animation will be created. Static body for 3D physics. A static body is a simple body that is not intended to move. In contrast to , they don't consume any CPU resources as long as they don't move. Additionally, a constant linear or angular velocity can be set for the static body, so even if it doesn't move, it affects other bodies as if it was moving (this is useful for simulating conveyor belts or conveyor wheels). The body's friction, from 0 (frictionless) to 1 (full friction). Deprecated, use instead via . The body's bounciness. Values range from 0 (no bounce) to 1 (full bounciness). Deprecated, use instead via . The physics material override for the body. If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. The body's constant linear velocity. This does not move the body, but affects other bodies that touch it, as if it was in a state of movement. The body's constant angular velocity. This does not rotate the body, but affects other bodies that touch it, as if it was in a state of rotation. Static body for 2D physics. A StaticBody2D is a body that is not intended to move. It is ideal for implementing objects in the environment, such as walls or platforms. Additionally, a constant linear or angular velocity can be set for the static body, which will affect colliding bodies as if it were moving (for example, a conveyor belt). The body's constant linear velocity. This does not move the body, but affects colliding bodies, as if it were moving. The body's constant angular velocity. This does not rotate the body, but affects colliding bodies, as if it were rotating. The body's friction. Values range from 0 (no friction) to 1 (full friction). Deprecated, use instead via . The body's bounciness. Values range from 0 (no bounce) to 1 (full bounciness). Deprecated, use instead via . The physics material override for the body. If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. StreamPeer is an abstraction and base class for stream-based protocols (such as TCP). It provides an API for sending and receiving data through streams as raw data or strings. If true, this will using big-endian format for encoding and decoding. Sends a chunk of data through the connection, blocking if necessary until the data is done sending. This function returns an code. Sends a chunk of data through the connection. If all the data could not be sent at once, only part of it will. This function returns two values, an code and an integer, describing how much data was actually sent. Returns a chunk data with the received bytes. The amount of bytes to be received can be requested in the bytes argument. If not enough bytes are available, the function will block until the desired amount is received. This function returns two values, an code and a data array. Returns a chunk data with the received bytes. The amount of bytes to be received can be requested in the "bytes" argument. If not enough bytes are available, the function will return how many were actually received. This function returns two values, an code, and a data array. Returns the amount of bytes this has available. Puts a signed byte into the stream. Puts an unsigned byte into the stream. Puts a signed 16-bit value into the stream. Puts an unsigned 16-bit value into the stream. Puts a signed 32-bit value into the stream. Puts an unsigned 32-bit value into the stream. Puts a signed 64-bit value into the stream. Puts an unsigned 64-bit value into the stream. Puts a single-precision float into the stream. Puts a double-precision float into the stream. Puts a zero-terminated ASCII string into the stream prepended by a 32-bit unsigned integer representing its size. Note: To put an ASCII string without prepending its size, you can use : put_data("Hello world".to_ascii()) Puts a zero-terminated UTF-8 string into the stream prepended by a 32 bits unsigned integer representing its size. Note: To put an UTF-8 string without prepending its size, you can use : put_data("Hello world".to_utf8()) Puts a Variant into the stream. If full_objects is true encoding objects is allowed (and can potentially include code). Gets a signed byte from the stream. Gets an unsigned byte from the stream. Gets a signed 16-bit value from the stream. Gets an unsigned 16-bit value from the stream. Gets a signed 32-bit value from the stream. Gets an unsigned 32-bit value from the stream. Gets a signed 64-bit value from the stream. Gets an unsigned 64-bit value from the stream. Gets a single-precision float from the stream. Gets a double-precision float from the stream. Gets a string with byte-length bytes from the stream. If bytes is negative (default) the length will be read from the stream using the reverse process of . Gets an UTF-8 string with byte-length bytes from the stream (this decodes the string sent as UTF-8). If bytes is negative (default) the length will be read from the stream using the reverse process of . Gets a Variant from the stream. If allow_objects is true, decoding objects is allowed. Warning: Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. SSL stream peer. This object can be used to connect to an SSL server or accept a single SSL client connection. A status representing a that is disconnected. A status representing a during handshaking. A status representing a that is connected to a host. A status representing a in error state. An error status that shows a mismatch in the SSL certificate domain presented by the host and the domain requested for validation. Poll the connection to check for incoming bytes. Call this right before for it to work properly. Accepts a peer connection as a server using the given private_key and providing the given certificate to the client. You can pass the optional chain parameter to provide additional CA chain information along with the certificate. Connects to a peer using an underlying stream. If validate_certs is true, will validate that the certificate presented by the peer matches the for_hostname. Note: Specifying a custom valid_certificate is not supported in HTML5 exports due to browsers restrictions. Returns the status of the connection. See for values. Disconnects from host. TCP stream peer. This object can be used to connect to TCP servers, or also is returned by a TCP server. The initial status of the . This is also the status after disconnecting. A status representing a that is connecting to a host. A status representing a that is connected to a host. A status representing a in error state. Connects to the specified host:port pair. A hostname will be resolved if valid. Returns on success or on failure. Returns true if this peer is currently connected or is connecting to a host, false otherwise. Returns the status of the connection, see . Returns the IP of this peer. Returns the port of this peer. Disconnects from host. If enabled is true, packets will be sent immediately. If enabled is false (the default), packet transfers will be delayed and combined using Nagle's algorithm. Note: 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. A texture that is loaded from a .stex file. The StreamTexture's file path to a .stex file. Loads the texture from the given path. StyleBox is that provides an abstract base class for drawing stylized boxes for the UI. StyleBoxes are used for drawing the styles of buttons, line edit backgrounds, tree backgrounds, etc. and also for testing a transparency mask for pointer signals. If mask test fails on a StyleBox assigned as mask to a control, clicks and motion signals will go through it to the one below. Note: For children of that have Theme Properties, the focus is displayed over the normal, hover or pressed . This makes the focus more reusable across different nodes. The left margin for the contents of this style box.Increasing this value reduces the space available to the contents from the left. Refer to for extra considerations. The right margin for the contents of this style box. Increasing this value reduces the space available to the contents from the right. Refer to for extra considerations. The top margin for the contents of this style box. Increasing this value reduces the space available to the contents from the top. Refer to for extra considerations. The bottom margin for the contents of this style box. Increasing this value reduces the space available to the contents from the bottom. If this value is negative, it is ignored and a child-specific margin is used instead. For example for the border thickness (if any) is used instead. It is up to the code using this style box to decide what these contents are: for example, a respects this content margin for the textual contents of the button. should be used to fetch this value as consumer instead of reading these properties directly. This is because it correctly respects negative values and the fallback mentioned above. Test a position in a rectangle, return whether it passes the mask test. Sets the default value of the specified to given offset in pixels. Returns the default value of the specified . Returns the content margin offset for the specified . Positive values reduce size inwards, unlike 's margin values. Returns the minimum size that this stylebox can be shrunk to. Returns the size of this without the margins. Returns the "offset" of a stylebox. This helper function returns a value equivalent to Vector2(style.get_margin(MARGIN_LEFT), style.get_margin(MARGIN_TOP)). Returns the that handles its or callback at this moment. Draws this stylebox using a with given . You can get a value using on a -derived node. Empty stylebox (really does not display anything). This can be used to achieve all kinds of looks without the need of a texture. The following properties are customizable: - Color - Border width (individual width for each border) - Rounded corners (individual radius for each corner) - Shadow (with blur and offset) Setting corner radius to high values is allowed. As soon as corners overlap, the stylebox will switch to a relative system. Example: height = 30 corner_radius_top_left = 50 corner_radius_bottom_left = 100 The relative system now would take the 1:2 ratio of the two left corners to calculate the actual corner width. Both corners added will never be more than the height. Result: corner_radius_top_left: 10 corner_radius_bottom_left: 20 The background color of the stylebox. Toggles drawing of the inner part of the stylebox. Border width for the left border. Border width for the top border. Border width for the right border. Border width for the bottom border. Sets the color of the border. If true, the border will fade into the background color. The top-left corner's radius. If 0, the corner is not rounded. The top-right corner's radius. If 0, the corner is not rounded. The bottom-right corner's radius. If 0, the corner is not rounded. The bottom-left corner's radius. If 0, the corner is not rounded. This sets the number of vertices used for each corner. Higher values result in rounder corners but take more processing power to compute. When choosing a value, you should take the corner radius () into account. For corner radii less than 10, 4 or 5 should be enough. For corner radii less than 30, values between 8 and 12 should be enough. A corner detail of 1 will result in chamfered corners instead of rounded corners, which is useful for some artistic effects. Expands the stylebox outside of the control rect on the left edge. Useful in combination with to draw a border outside the control rect. Expands the stylebox outside of the control rect on the right edge. Useful in combination with to draw a border outside the control rect. Expands the stylebox outside of the control rect on the top edge. Useful in combination with to draw a border outside the control rect. Expands the stylebox outside of the control rect on the bottom edge. Useful in combination with to draw a border outside the control rect. The color of the shadow. This has no effect if is lower than 1. The shadow size in pixels. The shadow offset in pixels. Adjusts the position of the shadow relatively to the stylebox. Antialiasing draws a small ring around the edges, which fades to transparency. As a result, edges look much smoother. This is only noticeable when using rounded corners. This changes the size of the faded ring. Higher values can be used to achieve a "blurry" effect. Sets the border width to width pixels for all margins. Returns the smallest border width out of all four borders. Sets the border width to width pixels for the given margin. See for possible values. Returns the given margin's border width. See for possible values. Sets the corner radius for each corner to radius_top_left, radius_top_right, radius_bottom_right, and radius_bottom_left pixels. Sets the corner radius to radius pixels for all corners. Sets the corner radius to radius pixels for the given corner. See for possible values. Returns the given corner's radius. See for possible values. Sets the expand margin to size pixels for the given margin. See for possible values. Sets the expand margin to size pixels for all margins. Sets the expand margin for each margin to size_left, size_top, size_right, and size_bottom pixels. Returns the size of the given margin's expand margin. See for possible values. that displays a single line of a given color and thickness. It can be used to draw things like separators. The line's color. The number of pixels the line will extend before the 's bounds. If set to a negative value, the line will begin inside the 's bounds. The number of pixels the line will extend past the 's bounds. If set to a negative value, the line will end inside the 's bounds. The line's thickness in pixels. If true, the line will be vertical. If false, the line will be horizontal. Texture-based nine-patch , in a way similar to . This stylebox performs a 3×3 scaling of a texture, where only the center cell is fully stretched. This makes it possible to design bordered styles regardless of the stylebox's size. Stretch the stylebox's texture. This results in visible distortion unless the texture size matches the stylebox's size perfectly. Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. Unlike , the texture may be slightly stretched to make the nine-patch texture tile seamlessly. The texture to use when drawing this style box. The normal map to use when drawing this style box. Note: Godot expects the normal map to use X+, Y-, and Z+ coordinates. See this page for a comparison of normal map coordinates expected by popular engines. Species a sub-region of the texture to use. This is equivalent to first wrapping the texture in an with the same region. Increases the left margin of the 3×3 texture box. A higher value means more of the source texture is considered to be part of the left border of the 3×3 box. This is also the value used as fallback for if it is negative. Increases the right margin of the 3×3 texture box. A higher value means more of the source texture is considered to be part of the right border of the 3×3 box. This is also the value used as fallback for if it is negative. Increases the top margin of the 3×3 texture box. A higher value means more of the source texture is considered to be part of the top border of the 3×3 box. This is also the value used as fallback for if it is negative. Increases the bottom margin of the 3×3 texture box. A higher value means more of the source texture is considered to be part of the bottom border of the 3×3 box. This is also the value used as fallback for if it is negative. Expands the left margin of this style box when drawing, causing it to be drawn larger than requested. Expands the right margin of this style box when drawing, causing it to be drawn larger than requested. Expands the top margin of this style box when drawing, causing it to be drawn larger than requested. Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested. Controls how the stylebox's texture will be stretched or tiled horizontally. See for possible values. Controls how the stylebox's texture will be stretched or tiled vertically. See for possible values. Modulates the color of the texture when this style box is drawn. If true, the nine-patch texture's center tile will be drawn. Sets the margin to size pixels for the given margin. See for possible values. Returns the size of the given margin. See for possible values. Sets the expand margin to size pixels for the given margin. See for possible values. Sets the expand margin to size pixels for all margins. Sets the expand margin for each margin to size_left, size_top, size_right, and size_bottom pixels. Returns the size of the given margin's expand margin. See for possible values. The is used to construct a by specifying vertex attributes individually. It can be used to construct a from a script. All properties except indices need to be added before calling . For example, to add vertex colors and UVs: var st = SurfaceTool.new() st.begin(Mesh.PRIMITIVE_TRIANGLES) st.add_color(Color(1, 0, 0)) st.add_uv(Vector2(0, 0)) st.add_vertex(Vector3(0, 0, 0)) The above now contains one vertex of a triangle which has a UV coordinate and a specified . If another vertex were added without calling or , then the last values would be used. Vertex attributes must be passed before calling . Failure to do so will result in an error when committing the vertex information to a mesh. Additionally, the attributes used before the first vertex is added determine the format of the mesh. For example, if you only add UVs to the first vertex, you cannot add color to any of the subsequent vertices. See also , and for procedural geometry generation. Note: Godot uses clockwise winding order for front faces of triangle primitive modes. Called before adding any vertices. Takes the primitive type as an argument (e.g. ). Specifies the position of current vertex. Should be called after specifying other vertex properties (e.g. Color, UV). Specifies a to use for the next vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. Note: The material must have enabled for the vertex color to be visible. Specifies a normal to use for the next vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. Specifies a tangent to use for the next vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. Specifies a set of UV coordinates to use for the next vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. Specifies an optional second set of UV coordinates to use for the next vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. Specifies an array of bones to use for the next vertex. bones must contain 4 integers. Specifies weight values to use for the next vertex. weights must contain 4 values. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. Specifies whether the current vertex (if using only vertex arrays) or current index (if also using index arrays) should use smooth normals for normal calculation. Inserts a triangle fan made of array data into being constructed. Requires the primitive type be set to . If the parameter is null, then the default value is new Vector2[] {} If the parameter is null, then the default value is new Color[] {} If the parameter is null, then the default value is new Vector2[] {} If the parameter is null, then the default value is new Vector3[] {} If the parameter is null, then the default value is new Godot.Collections.Array {} Adds an index to index array if you are using indexed vertices. Does not need to be called before adding vertices. Shrinks the vertex array by creating an index array. This can improve performance by avoiding vertex reuse. Removes the index array by expanding the vertex array. Generates normals from vertices so you do not have to do it manually. If flip is true, the resulting normals will be inverted. should be called after generating geometry and before committing the mesh using or . Note: only works if the primitive type to be set to . Generates a tangent vector for each vertex. Requires that each vertex have UVs and normals set already. Sets to be used by the you are constructing. Clear all information passed into the surface tool so far. Creates a vertex array from an existing . Creates a vertex array from the specified blend shape of an existing . This can be used to extract a specific pose from a blend shape. Append vertices from a given surface onto the current vertex array with specified . Returns a constructed from current information passed in. If an existing is passed in as an argument, will add an extra surface to the existing . Default flag is . See ARRAY_COMPRESS_* constants in for other flags. Commits the data to the same format used by . This way you can further process the mesh data using the API. A TCP server. Listens to connections on a port and returns a when it gets an incoming connection. Listen on the port binding to bind_address. If bind_address is set as "*" (default), the server will listen on all available addresses (both IPv4 and IPv6). If bind_address is set as "0.0.0.0" (for IPv4) or "::" (for IPv6), the server will listen on all available addresses matching that IP type. If bind_address is set to any valid address (e.g. "192.168.1.101", "::1", etc), the server will only listen on the interface with that addresses (or fail if no interface with the given address exists). Returns true if a connection is available for taking. Returns true if the server is currently listening for connections. If a connection is available, returns a StreamPeerTCP with the connection. Stops listening. Sets the active tab's visible property to the value true. Sets all other children's to false. Ignores non- children. Individual tabs are always visible unless you use and to hide it. To hide only a tab's content, nest the content inside a child , so it receives the 's visibility setting instead. Align the tabs to the left. Align the tabs to the center. Align the tabs to the right. The alignment of all tabs in the tab container. See the constants for details. The current tab index. When set, this index's node's visible property is set to true and all others are set to false. If true, tabs are visible. If false, tabs' content and titles are hidden. If true, all tabs are drawn in front of the panel. If false, inactive tabs are drawn behind the panel. If true, tabs can be rearranged with mouse drag. If true, children nodes that are hidden have their minimum size take into account in the total, instead of only the currently visible one. Returns the number of tabs. Returns the previously active tab index. Returns the child node located at the active tab index. Returns the node from the tab at index tab_idx. Sets a title for the tab at index tab_idx. Tab titles default to the name of the indexed child node, but this can be overridden with . Returns the title of the tab at index tab_idx. Tab titles default to the name of the indexed child node, but this can be overridden with . Sets an icon for the tab at index tab_idx. Returns the for the tab at index tab_idx or null if the tab has no . If disabled is false, hides the tab at index tab_idx. Note: Its title text will remain, unless also removed with . Returns true if the tab at index tab_idx is disabled. If set on a node instance, a popup menu icon appears in the top-right corner of the . Clicking it will expand the node. Returns the node instance if one has been set already with . Defines rearrange group id, choose for each the same value to enable tab drag between . Enable drag with set_drag_to_rearrange_enabled(true). Returns the rearrange group id. Simple tabs control, similar to but is only in charge of drawing tabs, not interacting with children. Never show the close buttons. Only show the close button on the currently active tab. Show the close button on all tabs. Represents the size of the enum. Align the tabs to the left. Align the tabs to the center. Align the tabs to the right. Represents the size of the enum. Select tab at index tab_idx. The alignment of all tabs. See for details. Sets when the close button will appear on the tabs. See for details. if true, the mouse's scroll wheel can be used to navigate the scroll view. If true, tabs can be rearranged with mouse drag. Returns the number of tabs. Returns the previously active tab index. Sets a title for the tab at index tab_idx. Returns the title of the tab at index tab_idx. Tab titles default to the name of the indexed child node, but this can be overridden with . Sets an icon for the tab at index tab_idx. Returns the for the tab at index tab_idx or null if the tab has no . If disabled is false, hides the tab at index tab_idx. Note: Its title text will remain unless it is also removed with . Returns true if the tab at index tab_idx is disabled. Removes the tab at index tab_idx. Adds a new tab. Returns the number of hidden tabs offsetted to the left. Returns true if the offset buttons (the ones that appear when there's not enough space for all tabs) are visible. Moves the scroll view to make the tab visible. Returns tab with local position and size. Moves a tab from from to to. Defines the rearrange group ID. Choose for each the same value to dragging tabs between . Enable drag with set_drag_to_rearrange_enabled(true). Returns the ' rearrange group ID. If true, enables selecting a tab with the right mouse button. Returns true if select with right mouse button is enabled. TextEdit is meant for editing large, multiline text. It also has facilities for editing code, such as syntax highlighting support and multiple levels of undo/redo. Match case when searching. Match whole words when searching. Search from end to beginning. Used to access the result column from . Used to access the result line from . Cuts (copies and clears) the selected text. Copies the selected text. Pastes the clipboard text over the selected text (or at the cursor's position). Erases the whole text. Selects the whole text. Undoes the previous action. Redoes the previous action. Represents the size of the enum. String value of the . If true, read-only mode is enabled. Existing text cannot be modified and new text cannot be added. If true, the line containing the cursor is highlighted. If true, any custom color properties that have been set for this will be visible. If true, line numbers are displayed to the left of the text. If true, the "tab" character will have a visible representation. If true, the "space" character will have a visible representation. If true, the breakpoint gutter is visible. If true, the fold gutter is visible. This enables folding groups of indented lines. If true, all occurrences of the selected text will be highlighted. If true, custom font_color_selected will be used for selected text. If true, a right-click displays the context menu. If true, shortcut keys for context menu items are enabled, even if the context menu is disabled. If true, the native virtual keyboard is shown when focused on platforms that support it. If true, text can be selected. If false, text can not be selected by the user or by the or methods. If true, sets the step of the scrollbars to 0.25 which results in smoother scrolling. Vertical scroll sensitivity. If true, all lines that have been set to hidden by , will not be visible. If true, enables text wrapping when it goes beyond the edge of what is visible. The current vertical scroll value. The current horizontal scroll value. If true, a minimap is shown, providing an outline of your source code. The width, in pixels, of the minimap. If true, the caret displays as a rectangle. If false, the caret displays as a bar. If true, the caret (visual cursor) blinks. Duration (in seconds) of a caret's blinking cycle. If true, a right-click moves the cursor at the mouse position before displaying the context menu. If false, the context menu disregards mouse location. Insert the specified text at the cursor position. Returns the amount of total lines in the text. Returns the text of a specific line. Sets the text for a specific line. Centers the viewport on the line the editing cursor is at. This also resets the value to 0. Moves the cursor at the specified column index. If adjust_viewport is set to true, the viewport will center at the cursor position after the move occurs. Moves the cursor at the specified line index. If adjust_viewport is set to true, the viewport will center at the cursor position after the move occurs. If can_be_hidden is set to true, the specified line can be hidden using . Returns the column the editing cursor is at. Returns the line the editing cursor is at. Returns true when the specified line is marked as safe. If true, marks the line as safe. This will show the line number with the color provided in the safe_line_number_color theme property. Returns true when the specified line is bookmarked. Bookmarks the line if bookmark is true. Deletes the bookmark if bookmark is false. Bookmarks are shown in the . Adds or removes the breakpoint in line. Breakpoints are shown in the . Returns true when the specified line has a breakpoint. Cut's the current selection. Copy's the current text selection. Paste the current selection. Perform selection, from line/column to line/column. If is false, no selection will occur. Select all the text. If is false, no selection will occur. Deselects the current selection. Returns true if the selection is active. Returns the selection begin line. Returns the selection begin column. Returns the selection end line. Returns the selection end column. Returns the text inside the selection. Returns a text with the word under the caret (text cursor) location. Perform a search inside the text. Search flags can be specified in the enum. Returns an empty PoolIntArray if no result was found. Otherwise, the result line and column can be accessed at indices specified in the enum, e.g: var result = search(key, flags, line, column) if result.size() > 0: # Result found. var res_line = result[TextEdit.SEARCH_RESULT_LINE] var res_column = result[TextEdit.SEARCH_RESULT_COLUMN] Perform undo operation. Perform redo operation. Clears the undo history. If true, hides the line of the specified index. Returns whether the line at the specified index is hidden or not. Folds all lines that are possible to be folded (see ). Unhide all lines that were previously set to hidden by . Folds the given line, if possible (see ). Unfolds the given line, if folded. Toggle the folding of the code block at the given line. Returns if the given line is foldable, that is, it has indented lines right below it. Returns whether the line at the specified index is folded or not. Adds a keyword and its . Returns whether the specified keyword has a color set to it or not. Returns the of the specified keyword. Adds color region (given the delimiters) and its colors. Clears all custom syntax coloring information previously added with or . Triggers a right-click menu action by the specified index. See for a list of available indexes. Returns the of this . By default, this menu is displayed when right-clicking on the . Returns an array containing the line number of each breakpoint. Removes all the breakpoints. This will not fire the breakpoint_toggled signal. A texture works by registering an image in the video hardware, which then can be used in 3D models or 2D or GUI . Textures are often created by loading them from a file. See @GDScript.load. is a base for other resources. It cannot be used directly. Note: The maximum texture size is 16384×16384 pixels due to graphics hardware limitations. Larger textures may fail to import. Default flags. , and are enabled. Generates mipmaps, which are smaller versions of the same texture to use when zoomed out, keeping the aspect ratio. Repeats the texture (instead of clamp to edge). Note: Ignored when using an as these don't support repetition. Uses a magnifying filter, to enable smooth zooming in of the texture. Uses anisotropic mipmap filtering. Generates smaller versions of the same texture with different aspect ratios. This results in better-looking textures when viewed from oblique angles. Converts the texture to the sRGB color space. Repeats the texture with alternate sections mirrored. Note: Ignored when using an as these don't support repetition. Texture is a video surface. The texture's . are used to set various properties of the . Returns the texture width. Returns the texture height. Returns the texture size. Returns true if this has an alpha channel. Draws the texture using a with the API at the specified position. Equivalent to with a rect at position and the size of this . If the parameter is null, then the default value is new Color(1, 1, 1, 1) Draws the texture using a with the API. Equivalent to . If the parameter is null, then the default value is new Color(1, 1, 1, 1) Draws a part of the texture using a with the API. Equivalent to . If the parameter is null, then the default value is new Color(1, 1, 1, 1) Returns an that is a copy of data from this . s can be accessed and manipulated directly. Texture3D is a 3-dimensional texture that has a width, height, and depth. s store an array of s in a single primitive. Each layer of the texture array has its own mipmap chain. This makes it is a good alternative to texture atlases. s must be displayed using shaders. After importing your file as a and setting the appropriate Horizontal and Vertical Slices, display it by setting it as a uniform to a shader, for example: shader_type canvas_item; uniform sampler2DArray tex; uniform int index; void fragment() { COLOR = texture(tex, vec3(UV.x, UV.y, float(index))); } Set the integer uniform "index" to show a particular part of the texture as defined by the Horizontal and Vertical Slices in the importer. has the same functionality as , except it uses sprites instead of Godot's resource. It is faster to create, but it doesn't support localization like more complex s. The "normal" state must contain a texture (); other textures are optional. See also which contains common properties and methods associated with this node. Scale to fit the node's bounding rectangle. Tile inside the node's bounding rectangle. The texture keeps its original size and stays in the bounding rectangle's top-left corner. The texture keeps its original size and stays centered in the node's bounding rectangle. Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio. Scale the texture to fit the node's bounding rectangle, center it, and maintain its aspect ratio. Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits. Texture to display by default, when the node is not in the disabled, focused, hover or pressed state. Texture to display on mouse down over the node, if the node has keyboard focus and the player presses the Enter key or if the player presses the key. Texture to display when the mouse hovers the node. Texture to display when the node is disabled. See . Texture to display when the node has mouse or keyboard focus. Pure black and white image to use for click detection. On the mask, white pixels represent the button's clickable area. Use it to create buttons with curved shapes. If true, the texture stretches to the edges of the node's bounding rectangle using the . If false, the texture will not scale with the node. Controls the texture's behavior when you resize the node's bounding rectangle, only if is true. Set it to one of the constants. See the constants to learn more. Base class for and . Cannot be used directly, but contains all the functions necessary for accessing and using and . Data is set on a per-layer basis. For s, the layer specifies the depth or Z-index, they can be treated as a bunch of 2D slices. Similarly, for s, the layer specifies the array layer. Texture will generate mipmaps on creation. Texture will repeat when UV used is outside the 0-1 range. Use filtering when reading from texture. Filtering smooths out pixels. Turning filtering off is slightly faster and more appropriate when you need access to individual pixels. Equivalent to . Specifies which apply to this texture. Returns a dictionary with all the data used by this texture. Returns the current format being used by this texture. See for details. Returns the width of the texture. Width is typically represented by the X-axis. Returns the height of the texture. Height is typically represented by the Y-axis. Returns the depth of the texture. Depth is the 3rd dimension (typically Z-axis). Creates the or with specified width, height, and depth. See for format options. See enumerator for flags options. Sets the data for the specified layer. Data takes the form of a 2-dimensional resource. Returns an resource with the data from specified layer. Partially sets the data for a specified layer by overwriting using the data of the specified image. x_offset and y_offset determine where the is "stamped" over the texture. The image must fit within the texture. TextureProgress works like , but uses up to 3 textures instead of Godot's resource. It can be used to create horizontal, vertical and radial progress bars. The fills from left to right. The fills from right to left. The fills from top to bottom. The fills from bottom to top. Turns the node into a radial bar. The fills clockwise. See , and to control the way the bar fills up. Turns the node into a radial bar. The fills counterclockwise. See , and to control the way the bar fills up. The fills from the center, expanding both towards the left and the right. The fills from the center, expanding both towards the top and the bottom. Turns the node into a radial bar. The fills radially from the center, expanding both clockwise and counterclockwise. See , and to control the way the bar fills up. that draws under the progress bar. The bar's background. that draws over the progress bar. Use it to add highlights or an upper-frame that hides part of . that clips based on the node's value and . As value increased, the texture fills up. It shows entirely when value reaches max_value. It doesn't show at all if value is equal to min_value. The value property comes from . See , , . The fill direction. See for possible values. Multiplies the color of the bar's texture_under texture. Multiplies the color of the bar's texture_over texture. The effect is similar to , except it only affects this specific texture instead of the entire node. Multiplies the color of the bar's texture_progress texture. Starting angle for the fill of if is or . When the node's value is equal to its min_value, the texture doesn't show up at all. When the value increases, the texture fills and tends towards . Upper limit for the fill of if is or . When the node's value is equal to its max_value, the texture fills up to this angle. See , . Offsets if is or . If true, Godot treats the bar's textures like in . Use the stretch_margin_* properties like to set up the nine patch's 3×3 grid. When using a radial , this setting will enable stretching. The width of the 9-patch's left column. The height of the 9-patch's top row. The width of the 9-patch's right column. The height of the 9-patch's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. Used to draw icons and sprites in a user interface. The texture's placement can be controlled with the property. It can scale, tile, or stay centered inside its bounding rectangle. Note: You should enable when using a TextureRect to display a . Alternatively, you can enable on the Viewport. Otherwise, the image will appear upside down. Scale to fit the node's bounding rectangle, only if expand is true. Default stretch_mode, for backwards compatibility. Until you set expand to true, the texture will behave like . Scale to fit the node's bounding rectangle. Tile inside the node's bounding rectangle. The texture keeps its original size and stays in the bounding rectangle's top-left corner. The texture keeps its original size and stays centered in the node's bounding rectangle. Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio. Scale the texture to fit the node's bounding rectangle, center it and maintain its aspect ratio. Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits. The node's resource. If true, the texture scales to fit its bounding rectangle. Controls the texture's behavior when resizing the node's bounding rectangle. See . If true, texture is flipped horizontally. If true, texture is flipped vertically. A theme for skinning controls. Controls can be skinned individually, but for complex applications, it's more practical to just create a global theme that defines everything. This theme can be applied to any ; the Control and its children will automatically use it. Theme resources can alternatively be loaded by writing them in a .theme file, see the documentation for more information. The theme's default font. Sets the theme's icon to texture at name in node_type. Does nothing if the theme does not have node_type. Returns the icon at name if the theme has node_type. Returns true if icon with name is in node_type. Returns false if the theme does not have node_type. Clears the icon at name if the theme has node_type. Returns all the icons as a filled with each 's name, for use in , if the theme has node_type. Sets theme's to stylebox at name in node_type. Does nothing if the theme does not have node_type. Returns the at name if the theme has node_type. Valid names may be found using . Valid node_types may be found using . Returns true if with name is in node_type. Returns false if the theme does not have node_type. Clears at name if the theme has node_type. Returns all the s as a filled with each 's name, for use in , if the theme has node_type. Valid node_types may be found using . Returns all the types as a filled with each 's type, for use in and/or , if the theme has node_type. Sets the theme's to font at name in node_type. Does nothing if the theme does not have node_type. Returns the at name if the theme has node_type. Returns true if with name is in node_type. Returns false if the theme does not have node_type. Clears the at name if the theme has node_type. Returns all the s as a filled with each 's name, for use in , if the theme has node_type. Sets the theme's to color at name in node_type. Does nothing if the theme does not have node_type. Returns the at name if the theme has node_type. Returns true if with name is in node_type. Returns false if the theme does not have node_type. Clears the at name if the theme has node_type. Returns all the s as a filled with each 's name, for use in , if the theme has node_type. Sets the theme's constant to constant at name in node_type. Does nothing if the theme does not have node_type. Returns the constant at name if the theme has node_type. Returns true if constant with name is in node_type. Returns false if the theme does not have node_type. Clears the constant at name if the theme has node_type. Returns all the constants as a filled with each constant's name, for use in , if the theme has node_type. Clears all values on the theme. Returns all the types in node_type as a for use in any of the get_* functions, if the theme has node_type. Sets the theme's values to a copy of the default theme values. Sets the theme's values to a copy of a given theme. Node for 2D tile-based maps. Tilemaps use a which contain a list of tiles (textures plus optional collision, navigation, and/or occluder shapes) which are used to create grid-based maps. When doing physics queries against the tilemap, the cell coordinates are encoded as metadata for each detected collision shape returned by methods such as , , etc. Returned when a cell doesn't exist. Orthogonal orientation mode. Isometric orientation mode. Custom orientation mode. Tile origin at its top-left corner. Tile origin at its center. Tile origin at its bottom-left corner. Half offset on the X coordinate. Half offset on the Y coordinate. Half offset disabled. Half offset on the X coordinate (negative). Half offset on the Y coordinate (negative). The TileMap orientation mode. See for possible values. The assigned . The TileMap's cell size. The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size. The custom to be applied to the TileMap's cells. Amount to offset alternating tiles. See for possible values. Position for tile origin. See for possible values. If true, the TileMap's direct children will be drawn in order of their Y coordinate. If true, collision shapes are shown in the editor and at run-time. Requires Visible Collision Shapes to be enabled in the Debug menu for collision shapes to be visible at run-time. If true, the compatibility with the tilemaps made in Godot 3.1 or earlier is maintained (textures move when the tile origin changes and rotate if the texture size is not homogeneous). This mode presents problems when doing flip_h, flip_v and transpose tile operations on non-homogeneous isometric tiles (e.g. 2:1), in which the texture could not coincide with the collision, thus it is not recommended for isometric or non-square tiles. If false, the textures do not move when doing flip_h, flip_v operations if no offset is used, nor when changing the tile origin. The compatibility mode doesn't work with the option, because displacing textures with the option or in irregular tiles is not relevant when centering those textures. If true, the textures will be centered in the middle of each tile. This is useful for certain isometric or top-down modes when textures are made larger or smaller than the tiles (e.g. to avoid flickering on tile edges). The offset is still applied, but from the center of the tile. If used, is ignored. If false, the texture position start in the top-left corner unless is enabled. If true, the cell's UVs will be clipped. If true, this tilemap's collision shape will be added to the collision shape of the parent. The parent has to be a . If true, TileMap collisions will be handled as a kinematic body. If false, collisions will be handled as static body. Friction value for static body collisions (see collision_use_kinematic). Bounce value for static body collisions (see collision_use_kinematic). The collision layer(s) for all colliders in the TileMap. See Collision layers and masks in the documentation for more information. The collision mask(s) for all colliders in the TileMap. See Collision layers and masks in the documentation for more information. The light mask assigned to all light occluders in the TileMap. The TileSet's light occluders will cast shadows only from Light2D(s) that have the same light mask(s). Sets the given collision layer bit. Returns true if the given collision layer bit is set. Sets the given collision mask bit. Returns true if the given collision mask bit is set. Sets the tile index for the cell given by a Vector2. An index of -1 clears the cell. Optionally, the tile can also be flipped, transposed, or given autotile coordinates. The autotile coordinate refers to the column and row of the subtile. Note: Data such as navigation polygons and collision shapes are not immediately updated for performance reasons. If you need these to be immediately updated, you can call . Overriding this method also overrides it internally, allowing custom logic to be implemented when tiles are placed/removed: func set_cell(x, y, tile, flip_x=false, flip_y=false, transpose=false, autotile_coord=Vector2()): # Write your custom logic here. # To call the default method: .set_cell(x, y, tile, flip_x, flip_y, transpose, autotile_coord) If the parameter is null, then the default value is new Vector2(0, 0) Sets the tile index for the given cell. An index of -1 clears the cell. Optionally, the tile can also be flipped or transposed. Note: Data such as navigation polygons and collision shapes are not immediately updated for performance reasons. If you need these to be immediately updated, you can call . Returns the tile index of the given cell. If no tile exists in the cell, returns . Returns the tile index of the cell given by a Vector2. If no tile exists in the cell, returns . Returns true if the given cell is flipped in the X axis. Returns true if the given cell is flipped in the Y axis. Returns true if the given cell is transposed, i.e. the X and Y axes are swapped. Returns the coordinate (subtile column and row) of the autotile variation in the tileset. Returns a zero vector if the cell doesn't have autotiling. Clears cells that do not exist in the tileset. Clears all cells. Returns a array with the positions of all cells containing a tile from the tileset (i.e. a tile index different from -1). Returns an array of all cells with the given tile index specified in id. Returns a rectangle enclosing the used (non-empty) tiles of the map. Returns the local position of the top left corner of the cell corresponding to the given tilemap (grid-based) coordinates. To get the global position, use : var local_position = my_tilemap.map_to_world(map_position) var global_position = my_tilemap.to_global(local_position) Optionally, the tilemap's half offset can be ignored. Returns the tilemap (grid-based) coordinates corresponding to the given local position. To use this with a global position, first determine the local position with : var local_position = my_tilemap.to_local(global_position) var map_position = my_tilemap.world_to_map(local_position) Updates the tile map's quadrants, allowing things such as navigation and collision shapes to be immediately used if modified. Applies autotiling rules to the cell (and its adjacent cells) referenced by its grid-based X and Y coordinates. Applies autotiling rules to the cells in the given region (specified by grid-based X and Y coordinates). Calling with invalid (or missing) parameters applies autotiling rules for the entire tilemap. If the parameter is null, then the default value is new Vector2(0, 0) If the parameter is null, then the default value is new Vector2(0, 0) A TileSet is a library of tiles for a . It contains a list of tiles, each consisting of a sprite and optional collision shapes. Tiles are referenced by a unique integer ID. Determines when the auto-tiler should consider two different auto-tile IDs to be bound together. Note: neighbor_id will be -1 () when checking a tile against an empty neighbor tile. Creates a new tile with the given ID. Clears all bitmask information of the autotile. Sets the subtile that will be used as an icon in an atlas/autotile given its coordinates. The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor. Returns the subtile that's being used as an icon in an atlas/autotile given its coordinates. The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor. Sets the priority of the subtile from an autotile given its coordinates. When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked. Returns the priority of the subtile from an autotile given its coordinates. When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked. Sets the drawing index of the subtile from an atlas/autotile given its coordinates. Returns the drawing index of the subtile from an atlas/autotile given its coordinates. Sets the light occluder of the subtile from an atlas/autotile given its coordinates. Returns the light occluder of the subtile from an atlas/autotile given its coordinates. Sets the navigation polygon of the subtile from an atlas/autotile given its coordinates. Returns the navigation polygon of the subtile from an atlas/autotile given its coordinates. Sets the bitmask of the subtile from an autotile given its coordinates. The value is the sum of the values in present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right). Returns the bitmask of the subtile from an autotile given its coordinates. The value is the sum of the values in present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right). Sets the of the autotile. Returns the of the autotile. Sets the spacing between subtiles of the atlas/autotile. Returns the spacing between subtiles of the atlas/autotile. Sets the size of the subtiles in an atlas/autotile. Returns the size of the subtiles in an atlas/autotile. Sets the tile's name. Returns the tile's name. Sets the tile's texture. Returns the tile's texture. Sets the tile's normal map texture. Note: Godot expects the normal map to use X+, Y-, and Z+ coordinates. See this page for a comparison of normal map coordinates expected by popular engines. Returns the tile's normal map texture. Sets the tile's material. Returns the tile's material. Sets the tile's modulation color. Returns the tile's modulation color. Sets the tile's texture offset. Returns the texture offset of the tile. Sets the tile's sub-region in the texture. This is common in texture atlases. Returns the tile sub-region in the texture. Sets a shape for the tile, enabling collision. Returns a tile's given shape. Sets the offset of a tile's shape. Returns the offset of a tile's shape. Sets a on a tile's shape. Returns the of a tile's shape. Enables one-way collision on a tile's shape. Returns the one-way collision value of a tile's shape. Adds a shape to the tile. If the parameter is null, then the default value is new Vector2(0, 0) Returns the number of shapes assigned to a tile. Sets an array of shapes for the tile, enabling collision. Returns an array of dictionaries describing the tile's shapes. Dictionary structure in the array returned by this method: { "autotile_coord": Vector2, "one_way": bool, "one_way_margin": int, "shape": CollisionShape2D, "shape_transform": Transform2D, } Sets the tile's . Returns the tile's . Sets the tile's navigation polygon. Returns the navigation polygon of the tile. Sets an offset for the tile's navigation polygon. Returns the offset of the tile's navigation polygon. Sets a light occluder for the tile. Returns the tile's light occluder. Sets an offset for the tile's light occluder. Returns the offset of the tile's light occluder. Sets the tile's drawing index. Returns the tile's Z index (drawing layer). Removes the given tile ID. Clears all tiles. Returns the ID following the last currently used ID, useful when creating a new tile. Returns the first tile matching the given name. Returns an array of all currently used tile IDs. Counts down a specified interval and emits a signal on reaching 0. Can be set to repeat or "one-shot" mode. Note: To create a one-shot timer without instantiating a node, use . Update the timer during the physics step at each frame (fixed framerate processing). Update the timer during the idle time at each frame. Processing mode. See . Wait time in seconds. If true, the timer will stop when reaching 0. If false, it will restart. If true, the timer will automatically start when entering the scene tree. Note: This property is automatically set to false after the timer enters the scene tree and starts. If true, the timer is paused and will not process until it is unpaused again, even if is called. The timer's remaining time in seconds. Returns 0 if the timer is inactive. Note: You cannot set this value. To change the timer's remaining time, use . Starts the timer. Sets wait_time to time_sec if time_sec > 0. This also resets the remaining time to wait_time. Note: this method will not resume a paused timer. See . Stops the timer. Returns true if the timer is stopped. This is a helper class to generate a flat (see ), creating a is equivalent to: var btn = Button.new() btn.flat = true TouchScreenButton allows you to create on-screen buttons for touch devices. It's intended for gameplay use, such as a unit you have to touch to move. Unlike , TouchScreenButton supports multitouch out of the box. Several TouchScreenButtons can be pressed at the same time with touch input. This node inherits from . Unlike with nodes, you cannot set anchors on it. If you want to create menus or user interfaces, you may want to use nodes instead. To make button nodes react to touch events, you can enable the Emulate Mouse option in the Project Settings. You can configure TouchScreenButton to be visible only on touch devices, helping you develop your game both for desktop and mobile devices. Always visible. Visible on touch screens only. The button's texture for the normal state. The button's texture for the pressed state. The button's bitmask. The button's shape. If true, the button's shape is centered in the provided texture. If no texture is used, this property has no effect. If true, the button's shape is visible. If true, the pressed and released signals are emitted whenever a pressed finger goes in and out of the button, even if the pressure started outside the active area of the button. Note: this is a "pass-by" (not "bypass") press mode. The button's action. Actions can be handled with . The button's visibility mode. See for possible values. Returns true if this button is currently pressed. Translations are resources that can be loaded and unloaded on demand. They map a string to another string. The locale of the translation. Adds a message if nonexistent, followed by its translation. Returns a message's translation. Erases a message. Returns all the messages (keys). Returns the number of existing messages. Server that manages all translations. Translations can be set to it and removed from it. Sets the locale of the game. Returns the current locale of the game. Returns a locale's language and its variant (e.g. "en_US" would return "English (United States)"). Returns the current locale's translation for the given message (key). Adds a resource. Removes the given translation from the server. Clears the server from all translations. Returns an Array of all loaded locales of the game. This shows a tree of items that can be selected, expanded and collapsed. The tree can have multiple columns with custom controls like text editing, buttons and popups. It can be useful for structured displays and interactions. Trees are built via code, using objects to create the structure. They have a single root but multiple roots can be simulated if a dummy hidden root is added. func _ready(): var tree = Tree.new() var root = tree.create_item() tree.set_hide_root(true) var child1 = tree.create_item(root) var child2 = tree.create_item(root) var subchild1 = tree.create_item(child1) subchild1.set_text(0, "Subchild1") To iterate over all the objects in a object, use and after getting the root through . You can use on a to remove it from the . Allows selection of a single cell at a time. From the perspective of items, only a single item is allowed to be selected. And there is only one column selected in the selected item. The focus cursor is always hidden in this mode, but it is positioned at the current selection, making the currently selected item the currently focused item. Allows selection of a single row at a time. From the perspective of items, only a single items is allowed to be selected. And all the columns are selected in the selected item. The focus cursor is always hidden in this mode, but it is positioned at the first column of the current selection, making the currently selected item the currently focused item. Allows selection of multiple cells at the same time. From the perspective of items, multiple items are allowed to be selected. And there can be multiple columns selected in each selected item. The focus cursor is visible in this mode, the item or column under the cursor is not necessarily selected. Disables all drop sections, but still allows to detect the "on item" drop section by . Note: This is the default flag, it has no effect when combined with other flags. Enables the "on item" drop section. This drop section covers the entire item. When combined with , this drop section halves the height and stays centered vertically. Enables "above item" and "below item" drop sections. The "above item" drop section covers the top half of the item, and the "below item" drop section covers the bottom half. When combined with , these drop sections halves the height and stays on top / bottom accordingly. The number of columns. If true, the currently selected cell may be selected again. If true, a right mouse button click can select items. If true, the folding arrow is hidden. If true, the tree's root is hidden. The drop mode as an OR combination of flags. See constants. Once dropping is done, reverts to . Setting this during is recommended. This controls the drop sections, i.e. the decision and drawing of possible drop locations based on the mouse position. Allows single or multiple selection. See the constants. Clears the tree. This removes all items. Creates an item in the tree and adds it as a child of parent. If parent is null, the root item will be the parent, or the new item will be the root itself if the tree is empty. The new item will be the idxth child of parent, or it will be the last child if there are not enough siblings. Returns the tree's root item, or null if the tree is empty. Sets the minimum width of a column. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to . If true, the column will have the "Expand" flag of . Columns that have the "Expand" flag will use their "min_width" in a similar fashion to . Returns the column's width in pixels. Returns the next selected item after the given one, or null if the end is reached. If from is null, this returns the first selected item. Returns the currently focused item, or null if no item is focused. In and modes, the focused item is same as the selected item. In mode, the focused item is the item under the focus cursor, not necessarily selected. To get the currently selected item(s), use . Returns the currently focused column, or -1 if no column is focused. In mode, the focused column is the selected column. In mode, the focused column is always 0 if any item is selected. In mode, the focused column is the column under the focus cursor, and there are not necessarily any column selected. To tell whether a column of an item is selected, use . Returns the last pressed button's index. Returns the currently edited item. Can be used with item_edited to get the item that was modified. func _ready(): $Tree.item_edited.connect(on_Tree_item_edited) func on_Tree_item_edited(): print($Tree.get_edited()) # This item just got edited (e.g. checked). Returns the column for the currently edited item. Edits the selected tree item as if it was clicked. The item must be set editable with . Returns true if the item could be edited. Fails if no item is selected. Returns the rectangle for custom popups. Helper to create custom cell controls that display a popup. See . Returns the rectangle area for the specified item. If column is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. Returns the tree item at the specified position (relative to the tree origin position). Returns the column index at position, or -1 if no item is there. Returns the drop section at position, or -100 if no item is there. Values -1, 0, or 1 will be returned for the "above item", "on item", and "below item" drop sections, respectively. See for a description of each drop section. To get the item which the returned drop section is relative to, use . Makes the currently focused cell visible. This will scroll the tree if necessary. In mode, this will not do horizontal scrolling, as all the cells in the selected row is focused logically. Note: Despite the name of this method, the focus cursor itself is only visible in mode. If true, column titles are visible. Returns true if the column titles are being shown. Sets the title of a column. Returns the column's title. Returns the current scrolling position. Control for a single item inside a . May have child s and be styled as well as contain buttons. You can remove a by using . Cell contains a string. Cell contains a checkbox. Cell contains a range. Cell contains an icon. Align text to the left. See set_text_align(). Center text. See set_text_align(). Align text to the right. See set_text_align(). If true, the TreeItem is collapsed. If true, folding is disabled for this TreeItem. The custom minimum height. Sets the given column's cell mode to mode. See constants. Returns the column's cell mode. If true, the column column is checked. Returns true if the given column is checked. Sets the given column's text value. Returns the given column's text. Sets a string to be shown after a column's value (for example, a unit abbreviation). Gets the suffix string shown after the column value. Sets the given column's icon . Returns the given column's icon . Error if no icon is set. Sets the given column's icon's texture region. Returns the icon region as . Sets the given column's icon's maximum width. Returns the column's icon's maximum width. Modulates the given column's icon with modulate. Returns the modulating the column's icon. Sets the value of a column. Returns the value of a column. Sets the range of accepted values for a column. The column must be in the mode. If expr is true, the edit mode slider will use an exponential scale as with . Returns a dictionary containing the range parameters for a given column. The keys are "min", "max", "step", and "expr". Sets the metadata value for the given column, which can be retrieved later using . This can be used, for example, to store a reference to the original data. Returns the metadata value that was set for the given column using . Sets the given column's custom draw callback to callback method on object. The callback should accept two arguments: the that is drawn and its position and size as a . Returns the next TreeItem in the tree or a null object if there is none. Returns the previous TreeItem in the tree or a null object if there is none. Returns the parent TreeItem or a null object if there is none. Returns the TreeItem's first child item or a null object if there is none. Returns the next visible TreeItem in the tree or a null object if there is none. If wrap is enabled, the method will wrap around to the first visible element in the tree when called on the last visible element, otherwise it returns null. Returns the previous visible TreeItem in the tree or a null object if there is none. If wrap is enabled, the method will wrap around to the last visible element in the tree when called on the first visible element, otherwise it returns null. Removes the given child and all its children from the . Note that it doesn't free the item from memory, so it can be reused later. To completely remove a use . If true, the given column is selectable. Returns true if column column is selectable. Returns true if column column is selected. Selects the column column. Deselects the given column. If true, column column is editable. Returns true if column column is editable. Sets the given column's custom color. Resets the color for the given column to default. Returns the custom color of column column. Sets the given column's custom background color and whether to just use it as an outline. Resets the background color for the given column to default. Returns the custom background color of column column. Adds a button with button at column column. The button_idx index is used to identify the button when calling other methods. If not specified, the next available index is used, which may be retrieved by calling immediately after this method. Optionally, the button can be disabled and have a tooltip. Returns the number of buttons in column column. May be used to get the most recently added button's index, if no index was specified. Returns the tooltip string for the button at index button_idx in column column. Returns the of the button at index button_idx in column column. Sets the given column's button at index button_idx to button. Removes the button at index button_idx in column column. If true, disables the button at index button_idx in column column. Returns true if the button at index button_idx for the given column is disabled. If true, column column is expanded to the right. Returns true if expand_right is set. Sets the given column's tooltip text. Returns the given column's tooltip. Sets the given column's text alignment. See for possible values. Returns the given column's text alignment. Moves this TreeItem to the top in the hierarchy. Moves this TreeItem to the bottom in the hierarchy. Calls the method on the actual TreeItem and its children recursively. Pass parameters as a comma separated list. Mesh type used internally for collision calculations. Tweens are useful for animations requiring a numerical property to be interpolated over a range of values. The name tween comes from in-betweening, an animation technique where you specify keyframes and the computer interpolates the frames that appear between them. is more suited than for animations where you don't know the final values in advance. For example, interpolating a dynamically-chosen camera zoom value is best done with a node; it would be difficult to do the same thing with an node. Here is a brief usage example that makes a 2D node move smoothly between two positions: var tween = get_node("Tween") tween.interpolate_property($Node2D, "position", Vector2(0, 0), Vector2(100, 100), 1, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT) tween.start() Many methods require a property name, such as "position" above. You can find the correct property name by hovering over the property in the Inspector. You can also provide the components of a property directly by using "property:component" (e.g. position:x), where it would only apply to that particular component. Many of the methods accept trans_type and ease_type. The first accepts an constant, and refers to the way the timing of the animation is handled (see easings.net for some examples). The second accepts an constant, and controls where the trans_type is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different constants with , and use the one that looks best. Tween easing and transition types cheatsheet The animation is interpolated linearly. The animation is interpolated using a sine function. The animation is interpolated with a quintic (to the power of 5) function. The animation is interpolated with a quartic (to the power of 4) function. The animation is interpolated with a quadratic (to the power of 2) function. The animation is interpolated with an exponential (to the power of x) function. The animation is interpolated with elasticity, wiggling around the edges. The animation is interpolated with a cubic (to the power of 3) function. The animation is interpolated with a function using square roots. The animation is interpolated by bouncing at the end. The animation is interpolated backing out at ends. The tween updates with the _physics_process callback. The tween updates with the _process callback. The interpolation starts slowly and speeds up towards the end. The interpolation starts quickly and slows down towards the end. A combination of and . The interpolation is slowest at both ends. A combination of and . The interpolation is fastest at both ends. If true, the tween loops. The tween's animation process thread. See . The tween's speed multiplier. For example, set it to 1.0 for normal speed, 2.0 for two times normal speed, or 0.5 for half of the normal speed. A value of 0 pauses the animation, but see also or for this. Returns true if any tweens are currently running. Note: This method doesn't consider tweens that have ended. Activates/deactivates the tween. See also and . Starts the tween. You can define animations both before and after this. Resets a tween to its initial value (the one given, not the one before the tween), given its object and property/method pair. By default, all tweens are removed, unless key is specified. Resets all tweens to their initial values (the ones given, not those before the tween). Stops a tween, given its object and property/method pair. By default, all tweens are stopped, unless key is specified. Stops animating all tweens. Continues animating a stopped tween, given its object and property/method pair. By default, all tweens are resumed, unless key is specified. Continues animating all stopped tweens. Stops animation and removes a tween, given its object and property/method pair. By default, all tweens are removed, unless key is specified. Stops animation and removes all tweens. Sets the interpolation to the given time in seconds. Returns the current time of the tween. Returns the total time needed for all tweens to end. If you have two tweens, one lasting 10 seconds and the other 20 seconds, it would return 20 seconds, as by that time all tweens would have finished. Animates property of object from initial_val to final_val for duration seconds, delay seconds later. Setting the initial value to null uses the current value of the property. Use for trans_type and for ease_type parameters. These values control the timing and direction of the interpolation. See the class description for more information. Animates method of object from initial_val to final_val for duration seconds, delay seconds later. Methods are called with consecutive values. Use for trans_type and for ease_type parameters. These values control the timing and direction of the interpolation. See the class description for more information. Calls callback of object after duration. arg1-arg5 are arguments to be passed to the callback. Calls callback of object after duration on the main thread (similar to ). arg1-arg5 are arguments to be passed to the callback. Follows property of object and applies it on target_property of target, beginning from initial_val for duration seconds, delay seconds later. Use for trans_type and for ease_type parameters. These values control the timing and direction of the interpolation. See the class description for more information. Follows method of object and applies the returned value on target_method of target, beginning from initial_val for duration seconds, delay later. Methods are called with consecutive values. Use for trans_type and for ease_type parameters. These values control the timing and direction of the interpolation. See the class description for more information. Animates property of object from the current value of the initial_val property of initial to final_val for duration seconds, delay seconds later. Use for trans_type and for ease_type parameters. These values control the timing and direction of the interpolation. See the class description for more information. Animates method of object from the value returned by initial_method to final_val for duration seconds, delay seconds later. Methods are animated by calling them with consecutive values. Use for trans_type and for ease_type parameters. These values control the timing and direction of the interpolation. See the class description for more information. A simple server that opens a UDP socket and returns connected upon receiving new packets. See also . After starting the server (), you will need to it at regular intervals (e.g. inside ) for it to process new packets, delivering them to the appropriate , and taking new connections. Below a small example of how it can be used: # server.gd extends Node var server := UDPServer.new() var peers = [] func _ready(): server.listen(4242) func _process(delta): server.poll() # Important! if server.is_connection_available(): var peer : PacketPeerUDP = server.take_connection() var pkt = peer.get_packet() print("Accepted peer: %s:%s" % [peer.get_packet_ip(), peer.get_packet_port()]) print("Received data: %s" % [pkt.get_string_from_utf8()]) # Reply so it knows we received the message. peer.put_packet(pkt) # Keep a reference so we can keep contacting the remote peer. peers.append(peer) for i in range(0, peers.size()): pass # Do something with the connected peers. # client.gd extends Node var udp := PacketPeerUDP.new() var connected = false func _ready(): udp.connect_to_host("127.0.0.1", 4242) func _process(delta): if !connected: # Try to contact server udp.put_packet("The answer is... 42!".to_utf8()) if udp.get_available_packet_count() > 0: print("Connected: %s" % udp.get_packet().get_string_from_utf8()) connected = true Define the maximum number of pending connections, during , any new pending connection exceeding that value will be automatically dropped. Setting this value to 0 effectively prevents any new pending connection to be accepted (e.g. when all your players have connected). Starts the server by opening a UDP socket listening on the given port. You can optionally specify a bind_address to only listen for packets sent to that address. See also . Call this method at regular intervals (e.g. inside ) to process new packets. And packet from known address/port pair will be delivered to the appropriate , any packet received from an unknown address/port pair will be added as a pending connection (see , ). The maximum number of pending connection is defined via . Returns true if a packet with a new address/port combination was received on the socket. Returns true if the socket is open and listening on a port. Returns the first pending connection (connected to the appropriate address/port). Will return null if no new connection is available. See also , . Stops the server, closing the UDP socket if open. Will close all connected accepted via (remote peers will not be notified). Provides UPNP functionality to discover s on the local network and execute commands on them, like managing port mappings (port forwarding) and querying the local and remote network IP address. Note that methods on this class are synchronous and block the calling thread. To forward a specific port: const PORT = 7777 var upnp = UPNP.new() upnp.discover(2000, 2, "InternetGatewayDevice") upnp.add_port_mapping(port) To close a specific port (e.g. after you have finished using it): upnp.delete_port_mapping(port) UPNP command or discovery was successful. Not authorized to use the command on the . May be returned when the user disabled UPNP on their router. No port mapping was found for the given port, protocol combination on the given . Inconsistent parameters. No such entry in array. May be returned if a given port, protocol combination is not found on an . The action failed. The does not allow wildcard values for the source IP address. The does not allow wildcard values for the external port. The does not allow wildcard values for the internal port. The remote host value must be a wildcard. The external port value must be a wildcard. No port maps are available. May also be returned if port mapping functionality is not available. Conflict with other mechanism. May be returned instead of if a port mapping conflicts with an existing one. Conflict with an existing port mapping. External and internal port values must be the same. Only permanent leases are supported. Do not use the duration parameter when adding port mappings. Invalid gateway. Invalid port. Invalid protocol. Invalid duration. Invalid arguments. Invalid response. Invalid parameter. HTTP error. Socket error. Error allocating memory. No gateway available. You may need to call first, or discovery didn't detect any valid IGDs (InternetGatewayDevices). No devices available. You may need to call first, or discovery didn't detect any valid s. Unknown error. Multicast interface to use for discovery. Uses the default multicast interface if empty. If 0, the local port to use for discovery is chosen automatically by the system. If 1, discovery will be done from the source port 1900 (same as destination port). Otherwise, the value will be used as the port. If true, IPv6 is used for discovery. Returns the number of discovered s. Returns the at the given index. Adds the given to the list of discovered devices. Sets the device at index from the list of discovered devices to device. Removes the device at index from the list of discovered devices. Clears the list of discovered devices. Returns the default gateway. That is the first discovered that is also a valid IGD (InternetGatewayDevice). Discovers local s. Clears the list of previously discovered devices. Filters for IGD (InternetGatewayDevice) type devices by default, as those manage port forwarding. timeout is the time to wait for responses in milliseconds. ttl is the time-to-live; only touch this if you know what you're doing. See for possible return values. Returns the external address of the default gateway (see ) as string. Returns an empty string on error. Adds a mapping to forward the external port (between 1 and 65535) on the default gateway (see ) to the internal_port on the local machine for the given protocol proto (either TCP or UDP, with UDP being the default). If a port mapping for the given port and protocol combination already exists on that gateway device, this method tries to overwrite it. If that is not desired, you can retrieve the gateway manually with and call on it, if any. If internal_port is 0 (the default), the same port number is used for both the external and the internal port (the port value). The description (desc) is shown in some router UIs and can be used to point out which application added the mapping. The mapping's lease duration can be limited by specifying a duration (in seconds). However, some routers are incompatible with one or both of these, so use with caution and add fallback logic in case of errors to retry without them if in doubt. See for possible return values. Deletes the port mapping for the given port and protocol combination on the default gateway (see ) if one exists. port must be a valid port between 1 and 65535, proto can be either TCP or UDP. See for possible return values. UPNP device. See for UPNP discovery and utility functions. Provides low-level access to UPNP control commands. Allows to manage port mappings (port forwarding) and to query network information of the device (like local and external IP address and status). Note that methods on this class are synchronous and block the calling thread. OK. HTTP error. Empty HTTP response. Returned response contained no URLs. Not a valid IGD. Disconnected. Unknown device. Invalid control. Memory allocation error. Unknown error. URL to the device description. Service type. IDG control URL. IGD service type. Address of the local machine in the network connecting it to this . IGD status. See . Returns true if this is a valid IGD (InternetGatewayDevice) which potentially supports port forwarding. Returns the external IP address of this or an empty string. Adds a port mapping to forward the given external port on this for the given protocol to the local machine. See . Deletes the port mapping identified by the given port and protocol combination on this device. See . Helper to manage undo/redo operations in the editor or custom tools. It works by registering methods and property changes inside "actions". Common behavior is to create an action, then add do/undo calls to functions or property changes, then committing the action. Here's an example on how to add an action to the Godot editor's own , from a plugin: var undo_redo = get_undo_redo() # Method of EditorPlugin. func do_something(): pass # Put your code here. func undo_something(): pass # Put here the code that reverts what's done by "do_something()". func _on_MyButton_pressed(): var node = get_node("MyNode2D") undo_redo.create_action("Move the node") undo_redo.add_do_method(self, "do_something") undo_redo.add_undo_method(self, "undo_something") undo_redo.add_do_property(node, "position", Vector2(100,100)) undo_redo.add_undo_property(node, "position", node.position) undo_redo.commit_action() , , , , , and should be called one after the other, like in the example. Not doing so could lead to crashes. If you don't need to register a method, you can leave and out; the same goes for properties. You can also register more than one method/property. Makes "do"/"undo" operations stay in separate actions. Makes so that the action's "do" operation is from the first action created and the "undo" operation is from the last subsequent action with the same name. Makes subsequent actions with the same name be merged into one. Create a new action. After this is called, do all your calls to , , , and , then commit the action with . The way actions are merged is dictated by the merge_mode argument. See for details. Commit the action. All "do" methods/properties are called/set when this function is called. Returns true if the is currently committing the action, i.e. running its "do" method or property change (see ). Register a method that will be called when the action is committed. Register a method that will be called when the action is undone. Register a property value change for "do". Register a property value change for "undo". Register a reference for "do" that will be erased if the "do" history is lost. This is useful mostly for new nodes created for the "do" call. Do not use for resources. Register a reference for "undo" that will be erased if the "undo" history is lost. This is useful mostly for nodes removed with the "do" call (not the "undo" call!). Clear the undo/redo history and associated references. Passing false to increase_version will prevent the version number to be increased from this. Gets the name of the current action. Returns true if an "undo" action is available. Returns true if a "redo" action is available. Gets the version. Every time a new action is committed, the 's version number is increased automatically. This is useful mostly to check if something changed from a saved version. Redo the last action. Undo the last action. Vertical box container. See . Vertical version of , which goes from top (min) to bottom (max). Vertical version of . Even though it looks vertical, it is used to separate objects horizontally. Vertical slider. See . This one goes from bottom (min) to top (max). Note: The Range.changed and Range.value_changed signals are part of the class which this class inherits from. Vertical split container. See . This goes from top to bottom. This node implements all the physics logic needed to simulate a car. It is based on the raycast vehicle system commonly found in physics engines. You will need to add a for the main body of your vehicle and add nodes for the wheels. You should also add a to this node for the 3D model of your car but this model should not include meshes for the wheels. You should control the vehicle by using the , , and properties and not change the position or orientation of this node directly. Note: The origin point of your VehicleBody will determine the center of gravity of your vehicle so it is better to keep this low and move the and upwards. Note: This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you will probably have to write your own physics integration using another class. Accelerates the vehicle by applying an engine force. The vehicle is only speed up if the wheels that have set to true and are in contact with a surface. The of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration. Note: The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears. A negative value will result in the vehicle reversing. Slows down the vehicle by applying a braking force. The vehicle is only slowed down if the wheels are in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking. The steering angle for the vehicle. Setting this to a non-zero value will result in the vehicle turning when it's moving. Wheels that have set to true will automatically be rotated. This node needs to be used as a child node of and simulates the behavior of one of its wheels. This node also acts as a collider to detect if the wheel is touching a surface. Note: This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you will probably have to write your own physics integration using another class. Accelerates the wheel by applying an engine force. The wheel is only speed up if it is in contact with a surface. The of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration. Note: The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears. A negative value will result in the wheel reversing. Slows down the wheel by applying a braking force. The wheel is only slowed down if it is in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking. The steering angle for the wheel. Setting this to a non-zero value will result in the vehicle turning when it's moving. If true, this wheel transfers engine force to the ground to propel the vehicle forward. This value is used in conjunction with and ignored if you are using the per-wheel value instead. If true, this wheel will be turned when the car steers. This value is used in conjunction with and ignored if you are using the per-wheel value instead. This value affects the roll of your vehicle. If set to 1.0 for all wheels, your vehicle will be prone to rolling over, while a value of 0.0 will resist body roll. The radius of the wheel in meters. This is the distance in meters the wheel is lowered from its origin point. Don't set this to 0.0 and move the wheel into position, instead move the origin point of your wheel (the gizmo in Godot) to the position the wheel will take when bottoming out, then use the rest length to move the wheel down to the position it should be in when the car is in rest. This determines how much grip this wheel has. It is combined with the friction setting of the surface the wheel is in contact with. 0.0 means no grip, 1.0 is normal grip. For a drift car setup, try setting the grip of the rear wheels slightly lower than the front wheels, or use a lower value to simulate tire wear. It's best to set this to 1.0 when starting out. This is the distance the suspension can travel. As Godot units are equivalent to meters, keep this setting relatively low. Try a value between 0.1 and 0.3 depending on the type of car. This value defines the stiffness of the suspension. Use a value lower than 50 for an off-road car, a value between 50 and 100 for a race car and try something around 200 for something like a Formula 1 car. The maximum force the spring can resist. This value should be higher than a quarter of the of the or the spring will not carry the weight of the vehicle. Good results are often obtained by a value that is about 3× to 4× this number. The damping applied to the spring when the spring is being compressed. This value should be between 0.0 (no damping) and 1.0. A value of 0.0 means the car will keep bouncing as the spring keeps its energy. A good value for this is around 0.3 for a normal car, 0.5 for a race car. The damping applied to the spring when relaxing. This value should be between 0.0 (no damping) and 1.0. This value should always be slightly higher than the property. For a value of 0.3, try a relaxation value of 0.5. Returns true if this wheel is in contact with a surface. Returns a value between 0.0 and 1.0 that indicates whether this wheel is skidding. 0.0 is skidding (the wheel has lost grip, e.g. icy terrain), 1.0 means not skidding (the wheel has full grip, e.g. dry asphalt road). Returns the rotational speed of the wheel in revolutions per minute. Control node for playing video streams using resources. Supported video formats are WebM (.webm, ), Ogg Theora (.ogv, ), and any format exposed via a GDNative plugin using . Note: Due to a bug, VideoPlayer does not support localization remapping yet. Warning: On HTML5, video playback will perform poorly due to missing architecture-specific assembly optimizations, especially for VP8/VP9. The embedded audio track to play. The assigned video stream. See description for supported formats. Audio volume in dB. Audio volume as a linear value. If true, playback starts when the scene loads. If true, the video is paused. If true, the video scales to the control size. Otherwise, the control minimum size will be automatically adjusted to match the video stream's dimensions. Amount of time in milliseconds to store in buffer while playing. The current position of the stream, in seconds. Note: Changing this value won't have any effect as seeking is not implemented yet, except in video formats implemented by a GDNative add-on. Audio bus to use for sound playback. Starts the video playback from the beginning. If the video is paused, this will not unpause the video. Stops the video playback and sets the stream position to 0. Note: Although the stream position will be set to 0, the first frame of the video stream won't become the current frame. Returns true if the video is playing. Note: The video is still considered playing if paused during playback. Returns the video stream's name, or "<No Stream>" if no video stream is assigned. Returns the current frame as a . Base resource type for all video streams. Classes that derive from can all be used as resource types to play back videos in . resource for for video formats implemented via GDNative. It can be used via godot-videodecoder which uses the FFmpeg library. Sets the video file that this resource handles. The supported extensions depend on the GDNative plugins used to expose video formats. Returns the video file handled by this . resource handling the Ogg Theora video format with .ogv extension. The Theora codec is less efficient than 's VP8 and VP9, but it requires less CPU resources to decode. The Theora codec is decoded on the CPU. Note: While Ogg Theora videos can also have an .ogg extension, you will have to rename the extension to .ogv to use those videos within Godot. Sets the Ogg Theora video file that this resource handles. The file name should have the .ogv extension. Returns the Ogg Theora video file handled by this . resource handling the WebM video format with .webm extension. Both the VP8 and VP9 codecs are supported. The VP8 and VP9 codecs are more efficient than , but they require more CPU resources to decode (especially VP9). Both the VP8 and VP9 codecs are decoded on the CPU. Note: Alpha channel (also known as transparency) is not supported. The video will always appear to have a black background, even if it originally contains an alpha channel. Note: There are known bugs and performance issues with WebM video playback in Godot. If you run into problems, try using the Ogg Theora format instead: Sets the WebM video file that this resource handles. The file name should have the .webm extension. Returns the WebM video file handled by this . A Viewport creates a different view into the screen, or a sub-view inside another viewport. Children 2D Nodes will display on it, and children Camera 3D nodes will render on it too. Optionally, a viewport can have its own 2D or 3D world, so they don't share what they draw with other viewports. If a viewport is a child of a , it will automatically take up its size, otherwise it must be set manually. Viewports can also choose to be audio listeners, so they generate positional audio depending on a 2D or 3D camera child of it. Also, viewports can be assigned to different screens in case the devices have multiple screens. Finally, viewports can also behave as render targets, in which case they will not be visible unless the associated texture is used to draw. Always clear the render target before drawing. Never clear the render target. Clear the render target next frame, then switch to . Amount of objects in frame. Amount of vertices in frame. Amount of material changes in frame. Amount of shader changes in frame. Amount of surface changes in frame. Amount of draw calls in frame. Amount of items or joined items in frame. Amount of draw calls in frame. Represents the size of the enum. Allocates all buffers needed for drawing 2D scenes. This takes less VRAM than the 3D usage modes. Note that 3D rendering effects such as glow and HDR are not available when using this mode. Allocates buffers needed for 2D scenes without allocating a buffer for screen copy. Accordingly, you cannot read from the screen. Of the types, this requires the least VRAM. Note that 3D rendering effects such as glow and HDR are not available when using this mode. Allocates full buffers for drawing 3D scenes and all 3D effects including buffers needed for 2D scenes and effects. Allocates buffers needed for drawing 3D scenes. But does not allocate buffers needed for reading from the screen and post-processing effects. Saves some VRAM. Objects are displayed normally. Objects are displayed without light information. Objected are displayed semi-transparent with additive blending so you can see where they intersect. Objects are displayed in wireframe style. This quadrant will not be used. This quadrant will only be used by one shadow map. This quadrant will be split in 4 and used by up to 4 shadow maps. This quadrant will be split 16 ways and used by up to 16 shadow maps. This quadrant will be split 64 ways and used by up to 64 shadow maps. This quadrant will be split 256 ways and used by up to 256 shadow maps. Unless the is very high, the shadows in this quadrant will be very low resolution. This quadrant will be split 1024 ways and used by up to 1024 shadow maps. Unless the is very high, the shadows in this quadrant will be very low resolution. Represents the size of the enum. Do not update the render target. Update the render target once, then switch to . Update the render target only when it is visible. This is the default value. Always update the render target. Multisample anti-aliasing mode disabled. This is the default value. Use 2x Multisample Antialiasing. Use 4x Multisample Antialiasing. Use 8x Multisample Antialiasing. Likely unsupported on low-end and older hardware. Use 16x Multisample Antialiasing. Likely unsupported on medium and low-end hardware. If true, the viewport will be used in AR/VR process. The width and height of viewport. If true, the size override affects stretch as well. If true, the viewport will use defined in world property. The custom which can be used as 3D environment source. The custom which can be used as 2D environment source. If true, the viewport should render its background as transparent. The multisample anti-aliasing mode. A higher number results in smoother edges at the cost of significantly worse performance. A value of 4 is best unless targeting very high-end systems. Enables fast approximate antialiasing. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K. If true, uses a fast post-processing filter to make banding significantly less visible. 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. Note: Only available on the GLES3 backend. must also be true for debanding to be effective. If true, the viewport rendering will receive benefits from High Dynamic Range algorithm. High Dynamic Range allows the viewport to receive values that are outside the 0-1 range. In Godot HDR uses 16 bits, meaning it does not store the full range of a floating point number. Note: Requires to be set to or , since HDR is not supported for 2D. If true, the viewport will disable 3D rendering. For actual disabling use usage. If true, the result after 3D rendering will not have a linear to sRGB color conversion applied. This is important when the viewport is used as a render target where the result is used as a texture on a 3D object rendered in another viewport. It is also important if the viewport is used to create data that is not color based (noise, heightmaps, pickmaps, etc.). Do not enable this when the viewport is used as a texture on a 2D object or if the viewport is your final output. The rendering mode of viewport. If true, renders the Viewport directly to the screen instead of to the root viewport. Only available in GLES2. This is a low-level optimization and should not be used in most cases. If used, reading from the Viewport or from SCREEN_TEXTURE becomes unavailable. For more information see . The overlay mode for test rendered geometry in debug purposes. If true, the result of rendering will be flipped vertically. The clear mode when viewport used as a render target. Note: This property is intended for 2D usage. The update mode when viewport used as a render target. If true, the viewport will process 2D audio streams. If true, the viewport will process 3D audio streams. If true, the objects rendered by viewport become subjects of mouse picking process. If true, the viewport will not receive input events. If true, the GUI controls on the viewport will lay pixel perfectly. The shadow atlas' resolution (used for omni and spot lights). The value will be rounded up to the nearest power of 2. Note: If this is set to 0, shadows won't be visible. Since user-created viewports default to a value of 0, this value must be set above 0 manually. The subdivision amount of the first quadrant on the shadow atlas. The subdivision amount of the second quadrant on the shadow atlas. The subdivision amount of the third quadrant on the shadow atlas. The subdivision amount of the fourth quadrant on the shadow atlas. The canvas transform of the viewport, useful for changing the on-screen positions of all child s. This is relative to the global canvas transform of the viewport. The global canvas transform of the viewport. The canvas transform is relative to this. Returns the 2D world of the viewport. Returns the 3D world of the viewport, or if none the world of the parent viewport. Returns the total transform of the viewport. Returns the visible rectangle in global screen coordinates. Sets the size override of the viewport. If the enable parameter is true the override is used, otherwise it uses the default size. If the size parameter is (-1, -1), it won't update the size. If the parameter is null, then the default value is new Vector2(-1, -1) If the parameter is null, then the default value is new Vector2(0, 0) Returns the size override set with . Returns true if the size override is enabled. See . Returns information about the viewport from the rendering pipeline. Returns the viewport's texture. Note: Due to the way OpenGL works, the resulting is flipped vertically. You can use on the result of to flip it back, for example: var img = get_viewport().get_texture().get_data() img.flip_y() Returns the viewport's RID from the . Forces update of the 2D and 3D worlds. Returns the active 3D camera. Attaches this to the root with the specified rectangle. This bypasses the need for another node to display this but makes you responsible for updating the position of this manually. Returns the mouse position relative to the viewport. Warps the mouse to a position relative to the viewport. Returns true if there are visible modals on-screen. Returns the drag data from the GUI, that was previously returned by . Returns true if the viewport is currently performing a drag operation. Returns the topmost modal in the stack. Sets the number of subdivisions to use in the specified quadrant. A higher number of subdivisions allows you to have more shadows in the scene at once, but reduces the quality of the shadows. A good practice is to have quadrants with a varying number of subdivisions and to have as few subdivisions as possible. Returns the of the specified quadrant. Stops the input from propagating further down the . A node that holds a , automatically setting its size. Note: Changing a ViewportContainer's will cause its contents to appear distorted. To change its visual size without causing distortion, adjust the node's margins instead (if it's not already in a container). If true, the viewport will be scaled to the control's size. Divides the viewport's effective resolution by this value while preserving its scale. This can be used to speed up rendering. For example, a 1280×720 viewport with set to 2 will be rendered at 640×360 while occupying the same size in the container. Note: must be true for this property to work. Displays the content of a node as a dynamic . This can be used to mix controls, 2D, and 3D elements in the same scene. To create a ViewportTexture in code, use the method on the target viewport. The path to the node to display. This is relative to the scene root, not to the node which uses the texture. The VisibilityEnabler will disable and nodes when they are not visible. It will only affect other nodes within the same scene as the VisibilityEnabler itself. If you just want to receive notifications, use instead. Note: VisibilityEnabler uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account. The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an node as a child of a node and/or Vector3.dot. Note: VisibilityEnabler will not affect nodes added after scene initialization. This enabler will pause nodes. This enabler will freeze nodes. Represents the size of the enum. If true, nodes will be paused. If true, nodes will be paused. Sets active state of the enabler identified by given constant. Returns whether the enabler identified by given constant is active. The VisibilityEnabler2D will disable , , and other nodes when they are not visible. It will only affect nodes with the same root node as the VisibilityEnabler2D, and the root node itself. If you just want to receive notifications, use instead. Note: For performance reasons, VisibilityEnabler2D uses an approximate heuristic with precision determined by . If you need precise visibility checking, use another method such as adding an node as a child of a node. Note: VisibilityEnabler2D will not affect nodes added after scene initialization. This enabler will pause nodes. This enabler will freeze nodes. This enabler will stop nodes. This enabler will stop the parent's _process function. This enabler will stop the parent's _physics_process function. This enabler will stop nodes animations. Represents the size of the enum. If true, nodes will be paused. If true, nodes will be paused. If true, nodes will be paused. If true, nodes will be paused. If true, the parent's will be stopped. If true, the parent's will be stopped. Sets active state of the enabler identified by given constant. Returns whether the enabler identified by given constant is active. The VisibilityNotifier detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a 's view. If you want nodes to be disabled automatically when they exit the screen, use instead. Note: VisibilityNotifier uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account. The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an node as a child of a node and/or Vector3.dot. The VisibilityNotifier's bounding box. If true, the bounding box is on the screen. Note: It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return false right after it is instantiated, even if it will be on screen in the draw pass. The VisibilityNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport. If you want nodes to be disabled automatically when they exit the screen, use instead. Note: For performance reasons, VisibilityNotifier2D uses an approximate heuristic with precision determined by . If you need precise visibility checking, use another method such as adding an node as a child of a node. The VisibilityNotifier2D's bounding rectangle. If true, the bounding rectangle is on the screen. Note: It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return false right after it is instantiated, even if it will be on screen in the draw pass. The is used to connect a resource to a visual representation. All visual 3D nodes inherit from the . In general, you should not access the properties directly as they are accessed and managed by the nodes that inherit from . is the node representation of the instance. The render layer(s) this is drawn on. This object will only be visible for s whose cull mask includes the render object this is set to. Sets the resource that is instantiated by this , which changes how the engine handles the under the hood. Equivalent to . Returns the RID of the resource associated with this . For example, if the Node is a , this will return the RID of the associated . Returns the RID of this instance. This RID is the same as the RID returned by . This RID is needed if you want to call functions directly on this . Enables a particular layer in . Returns true when the specified layer is enabled in and false otherwise. Returns the transformed (also known as the bounding box) for this . Transformed in this case means the plus the position, rotation, and scale of the 's . See also . Returns the (also known as the bounding box) for this . See also . A script implemented in the Visual Script programming environment. The script extends the functionality of all objects that instance it. extends an existing object, if that object's class matches one of the script's base classes. You are most likely to use this class via the Visual Script editor or when writing plugins for it. Add a function with the specified name to the VisualScript. Returns whether a function exists with the specified name. Remove a specific function and its nodes from the script. Change the name of a function. Position the center of the screen for a function. Returns the position of the center of the screen for a given function. Add a node to a function of the VisualScript. If the parameter is null, then the default value is new Vector2(0, 0) Remove a specific node. Returns the id of a function's entry point node. Returns a node given its id and its function. Returns whether a node exists with the given id. Position a node on the screen. Returns a node's position in pixels. Connect two sequence ports. The execution will flow from of from_node's from_output into to_node. Unlike , there isn't a to_port, since the target node can have only one sequence port. Disconnect two sequence ports previously connected with . Returns whether the specified sequence ports are connected. Connect two data ports. The value of from_node's from_port would be fed into to_node's to_port. Disconnect two data ports previously connected with . Returns whether the specified data ports are connected. Add a variable to the VisualScript, optionally giving it a default value or marking it as exported. Returns whether a variable exists with the specified name. Remove a variable with the given name. Change the default (initial) value of a variable. Returns the default (initial) value of a variable. Set a variable's info, using the same format as . Returns the information for a given variable as a dictionary. The information includes its name, type, hint and usage. Change whether a variable is exported. Returns whether a variable is exported. Change the name of a variable. Add a custom signal with the specified name to the VisualScript. Returns whether a signal exists with the specified name. Add an argument to a custom signal added with . Change the type of a custom signal's argument. Get the type of a custom signal's argument. Rename a custom signal's argument. Get the name of a custom signal's argument. Remove a specific custom signal's argument. Get the count of a custom signal's arguments. Swap two of the arguments of a custom signal. Remove a custom signal with the given name. Change the name of a custom signal. Set the base type of the script. A Visual Script node representing a constant from base types, such as . The type to get the constant from. The name of the constant to return. A built-in function used inside a . It is usually a math function or an utility function. See also @GDScript, for the same functions in the GDScript language. Return the sine of the input. Return the cosine of the input. Return the tangent of the input. Return the hyperbolic sine of the input. Return the hyperbolic cosine of the input. Return the hyperbolic tangent of the input. Return the arc sine of the input. Return the arc cosine of the input. Return the arc tangent of the input. Return the arc tangent of the input, using the signs of both parameters to determine the exact angle. Return the square root of the input. Return the remainder of one input divided by the other, using floating-point numbers. Return the positive remainder of one input divided by the other, using floating-point numbers. Return the input rounded down. Return the input rounded up. Return the input rounded to the nearest integer. Return the absolute value of the input. Return the sign of the input, turning it into 1, -1, or 0. Useful to determine if the input is positive or negative. Return the input raised to a given power. Return the natural logarithm of the input. Note that this is not the typical base-10 logarithm function calculators use. Return the mathematical constant e raised to the specified power of the input. e has an approximate value of 2.71828. Return whether the input is NaN (Not a Number) or not. NaN is usually produced by dividing 0 by 0, though other ways exist. Return whether the input is an infinite floating-point number or not. Infinity is usually produced by dividing a number by 0, though other ways exist. Easing function, based on exponent. 0 is constant, 1 is linear, 0 to 1 is ease-in, 1+ is ease out. Negative values are in-out/out in. Return the number of digit places after the decimal that the first non-zero digit occurs. Return the input snapped to a given step. Return a number linearly interpolated between the first two inputs, based on the third input. Uses the formula a + (a - b) * t. Moves the number toward a value, based on the third input. Return the result of value decreased by step * amount. Randomize the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time. Return a random 32 bits integer value. To obtain a random value between 0 to N (where N is smaller than 2^32 - 1), you can use it with the remainder function. Return a random floating-point value between 0 and 1. To obtain a random value between 0 to N, you can use it with multiplication. Return a random floating-point value between the two inputs. Set the seed for the random number generator. Return a random value from the given seed, along with the new seed. Convert the input from degrees to radians. Convert the input from radians to degrees. Convert the input from linear volume to decibel volume. Convert the input from decibel volume to linear volume. Converts a 2D point expressed in the polar coordinate system (a distance from the origin r and an angle th) to the cartesian coordinate system (X and Y axis). Converts a 2D point expressed in the cartesian coordinate system (X and Y axis) to the polar coordinate system (a distance from the origin and an angle). Return the greater of the two numbers, also known as their maximum. Return the lesser of the two numbers, also known as their minimum. Return the input clamped inside the given range, ensuring the result is never outside it. Equivalent to min(max(input, range_low), range_high). Return the nearest power of 2 to the input. Create a from the input. Create a from the input. Convert between types. Return the type of the input as an integer. Check for the integers that might be returned. Checks if a type is registered in the . Return a character with the given ascii value. Convert the input to a string. Print the given string to the output window. Print the given string to the standard error output. Print the given string to the standard output, without adding a newline. Serialize a Variant to a string. Deserialize a Variant from a string serialized using . Serialize a Variant to a . Deserialize a Variant from a serialized using . Return the with the given name and alpha ranging from 0 to 1. Note: Names are defined in color_names.inc. Return a number smoothly interpolated between the first two inputs, based on the third input. Similar to , but interpolates faster at the beginning and slower at the end. Using Hermite interpolation formula: var t = clamp((weight - from) / (to - from), 0.0, 1.0) return t * t * (3.0 - 2.0 * t) Represents the size of the enum. The function to be executed. This node returns a constant from a given class, such as . See the given class' documentation for available constants. Input Ports: none Output Ports: - Data (variant): value The constant's parent class. The constant to return. See the given class for its available constants. A Visual Script node used to display annotations in the script, so that code may be documented. Comment nodes can be resized so they encompass a group of nodes. The comment node's title. The text inside the comment node. The comment node's size (in pixels). A Visual Script Node used to compose array from the list of elements provided with custom in-graph UI hard coded in the VisualScript Editor. A Visual Script node that checks a input port. If true, it will exit via the "true" sequence port. If false, it will exit via the "false" sequence port. After exiting either, it exits via the "done" port. Sequence ports may be left disconnected. Input Ports: - Sequence: if (cond) is - Data (boolean): cond Output Ports: - Sequence: true - Sequence: false - Sequence: done This node returns a constant's value. Input Ports: none Output Ports: - Data (variant): get The constant's type. The constant's value. A Visual Script node which calls a base type constructor. It can be used for type conversion as well. A custom Visual Script node which can be scripted in powerful ways. Hint used by to tell that control should return to it when there is no other node left to execute. This is used by to redirect the sequence to the "Done" port after the true/false branch has finished execution. Hint used by to tell that control should return back, either hitting a previous or exiting the function. Hint used by to tell that control should stop and exit the function. Hint used by to tell that the function should be yielded. Using this requires you to have at least one working memory slot, which is used for the . The start mode used the first time when is called. The start mode used when is called after coming back from a . The start mode used when is called after resuming from . Return the node's title. Return the node's category. Return the count of input value ports. Return the specified input port's name. Return the specified input port's type. See the values. Return the amount of output sequence ports. Return the specified sequence output's name. Return the amount of output value ports. Return the specified output's name. Return the specified output's type. See the values. Return the custom node's text, which is shown right next to the input sequence port (if there is none, on the place that is usually taken by it). Return the size of the custom node's working memory. See for more details. Return whether the custom node has an input sequence port. Execute the custom node's logic, returning the index of the output sequence port to use or a when there is an error. The inputs array contains the values of the input ports. outputs is an array whose indices should be set to the respective outputs. The start_mode is usually , unless you have used the STEP_* constants. working_mem is an array which can be used to persist information between runs of the custom node. When returning, you can mask the returned value with one of the STEP_* constants. A Visual Script node which deconstructs a base type instance into its parts. The type to deconstruct. Emits a specified signal when it is executed. Input Ports: - Sequence: emit Output Ports: - Sequence The signal to emit. A Visual Script node returning a singleton from @GlobalScope. The singleton's name. This node steps through each item in a given input. Input can be any sequence data type, such as an or . When each item has been processed, execution passed out the exit Sequence port. Input Ports: - Sequence: for (elem) in (input) - Data (variant): input Output Ports: - Sequence: each - Sequence: exit - Data (variant): elem A Visual Script virtual class that defines the shape and the default behavior of the nodes that have to be in-graph editable nodes. Returns a local variable's value. "Var Name" must be supplied, with an optional type. Input Ports: none Output Ports: - Data (variant): get The local variable's name. The local variable's type. Changes a local variable's value to the given input. The new value is also provided on an output Data port. Input Ports: - Sequence - Data (variant): set Output Ports: - Sequence - Data (variant): get The local variable's name. The local variable's type. Provides common math constants, such as Pi, on an output Data port. Input Ports: none Output Ports: - Data (variant): get Unity: 1. Pi: 3.141593. Pi divided by two: 1.570796. Tau: 6.283185. Mathematical constant e, the natural log base: 2.718282. Square root of two: 1.414214. Infinity: inf. Not a number: nan. Represents the size of the enum. The math constant. A node which is part of a . Not to be confused with , which is a part of a . Returns the instance the node is bound to. Change the default value of a given port. Returns the default value of a given port. The default value is used when nothing is connected to the port. Notify that the node's ports have changed. Usually used in conjunction with . Input Ports: - Data (variant): A - Data (variant): B Output Ports: - Data (variant): result Creates a new or loads one from the filesystem. Input Ports: none Output Ports: - Data (object): res The to load. Ends the execution of a function and returns control to the calling function. Optionally, it can return a Variant value. Input Ports: - Sequence - Data (variant): result (optional) Output Ports: none If true, the return input port is available. The return value's data type. A direct reference to a node. Input Ports: none Output Ports: - Data: node (obj) The node's path in the scene tree. Chooses between two input values based on a Boolean condition. Input Ports: - Data (boolean): cond - Data (variant): a - Data (variant): b Output Ports: - Data (variant): out The input variables' type. Provides a reference to the node running the visual script. Input Ports: none Output Ports: - Data (object): instance Steps through a series of one or more output Sequence ports. The current data port outputs the currently executing item. Input Ports: - Sequence: in order Output Ports: - Sequence: 1 - Sequence: 2 - n (optional) - Data (int): current The number of steps in the sequence. Branches the flow based on an input's value. Use Case Count in the Inspector to set the number of branches and each comparison's optional type. Input Ports: - Sequence: 'input' is - Data (variant): = - Data (variant): = (optional) - Data (variant): input Output Ports: - Sequence - Sequence (optional) - Sequence: done Returns a variable's value. "Var Name" must be supplied, with an optional type. Input Ports: none Output Ports: - Data (variant): value The variable's name. Changes a variable's value to the given input. Input Ports: - Sequence - Data (variant): set Output Ports: - Sequence The variable's name. Loops while a condition is true. Execution continues out the exit Sequence port when the loop terminates. Input Ports: - Sequence: while(cond) - Data (bool): cond Output Ports: - Sequence: repeat - Sequence: exit Server for anything visible. The visual server is the API backend for everything visible. The whole scene system mounts on it to display. The visual server is completely opaque, the internals are entirely implementation specific and cannot be accessed. The visual server can be used to bypass the scene system entirely. Resources are created using the *_create functions. All objects are drawn to a viewport. You can use the attached to the or you can create one yourself with . When using a custom scenario or canvas, the scenario or canvas needs to be attached to the viewport using or . In 3D, all visual objects must be associated with a scenario. The scenario is a visual representation of the world. If accessing the visual server from a running game, the scenario can be accessed from the scene tree from any node with . Otherwise, a scenario can be created with . Similarly, in 2D, a canvas is needed to draw all canvas items. In 3D, all visible objects are comprised of a resource and an instance. A resource can be a mesh, a particle system, a light, or any other 3D object. In order to be visible resources must be attached to an instance using . The instance must also be attached to the scenario using in order to be visible. In 2D, all visible objects are some form of canvas item. In order to be visible, a canvas item needs to be the child of a canvas attached to a viewport, or it needs to be the child of another canvas item that is eventually attached to the canvas. Marks an error that shows that the index array is empty. Number of weights/bones per vertex. The minimum Z-layer for canvas items. The maximum Z-layer for canvas items. Max number of glow levels that can be used with glow post-process effect. Unused enum in Godot 3.x. The minimum renderpriority of all materials. The maximum renderpriority of all materials. Reflection probe will update reflections once and then stop. Reflection probe will update each frame. This mode is necessary to capture moving objects. Keeps shadows stable as camera moves but has lower effective resolution. Optimize use of shadow maps, increasing the effective resolution. But may result in shadows moving or flickering slightly. Blend shapes are normalized. Blend shapes are relative to base weight. Primitive to draw consists of points. Primitive to draw consists of lines. Primitive to draw consists of a line strip from start to end. Primitive to draw consists of a line loop (a line strip with a line between the last and the first vertex). Primitive to draw consists of triangles. Primitive to draw consists of a triangle strip (the last 3 vertices are always combined to make a triangle). Primitive to draw consists of a triangle strip (the last 2 vertices are always combined with the first to make a triangle). Represents the size of the enum. Normal texture with 2 dimensions, width and height. Texture made up of six faces, can be looked up with a vec3 in shader. An array of 2-dimensional textures. A 3-dimensional texture with width, height, and depth. Lowest quality of screen space ambient occlusion. Medium quality screen space ambient occlusion. Highest quality screen space ambient occlusion. Use lowest blur quality. Fastest, but may look bad. Use medium blur quality. Used highest blur quality. Looks the best, but is the slowest. The amount of objects in the frame. The amount of vertices in the frame. The amount of modified materials in the frame. The amount of shader rebinds in the frame. The amount of surface changes in the frame. The amount of draw calls in frame. The amount of 2d items in the frame. The amount of 2d draw calls in frame. Unimplemented in the GLES2 and GLES3 rendering backends, always returns 0. The amount of video memory used, i.e. texture and vertex memory combined. The amount of texture memory used. The amount of vertex memory used. The nine patch gets stretched where needed. The nine patch gets filled with tiles where needed. The nine patch gets filled with tiles where needed and stretches them a bit if needed. Number of objects drawn in a single frame. Number of vertices drawn in a single frame. Number of material changes during this frame. Number of shader changes during this frame. Number of surface changes during this frame. Number of draw calls during this frame. Number of 2d items drawn this frame. Number of 2d draw calls during this frame. Represents the size of the enum. The viewport is always cleared before drawing. The viewport is never cleared before drawing. The viewport is cleared once, then the clear mode is set to . Use more detail vertically when computing shadow map. Use more detail horizontally when computing shadow map. Shader is a 3D shader. Shader is a 2D shader. Shader is a particle shader. Represents the size of the enum. Use to store MultiMesh transform. Use to store MultiMesh transform. Disable shadows from this instance. Cast shadows from this instance. Disable backface culling when rendering the shadow of the object. This is slightly slower but may result in more correct shadows. Only render the shadows from the object. The object itself will not be drawn. Debug draw is disabled. Default setting. Debug draw sets objects to unshaded. Overwrites clear color to (0,0,0,0). Debug draw draws objects in wireframe. The Viewport does not render 3D but samples. The Viewport does not render 3D and does not sample. The Viewport renders 3D with effects. The Viewport renders 3D but without effects. Use the clear color as background. Use a specified color as the background. Use a sky resource for the background. Use a custom color for background, but use a sky for shading and reflections. Use a specified canvas layer as the background. This can be useful for instantiating a 2D scene in a 3D world. Do not clear the background, use whatever was rendered last frame as the background. Represents the size of the enum. MultiMesh does not use custom data. MultiMesh custom data uses 8 bits per component. This packs the 4-component custom data into a single float. MultiMesh custom data uses a float per component. Use a dual paraboloid shadow map for omni lights. Use a cubemap shadow map for omni lights. Slower but better quality than dual paraboloid. Generates mipmaps, which are smaller versions of the same texture to use when zoomed out, keeping the aspect ratio. Repeats the texture (instead of clamp to edge). Uses a magnifying filter, to enable smooth zooming in of the texture. Uses anisotropic mipmap filtering. Generates smaller versions of the same texture with different aspect ratios. This results in better-looking textures when viewed from oblique angles. Converts the texture to the sRGB color space. Repeats the texture with alternate sections mirrored. Texture is a video surface. Default flags. , and are enabled. Hardware supports shaders. This enum is currently unused in Godot 3.x. Hardware supports multithreading. This enum is currently unused in Godot 3.x. The instance does not have a type. The instance is a mesh. The instance is a multimesh. The instance is an immediate geometry. The instance is a particle emitter. The instance is a light. The instance is a reflection probe. The instance is a GI probe. The instance is a lightmap capture. Represents the size of the enum. A combination of the flags of geometry instances (mesh, multimesh, immediate and particles). Disables the blur set for SSAO. Will make SSAO look noisier. Perform a 1x1 blur on the SSAO output. Performs a 2x2 blur on the SSAO output. Performs a 3x3 blur on the SSAO output. Use this for smoothest SSAO. Output color as they came in. Use the Reinhard tonemapper. Use the filmic tonemapper. Use the ACES tonemapper. Add the effect of the glow on top of the scene. Blends the glow effect with the screen. Does not get as bright as additive. Produces a subtle color disturbance around objects. Shows the glow effect by itself without the underlying scene. MultiMesh does not use per-instance color. MultiMesh color uses 8 bits per component. This packs the color into a single float. MultiMesh color uses a float per channel. Do not apply a filter to canvas light shadows. Use PCF3 filtering to filter canvas light shadows. Use PCF5 filtering to filter canvas light shadows. Use PCF7 filtering to filter canvas light shadows. Use PCF9 filtering to filter canvas light shadows. Use PCF13 filtering to filter canvas light shadows. Do not use a debug mode. Draw all objects as wireframe models. Draw all objects in a way that displays how much overdraw is occurring. Overdraw occurs when a section of pixels is drawn and shaded and then another object covers it up. To optimize a scene, you should reduce overdraw. Draw all objects without shading. Equivalent to setting all objects shaders to unshaded. Do not update the viewport. Update the viewport once then set to disabled. Update the viewport whenever it is visible. Always update the viewport. Flag used to mark a vertex array. Flag used to mark a normal array. Flag used to mark a tangent array. Flag used to mark a color array. Flag used to mark an UV coordinates array. Flag used to mark an UV coordinates array for the second UV coordinates. Flag used to mark a bone information array. Flag used to mark a weights array. Flag used to mark an index array. Flag used to mark a compressed (half float) vertex array. Flag used to mark a compressed (half float) normal array. Flag used to mark a compressed (half float) tangent array. Flag used to mark a compressed (half float) color array. Flag used to mark a compressed (half float) UV coordinates array. Flag used to mark a compressed (half float) UV coordinates array for the second UV coordinates. Flag used to mark a compressed bone array. Flag used to mark a compressed (half float) weight array. Flag used to mark a compressed index array. Flag used to mark that the array contains 2D vertices. Flag used to mark that the array uses 16-bit bones instead of 8-bit. Used to set flags , , , , and quickly. Draw particles in the order that they appear in the particles array. Sort particles based on their lifetime. Sort particles based on their distance to the camera. Adds light color additive to the canvas. Adds light color subtractive to the canvas. The light adds color depending on transparency. The light adds color depending on mask. Use orthogonal shadow projection for directional light. Use 2 splits for shadow projection when using directional light. Use 4 splits for shadow projection when using directional light. The light's energy. The light's influence on specularity. The light's range. The light's attenuation. The spotlight's angle. The spotlight's attenuation. Scales the shadow color. Max distance that shadows will be rendered. Proportion of shadow atlas occupied by the first split. Proportion of shadow atlas occupied by the second split. Proportion of shadow atlas occupied by the third split. The fourth split occupies the rest. Normal bias used to offset shadow lookup by object normal. Can be used to fix self-shadowing artifacts. Bias the shadow lookup to fix self-shadowing artifacts. Increases bias on further splits to fix self-shadowing that only occurs far away from the camera. Represents the size of the enum. Array is a vertex array. Array is a normal array. Array is a tangent array. Array is a color array. Array is an UV coordinates array. Array is an UV coordinates array for the second UV coordinates. Array contains bone information. Array is weight information. Array is index array. Represents the size of the enum. Culling of the canvas occluder is disabled. Culling of the canvas occluder is clockwise. Culling of the canvas occluder is counterclockwise. Allows the instance to be used in baked lighting. When set, manually requests to draw geometry on next frame. Represents the size of the enum. Multisample antialiasing is disabled. Multisample antialiasing is set to 2×. Multisample antialiasing is set to 4×. Multisample antialiasing is set to 8×. Multisample antialiasing is set to 16×. Multisample antialiasing is set to 2× on external texture. Special mode for GLES2 Android VR (Oculus Quest and Go). Multisample antialiasing is set to 4× on external texture. Special mode for GLES2 Android VR (Oculus Quest and Go). Is a directional (sun) light. Is an omni light. Is a spot light. Marks the left side of a cubemap. Marks the right side of a cubemap. Marks the bottom side of a cubemap. Marks the top side of a cubemap. Marks the front side of a cubemap. Marks the back side of a cubemap. If false, disables rendering completely, but the engine logic is still being processed. You can call to draw a frame even with rendering disabled. Synchronizes threads. Forces a frame to be drawn when the function is called. Drawing a frame updates all s that are set to update. Use with extreme caution. Not implemented in Godot 3.x. Draws a frame. This method is deprecated, please use instead. Creates an empty texture and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all texture_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. Creates a texture, allocates the space for an image, and fills in the image. Allocates the GPU memory for the texture. Sets the texture's image data. If it's a CubeMap, it sets the image data at a cube side. Sets a part of the data for a texture. Warning: this function calls the underlying graphics API directly and may corrupt your texture if used improperly. Returns a copy of a texture's image unless it's a CubeMap, in which case it returns the of the image at one of the cubes sides. Sets the texture's flags. See for options. Returns the flags of a texture. Returns the format of the texture's image. Returns the type of the texture, can be any of the . Returns the opengl id of the texture's image. Returns the texture's width. Returns the texture's height. Returns the depth of the texture. Resizes the texture to the specified dimensions. Sets the texture's path. Returns the texture's path. If true, sets internal processes to shrink all image data to half the size. Binds the texture to a texture slot. Returns a list of all the textures and their information. If true, the image will be stored in the texture's images array if overwritten. Creates an empty sky and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all sky_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. Sets a sky's texture. Creates an empty shader and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all shader_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. Sets a shader's code. Returns a shader's code. Returns the parameters of a shader. Sets a shader's default texture. Overwrites the texture given by name. Returns a default texture from a shader searched by name. Creates an empty material and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all material_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. Sets a shader material's shader. Returns the shader of a certain material's shader. Returns an empty RID if the material doesn't have a shader. Sets a material's parameter. Returns the value of a certain material's parameter. Returns the default value for the param if available. Otherwise returns an empty Variant. Sets a material's render priority. Sets a material's line width. Sets an object's next material. Creates a new mesh and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all mesh_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. To place in a scene, attach this mesh to an instance using using the returned RID. Function is unused in Godot 3.x. Function is unused in Godot 3.x. Adds a surface generated from the Arrays to a mesh. See constants for types. If the parameter is null, then the default value is new Godot.Collections.Array {} Sets a mesh's blend shape count. Returns a mesh's blend shape count. Sets a mesh's blend shape mode. Returns a mesh's blend shape mode. Updates a specific region of a vertex buffer for the specified surface. Warning: this function alters the vertex buffer directly with no safety mechanisms, you can easily corrupt your mesh. Sets a mesh's surface's material. Returns a mesh's surface's material. Returns a mesh's surface's amount of vertices. Returns a mesh's surface's amount of indices. Returns a mesh's surface's vertex buffer. Returns a mesh's surface's index buffer. Returns a mesh's surface's buffer arrays. Returns a mesh's surface's arrays for blend shapes. Returns the format of a mesh's surface. Returns the primitive type of a mesh's surface. Returns a mesh's surface's aabb. Returns the aabb of a mesh's surface's skeleton. Removes a mesh's surface. Returns a mesh's number of surfaces. Sets a mesh's custom aabb. Returns a mesh's custom aabb. Removes all surfaces from a mesh. Creates a new multimesh on the VisualServer and returns an handle. This RID will be used in all multimesh_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. To place in a scene, attach this multimesh to an instance using using the returned RID. Allocates space for the multimesh data. Format parameters determine how the data will be stored by OpenGL. See , , and for usage. Equivalent to . Returns the number of instances allocated for this multimesh. Sets the mesh to be drawn by the multimesh. Equivalent to . Sets the for this instance. Equivalent to . Sets the for this instance. For use when multimesh is used in 2D. Equivalent to . Sets the color by which this instance will be modulated. Equivalent to . Sets the custom data for this instance. Custom data is passed as a , but is interpreted as a vec4 in the shader. Equivalent to . Returns the RID of the mesh that will be used in drawing this multimesh. Calculates and returns the axis-aligned bounding box that encloses all instances within the multimesh. Returns the of the specified instance. Returns the of the specified instance. For use when the multimesh is set to use 2D transforms. Returns the color by which the specified instance will be modulated. Returns the custom data associated with the specified instance. Sets the number of instances visible at a given time. If -1, all instances that have been allocated are drawn. Equivalent to . Returns the number of visible instances for this multimesh. Sets all data related to the instances in one go. This is especially useful when loading the data from disk or preparing the data from GDNative. All data is packed in one large float array. An array may look like this: Transform for instance 1, color data for instance 1, custom data for instance 1, transform for instance 2, color data for instance 2, etc. is stored as 12 floats, is stored as 8 floats, COLOR_8BIT / CUSTOM_DATA_8BIT is stored as 1 float (4 bytes as is) and COLOR_FLOAT / CUSTOM_DATA_FLOAT is stored as 4 floats. Creates an immediate geometry and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all immediate_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. To place in a scene, attach this immediate geometry to an instance using using the returned RID. Sets up internals to prepare for drawing. Equivalent to . Adds the next vertex using the information provided in advance. Equivalent to . Adds the next vertex using the information provided in advance. This is a helper class that calls under the hood. Equivalent to . Sets the normal to be used with next vertex. Equivalent to . Sets the tangent to be used with next vertex. Equivalent to . Sets the color to be used with next vertex. Equivalent to . Sets the UV to be used with next vertex. Equivalent to . Sets the UV2 to be used with next vertex. Equivalent to . Ends drawing the and displays it. Equivalent to . Clears everything that was set up between and . Equivalent to . Sets the material to be used to draw the . Returns the material assigned to the . Creates a skeleton and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all skeleton_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. Allocates the GPU buffers for this skeleton. Returns the number of bones allocated for this skeleton. Sets the for a specific bone of this skeleton. Returns the set for a specific bone of this skeleton. Sets the for a specific bone of this skeleton. Returns the set for a specific bone of this skeleton. Creates a directional light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most light_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. To place in a scene, attach this directional light to an instance using using the returned RID. Creates a new omni light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most light_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. To place in a scene, attach this omni light to an instance using using the returned RID. Creates a spot light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most light_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. To place in a scene, attach this spot light to an instance using using the returned RID. Sets the color of the light. Equivalent to . Sets the specified light parameter. See for options. Equivalent to . If true, light will cast shadows. Equivalent to . Sets the color of the shadow cast by the light. Equivalent to . Not implemented in Godot 3.x. If true, light will subtract light instead of adding light. Equivalent to . Sets the cull mask for this Light. Lights only affect objects in the selected layers. Equivalent to . If true, reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double sided shadows with . Equivalent to . Sets whether GI probes capture light information from this light. Deprecated method. Use instead. This method is only kept for compatibility reasons and calls internally, setting the bake mode to or depending on the given parameter. Sets the bake mode for this light, see for options. The bake mode affects how the light will be baked in s and s. Sets whether to use a dual paraboloid or a cubemap for the shadow map. Dual paraboloid is faster but may suffer from artifacts. Equivalent to . Sets whether to use vertical or horizontal detail for this omni light. This can be used to alleviate artifacts in the shadow map. Equivalent to . Sets the shadow mode for this directional light. Equivalent to . See for options. If true, this directional light will blend between shadow map splits resulting in a smoother transition between them. Equivalent to . Sets the shadow depth range mode for this directional light. Equivalent to . See for options. Creates a reflection probe and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all reflection_probe_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. To place in a scene, attach this reflection probe to an instance using using the returned RID. Sets how often the reflection probe updates. Can either be once or every frame. See for options. Sets the intensity of the reflection probe. Intensity modulates the strength of the reflection. Equivalent to . Sets the ambient light color for this reflection probe when set to interior mode. Equivalent to . Sets the energy multiplier for this reflection probes ambient light contribution when set to interior mode. Equivalent to . Sets the contribution value for how much the reflection affects the ambient light for this reflection probe when set to interior mode. Useful so that ambient light matches the color of the room. Equivalent to . Sets the max distance away from the probe an object can be before it is culled. Equivalent to . Sets the size of the area that the reflection probe will capture. Equivalent to . Sets the origin offset to be used when this reflection probe is in box project mode. Equivalent to . If true, reflections will ignore sky contribution. Equivalent to . If true, uses box projection. This can make reflections look more correct in certain situations. Equivalent to . If true, computes shadows in the reflection probe. This makes the reflection much slower to compute. Equivalent to . Sets the render cull mask for this reflection probe. Only instances with a matching cull mask will be rendered by this probe. Equivalent to . Creates a GI probe and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all gi_probe_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. To place in a scene, attach this GI probe to an instance using using the returned RID. Sets the axis-aligned bounding box that covers the extent of the GI probe. Returns the axis-aligned bounding box that covers the full extent of the GI probe. Sets the size of individual cells within the GI probe. Returns the cell size set by . Sets the to cell for this GI probe. Returns the Transform set by . Sets the data to be used in the GI probe for lighting calculations. Normally this is created and called internally within the node. You should not try to set this yourself. Returns the data used by the GI probe. Sets the dynamic range of the GI probe. Dynamic range sets the limit for how bright lights can be. A smaller range captures greater detail but limits how bright lights can be. Equivalent to . Returns the dynamic range set for this GI probe. Equivalent to . Sets the energy multiplier for this GI probe. A higher energy makes the indirect light from the GI probe brighter. Equivalent to . Returns the energy multiplier for this GI probe. Equivalent to . Sets the bias value to avoid self-occlusion. Equivalent to . Returns the bias value for the GI probe. Bias is used to avoid self occlusion. Equivalent to . Sets the normal bias for this GI probe. Normal bias behaves similar to the other form of bias and may help reduce self-occlusion. Equivalent to . Returns the normal bias for this GI probe. Equivalent to . Sets the propagation of light within this GI probe. Equivalent to . Returns the propagation value for this GI probe. Equivalent to . Sets the interior value of this GI probe. A GI probe set to interior does not include the sky when calculating lighting. Equivalent to . Returns true if the GI probe is set to interior, meaning it does not account for sky light. Equivalent to . Sets the compression setting for the GI probe data. Compressed data will take up less space but may look worse. Equivalent to . Returns true if the GI probe data associated with this GI probe is compressed. Equivalent to . Creates a lightmap capture and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all lightmap_capture_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. To place in a scene, attach this lightmap capture to an instance using using the returned RID. Sets the size of the area covered by the lightmap capture. Equivalent to . Returns the size of the lightmap capture area. Sets the octree to be used by this lightmap capture. This function is normally used by the node. Equivalent to . Sets the octree cell transform for this lightmap capture's octree. Equivalent to . Returns the cell transform for this lightmap capture's octree. Sets the subdivision level of this lightmap capture's octree. Equivalent to . Returns the cell subdivision amount used by this lightmap capture's octree. Returns the octree used by the lightmap capture. Sets the energy multiplier for this lightmap capture. Equivalent to . Returns the energy multiplier used by the lightmap capture. Sets the "interior" mode for this lightmap capture. Equivalent to . Returns true if capture is in "interior" mode. Creates a particle system and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all particles_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. To place in a scene, attach these particles to an instance using using the returned RID. If true, particles will emit over time. Setting to false does not reset the particles, but only stops their emission. Equivalent to . Returns true if particles are currently set to emitting. Sets the number of particles to be drawn and allocates the memory for them. Equivalent to . Sets the lifetime of each particle in the system. Equivalent to . If true, particles will emit once and then stop. Equivalent to . Sets the preprocess time for the particles' animation. This lets you delay starting an animation until after the particles have begun emitting. Equivalent to . Sets the explosiveness ratio. Equivalent to . Sets the emission randomness ratio. This randomizes the emission of particles within their phase. Equivalent to . Sets a custom axis-aligned bounding box for the particle system. Equivalent to . Sets the speed scale of the particle system. Equivalent to . If true, particles use local coordinates. If false they use global coordinates. Equivalent to . Sets the material for processing the particles. Note: this is not the material used to draw the materials. Equivalent to . Sets the frame rate that the particle system rendering will be fixed to. Equivalent to . If true, uses fractional delta which smooths the movement of the particles. Equivalent to . Returns true if particles are not emitting and particles are set to inactive. Add particle system to list of particle systems that need to be updated. Update will take place on the next frame, or on the next call to , , or . Reset the particles on the next update. Equivalent to . Sets the draw order of the particles to one of the named enums from . See for options. Equivalent to . Sets the number of draw passes to use. Equivalent to . Sets the mesh to be used for the specified draw pass. Equivalent to , , , and . Calculates and returns the axis-aligned bounding box that contains all the particles. Equivalent to . Sets the that will be used by the particles when they first emit. Creates a camera and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all camera_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. Sets camera to use perspective projection. Objects on the screen becomes smaller when they are far away. Sets camera to use orthogonal projection, also known as orthographic projection. Objects remain the same size on the screen no matter how far away they are. Sets camera to use frustum projection. This mode allows adjusting the offset argument to create "tilted frustum" effects. Sets of camera. Sets the cull mask associated with this camera. The cull mask describes which 3D layers are rendered by this camera. Equivalent to . Sets the environment used by this camera. Equivalent to . If true, preserves the horizontal aspect ratio which is equivalent to . If false, preserves the vertical aspect ratio which is equivalent to . Creates an empty viewport and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all viewport_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. If true, the viewport uses augmented or virtual reality technologies. See . Sets the viewport's width and height. If true, sets the viewport active, else sets it inactive. Sets the viewport's parent to another viewport. Copies viewport to a region of the screen specified by rect. If is true, then 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: func _ready(): get_viewport().set_attach_to_screen_rect(Rect2()) $Viewport.set_attach_to_screen_rect(Rect2(0, 0, 600, 600)) 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 a further optimization see, . If the parameter is null, then the default value is new Rect2(0, 0, 0, 0) If true, render the contents of the viewport directly to screen. This allows a low-level optimization where you can skip drawing a viewport to the root viewport. While this optimization can result in a significant increase in speed (especially on older devices), it comes at a cost of usability. When this is enabled, you cannot read from the viewport or from the SCREEN_TEXTURE. You also lose the benefit of certain window settings, such as the various stretch modes. Another consequence to be aware of is that in 2D the rendering happens in window coordinates, so if you have a viewport that is double the size of the window, and you set this, then only the portion that fits within the window will be drawn, no automatic scaling is possible, even if your game scene is significantly larger than the window size. Detaches the viewport from the screen. Sets when the viewport should be updated. See constants for options. If true, the viewport's rendering is flipped vertically. Sets the clear mode of a viewport. See for options. Returns the viewport's last rendered frame. Currently unimplemented in Godot 3.x. If true, the viewport's canvas is not rendered. If true, rendering of a viewport's environment is disabled. If true, a viewport's 3D rendering is disabled. Sets a viewport's camera. Sets a viewport's scenario. The scenario contains information about the , environment information, reflection atlas etc. Sets a viewport's canvas. Detaches a viewport from a canvas and vice versa. Sets the transformation of a viewport's canvas. If true, the viewport renders its background as transparent. Sets the viewport's global transformation matrix. Sets the stacking order for a viewport's canvas. layer is the actual canvas layer, while sublayer specifies the stacking order of the canvas among those in the same layer. Sets the size of the shadow atlas's images (used for omni and spot lights). The value will be rounded up to the nearest power of 2. Sets the shadow atlas quadrant's subdivision. Sets the anti-aliasing mode. See for options. Enables fast approximate antialiasing for this viewport. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K. If true, uses a fast post-processing filter to make banding significantly less visible. 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. Note: Only available on the GLES3 backend. must also be true for debanding to be effective. If true, the viewport renders to hdr. Sets the viewport's 2D/3D mode. See constants for options. Returns a viewport's render information. For options, see the constants. Sets the debug draw mode of a viewport. See for options. Creates an environment and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all environment_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. Sets the BGMode of the environment. Equivalent to . Sets the to be used as the environment's background when using BGMode sky. Equivalent to . Sets a custom field of view for the background . Equivalent to . Sets the rotation of the background expressed as a . Equivalent to . Color displayed for clear areas of the scene (if using Custom color or Color+Sky background modes). Sets the intensity of the background color. Sets the maximum layer to use if using Canvas background mode. Sets the ambient light parameters. See for more details. Sets the values to be used with the "DoF Near Blur" post-process effect. See for more details. Sets the values to be used with the "DoF Far Blur" post-process effect. See for more details. Sets the variables to be used with the "glow" post-process effect. See for more details. Sets the variables to be used with the "tonemap" post-process effect. See for more details. Sets the values to be used with the "Adjustment" post-process effect. See for more details. Sets the variables to be used with the "screen space reflections" post-process effect. See for more details. Sets the variables to be used with the "Screen Space Ambient Occlusion (SSAO)" post-process effect. See for more details. Sets the variables to be used with the scene fog. See for more details. Sets the variables to be used with the fog depth effect. See for more details. Sets the variables to be used with the fog height effect. See for more details. Creates a scenario and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all scenario_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. The scenario is the 3D world that all the visual instances exist in. Sets the for this scenario. See for options. Sets the environment that will be used with this scenario. Sets the size of the reflection atlas shared by all reflection probes in this scenario. Sets the fallback environment to be used by this scenario. The fallback environment is used if no environment is set. Internally, this is used by the editor to provide a default environment. Creates a visual instance, adds it to the VisualServer, and sets both base and scenario. It can be accessed with the RID that is returned. This RID will be used in all instance_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. Creates a visual instance and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all instance_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. An instance is a way of placing a 3D object in the scenario. Objects like particles, meshes, and reflection probes need to be associated with an instance to be visible in the scenario using . Sets the base of the instance. A base can be any of the 3D objects that are created in the VisualServer that can be displayed. For example, any of the light types, mesh, multimesh, immediate geometry, particle system, reflection probe, lightmap capture, and the GI probe are all types that can be set as the base of an instance in order to be displayed in the scenario. Sets the scenario that the instance is in. The scenario is the 3D world that the objects will be displayed in. Sets the render layers that this instance will be drawn to. Equivalent to . Sets the world space transform of the instance. Equivalent to . Attaches a unique Object ID to instance. Object ID must be attached to instance for proper culling with , , and . Sets the weight for a given blend shape associated with this instance. Sets the material of a specific surface. Equivalent to . Sets whether an instance is drawn or not. Equivalent to . Sets the lightmap to use with this instance. If the parameter is null, then the default value is new Rect2(0, 0, 1, 1) Sets a custom AABB to use when culling objects from the view frustum. Equivalent to . Attaches a skeleton to an instance. Removes the previous skeleton from the instance. Function not implemented in Godot 3.x. Sets a margin to increase the size of the AABB when culling objects from the view frustum. This allows you to avoid culling objects that fall outside the view frustum. Equivalent to . Sets the flag for a given . See for more details. Sets the shadow casting setting to one of . Equivalent to . Sets a material that will override the material for all surfaces on the mesh associated with this instance. Equivalent to . Not implemented in Godot 3.x. Not implemented in Godot 3.x. Returns an array of object IDs intersecting with the provided AABB. Only visual 3D nodes are considered, such as or . Use @GDScript.instance_from_id to obtain the actual nodes. A scenario RID must be provided, which is available in the you want to query. This forces an update for all resources queued to update. Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. Returns an array of object IDs intersecting with the provided 3D ray. Only visual 3D nodes are considered, such as or . Use @GDScript.instance_from_id to obtain the actual nodes. A scenario RID must be provided, which is available in the you want to query. This forces an update for all resources queued to update. Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. Returns an array of object IDs intersecting with the provided convex shape. Only visual 3D nodes are considered, such as or . Use @GDScript.instance_from_id to obtain the actual nodes. A scenario RID must be provided, which is available in the you want to query. This forces an update for all resources queued to update. Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. Creates a canvas and returns the assigned . It can be accessed with the RID that is returned. This RID will be used in all canvas_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. A copy of the canvas item will be drawn with a local offset of the mirroring . Modulates all colors in the given canvas. Creates a new and returns its . It can be accessed with the RID that is returned. This RID will be used in all canvas_item_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. Sets the parent for the . The parent can be another canvas item, or it can be the root canvas that is attached to the viewport. Sets if the canvas item (including its children) is visible. The light mask. See for more information on light masks. Sets the 's . Sets clipping for the . Enables the use of distance fields for GUI elements that are rendering distance field based fonts. Defines a custom drawing rectangle for the . If the parameter is null, then the default value is new Rect2(0, 0, 0, 0) Sets the color that modulates the and its children. Sets the color that modulates the without children. Sets to be drawn behind its parent. Adds a line command to the 's draw commands. Adds a polyline, which is a line from multiple points with a width, to the 's draw commands. Adds a rectangle to the 's draw commands. Adds a circle command to the 's draw commands. Adds a textured rect to the 's draw commands. If the parameter is null, then the default value is new Color(1, 1, 1, 1) Adds a texture rect with region setting to the 's draw commands. If the parameter is null, then the default value is new Color(1, 1, 1, 1) Adds a nine patch image to the 's draw commands. See for more explanation. If the parameter is null, then the default value is new Color(1, 1, 1, 1) Adds a primitive to the 's draw commands. Adds a polygon to the 's draw commands. If the parameter is null, then the default value is new Vector2[] {} Adds a triangle array to the 's draw commands. If the parameter is null, then the default value is new Vector2[] {} If the parameter is null, then the default value is new int[] {} If the parameter is null, then the default value is new float[] {} Adds a mesh command to the 's draw commands. If the parameter is null, then the default value is Transform2D.Identity If the parameter is null, then the default value is new Color(1, 1, 1, 1) Adds a to the 's draw commands. Only affects its aabb at the moment. Adds a particle system to the 's draw commands. Adds a command to the 's draw commands. This sets the extra_matrix uniform when executed. This affects the later commands of the canvas item. If ignore is true, the VisualServer does not perform clipping. Sets if 's children should be sorted by y-position. Sets the 's Z index, i.e. its draw order (lower indexes are drawn first). If this is enabled, the Z index of the parent will be added to the children's Z index. Sets the to copy a rect to the backbuffer. Clears the and removes all commands in it. Sets the index for the . Sets a new material to the . Sets if the uses its parent's material. Creates a canvas light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all canvas_light_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. Attaches the canvas light to the canvas. Removes it from its previous canvas. Enables or disables a canvas light. Sets the texture's scale factor of the light. Equivalent to . Sets the canvas light's . Sets texture to be used by light. Equivalent to . Sets the offset of the light's texture. Equivalent to . Sets the color for a light. Sets a canvas light's height. Sets a canvas light's energy. Sets the Z range of objects that will be affected by this light. Equivalent to and . The layer range that gets rendered with this light. The light mask. See for more information on light masks. The binary mask used to determine which layers this canvas light's shadows affects. See for more information on light masks. The mode of the light, see constants. Enables or disables the canvas light's shadow. Sets the width of the shadow buffer, size gets scaled to the next power of two for this. Sets the length of the shadow's gradient. Sets the canvas light's shadow's filter, see constants. Sets the color of the canvas light's shadow. Smoothens the shadow. The lower, the smoother. Creates a light occluder and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all canvas_light_ocluder_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. Attaches a light occluder to the canvas. Removes it from its previous canvas. Enables or disables light occluder. Sets a light occluder's polygon. Sets a light occluder's . The light mask. See for more information on light masks. Creates a new light occluder polygon and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all canvas_occluder_polygon_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's static method. Sets the shape of the occluder polygon. Sets the shape of the occluder polygon as lines. Sets an occluder polygons cull mode. See constants. Sets margin size, where black bars (or images, if was used) are rendered. Sets images to be rendered in the window margin. Tries to free an object in the VisualServer. Schedules a callback to the corresponding named method on where after a frame has been drawn. The callback method must use only 1 argument which will be called with userdata. Returns true if changes have been made to the VisualServer's data. is usually called if this happens. Initializes the visual server. This function is called internally by platform-dependent code during engine initialization. If called from a running game, it will not do anything. Removes buffers and clears testcubes. Returns a certain information, see for options. Returns the name of the video adapter (e.g. "GeForce GTX 1080/PCIe/SSE2"). Note: When running a headless or server binary, this function returns an empty string. Returns the vendor of the video adapter (e.g. "NVIDIA Corporation"). Note: When running a headless or server binary, this function returns an empty string. Returns a mesh of a sphere with the given amount of horizontal and vertical subdivisions. Returns the id of the test cube. Creates one if none exists. Returns the id of the test texture. Creates one if none exists. Returns the id of a white texture. Creates one if none exists. Sets a boot image. The color defines the background color. If scale is true, the image will be scaled to fit the screen size. If use_filter is true, the image will be scaled with linear interpolation. If use_filter is false, the image will be scaled with nearest-neighbor interpolation. Sets the default clear color which is used when a specific clear color has not been selected. Sets the scale to apply to the passage of time for the shaders' TIME builtin. The default value is 1.0, which means TIME will count the real time as it goes by, without narrowing or stretching it. Not yet implemented. Always returns false. Returns true if the OS supports a certain feature. Features might be s3tc, etc, etc2, pvrtc and skinning_fallback. When rendering with GLES2, returns true with skinning_fallback in case the hardware doesn't support the default GPU skinning process. If true, the engine will generate wireframes for use with the wireframe debug mode. This class allows you to define a custom shader program that can be used for various materials to render objects. The visual shader editor creates the shader. A vertex shader, operating on vertices. A fragment shader, operating on fragments (pixels). A shader for light calculations. Represents the size of the enum. The offset vector of the whole graph. Sets the mode of this shader. Adds the specified node to the shader. Returns the shader node instance with specified type and id. Sets the position of the specified node. Returns the position of the specified node within the shader graph. Returns the list of all nodes in the shader with the specified type. Removes the specified node from the shader. Returns true if the specified node and port connection exist. Returns true if the specified nodes and ports can be connected together. Connects the specified nodes and ports. Connects the specified nodes and ports. Connects the specified nodes and ports, even if they can't be connected. Such connection is invalid and will not function properly. Returns the list of connected nodes with the specified type. Floating-point scalar. Translated to float type in shader code. 3D vector of floating-point values. Translated to vec3 type in shader code. Boolean type. Translated to bool type in shader code. Transform type. Translated to mat4 type in shader code. Sampler type. Translated to reference of sampler uniform in shader code. Can only be used for input ports in non-uniform nodes. Represents the size of the enum. Sets the output port index which will be showed for preview. If set to -1 no port will be open for preview. Sets the default value for the selected input port. Returns the default value of the input port. Sets the default input ports values using an of the form [index0, value0, index1, value1, ...]. For example: [0, Vector3(0, 0, 0), 1, Vector3(0, 0, 0)]. Returns an containing default values for all of the input ports of the node in the form [index0, value0, index1, value1, ...]. Has only one output port and no inputs. Translated to bool in the shader language. A boolean constant which represents a state of this node. Translated to uniform bool in the shader language. Has two output ports representing RGB and alpha channels of . Translated to vec3 rgb and float alpha in the shader language. A constant which represents a state of this node. Accept a to the input port and transform it according to . Converts the color to grayscale using the following formula: vec3 c = input; float max1 = max(c.r, c.g); float max2 = max(max1, c.b); float max3 = max(max1, max2); return vec3(max3, max3, max3); Applies sepia tone effect using the following formula: vec3 c = input; float r = (c.r * 0.393) + (c.g * 0.769) + (c.b * 0.189); float g = (c.r * 0.349) + (c.g * 0.686) + (c.b * 0.168); float b = (c.r * 0.272) + (c.g * 0.534) + (c.b * 0.131); return vec3(r, g, b); A function to be applied to the input color. See for options. Applies to two color inputs. Produce a screen effect with the following formula: result = vec3(1.0) - (vec3(1.0) - a) * (vec3(1.0) - b); Produce a difference effect with the following formula: result = abs(a - b); Produce a darken effect with the following formula: result = min(a, b); Produce a lighten effect with the following formula: result = max(a, b); Produce an overlay effect with the following formula: for (int i = 0; i < 3; i++) { float base = a[i]; float blend = b[i]; if (base < 0.5) { result[i] = 2.0 * base * blend; } else { result[i] = 1.0 - 2.0 * (1.0 - blend) * (1.0 - base); } } Produce a dodge effect with the following formula: result = a / (vec3(1.0) - b); Produce a burn effect with the following formula: result = vec3(1.0) - (vec3(1.0) - a) / b; Produce a soft light effect with the following formula: for (int i = 0; i < 3; i++) { float base = a[i]; float blend = b[i]; if (base < 0.5) { result[i] = base * (blend + 0.5); } else { result[i] = 1.0 - (1.0 - base) * (1.0 - (blend - 0.5)); } } Produce a hard light effect with the following formula: for (int i = 0; i < 3; i++) { float base = a[i]; float blend = b[i]; if (base < 0.5) { result[i] = base * (2.0 * blend); } else { result[i] = 1.0 - (1.0 - base) * (1.0 - 2.0 * (blend - 0.5)); } } An operator to be applied to the inputs. See for options. Translated to uniform vec4 in the shader language. Compares a and b of by . Returns a boolean scalar. Translates to if instruction in shader code. A floating-point scalar. A 3D vector type. A boolean type. A transform (mat4) type. Comparison for equality (a == b). Comparison for inequality (a != b). Comparison for greater than (a > b). Cannot be used if set to or . Comparison for greater than or equal (a >= b). Cannot be used if set to or . Comparison for less than (a < b). Cannot be used if set to or . Comparison for less than or equal (a < b). Cannot be used if set to or . The result will be true if all of component in vector satisfy the comparison condition. The result will be true if any of component in vector satisfy the comparison condition. The type to be used in the comparison. See for options. A comparison function. See for options. Extra condition which is applied if is set to . Translated to texture(cubemap, vec3) in the shader language. Returns a color vector and alpha channel as scalar. No hints are added to the uniform declaration. Adds hint_albedo as hint to the uniform declaration for proper sRGB to linear conversion. Adds hint_normal as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. Use the set via . If this is set to , the samplerCube port is ignored. Use the sampler reference passed via the samplerCube port. If this is set to , the texture is ignored. Defines which source should be used for the sampling. See for options. The texture to sample when using as . Defines the type of data provided by the source texture. See for options. Translated to uniform samplerCube in the shader language. The output value can be used as port for . By inheriting this class you can create a custom script addon which will be automatically added to the Visual Shader Editor. The 's behavior is defined by overriding the provided virtual methods. In order for the node to be registered as an editor addon, you must use the tool keyword and provide a class_name for your custom script. For example: tool extends VisualShaderNodeCustom class_name VisualShaderNodeNoise Override this method to define the category of the associated custom node in the Visual Shader Editor's members dialog. The path may look like "MyGame/MyFunctions/Noise". Defining this method is optional. If not overridden, the node will be filed under the "Custom" category. Override this method to define the actual shader code of the associated custom node. The shader code should be returned as a string, which can have multiple lines (the """ multiline string construct can be used for convenience). The input_vars and output_vars arrays contain the string names of the various input and output variables, as defined by _get_input_* and _get_output_* virtual methods in this class. The output ports can be assigned values in the shader code. For example, return output_vars[0] + " = " + input_vars[0] + ";". You can customize the generated code based on the shader mode (see ) and/or type (see ). Defining this method is required. Override this method to define the description of the associated custom node in the Visual Shader Editor's members dialog. Defining this method is optional. Override this method to add shader code on top of the global shader, to define your own standard library of reusable methods, varyings, constants, uniforms, etc. The shader code should be returned as a string, which can have multiple lines (the """ multiline string construct can be used for convenience). Be careful with this functionality as it can cause name conflicts with other custom nodes, so be sure to give the defined entities unique names. You can customize the generated code based on the shader mode (see ). Defining this method is optional. Override this method to define the amount of input ports of the associated custom node. Defining this method is required. If not overridden, the node has no input ports. Override this method to define the names of input ports of the associated custom node. The names are used both for the input slots in the editor and as identifiers in the shader code, and are passed in the input_vars array in . Defining this method is optional, but recommended. If not overridden, input ports are named as "in" + str(port). Override this method to define the returned type of each input port of the associated custom node (see for possible types). Defining this method is optional, but recommended. If not overridden, input ports will return the type. Override this method to define the name of the associated custom node in the Visual Shader Editor's members dialog and graph. Defining this method is optional, but recommended. If not overridden, the node will be named as "Unnamed". Override this method to define the amount of output ports of the associated custom node. Defining this method is required. If not overridden, the node has no output ports. Override this method to define the names of output ports of the associated custom node. The names are used both for the output slots in the editor and as identifiers in the shader code, and are passed in the output_vars array in . Defining this method is optional, but recommended. If not overridden, output ports are named as "out" + str(port). Override this method to define the returned type of each output port of the associated custom node (see for possible types). Defining this method is optional, but recommended. If not overridden, output ports will return the type. Override this method to define the return icon of the associated custom node in the Visual Shader Editor's members dialog. Defining this method is optional. If not overridden, no return icon is shown. Override this method to define the subcategory of the associated custom node in the Visual Shader Editor's members dialog. Defining this method is optional. If not overridden, the node will be filed under the root of the main category (see ). Translates to determinant(x) in the shader language. Translates to dot(a, b) in the shader language. Custom Godot Shading Language expression, with a custom amount of input and output ports. The provided code is directly injected into the graph's matching shader function (vertex, fragment, or light), so it cannot be used to declare functions, varyings, uniforms, or global constants. See for such global definitions. An expression in Godot Shading Language, which will be injected at the start of the graph's matching shader function (vertex, fragment, or light), and thus cannot be used to declare functions, varyings, uniforms, or global constants. Translates to faceforward(N, I, Nref) in the shader language. The function has three vector parameters: N, the vector to orient, I, the incident vector, and Nref, the reference vector. If the dot product of I and Nref is smaller than zero the return value is N. Otherwise, -N is returned. Returns falloff based on the dot product of surface normal and view direction of camera (pass associated inputs to it). Custom Godot Shader Language expression, which is placed on top of the generated shader. You can place various function definitions inside to call later in s (which are injected in the main shader functions). You can also declare varyings, uniforms and global constants. Currently, has no direct usage, use the derived classes instead. The size of the node in the visual shader graph. Defines all input ports using a formatted as a colon-separated list: id,type,name; (see ). Returns a description of the input ports as a colon-separated list using the format id,type,name; (see ). Defines all output ports using a formatted as a colon-separated list: id,type,name; (see ). Returns a description of the output ports as a colon-separated list using the format id,type,name; (see ). Returns true if the specified port name does not override an existed port name and is valid within the shader. Adds an input port with the specified type (see ) and name. Removes the specified input port. Returns the number of input ports in use. Alternative for . Returns true if the specified input port exists. Removes all previously specified input ports. Adds an output port with the specified type (see ) and name. Removes the specified output port. Returns the number of output ports in use. Alternative for . Returns true if the specified output port exists. Removes all previously specified output ports. Renames the specified input port. Sets the specified input port's type (see ). Renames the specified output port. Sets the specified output port's type (see ). Returns a free input port ID which can be used in . Returns a free output port ID which can be used in . Gives access to input variables (built-ins) available for the shader. See the shading reference for the list of available built-ins for each shader type (check Tutorials section for link). One of the several input constants in lower-case style like: "vertex"(VERTEX) or "point_size"(POINT_SIZE). Returns the boolean result of the comparison between INF or NaN and a scalar parameter. Comparison with INF (Infinity). Comparison with NaN (Not a Number; denotes invalid numeric results, e.g. division by zero). The comparison function. See for options. OuterProduct treats the first parameter c as a column vector (matrix with one column) and the second parameter r as a row vector (matrix with one row) and does a linear algebraic matrix multiply c * r, yielding a matrix whose number of rows is the number of components in c and whose number of columns is the number of components in r. This visual shader node is present in all shader graphs in form of "Output" block with multiple output value ports. Constrains a value to lie between min and max values. This node is only available in Fragment and Light visual shaders. Sum of absolute derivative in x and y. Derivative in x using local differencing. Derivative in y using local differencing. The derivative type. See for options. Translates to mix(a, b, weight) in the shader language. Translates to smoothstep(edge0, edge1, x) in the shader language. Returns 0.0 if x is smaller than edge0 and 1.0 if x is larger than edge1. Otherwise the return value is interpolated between 0.0 and 1.0 using Hermite polynomials. Returns an associated scalar if the provided boolean value is true or false. Returns an associated vector if the provided boolean value is true or false. Performs a lookup operation on the provided texture, with support for multiple texture sources to choose from. No hints are added to the uniform declaration. Adds hint_albedo as hint to the uniform declaration for proper sRGB to linear conversion. Adds hint_normal as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. Use the texture given as an argument for this function. Use the current viewport's texture as the source. Use the texture from this shader's texture built-in (e.g. a texture of a ). Use the texture from this shader's normal map built-in. Use the depth texture available for this shader. Use the texture provided in the input port for this function. Determines the source for the lookup. See for options. The source texture, if needed for the selected . Specifies the type of the texture if is set to . See for options. Performs a lookup operation on the texture provided as a uniform for the shader. No hints are added to the uniform declaration. Adds hint_albedo as hint to the uniform declaration for proper sRGB to linear conversion. Adds hint_normal as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. Adds hint_aniso as hint to the uniform declaration to use for a flowmap. Defaults to white color. Defaults to black color. Defines the type of data provided by the source texture. See for options. Sets the default color if no texture is assigned to the uniform. Performs a lookup operation on the texture provided as a uniform for the shader, with support for triplanar mapping. Creates a 4x4 transform matrix using four vectors of type vec3. Each vector is one row in the matrix and the last column is a vec4(0, 0, 0, 1). A constant , which can be used as an input node. A constant which represents the state of this node. Takes a 4x4 transform matrix and decomposes it into four vec3 values, one from each row of the matrix. Computes an inverse or transpose function on the provided . Perform the inverse operation on the matrix. Perform the transpose operation on the matrix. The function to be computed. See for options. A multiplication operation on two transforms (4x4 matrices), with support for different multiplication operators. Multiplies transform a by the transform b. Multiplies transform b by the transform a. Performs a component-wise multiplication of transform a by the transform b. Performs a component-wise multiplication of transform b by the transform a. The multiplication type to be performed on the transforms. See for options. Translated to uniform mat4 in the shader language. A multiplication operation on a transform (4x4 matrix) and a vector, with support for different multiplication operators. Multiplies transform a by the vector b. Multiplies vector b by the transform a. Multiplies transform a by the vector b, skipping the last row and column of the transform. Multiplies vector b by the transform a, skipping the last row and column of the transform. The multiplication type to be performed. See for options. A uniform represents a variable in the shader which is set externally, i.e. from the . Uniforms are exposed as properties in the and can be assigned from the inspector or from a script. Name of the uniform, by which it can be accessed through the properties. Creating a reference to a allows you to reuse this uniform in different shaders or shader stages easily. The name of the uniform which this reference points to. A constant , which can be used as an input node. A constant which represents the state of this node. Translated to uniform vec3 in the shader language. Constrains a value to lie between min and max values. The operation is performed on each component of the vector individually. Creates a vec3 using three scalar values that can be provided from separate inputs. Takes a vec3 and decomposes it into three scalar values that can be used as separate inputs. This node is only available in Fragment and Light visual shaders. Sum of absolute derivative in x and y. Derivative in x using local differencing. Derivative in y using local differencing. A derivative type. See for options. Calculates distance from point represented by vector p0 to vector p1. Translated to distance(p0, p1) in the shader language. A visual shader node able to perform different functions using vectors. Normalizes the vector so that it has a length of 1 but points in the same direction. Clamps the value between 0.0 and 1.0. Returns the opposite value of the parameter. Returns 1/vector. Converts RGB vector to HSV equivalent. Converts HSV vector to RGB equivalent. Returns the absolute value of the parameter. Returns the arc-cosine of the parameter. Returns the inverse hyperbolic cosine of the parameter. Returns the arc-sine of the parameter. Returns the inverse hyperbolic sine of the parameter. Returns the arc-tangent of the parameter. Returns the inverse hyperbolic tangent of the parameter. Finds the nearest integer that is greater than or equal to the parameter. Returns the cosine of the parameter. Returns the hyperbolic cosine of the parameter. Converts a quantity in radians to degrees. Base-e Exponential. Base-2 Exponential. Finds the nearest integer less than or equal to the parameter. Computes the fractional part of the argument. Returns the inverse of the square root of the parameter. Natural logarithm. Base-2 logarithm. Converts a quantity in degrees to radians. Finds the nearest integer to the parameter. Finds the nearest even integer to the parameter. Extracts the sign of the parameter, i.e. returns -1 if the parameter is negative, 1 if it's positive and 0 otherwise. Returns the sine of the parameter. Returns the hyperbolic sine of the parameter. Returns the square root of the parameter. Returns the tangent of the parameter. Returns the hyperbolic tangent of the parameter. Returns a value equal to the nearest integer to the parameter whose absolute value is not larger than the absolute value of the parameter. Returns 1.0 - vector. The function to be performed. See for options. Translates to mix(a, b, weight) in the shader language, where weight is a with weights for each component. Translated to length(p0) in the shader language. A visual shader node for use of vector operators. Operates on vector a and vector b. Adds two vectors. Subtracts a vector from a vector. Multiplies two vectors. Divides vector by vector. Returns the remainder of the two vectors. Returns the value of the first parameter raised to the power of the second, for each component of the vectors. Returns the greater of two values, for each component of the vectors. Returns the lesser of two values, for each component of the vectors. Calculates the cross product of two vectors. Returns the arc-tangent of the parameters. Returns the vector that points in the direction of reflection. a is incident vector and b is the normal vector. Vector step operator. Returns 0.0 if a is smaller than b and 1.0 otherwise. The operator to be used. See for options. Translated to refract(I, N, eta) in the shader language, where I is the incident vector, N is the normal vector and eta is the ratio of the indices of the refraction. Translates to mix(a, b, weight) in the shader language, where a and b are vectors and weight is a scalar. Translates to smoothstep(edge0, edge1, x) in the shader language, where x is a scalar. Returns 0.0 if x is smaller than edge0 and 1.0 if x is larger than edge1. Otherwise the return value is interpolated between 0.0 and 1.0 using Hermite polynomials. Translates to step(edge, x) in the shader language. Returns 0.0 if x is smaller than edge and 1.0 otherwise. Translates to smoothstep(edge0, edge1, x) in the shader language, where x is a vector. Returns 0.0 if x is smaller than edge0 and 1.0 if x is larger than edge1. Otherwise the return value is interpolated between 0.0 and 1.0 using Hermite polynomials. A weakref can hold a , without contributing to the reference counter. A weakref can be created from an using @GDScript.weakref. If this object is not a reference, weakref still works, however, it does not have any effect on the object. Weakrefs are useful in cases where multiple classes have variables that refer to each other. Without weakrefs, using these classes could lead to memory leaks, since both references keep each other from being released. Making part of the variables a weakref can prevent this cyclic dependency, and allows the references to be released. Returns the this weakref is referring to. Tells the channel to send data over this channel as text. An external peer (non-Godot) would receive this as a string. Tells the channel to send data over this channel as binary. An external peer (non-Godot) would receive this as array buffer or blob. The channel was created, but it's still trying to connect. The channel is currently open, and data can flow over it. The channel is being closed, no new messages will be accepted, but those already in queue will be flushed. The channel was closed, or connection failed. The transfer mode to use when sending outgoing packet. Either text or binary. Reserved, but not used for now. Closes this data channel, notifying the other peer. Returns true if the last received packet was transferred as text. See . Returns the current state of this channel, see . Returns the label assigned to this channel during creation. Returns true if this channel was created with ordering enabled (default). Returns the id assigned to this channel during creation (or auto-assigned during negotiation). If the channel is not negotiated out-of-band the id will only be available after the connection is established (will return 65535 until then). Returns the maxPacketLifeTime value assigned to this channel during creation. Will be 65535 if not specified. Returns the maxRetransmits value assigned to this channel during creation. Will be 65535 if not specified. Returns the sub-protocol assigned to this channel during creation. An empty string if not specified. Returns true if this channel was created with out-of-band configuration. This class constructs a full mesh of (one connection for each peer) that can be used as a . You can add each via or remove them via . Peers must be added in state to allow it to create the appropriate channels. This class will not create offers nor set descriptions, it will only poll them, and notify connections and disconnections. NetworkedMultiplayerPeer.connection_succeeded and NetworkedMultiplayerPeer.server_disconnected will not be emitted unless server_compatibility is true in . Beside that data transfer works like in a . Initialize the multiplayer peer with the given peer_id (must be between 1 and 2147483647). If server_compatibilty is false (default), the multiplayer peer will be immediately in state and NetworkedMultiplayerPeer.connection_succeeded will not be emitted. If server_compatibilty is true the peer will suppress all NetworkedMultiplayerPeer.peer_connected signals until a peer with id connects and then emit NetworkedMultiplayerPeer.connection_succeeded. After that the signal NetworkedMultiplayerPeer.peer_connected will be emitted for every already connected peer, and any new peer that might connect. If the server peer disconnects after that, signal NetworkedMultiplayerPeer.server_disconnected will be emitted and state will become . Add a new peer to the mesh with the given peer_id. The must be in state . Three channels will be created for reliable, unreliable, and ordered transport. The value of unreliable_lifetime will be passed to the maxPacketLifetime option when creating unreliable and ordered channels (see ). Remove the peer with given peer_id from the mesh. If the peer was connected, and NetworkedMultiplayerPeer.peer_connected was emitted for it, then NetworkedMultiplayerPeer.peer_disconnected will be emitted. Returns true if the given peer_id is in the peers map (it might not be connected though). Return a dictionary representation of the peer with given peer_id with three keys. connection containing the to this peer, channels an array of three , and connected a boolean representing if the peer connection is currently connected (all three channels are open). Returns a dictionary which keys are the peer ids and values the peer representation as in . Close all the add peer connections and channels, freeing all resources. A WebRTC connection between the local computer and a remote peer. Provides an interface to connect, maintain and monitor the connection. Setting up a WebRTC connection between two peers from now on) may not seem a trivial task, but it can be broken down into 3 main steps: - The peer that wants to initiate the connection (A from now on) creates an offer and send it to the other peer (B from now on). - B receives the offer, generate and answer, and sends it to A). - A and B then generates and exchange ICE candidates with each other. After these steps, the connection should become connected. Keep on reading or look into the tutorial for more information. The connection is new, data channels and an offer can be created in this state. The peer is connecting, ICE is in progress, none of the transports has failed. The peer is connected, all ICE transports are connected. At least one ICE transport is disconnected. One or more of the ICE transports failed. The peer connection is closed (after calling for example). Re-initialize this peer connection, closing any previously active connection, and going back to state . A dictionary of options can be passed to configure the peer connection. Valid options are: { "iceServers": [ { "urls": [ "stun:stun.example.com:3478" ], # One or more STUN servers. }, { "urls": [ "turn:turn.example.com:3478" ], # One or more TURN servers. "username": "a_username", # Optional username for the TURN server. "credential": "a_password", # Optional password for the TURN server. } ] } If the parameter is null, then the default value is new Godot.Collections.Dictionary() Returns a new (or null on failure) with given label and optionally configured via the options dictionary. This method can only be called when the connection is in state . There are two ways to create a working data channel: either call on only one of the peer and listen to data_channel_received on the other, or call on both peers, with the same values, and the negotiated option set to true. Valid options are: { "negotiated": true, # When set to true (default off), means the channel is negotiated out of band. "id" must be set too. "data_channel_received" will not be called. "id": 1, # When "negotiated" is true this value must also be set to the same value on both peer. # Only one of maxRetransmits and maxPacketLifeTime can be specified, not both. They make the channel unreliable (but also better at real time). "maxRetransmits": 1, # Specify the maximum number of attempt the peer will make to retransmits packets if they are not acknowledged. "maxPacketLifeTime": 100, # Specify the maximum amount of time before giving up retransmitions of unacknowledged packets (in milliseconds). "ordered": true, # When in unreliable mode (i.e. either "maxRetransmits" or "maxPacketLifetime" is set), "ordered" (true by default) specify if packet ordering is to be enforced. "protocol": "my-custom-protocol", # A custom sub-protocol string for this channel. } Note: You must keep a reference to channels created this way, or it will be closed. If the parameter is null, then the default value is new Godot.Collections.Dictionary() Creates a new SDP offer to start a WebRTC connection with a remote peer. At least one must have been created before calling this method. If this functions returns , session_description_created will be called when the session is ready to be sent. Sets the SDP description of the local peer. This should be called in response to session_description_created. After calling this function the peer will start emitting ice_candidate_created (unless an different from is returned). Sets the SDP description of the remote peer. This should be called with the values generated by a remote peer and received over the signaling server. If type is offer the peer will emit session_description_created with the appropriate answer. If type is answer the peer will start emitting ice_candidate_created. Add an ice candidate generated by a remote peer (and received over the signaling server). See ice_candidate_created. Call this method frequently (e.g. in or ) to properly receive signals. Close the peer connection and all data channels associated with it. Note, you cannot reuse this object for a new connection unless you call . Returns the connection state. See . This class implements a WebSocket client compatible with any RFC 6455-compliant WebSocket server. This client can be optionally used as a network peer for the . After starting the client (), you will need to it at regular intervals (e.g. inside ). You will receive appropriate signals when connecting, disconnecting, or when new data is available. If true, SSL certificate verification is enabled. Note: You must specify the certificates to be used in the Project Settings for it to work when exported. If specified, this will be the only one accepted when connecting to an SSL host. Any other certificate provided by the server will be regarded as invalid. Note: Specifying a custom trusted_ssl_certificate is not supported in HTML5 exports due to browsers restrictions. Connects to the given URL requesting one of the given protocols as sub-protocol. If the list empty (default), no sub-protocol will be requested. If true is passed as gd_mp_api, the client will behave like a network peer for the , connections to non-Godot servers will not work, and data_received will not be emitted. If false is passed instead (default), you must call functions (put_packet, get_packet, etc.) on the returned via get_peer(1) and not on this object directly (e.g. get_peer(1).put_packet(data)). You can optionally pass a list of custom_headers to be added to the handshake HTTP request. Note: To avoid mixed content warnings or errors in HTML5, you may have to use a url that starts with wss:// (secure) instead of ws://. When doing so, make sure to use the fully qualified domain name that matches the one defined in the server's SSL certificate. Do not connect directly via the IP address for wss:// connections, as it won't match with the SSL certificate. Note: Specifying custom_headers is not supported in HTML5 exports due to browsers restrictions. If the parameter is null, then the default value is new string[] {} If the parameter is null, then the default value is new string[] {} Disconnects this client from the connected host. See for more information. Return the IP address of the currently connected host. Return the IP port of the currently connected host. Base class for WebSocket server and client, allowing them to be used as network peer for the . Configures the buffer sizes for this WebSocket peer. Default values can be specified in the Project Settings under network/limits. For server, values are meant per connected peer. The first two parameters define the size and queued packets limits of the input buffer, the last two of the output buffer. Buffer sizes are expressed in KiB, so 4 = 2^12 = 4096 bytes. All parameters will be rounded up to the nearest power of two. Note: HTML5 exports only use the input buffer since the output one is managed by browsers. Returns the associated to the given peer_id. This class represent a specific WebSocket connection, you can do lower level operations with it. You can choose to write to the socket in binary or text mode, and you can recognize the mode used for writing by the other peer. Specifies that WebSockets messages should be transferred as text payload (only valid UTF-8 is allowed). Specifies that WebSockets messages should be transferred as binary payload (any byte combination is allowed). Gets the current selected write mode. See . Sets the socket to use the given . Returns true if this peer is currently connected. Returns true if the last received packet was sent as a text payload. See . Closes this WebSocket connection. code is the status code for the closure (see RFC 6455 section 7.4 for a list of valid status codes). reason is the human readable reason for closing the connection (can be any UTF-8 string that's smaller than 123 bytes). Note: To achieve a clean close, you will need to keep polling until either WebSocketClient.connection_closed or WebSocketServer.client_disconnected is received. Note: The HTML5 export might not support all status codes. Please refer to browser-specific documentation for more details. Returns the IP address of the connected peer. Note: Not available in the HTML5 export. Returns the remote port of the connected peer. Note: Not available in the HTML5 export. Disable Nagle's algorithm on the underling TCP socket (default). See for more information. Note: Not available in the HTML5 export. This class implements a WebSocket server that can also support the high-level multiplayer API. After starting the server (), you will need to it at regular intervals (e.g. inside ). When clients connect, disconnect, or send data, you will receive the appropriate signal. Note: Not available in HTML5 exports. When not set to * will restrict incoming connections to the specified IP address. Setting bind_ip to 127.0.0.1 will cause the server to listen only to the local host. When set to a valid (along with ) will cause the server to require SSL instead of regular TCP (i.e. the wss:// protocol). When set to a valid (along with ) will cause the server to require SSL instead of regular TCP (i.e. the wss:// protocol). When using SSL (see and ), you can set this to a valid to be provided as additional CA chain information during the SSL handshake. Returns true if the server is actively listening on a port. Starts listening on the given port. You can specify the desired subprotocols via the "protocols" array. If the list empty (default), no sub-protocol will be requested. If true is passed as gd_mp_api, the server will behave like a network peer for the , connections from non-Godot clients will not work, and data_received will not be emitted. If false is passed instead (default), you must call functions (put_packet, get_packet, etc.), on the returned via get_peer(id) to communicate with the peer with given id (e.g. get_peer(id).get_available_packet_count). If the parameter is null, then the default value is new string[] {} Stops the server and clear its state. Returns true if a peer with the given ID is connected. Returns the IP address of the given peer. Returns the remote port of the given peer. Disconnects the peer identified by id from the server. See for more information. WebXR is an open standard that allows creating VR and AR applications that run in the web browser. As such, this interface is only available when running in an HTML5 export. WebXR supports a wide range of devices, from the very capable (like Valve Index, HTC Vive, Oculus Rift and Quest) down to the much less capable (like Google Cardboard, Oculus Go, GearVR, or plain smartphones). Since WebXR is based on Javascript, it makes extensive use of callbacks, which means that is forced to use signals, where other AR/VR interfaces would instead use functions that return a result immediately. This makes quite a bit more complicated to initialize than other AR/VR interfaces. Here's the minimum code required to start an immersive VR session: extends Spatial var webxr_interface var vr_supported = false func _ready(): # We assume this node has a button as a child. # This button is for the user to consent to entering immersive VR mode. $Button.connect("pressed", self, "_on_Button_pressed") webxr_interface = ARVRServer.find_interface("WebXR") if webxr_interface: # WebXR uses a lot of asynchronous callbacks, so we connect to various # signals in order to receive them. webxr_interface.connect("session_supported", self, "_webxr_session_supported") webxr_interface.connect("session_started", self, "_webxr_session_started") webxr_interface.connect("session_ended", self, "_webxr_session_ended") webxr_interface.connect("session_failed", self, "_webxr_session_failed") # This returns immediately - our _webxr_session_supported() method # (which we connected to the "session_supported" signal above) will # be called sometime later to let us know if it's supported or not. webxr_interface.is_session_supported("immersive-vr") func _webxr_session_supported(session_mode, supported): if session_mode == 'immersive-vr': vr_supported = supported func _on_Button_pressed(): if not vr_supported: OS.alert("Your browser doesn't support VR") return # We want an immersive VR session, as opposed to AR ('immersive-ar') or a # simple 3DoF viewer ('viewer'). webxr_interface.session_mode = 'immersive-vr' # 'bounded-floor' is room scale, 'local-floor' is a standing or sitting # experience (it puts you 1.6m above the ground if you have 3DoF headset), # whereas as 'local' puts you down at the ARVROrigin. # This list means it'll first try to request 'bounded-floor', then # fallback on 'local-floor' and ultimately 'local', if nothing else is # supported. webxr_interface.requested_reference_space_types = 'bounded-floor, local-floor, local' # In order to use 'local-floor' or 'bounded-floor' we must also # mark the features as required or optional. webxr_interface.required_features = 'local-floor' webxr_interface.optional_features = 'bounded-floor' # This will return false if we're unable to even request the session, # however, it can still fail asynchronously later in the process, so we # only know if it's really succeeded or failed when our # _webxr_session_started() or _webxr_session_failed() methods are called. if not webxr_interface.initialize(): OS.alert("Failed to initialize") return func _webxr_session_started(): $Button.visible = false # This tells Godot to start rendering to the headset. get_viewport().arvr = true # This will be the reference space type you ultimately got, out of the # types that you requested above. This is useful if you want the game to # work a little differently in 'bounded-floor' versus 'local-floor'. print ("Reference space type: " + webxr_interface.reference_space_type) func _webxr_session_ended(): $Button.visible = true # If the user exits immersive mode, then we tell Godot to render to the web # page again. get_viewport().arvr = false func _webxr_session_failed(message): OS.alert("Failed to initialize: " + message) There are several ways to handle "controller" input: - Using nodes and their ARVRController.button_pressed and ARVRController.button_release signals. This is how controllers are typically handled in AR/VR apps in Godot, however, this will only work with advanced VR controllers like the Oculus Touch or Index controllers, for example. The buttons codes are defined by Section 3.3 of the WebXR Gamepads Module. - Using and or . This works the same as normal joypads, except the starts at 100, so the left controller is 100 and the right controller is 101, and the button codes are also defined by Section 3.3 of the WebXR Gamepads Module. - Using the select, squeeze and related signals. This method will work for both advanced VR controllers, and non-traditional "controllers" like a tap on the screen, a spoken voice command or a button press on the device itself. The controller_id passed to these signals is the same id as used in . You can use one or all of these methods to allow your game or app to support a wider or narrower set of devices and input methods, or to allow more advanced interations with more advanced devices. The session mode used by when setting up the WebXR session. This doesn't have any effect on the interface when already initialized. Possible values come from WebXR's XRSessionMode, including: "immersive-vr", "immersive-ar", and "inline". A comma-seperated list of required features used by when setting up the WebXR session. If a user's browser or device doesn't support one of the given features, initialization will fail and session_failed will be emitted. This doesn't have any effect on the interface when already initialized. Possible values come from WebXR's XRReferenceSpaceType. If you want to use a particular reference space type, it must be listed in either or . A comma-seperated list of optional features used by when setting up the WebXR session. If a user's browser or device doesn't support one of the given features, initialization will continue, but you won't be able to use the requested feature. This doesn't have any effect on the interface when already initialized. Possible values come from WebXR's XRReferenceSpaceType. If you want to use a particular reference space type, it must be listed in either or . A comma-seperated list of reference space types used by when setting up the WebXR session. The reference space types are requested in order, and the first on supported by the users device or browser will be used. The property contains the reference space type that was ultimately used. This doesn't have any effect on the interface when already initialized. Possible values come from WebXR's XRReferenceSpaceType. If you want to use a particular reference space type, it must be listed in either or . The reference space type (from the list of requested types set in the property), that was ultimately used by when setting up the WebXR session. Possible values come from WebXR's XRReferenceSpaceType. If you want to use a particular reference space type, it must be listed in either or . Indicates if the WebXR session's imagery is visible to the user. Possible values come from WebXR's XRVisibilityState, including "hidden", "visible", and "visible-blurred". The vertices of a polygon which defines the boundaries of the user's play area. This will only be available if is "bounded-floor" and only on certain browsers and devices that support it. The reference_space_reset signal may indicate when this changes. Checks if the given session_mode is supported by the user's browser. Possible values come from WebXR's XRSessionMode, including: "immersive-vr", "immersive-ar", and "inline". This method returns nothing, instead it emits the session_supported signal with the result. Gets an for the given controller_id. In the context of WebXR, a "controller" can be an advanced VR controller like the Oculus Touch or Index controllers, or even a tap on the screen, a spoken voice command or a button press on the device itself. When a non-traditional controller is used, interpret the position and orientation of the as a ray pointing at the object the user wishes to interact with. Use this method to get information about the controller that triggered one of these signals: - selectstart - select - selectend - squeezestart - squeeze - squeezestart Windowdialog is the base class for all window-based dialogs. It's a by-default toplevel that draws a window decoration and allows motion and resizing. The text displayed in the window's title bar. If true, the user can resize the window. Returns the close . Class that has everything pertaining to a world. A physics space, a visual scenario and a sound space. Spatial nodes register their resources into the current world. The World's . The World's fallback_environment will be used if the World's fails or is missing. The World's physics space. The World's visual scenario. Direct access to the world's physics 3D space state. Used for querying current and potential collisions. Class that has everything pertaining to a 2D world. A physics space, a visual scenario and a sound space. 2D nodes register their resources into the current 2D world. The of this world's canvas resource. Used by the for 2D drawing. The of this world's physics space resource. Used by the for 2D physics, treating it as both a space and an area. Direct access to the world's physics 2D space state. Used for querying current and potential collisions. When using multi-threaded physics, access is limited to _physics_process(delta) in the main thread. The node is used to configure the default for the scene. The parameters defined in the can be overridden by an node set on the current . Additionally, only one may be instanced in a given scene at a time. The allows the user to specify default lighting parameters (e.g. ambient lighting), various post-processing effects (e.g. SSAO, DOF, Tonemapping), and how to draw the background (e.g. solid color, skybox). Usually, these are added in order to improve the realism/color balance of the scene. The resource used by this , defining the default properties. The X509Certificate class represents an X509 certificate. Certificates can be loaded and saved like any other . They can be used as the server certificate in (along with the proper ), and to specify the only certificate that should be accepted when connecting to an SSL server via . Note: Not available in HTML5 exports. Saves a certificate to the given path (should be a "*.crt" file). Loads a certificate from path ("*.crt" file). This class can serve as base to make custom XML parsers. Since XML is a very flexible standard, this interface is low-level so it can be applied to any possible schema. There's no node (no file or buffer opened). Element (tag). End of element. Text node. Comment node. CDATA content. Unknown node. Reads the next node of the file. This returns an error code. Gets the type of the current node. Compare with constants. Gets the name of the current element node. This will raise an error if the current node type is neither nor . Gets the contents of a text node. This will raise an error in any other type of node. Gets the byte offset of the current node since the beginning of the file or buffer. Gets the amount of attributes in the current element. Gets the name of the attribute specified by the index in idx argument. Gets the value of the attribute specified by the index in idx argument. Check whether the current element has a certain attribute. Gets the value of a certain attribute of the current element by name. This will raise an error if the element has no such attribute. Gets the value of a certain attribute of the current element by name. This will return an empty if the attribute is not found. Check whether the current element is empty (this only works for completely empty tags, e.g. <element \>). Gets the current line in the parsed file (currently not implemented). Skips the current section. If the node contains other elements, they will be ignored and the cursor will go to the closing of the current element. Moves the buffer cursor to a certain offset (since the beginning) and read the next node there. This returns an error code. Opens an XML file for parsing. This returns an error code. Opens an XML raw buffer for parsing. This returns an error code. Sort all child nodes based on their Y positions. The child node must inherit from for it to be sorted. Nodes that have a higher Y position will be drawn later, so they will appear on top of nodes that have a lower Y position. Nesting of YSort nodes is possible. Children YSort nodes will be sorted in the same space as the parent YSort, allowing to better organize a scene or divide it in multiple ones, yet keep the unique sorting. If true, child nodes are sorted, otherwise sorting is disabled. Provides access to metadata stored for every available class. Returns the names of all the classes available. Returns the names of all the classes that directly or indirectly inherit from class. Returns the parent class of class. Returns whether the specified class is available or not. Returns whether inherits is an ancestor of class or not. Returns true if you can instance objects from the specified class, false in other case. Creates an instance of class. Returns whether class or its ancestry has a signal called signal or not. Returns the signal data of class or its ancestry. The returned value is a with the following keys: args, default_args, flags, id, name, return: (class_name, hint, hint_string, name, type, usage). Returns an array with all the signals of class or its ancestry if no_inheritance is false. Every element of the array is a as described in . Returns an array with all the properties of class or its ancestry if no_inheritance is false. Returns the value of property of class or its ancestry. Sets property value of class to value. Returns whether class (or its ancestry if no_inheritance is false) has a method called method or not. Returns an array with all the methods of class or its ancestry if no_inheritance is false. Every element of the array is a with the following keys: args, default_args, flags, id, name, return: (class_name, hint, hint_string, name, type, usage). Note: In exported release builds the debug info is not available, so the returned dictionaries will contain only method names. Returns an array with the names all the integer constants of class or its ancestry. Returns whether class or its ancestry has an integer constant called name or not. Returns the value of the integer constant name of class or its ancestry. Always returns 0 when the constant could not be found. Returns a category associated with the class for use in documentation and the Asset Library. Debug mode required. Returns whether this class is enabled or not. Directory type. It is used to manage directories and their content (not restricted to the project folder). When creating a new , its default opened directory will be res://. This may change in the future, so it is advised to always use to initialize your where you want to operate, with explicit error checking. Note: 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. Use to access imported resources. Here is an example on how to iterate through the files of a directory: func dir_contents(path): var dir = Directory.new() if dir.open(path) == OK: dir.list_dir_begin() var file_name = dir.get_next() while file_name != "": if dir.current_is_dir(): print("Found directory: " + file_name) else: print("Found file: " + file_name) file_name = dir.get_next() else: print("An error occurred when trying to access the path.") Opens an existing directory of the filesystem. The path argument can be within the project tree (res://folder), the user directory (user://folder) or an absolute path of the user filesystem (e.g. /tmp/folder or C:\tmp\folder). Returns one of the code constants (OK on success). Initializes the stream used to list all files and directories using the function, closing the current opened stream if needed. Once the stream has been processed, it should typically be closed with . If skip_navigational is true, . and .. are filtered out. If skip_hidden is true, hidden files are filtered out. Returns the next element (file or directory) in the current directory (including . and .., unless skip_navigational was given to ). The name of the file or directory is returned (and not its full path). Once the stream has been fully processed, the method returns an empty String and closes the stream automatically (i.e. would not be mandatory in such a case). Returns whether the current item processed with the last call is a directory (. and .. are considered directories). Closes the current stream opened with (whether it has been fully processed with does not matter). On Windows, returns the number of drives (partitions) mounted on the current filesystem. On other platforms, the method returns 0. On Windows, returns the name of the drive (partition) passed as an argument (e.g. C:). On other platforms, or if the requested drive does not exist, the method returns an empty String. Returns the currently opened directory's drive index. See to convert returned index to the name of the drive. Changes the currently opened directory to the one passed as an argument. The argument can be relative to the current directory (e.g. newdir or ../newdir), or an absolute path (e.g. /tmp/newdir or res://somedir/newdir). Returns one of the code constants (OK on success). Returns the absolute path to the currently opened directory (e.g. res://folder or C:\tmp\folder). Creates a directory. The argument can be relative to the current directory, or an absolute path. The target directory should be placed in an already existing directory (to create the full path recursively, see ). Returns one of the code constants (OK on success). Creates a target directory and all necessary intermediate directories in its path, by calling recursively. The argument can be relative to the current directory, or an absolute path. Returns one of the code constants (OK on success). Returns whether the target file exists. The argument can be relative to the current directory, or an absolute path. Returns whether the target directory exists. The argument can be relative to the current directory, or an absolute path. On UNIX desktop systems, returns the available space on the current directory's disk. On other platforms, this information is not available and the method returns 0 or -1. Copies the from file to the to destination. Both arguments should be paths to files, either relative or absolute. If the destination file exists and is not access-protected, it will be overwritten. Returns one of the code constants (OK on success). Renames (move) the from file to the to destination. Both arguments should be paths to files, either relative or absolute. If the destination file exists and is not access-protected, it will be overwritten. Returns one of the code constants (OK on success). Deletes the target file or an empty directory. The argument can be relative to the current directory, or an absolute path. If the target directory is not empty, the operation will fail. Returns one of the code constants (OK on success). The singleton allows you to query and modify the project's run-time parameters, such as frames per second, time scale, and others. If true, the script is currently running inside the editor. This is useful for tool scripts to conditionally draw editor helpers, or prevent accidentally running "game" code that would affect the scene state while in the editor: if Engine.editor_hint: draw_gizmos() else: simulate_physics() See Running code in the editor in the documentation for more information. Note: To detect whether the script is run from an editor build (e.g. when pressing F5), use with the "editor" argument instead. OS.has_feature("editor") will evaluate to true both when the code is running in the editor and when running the project from the editor, but it will evaluate to false when the code is run from an exported project. The number of fixed iterations per second. This controls how often physics simulation and methods are run. This value should generally always be set to 60 or above, as Godot doesn't interpolate the physics step. As a result, values lower than 60 will look stuttery. This value can be increased to make input more reactive or work around tunneling issues, but keep in mind doing so will increase CPU usage. The desired frames per second. If the hardware cannot keep up, this setting may not be respected. A value of 0 means no limit. Controls how fast or slow the in-game clock ticks versus the real life one. It defaults to 1.0. A value of 2.0 means the game moves twice as fast as real life, whilst a value of 0.5 means the game moves at half the regular speed. Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows smoothing out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. Returns the fraction through the current physics tick we are at the time of rendering the frame. This can be used to implement fixed timestep interpolation. Returns the total number of frames drawn. If the render loop is disabled with --disable-render-loop via command line, this returns 0. See also . Returns the frames per second of the running game. Returns the total number of frames passed since engine initialization which is advanced on each physics frame. Returns the total number of frames passed since engine initialization which is advanced on each idle frame, regardless of whether the render loop is enabled. See also . Returns the main loop object (see and ). Returns the current engine version information in a Dictionary. major - Holds the major version number as an int minor - Holds the minor version number as an int patch - Holds the patch version number as an int hex - Holds the full version number encoded as a hexadecimal int with one byte (2 places) per number (see example below) status - Holds the status (e.g. "beta", "rc1", "rc2", ... "stable") as a String build - Holds the build name (e.g. "custom_build") as a String hash - Holds the full Git commit hash as a String year - Holds the year the version was released in as an int string - major + minor + patch + status + build in a single String The hex 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 0x03010C. Note: It's still an int internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for easy version comparisons from code: if Engine.get_version_info().hex >= 0x030200: # Do things specific to version 3.2 or later else: # Do things specific to versions before 3.2 Returns engine author information in a Dictionary. lead_developers - Array of Strings, lead developer names founders - Array of Strings, founder names project_managers - Array of Strings, project manager names developers - Array of Strings, developer names Returns an Array of copyright information Dictionaries. name - String, component name parts - Array of Dictionaries {files, copyright, license} describing subsections of the component Returns a Dictionary of Arrays of donor names. {platinum_sponsors, gold_sponsors, silver_sponsors, bronze_sponsors, mini_sponsors, gold_donors, silver_donors, bronze_donors} Returns Dictionary of licenses used by Godot and included third party components. Returns Godot license text. Returns true if the game is inside the fixed process and physics phase of the game loop. Returns true if a singleton with given name exists in global scope. Returns a global singleton with given name. Often used for plugins, e.g. GodotPayment on Android. File type. This is used to permanently store data into the user device's file system and to read from it. This can be used to store game save data or player configuration files, for example. Here's a sample on how to write and read from a file: func save(content): var file = File.new() file.open("user://save_game.dat", File.WRITE) file.store_string(content) file.close() func load(): var file = File.new() file.open("user://save_game.dat", File.READ) var content = file.get_as_text() file.close() return content In the example above, the file will be saved in the user data folder as specified in the Data paths documentation. Note: To access project resources once exported, it is recommended to use instead of the API, as some files are converted to engine-specific formats and their original source files might not be present in the exported PCK package. Note: Files are automatically closed only if the process exits "normally" (such as by clicking the window manager's close button or pressing Alt + F4). If you stop the project execution by pressing F8 while the project is running, the file won't be closed as the game process will be killed. You can work around this by calling at regular intervals. Uses the FastLZ compression method. Uses the DEFLATE compression method. Uses the Zstandard compression method. Uses the gzip compression method. Opens the file for read operations. The cursor is positioned at the beginning of the file. Opens the file for write operations. The file is created if it does not exist, and truncated if it does. Opens the file for read and write operations. Does not truncate the file. The cursor is positioned at the beginning of the file. Opens the file for read and write operations. The file is created if it does not exist, and truncated if it does. The cursor is positioned at the beginning of the file. If true, the file is read with big-endian endianness. If false, the file is read with little-endian endianness. If in doubt, leave this to false as most files are written with little-endian endianness. Note: is only about the file format, not the CPU type. The CPU endianness doesn't affect the default endianness for files written. Note: This is always reset to false whenever you open the file. Therefore, you must set after opening the file, not before. Opens an encrypted file in write or read mode. You need to pass a binary key to encrypt/decrypt it. Note: The provided key must be 32 bytes long. Opens an encrypted file in write or read mode. You need to pass a password to encrypt/decrypt it. Opens a compressed file for reading or writing. Note: can only read files that were saved by Godot, not third-party compression formats. See GitHub issue #28999 for a workaround. Opens the file for writing or reading, depending on the flags. Writes the file's buffer to disk. Flushing is automatically performed when the file is closed. This means you don't need to call manually before closing a file using . Still, calling can be used to ensure the data is safe even if the project crashes instead of being closed gracefully. Note: Only call when you actually need it. Otherwise, it will decrease performance due to constant disk writes. Closes the currently opened file and prevents subsequent read/write operations. Use to persist the data to disk without closing the file. Returns the path as a for the current open file. Returns the absolute path as a for the current open file. Returns true if the file is currently opened. Changes the file reading/writing cursor to the specified position (in bytes from the beginning of the file). Changes the file reading/writing cursor to the specified position (in bytes from the end of the file). Note: This is an offset, so you should use negative numbers or the cursor will be at the end of the file. Returns the file cursor's position. Returns the size of the file in bytes. Returns true if the file cursor has read past the end of the file. Note: This function will still return false while at the end of the file and only activates when reading past it. This can be confusing but it conforms to how low-level file access works in all operating systems. There is always and to implement a custom logic. Returns the next 8 bits from the file as an integer. See for details on what values can be stored and retrieved this way. Returns the next 16 bits from the file as an integer. See for details on what values can be stored and retrieved this way. Returns the next 32 bits from the file as an integer. See for details on what values can be stored and retrieved this way. Returns the next 64 bits from the file as an integer. See for details on what values can be stored and retrieved this way. Returns the next 32 bits from the file as a floating-point number. Returns the next 64 bits from the file as a floating-point number. Returns the next bits from the file as a floating-point number. Returns next len bytes of the file as a . Returns the next line of the file as a . Text is interpreted as being UTF-8 encoded. Returns the next value of the file in CSV (Comma-Separated Values) format. You can pass a different delimiter delim to use other than the default "," (comma). This delimiter must be one-character long. Text is interpreted as being UTF-8 encoded. Returns the whole file as a . Text is interpreted as being UTF-8 encoded. Returns an MD5 String representing the file at the given path or an empty on failure. Returns a SHA-256 representing the file at the given path or an empty on failure. Returns the last error that happened when trying to perform operations. Compare with the ERR_FILE_* constants from . Returns the next Variant value from the file. If allow_objects is true, decoding objects is allowed. Warning: Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. Stores an integer as 8 bits in the file. Note: The value should lie in the interval [0, 255]. Any other value will overflow and wrap around. To store a signed integer, use , or convert it manually (see for an example). Stores an integer as 16 bits in the file. Note: The value should lie in the interval [0, 2^16 - 1]. Any other value will overflow and wrap around. To store a signed integer, use or store a signed integer from the interval [-2^15, 2^15 - 1] (i.e. keeping one bit for the signedness) and compute its sign manually when reading. For example: const MAX_15B = 1 << 15 const MAX_16B = 1 << 16 func unsigned16_to_signed(unsigned): return (unsigned + MAX_15B) % MAX_16B - MAX_15B func _ready(): var f = File.new() f.open("user://file.dat", File.WRITE_READ) f.store_16(-42) # This wraps around and stores 65494 (2^16 - 42). f.store_16(121) # In bounds, will store 121. f.seek(0) # Go back to start to read the stored value. var read1 = f.get_16() # 65494 var read2 = f.get_16() # 121 var converted1 = unsigned16_to_signed(read1) # -42 var converted2 = unsigned16_to_signed(read2) # 121 Stores an integer as 32 bits in the file. Note: The value should lie in the interval [0, 2^32 - 1]. Any other value will overflow and wrap around. To store a signed integer, use , or convert it manually (see for an example). Stores an integer as 64 bits in the file. Note: The value must lie in the interval [-2^63, 2^63 - 1] (i.e. be a valid value). Stores a floating-point number as 32 bits in the file. Stores a floating-point number as 64 bits in the file. Stores a floating-point number in the file. Stores the given array of bytes in the file. Appends line to the file followed by a line return character (\n), encoding the text as UTF-8. Store the given in the file as a line formatted in the CSV (Comma-Separated Values) format. You can pass a different delimiter delim to use other than the default "," (comma). This delimiter must be one-character long. Text will be encoded as UTF-8. Appends string to the file without a line return, encoding the text as UTF-8. Stores any Variant value in the file. If full_objects is true, encoding objects is allowed (and can potentially include code). Stores the given as a line in the file in Pascal format (i.e. also store the length of the string). Text will be encoded as UTF-8. Returns a saved in Pascal format from the file. Text is interpreted as being UTF-8 encoded. Returns true if the file exists in the given path. Note: 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 for an alternative approach that takes resource remapping into account. Returns the last time the file was modified in unix timestamp format or returns a "ERROR IN file". This unix timestamp can be converted to datetime by using . Geometry provides users with a set of helper functions to create geometric shapes, compute intersections between shapes, and process various other geometric operations. Endpoints are joined using the value and the path filled as a polygon. Endpoints are joined using the value and the path filled as a polyline. Endpoints are squared off with no extension. Endpoints are squared off and extended by delta units. Endpoints are rounded off and extended by delta units. Create regions where either subject or clip polygons (or both) are filled. Create regions where subject polygons are filled except where clip polygons are filled. Create regions where both subject and clip polygons are filled. Create regions where either subject or clip polygons are filled but not where both are filled. Squaring is applied uniformally at all convex edge joins at 1 * delta. While flattened paths can never perfectly trace an arc, they are approximated by a series of arc chords. There's a necessary limit to mitered joins since offsetting edges that join at very acute angles will produce excessively long and narrow "spikes". For any given edge join, when miter offsetting would exceed that maximum distance, "square" joining is applied. Returns an array with 6 s that describe the sides of a box centered at the origin. The box size is defined by extents, which represents one (positive) corner of the box (i.e. half its actual size). Returns an array of s closely bounding a faceted cylinder centered at the origin with radius radius and height height. The parameter sides defines how many planes will be generated for the round part of the cylinder. The parameter axis describes the axis along which the cylinder is oriented (0 for X, 1 for Y, 2 for Z). Returns an array of s closely bounding a faceted capsule centered at the origin with radius radius and height height. The parameter sides defines how many planes will be generated for the side part of the capsule, whereas lats gives the number of latitudinal steps at the bottom and top of the capsule. The parameter axis describes the axis along which the capsule is oriented (0 for X, 1 for Y, 2 for Z). Returns true if point is inside the circle or if it's located exactly on the circle's boundary, otherwise returns false. Given the 2D segment (segment_from, segment_to), returns the position on the segment (as a number between 0 and 1) at which the segment hits the circle that is located at position circle_position and has radius circle_radius. If the segment does not intersect the circle, -1 is returned (this is also the case if the line extending the segment would intersect the circle, but the segment does not). Checks if the two segments (from_a, to_a) and (from_b, to_b) intersect. If yes, return the point of intersection as . If no intersection takes place, returns an empty Variant. Checks if the two lines (from_a, dir_a) and (from_b, dir_b) intersect. If yes, return the point of intersection as . If no intersection takes place, returns an empty Variant. Note: The lines are specified using direction vectors, not end points. Given the two 2D segments (p1, q1) and (p2, q2), finds those two points on the two segments that are closest to each other. Returns a that contains this point on (p1, q1) as well the accompanying point on (p2, q2). Given the two 3D segments (p1, p2) and (q1, q2), finds those two points on the two segments that are closest to each other. Returns a that contains this point on (p1, p2) as well the accompanying point on (q1, q2). Returns the 2D point on the 2D segment (s1, s2) that is closest to point. The returned point will always be inside the specified segment. Returns the 3D point on the 3D segment (s1, s2) that is closest to point. The returned point will always be inside the specified segment. Returns the 2D point on the 2D line defined by (s1, s2) that is closest to point. The returned point can be inside the segment (s1, s2) or outside of it, i.e. somewhere on the line extending from the segment. Returns the 3D point on the 3D line defined by (s1, s2) that is closest to point. The returned point can be inside the segment (s1, s2) or outside of it, i.e. somewhere on the line extending from the segment. Used internally by the engine. Tests if the 3D ray starting at from with the direction of dir intersects the triangle specified by a, b and c. If yes, returns the point of intersection as . If no intersection takes place, an empty Variant is returned. Tests if the segment (from, to) intersects the triangle a, b, c. If yes, returns the point of intersection as . If no intersection takes place, an empty Variant is returned. Checks if the segment (from, to) intersects the sphere that is located at sphere_position and has radius sphere_radius. If no, returns an empty . If yes, returns a containing the point of intersection and the sphere's normal at the point of intersection. Checks if the segment (from, to) intersects the cylinder with height height that is centered at the origin and has radius radius. If no, returns an empty . If an intersection takes place, the returned array contains the point of intersection and the cylinder's normal at the point of intersection. Given a convex hull defined though the s in the array planes, tests if the segment (from, to) intersects with that hull. If an intersection is found, returns a containing the point the intersection and the hull's normal. If no intersecion is found, an the returned array is empty. Returns if point is inside the triangle specified by a, b and c. Returns true if polygon's vertices are ordered in clockwise order, otherwise returns false. Returns true if point is inside polygon or if it's located exactly on polygon's boundary, otherwise returns false. Triangulates the polygon specified by the points in polygon. Returns a where each triangle consists of three consecutive point indices into polygon (i.e. the returned array will have n * 3 elements, with n being the number of found triangles). If the triangulation did not succeed, an empty is returned. Triangulates the area specified by discrete set of points such that no point is inside the circumcircle of any resulting triangle. Returns a where each triangle consists of three consecutive point indices into points (i.e. the returned array will have n * 3 elements, with n being the number of found triangles). If the triangulation did not succeed, an empty is returned. Given an array of s, returns the convex hull as a list of points in counterclockwise order. The last point is the same as the first one. Clips the polygon defined by the points in points against the plane and returns the points of the clipped polygon. Merges (combines) polygon_a and polygon_b and returns an array of merged polygons. This performs between polygons. The operation may result in an outer polygon (boundary) and multiple inner polygons (holes) produced which could be distinguished by calling . Clips polygon_a against polygon_b and returns an array of clipped polygons. This performs between polygons. Returns an empty array if polygon_b completely overlaps polygon_a. If polygon_b is enclosed by polygon_a, returns an outer polygon (boundary) and inner polygon (hole) which could be distinguished by calling . Intersects polygon_a with polygon_b and returns an array of intersected polygons. This performs between polygons. In other words, returns common area shared by polygons. Returns an empty array if no intersection occurs. The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling . Mutually excludes common area defined by intersection of polygon_a and polygon_b (see ) and returns an array of excluded polygons. This performs between polygons. In other words, returns all but common area between polygons. The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling . Clips polyline against polygon and returns an array of clipped polylines. This performs between the polyline and the polygon. This operation can be thought of as cutting a line with a closed shape. Intersects polyline with polygon and returns an array of intersected polylines. This performs between the polyline and the polygon. This operation can be thought of as chopping a line with a closed shape. Inflates or deflates polygon by delta units (pixels). If delta is positive, makes the polygon grow outward. If delta is negative, shrinks the polygon inward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. Returns an empty array if delta is negative and the absolute value of it approximately exceeds the minimum bounding rectangle dimensions of the polygon. Each polygon's vertices will be rounded as determined by join_type, see . The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling . Note: To translate the polygon's vertices specifically, use the Transform2D.xform method: var polygon = PoolVector2Array([Vector2(0, 0), Vector2(100, 0), Vector2(100, 100), Vector2(0, 100)]) var offset = Vector2(50, 50) polygon = Transform2D(0, offset).xform(polygon) print(polygon) # prints [Vector2(50, 50), Vector2(150, 50), Vector2(150, 150), Vector2(50, 150)] Inflates or deflates polyline by delta units (pixels), producing polygons. If delta is positive, makes the polyline grow outward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. If delta is negative, returns an empty array. Each polygon's vertices will be rounded as determined by join_type, see . Each polygon's endpoints will be rounded as determined by end_type, see . The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling . Given an array of s representing tiles, builds an atlas. The returned dictionary has two keys: points is a vector of that specifies the positions of each tile, size contains the overall size of the whole atlas as . This class is a bridge between Godot and the Mono runtime. It exposes several low-level operations and is only available in Mono-enabled Godot builds. See also . Attaches the current thread to the Mono runtime. Detaches the current thread from the Mono runtime. Returns the current MonoDomain ID. Note: The Mono runtime must be initialized for this method to work (use to check). If the Mono runtime isn't initialized at the time this method is called, the engine will crash. Returns the scripts MonoDomain's ID. This will be the same MonoDomain ID as , unless the scripts domain isn't loaded. Note: The Mono runtime must be initialized for this method to work (use to check). If the Mono runtime isn't initialized at the time this method is called, the engine will crash. Returns true if the scripts domain is loaded, false otherwise. Returns true if the domain is being finalized, false otherwise. Returns true if the Mono runtime is shutting down, false otherwise. Returns true if the Mono runtime is initialized, false otherwise. Helper class for parsing JSON data. For usage example and other important hints, see . Converts a Variant var to JSON text and returns the result. Useful for serializing data to store or send over the network. Note: The JSON specification does not define integer or float types, but only a number type. Therefore, converting a Variant to JSON text will convert all numerical values to types. Use indent parameter to pretty print the output. Example output: ## JSON.print(my_dictionary) {"name":"my_dictionary","version":"1.0.0","entities":[{"name":"entity_0","value":"value_0"},{"name":"entity_1","value":"value_1"}]} ## JSON.print(my_dictionary, "\t") { "name": "my_dictionary", "version": "1.0.0", "entities": [ { "name": "entity_0", "value": "value_0" }, { "name": "entity_1", "value": "value_1" } ] } Parses a JSON-encoded string and returns a containing the result. Provides data transformation and encoding utility functions. Returns a Base64-encoded string of the Variant variant. If full_objects is true, encoding objects is allowed (and can potentially include code). Returns a decoded Variant corresponding to the Base64-encoded string base64_str. If allow_objects is true, decoding objects is allowed. Warning: Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. Returns a Base64-encoded string of a given . Returns a decoded corresponding to the Base64-encoded string base64_str. Returns a Base64-encoded string of the UTF-8 string utf8_str. Returns a decoded string corresponding to the Base64-encoded string base64_str. A synchronization mutex (mutual exclusion). This is used to synchronize multiple s, and is equivalent to a binary . It guarantees that only one thread can ever acquire the lock at a time. A mutex can be used to protect a critical section; however, be careful to avoid deadlocks. Locks this , blocks until it is unlocked by the current owner. Tries locking this , but does not block. Returns on success, otherwise. Unlocks this , leaving it to other threads. Operating System functions. OS wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, date and time, timers, environment variables, execution of binaries, command line, etc. The GLES2 rendering backend. It uses OpenGL ES 2.0 on mobile devices, OpenGL 2.1 on desktop platforms and WebGL 1.0 on the web. The GLES3 rendering backend. It uses OpenGL ES 3.0 on mobile devices, OpenGL 3.3 on desktop platforms and WebGL 2.0 on the web. Desktop directory path. DCIM (Digital Camera Images) directory path. Documents directory path. Downloads directory path. Movies directory path. Music directory path. Pictures directory path. Ringtones directory path. Landscape screen orientation. Portrait screen orientation. Reverse landscape screen orientation. Reverse portrait screen orientation. Uses landscape or reverse landscape based on the hardware sensor. Uses portrait or reverse portrait based on the hardware sensor. Uses most suitable orientation based on the hardware sensor. Unknown powerstate. Unplugged, running on battery. Plugged in, no battery available. Plugged in, battery charging. Plugged in, battery fully charged. Application handle: - Windows: HINSTANCE of the application - MacOS: NSApplication* of the application (not yet implemented) - Android: JNIEnv* of the application (not yet implemented) Display handle: - Linux: X11::Display* for the display Window handle: - Windows: HWND of the main window - Linux: X11::Window* of the main window - MacOS: NSWindow* of the main window (not yet implemented) - Android: jObject the main android activity (not yet implemented) Window view: - Windows: HDC of the main window drawing context - MacOS: NSView* of the main windows view (not yet implemented) OpenGL Context: - Windows: HGLRC - Linux: X11::GLXContext - MacOS: NSOpenGLContext* (not yet implemented) January. February. March. April. May. June. July. August. September. October. November. December. Sunday. Monday. Tuesday. Wednesday. Thursday. Friday. Saturday. The current tablet driver in use. The clipboard from the host OS. Might be unavailable on some platforms. The current screen index (starting from 0). The exit code passed to the OS when the main loop exits. By convention, an exit code of 0 indicates success whereas a non-zero exit code indicates an error. For portability reasons, the exit code should be set between 0 and 125 (inclusive). Note: This value will be ignored if using with an exit_code argument passed. If true, vertical synchronization (Vsync) is enabled. If true and vsync_enabled is true, the operating system's window compositor will be used for vsync when the compositor is enabled and the game is in windowed mode. Note: This option is experimental and meant to alleviate stutter experienced by some users. However, some users have experienced a Vsync framerate halving (e.g. from 60 FPS to 30 FPS) when using it. Note: This property is only implemented on Windows. If true, the engine optimizes for low processor usage by only refreshing the screen if needed. Can improve battery consumption on mobile. The amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage. If true, the engine tries to keep the screen on while the game is running. Useful on mobile. The minimum size of the window (without counting window manager decorations). Does not affect fullscreen mode. Set to (0, 0) to reset to the system default value. The maximum size of the window (without counting window manager decorations). Does not affect fullscreen mode. Set to (0, 0) to reset to the system default value. The current screen orientation. If true, removes the window frame. Note: Setting window_borderless to false disables per-pixel transparency. If true, the window background is transparent and window frame is removed. Use get_tree().get_root().set_transparent_background(true) to disable main viewport background rendering. Note: This property has no effect if Project > Project Settings > Display > Window > Per-pixel transparency > Allowed setting is disabled. Note: This property is implemented on HTML5, Linux, macOS and Windows. If true, the window is fullscreen. If true, the window is maximized. If true, the window is minimized. If true, the window is resizable by the user. The window position relative to the screen, the origin is the top left corner, +Y axis goes to the bottom and +X axis goes to the right. The size of the window (without counting window manager decorations). Add a new item with text "label" to global menu. Use "_dock" menu to add item to the macOS dock icon menu. Note: This method is implemented on macOS. Add a separator between items. Separators also occupy an index. Note: This method is implemented on macOS. Removes the item at index "idx" from the global menu. Note that the indexes of items after the removed item are going to be shifted by one. Note: This method is implemented on macOS. Clear the global menu, in effect removing all items. Note: This method is implemented on macOS. Returns the number of video drivers supported on the current platform. Returns the name of the video driver matching the given driver index. This index is a value from , and you can use to get the current backend's index. Returns the currently used video driver, using one of the values from . Returns the total number of available audio drivers. Returns the audio driver name for the given index. Returns an array of MIDI device names. The returned array will be empty if the system MIDI driver has not previously been initialised with . Note: This method is implemented on Linux, macOS and Windows. Initialises the singleton for the system MIDI driver. Note: This method is implemented on Linux, macOS and Windows. Shuts down system MIDI driver. Note: This method is implemented on Linux, macOS and Windows. Returns the number of displays attached to the host machine. Returns the position of the specified screen by index. If screen is [/code]-1[/code] (the default value), the current screen will be used. Returns the dimensions in pixels of the specified screen. If screen is [/code]-1[/code] (the default value), the current screen will be used. Returns the dots per inch density of the specified screen. If screen is [/code]-1[/code] (the default value), the current screen will be used. Note: On macOS, returned value is inaccurate if fractional display scaling mode is used. Note: On Android devices, the actual screen densities are grouped into six generalized densities: ldpi - 120 dpi mdpi - 160 dpi hdpi - 240 dpi xhdpi - 320 dpi xxhdpi - 480 dpi xxxhdpi - 640 dpi Note: This method is implemented on Android, Linux, macOS and Windows. Returns 72 on unsupported platforms. Return the scale factor of the specified screen by index. If screen is [/code]-1[/code] (the default value), the current screen will be used. Note: On macOS returned value is 2.0 for hiDPI (Retina) screen, and 1.0 for all other cases. Note: This method is implemented on macOS. Return the greatest scale factor of all screens. Note: On macOS returned value is 2.0 if there is at least one hiDPI (Retina) screen in the system, and 1.0 in all other cases. Note: This method is implemented on macOS. Returns unobscured area of the window where interactive controls should be rendered. Sets whether the window should always be on top. Note: This method is implemented on Linux, macOS and Windows. Returns true if the window should always be on top of other windows. Returns true if the window is currently focused. Note: Only implemented on desktop platforms. On other platforms, it will always return true. Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX. Note: This method is implemented on Linux, macOS and Windows. Returns the window size including decorations like window borders. Centers the window on the screen if in windowed mode. Moves the window to the front. Note: This method is implemented on Linux, macOS and Windows. Returns internal structure pointers for use in GDNative plugins. Note: This method is implemented on Linux and Windows (other OSs will soon be supported). Sets whether IME input mode should be enabled. If active IME handles key events before the application and creates an composition string and suggestion list. Application can retrieve the composition status by using and functions. Completed composition string is committed when input is finished. Note: This method is implemented on Linux, macOS and Windows. Sets position of IME suggestion list popup (in window coordinates). Note: This method is implemented on Linux, macOS and Windows. Returns the IME cursor position (the currently-edited portion of the string) relative to the characters in the composition string. is sent to the application to notify it of changes to the IME cursor position. Note: This method is implemented on macOS. Returns the IME intermediate composition string. is sent to the application to notify it of changes to the IME composition string. Note: This method is implemented on macOS. Returns true if the device has a touchscreen or emulates one. Sets the window title to the specified string. Note: This should be used sporadically. Don't set this every frame, as that will negatively affect performance on some window managers. Note: This method is implemented on HTML5, Linux, macOS and Windows. Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through. Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior). # Set region, using Path2D node. OS.set_window_mouse_passthrough($Path2D.curve.get_baked_points()) # Set region, using Polygon2D node. OS.set_window_mouse_passthrough($Polygon2D.polygon) # Reset region to default. OS.set_window_mouse_passthrough([]) Note: On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is. Note: This method is implemented on Linux, macOS and Windows. Returns the number of threads available on the host machine. Returns the path to the current engine executable. Execute the file at the given path with the arguments passed as an array of strings. Platform path resolution will take place. The resolved file must exist and be executable. The arguments are used in the given order and separated by a space, so OS.execute("ping", ["-w", "3", "godotengine.org"], false) will resolve to ping -w 3 godotengine.org in the system's shell. This method has slightly different behavior based on whether the blocking mode is enabled. If blocking is true, the Godot thread will pause its execution while waiting for the process to terminate. The shell output of the process will be written to the output array as a single string. When the process terminates, the Godot thread will resume execution. If blocking is false, the Godot thread will continue while the new process runs. It is not possible to retrieve the shell output in non-blocking mode, so output will be empty. The return value also depends on the blocking mode. When blocking, the method will return an exit code of the process. When non-blocking, the method returns a process ID, which you can use to monitor the process (and potentially terminate it with ). If the process forking (non-blocking) or opening (blocking) fails, the method will return -1 or another exit code. Example of blocking mode and retrieving the shell output: var output = [] var exit_code = OS.execute("ls", ["-l", "/tmp"], true, output) Example of non-blocking mode, running another instance of the project and storing its process ID: var pid = OS.execute(OS.get_executable_path(), [], false) If you wish to access a shell built-in or perform a composite command, a platform-specific shell can be invoked. For example: OS.execute("CMD.exe", ["/C", "cd %TEMP% && dir"], true, output) Note: This method is implemented on Android, iOS, Linux, macOS and Windows. If the parameter is null, then the default value is new Godot.Collections.Array {} Kill (terminate) the process identified by the given process ID (pid), e.g. the one returned by in non-blocking mode. Note: This method can also be used to kill processes that were not spawned by the game. Note: This method is implemented on Android, iOS, Linux, macOS and Windows. Requests the OS to open a resource with the most appropriate program. For example: - OS.shell_open("C:\\Users\name\Downloads") on Windows opens the file explorer at the user's Downloads folder. - OS.shell_open("https://godotengine.org") opens the default web browser on the official Godot website. - OS.shell_open("mailto:example@example.com") opens the default email client with the "To" field set to example@example.com. See Customizing mailto: Links for a list of fields that can be added. Use to convert a res:// or user:// path into a system path for use with this method. Note: This method is implemented on Android, iOS, HTML5, Linux, macOS and Windows. Returns the project's process ID. Note: This method is implemented on Android, iOS, Linux, macOS and Windows. Returns the value of an environment variable. Returns an empty string if the environment variable doesn't exist. Note: Double-check the casing of variable. Environment variable names are case-sensitive on all platforms except Windows. Sets the value of the environment variable variable to value. The environment variable will be set for the Godot process and any process executed with after running . The environment variable will not persist to processes run after the Godot process was terminated. Note: Double-check the casing of variable. Environment variable names are case-sensitive on all platforms except Windows. Returns true if the environment variable with the name variable exists. Note: Double-check the casing of variable. Environment variable names are case-sensitive on all platforms except Windows. Returns the name of the host OS. Possible values are: "Android", "iOS", "HTML5", "OSX", "Server", "Windows", "UWP", "X11". Returns the command-line arguments passed to the engine. Command-line arguments can be written in any form, including both --key value and --key=value forms so they can be properly parsed, as long as custom command-line arguments do not conflict with engine arguments. You can also incorporate environment variables using the method. You can set editor/main_run_args in the Project Settings to define command-line arguments to be passed by the editor when running the project. Here's a minimal example on how to parse command-line arguments into a dictionary using the --key=value form for arguments: var arguments = {} for argument in OS.get_cmdline_args(): if argument.find("=") > -1: var key_value = argument.split("=") arguments[key_value[0].lstrip("--")] = key_value[1] Returns current datetime as a dictionary of keys: year, month, day, weekday, dst (Daylight Savings Time), hour, minute, second. Returns current date as a dictionary of keys: year, month, day, weekday, dst (Daylight Savings Time). Returns current time as a dictionary of keys: hour, minute, second. Returns the current time zone as a dictionary with the keys: bias and name. Returns the current UNIX epoch timestamp in seconds. Important: This is the system clock that the user can manually set. Never use this method for precise time calculation since its results are also subject to automatic adjustments by the operating system. Always use or for precise time calculation instead, since they are guaranteed to be monotonic (i.e. never decrease). Gets a dictionary of time values corresponding to the given UNIX epoch time (in seconds). The returned Dictionary's values will be the same as , with the exception of Daylight Savings Time as it cannot be determined from the epoch. Gets an epoch time value from a dictionary of time values. datetime must be populated with the following keys: year, month, day, hour, minute, second. If the dictionary is empty 0 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 UTC). You can pass the output from directly into this function. Daylight Savings Time (dst), if present, is ignored. Returns the epoch time of the operating system in seconds. Returns the epoch time of the operating system in milliseconds. Sets the game's icon using a multi-size platform-specific icon file (*.ico on Windows and *.icns on macOS). Appropriate size sub-icons are used for window caption, taskbar/dock and window selection dialog. Note: This method is implemented on macOS and Windows. Sets the game's icon using an resource. The same image is used for window caption, taskbar/dock and window selection dialog. Image is scaled as needed. Note: This method is implemented on HTML5, Linux, macOS and Windows. Delay execution of the current thread by usec microseconds. usec must be greater than or equal to 0. Otherwise, will do nothing and will print an error message. Delay execution of the current thread by msec milliseconds. usec must be greater than or equal to 0. Otherwise, will do nothing and will print an error message. Returns the amount of time passed in milliseconds since the engine started. Returns the amount of time passed in microseconds since the engine started. Returns the amount of time in milliseconds it took for the boot logo to appear. Returns the host OS locale. Returns the current latin keyboard variant as a String. Possible return values are: "QWERTY", "AZERTY", "QZERTY", "DVORAK", "NEO", "COLEMAK" or "ERROR". Note: This method is implemented on Linux, macOS and Windows. Returns "QWERTY" on unsupported platforms. Returns the model name of the current device. Note: This method is implemented on Android and iOS. Returns "GenericDevice" on unsupported platforms. Returns the number of keyboard layouts. Note: This method is implemented on Linux, macOS and Windows. Returns active keyboard layout index. Note: This method is implemented on Linux, macOS and Windows. Sets active keyboard layout. Note: This method is implemented on Linux, macOS and Windows. Returns the ISO-639/BCP-47 language code of the keyboard layout at position index. Note: This method is implemented on Linux, macOS and Windows. Returns the localized name of the keyboard layout at position index. Note: This method is implemented on Linux, macOS and Windows. Returns true if the host OS allows drawing. If true, the user:// file system is persistent, so that its state is the same after a player quits and starts the game again. Relevant to the HTML5 platform, where this persistence may be unavailable. Returns true if the engine was executed with -v (verbose stdout). Returns true if the current host platform is using multiple threads. Returns true if the Godot binary used to run the project is a debug export template, or when running in the editor. Returns false if the Godot binary used to run the project is a release export template. To check whether the Godot binary used to run the project is an export template (debug or release), use OS.has_feature("standalone") instead. Dumps the memory allocation ringlist to a file (only works in debug). Entry format per line: "Address - Size - Description". Dumps all used resources to file (only works in debug). Entry format per line: "Resource Type : Resource Location". At the end of the file is a statistic of all used Resource Types. Returns true if the platform has a virtual keyboard, false otherwise. Shows the virtual keyboard if the platform has one. The existing_text parameter is useful for implementing your own or , as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions). The multiline parameter needs to be set to true to be able to enter multiple lines of text, as in . Note: This method is implemented on Android, iOS and UWP. Hides the virtual keyboard if it is shown, does nothing otherwise. Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden. Shows all resources currently used by the game. Shows all resources in the game. Optionally, the list can be written to a file by specifying a file path in tofile. Returns the amount of static memory being used by the program in bytes. Returns the maximum amount of static memory used (only works in debug). Returns the total amount of dynamic memory used (only works in debug). Returns the absolute directory path where user data is written (user://). On Linux, this is ~/.local/share/godot/app_userdata/[project_name], or ~/.local/share/[custom_name] if use_custom_user_dir is set. On macOS, this is ~/Library/Application Support/Godot/app_userdata/[project_name], or ~/Library/Application Support/[custom_name] if use_custom_user_dir is set. On Windows, this is %APPDATA%\Godot\app_userdata\[project_name], or %APPDATA%\[custom_name] if use_custom_user_dir is set. %APPDATA% expands to %USERPROFILE%\AppData\Roaming. If the project name is empty, user:// falls back to res://. Returns the actual path to commonly used folders across different platforms. Available locations are specified in . Note: This method is implemented on Android, Linux, macOS and Windows. Returns a string that is unique to the device. Note: This string may change without notice if the user reinstalls/upgrades their operating system or changes their hardware. This means it should generally not be used to encrypt persistent data as the data saved prior to an unexpected ID change would become inaccessible. The returned string may also be falsified using external programs, so do not rely on the string returned by for security purposes. Note: Returns an empty string on HTML5 and UWP, as this method isn't implemented on those platforms yet. Returns true if the OK button should appear on the left and Cancel on the right. Shows the list of loaded textures sorted by size in memory. Shows the number of resources loaded by the game of the given types. Plays native video from the specified path, at the given volume and with audio and subtitle tracks. Note: This method is implemented on Android and iOS, and the current Android implementation does not support the volume, audio_track and subtitle_track options. Returns true if native video is playing. Note: This method is implemented on Android and iOS. Stops native video playback. Note: This method is implemented on Android and iOS. Pauses native video playback. Note: This method is implemented on Android and iOS. Resumes native video playback. Note: This method is implemented on Android and iOS. Returns the given scancode as a string (e.g. Return values: "Escape", "Shift+Escape"). See also and . Returns true if the input scancode corresponds to a Unicode character. Returns the scancode of the given string (e.g. "Escape"). Enables backup saves if enabled is true. Displays a modal dialog box using the host OS' facilities. Execution is blocked until the dialog is closed. Sets the name of the current thread. Returns the ID of the current thread. This can be used in logs to ease debugging of multi-threaded applications. Note: Thread IDs are not deterministic and may be reused across application restarts. Returns true if the feature for the given feature tag is supported in the currently running instance, depending on platform, build etc. Can be used to check whether you're currently running a debug build, on a certain platform or arch, etc. Refer to the Feature Tags documentation for more details. Note: Tag names are case-sensitive. Returns the current state of the device regarding battery and power. See constants. Note: This method is implemented on Linux, macOS and Windows. Returns an estimate of the time left in seconds before the device runs out of battery. Returns -1 if power state is unknown. Note: This method is implemented on Linux, macOS and Windows. Returns the amount of battery left in the device as a percentage. Returns -1 if power state is unknown. Note: This method is implemented on Linux, macOS and Windows. At the moment this function is only used by AudioDriverOpenSL to request permission for RECORD_AUDIO on Android. With this function you can request dangerous permissions since normal permissions are automatically granted at install time in Android application. Note: This method is implemented on Android. With this function you can get the list of dangerous permissions that have been granted to the Android application. Note: This method is implemented on Android. Returns the total number of available tablet drivers. Note: This method is implemented on Windows. Returns the tablet driver name for the given index. Note: This method is implemented on Windows. Singleton for saving Godot-specific resource types to the filesystem. It uses the many classes registered in the engine (either built-in or from a plugin) to save engine-specific resource data to text-based (e.g. .tres or .tscn) or binary files (e.g. .res or .scn). Save the resource with a path relative to the scene which uses it. Bundles external resources. Changes the of the saved resource to match its new location. Do not save editor-specific metadata (identified by their __editor prefix). Save as big endian (see ). Compress the resource on save using . Only available for binary resource types. Take over the paths of the saved subresources (see ). Saves a resource to disk to the given path, using a that recognizes the resource object. The flags bitmask can be specified to customize the save behavior. Returns on success. Returns the list of extensions available for saving a resource of a given type. A synchronization semaphore which can be used to synchronize multiple s. Initialized to zero on creation. Be careful to avoid deadlocks. For a binary version, see . Tries to wait for the , if its value is zero, blocks until non-zero. Returns on success, otherwise. Lowers the , allowing one more thread in. Returns on success, otherwise. A unit of execution in a process. Can run methods on s simultaneously. The use of synchronization via or is advised if working with shared objects. Note: Breakpoints won't break on code if it's running in a thread. This is a current limitation of the GDScript debugger. A thread running with lower priority than normally. A thread with a standard priority. A thread running with higher priority than normally. Starts a new that runs method on object instance with userdata passed as an argument. Even if no userdata is passed, method must accept one argument and it will be null. The priority of the can be changed by passing a value from the enum. Returns on success, or on failure. Returns the current 's ID, uniquely identifying it among all threads. If the is not running this returns an empty string. Returns true if this is currently active. An active cannot start work on a new method but can be joined with . Joins the and waits for it to finish. Returns what the method called returned.