Built-in GDScript functions.
This contains the list of built-in gdscript functions. Mostly math functions and other utilities. Everything else is expanded by objects.
Standard sine function.
Standard cosine function.
Standard tangent function.
Hyperbolic sine.
Hyperbolic cosine.
Hyperbolic tangent.
Arc-sine.
Arc-cosine.
Arc-tangent.
Arc-tangent that takes a 2D vector as argument, returns the full -pi to +pi range.
Square root.
Module (remainder of x/y).
Module (remainder of x/y) that wraps equally in positive and negative.
Floor (rounds down to nearest integer).
Ceiling (rounds up to nearest integer).
Round to nearest integer.
Remove sign (works for integer and float).
Return sign (-1 or +1).
Power function, x elevate to y.
Natural logarithm.
Exponential logarithm.
Return true if the float is not a number.
Return true if the float is infinite.
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 amount of decimals in the floating point value.
Snap float value to a given step.
Linear interpolates between two values by a normalized value.
Decreases time by a specified amount.
Reset the seed of the random number generator with a new, different one.
Random 32 bits value (integer). To obtain a value from 0 to N, you can use remainder, like (for random from 0 to 19): randi() % 20.
Random value (0 to 1 float).
Random range, any floating point value between 'from' and 'to'
Set seed for the random number generator.
Random from seed, pass a seed and an array with both number and new seed is returned.
Convert from degrees to radians.
Convert from radians to degrees.
Convert from linear energy to decibels (audio).
Convert from decibels to linear energy (audio).
Return the maximum of two values.
Return the minimum of two values.
Clamp both values to a range.
Return the nearest larger power of 2 for an integer.
Return a weak reference to an object.
Return a reference to the specified function.
Convert from a type to another in the best way possible. The "type" parameter uses the enum TYPE_* in [@Global Scope].
Return the internal type of the given Variant object, using the TYPE_* enum in [@Global Scope].
Convert one or more arguments to strings in the best way possible.
Print one or more arguments to strings in the best way possible to a console line.
Print one or more arguments to the console with a tab between each argument.
Print one or more arguments to the console with a space between each argument.
Print one or more arguments to strings in the best way possible to standard error line.
Print one or more arguments to strings in the best way possible to console. No newline is added at the end.
Convert a value to a formatted string that can later be parsed using [method str2var].
Convert a formatted string that was returned by [method var2str] to the original value.
Encode a variable value to a byte array.
Decode a byte array back to a value.
Return an array with the given range. Range can be 1 argument N (0 to N-1), two arguments (initial, final-1) or three arguments (initial, final-1, increment).
Load a resource from the filesystem, pass a valid path as argument.
Convert a script class instance to a dictionary (useful for serializing).
Convert a previously converted instances to dictionary back into an instance. Useful for deserializing.
Hash the variable passed and return an integer.
Make a color from red, green, blue and alpha. Arguments can range from 0 to 255.
Print a stack track at code location, only works when running with debugger turned on.
Get an object by its ID.
Preload a resource from the filesystem. The resource is loaded during script parsing.
Stop the function execution and return the current state. Call resume on the state to resume execution. This makes the state invalid.
Returns anything that was passed to the resume function call.
If passed an object and a signal, the execution is resumed when the object's signal is emmited.
Assert that the condition is true. If the condition is false, generates an error.
Constant that represents how many times the diameter of a circumference fits around it's perimeter.
Global scope constants and variables.
Global scope constants and variables. This is all that resides in the globals, constants regarding error codes, scancodes, property hints, etc. It's not much.
Singletons are also documented here, since they can be accessed from anywhere.
Left margin, used usually for [Control] or [StyleBox] derived classes.
Top margin, used usually for [Control] or [StyleBox] derived classes.
Right margin, used usually for [Control] or [StyleBox] derived classes.
Bottom margin, used usually for [Control] or [StyleBox] derived classes.
General vertical alignment, used usually for [Separator], [ScrollBar], [Slider], etc.
General horizontal alignment, used usually for [Separator], [ScrollBar], [Slider], 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.
Scancodes with this bit applied are non printable.
Escape Key
Tab Key
Shift-Tab Key
Backspace Key
Return Key
Enter Key
Insert Key
Delete Key
Pause Key
Printscreen Key
Home Key
End Key
Left Arrow Key
Up Arrow Key
Right Arrow Key
Down Arrow Key
Pageup Key
Pagedown Key
Shift Key
Control Key
Alt Key
Capslock Key
Numlock Key
Scrolllock 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
Enter Key on Numpad
Multiply Key on Numpad
Divide Key on Numpad
Subtract Key on Numpad
Period Key on Numpad
Add Key on Numpad
Number 0 on Numpad
Number 1 on Numpad
Number 2 on Numpad
Number 3 on Numpad
Number 4 on Numpad
Number 5 on Numpad
Number 6 on Numpad
Number 7 on Numpad
Number 8 on Numpad
Number 9 on Numpad
Space Key
Number 0
Number 1
Number 2
Number 3
Number 4
Number 5
Number 6
Number 7
Number 8
Number 9
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
Left Mouse Button
Right Mouse Button
Middle Mouse Button
Joystick Button 0
Joystick Button 1
Joystick Button 2
Joystick Button 3
Joystick Button 4
Joystick Button 5
Joystick Button 6
Joystick Button 7
Joystick Button 8
Joystick Button 9
Joystick Button 10
Joystick Button 11
Joystick Button 12
Joystick Button 13
Joystick Button 14
Joystick Button 15
Joystick Button 16
Joystick Button Select
Joystick Button Start
Joystick DPad Up
Joystick DPad Down
Joystick DPad Left
Joystick DPad Right
Joystick Left Shoulder Button
Joystick Left Trigger
Joystick Left Stick Click
Joystick Right Shoulder Button
Joystick Right Trigger
Joystick Right Stick Click
Joystick Left Stick Horizontal Axis
Joystick Left Stick Vertical Axis
Joystick Right Stick Horizontal Axis
Joystick Right Stick Vertical Axis
Joystick Left Trigger Analog Axis
Joystick Right Trigger Analog Axis
Joystick Left Stick Horizontal Axis
Joystick Left Stick Vertical Axis
Joystick Right Stick Horizontal Axis
Joystick Right Stick Vertical Axis
Functions that return Error return OK when everything went ok. Most functions don't return error anyway and/or just print errors to stdout.
Generic fail return error.
No hint for edited property.
Hints that the string is a range, defined as "min,max" or "min,max,step". This is valid for integers and floats.
Hints that the string is an exponential range, defined as "min,max" or "min,max,step". This is valid for integers and floats.
Property hint for an enumerated value, like "Hello,Something,Else". This is valid for integer, float and string properties.
Property hint for a bitmask description, for bits 0,1,2,3 and 5 the hint would be like "Bit0,Bit1,Bit2,Bit3,,Bit5". Valid only for integers.
Property hint for a bitmask description that covers all 32 bits. Valid only for integers.
String property is a file (so pop up a file dialog when edited). Hint string can be a set of wildcards like "*.doc".
String property is a directory (so pop up a file dialog when edited).
String property is a resource, so open the resource popup menu when edited.
Property will be used as storage (default).
Property will be visible in editor (default).
Default usage (storage and editor).
Variable is of type nil (only applied for null).
Variable is of type bool.
Variable is of type integer.
Variable is of type float/real.
Variable is of type [String].
Variable is of type [Vector2].
Variable is of type [Rect2].
Variable is of type [Vector3].
Variable is of type [Matrix32].
Variable is of type [Plane].
Variable is of type [Quat].
Variable is of type [AABB].
Variable is of type [Matrix3].
Variable is of type [Transform].
Variable is of type [Color].
Variable is of type [Image].
Variable is of type [NodePath].
Variable is of type [RID].
Variable is of type [Object].
Variable is of type [InputEvent].
Variable is of type [Dictionary].
Variable is of type [Array].
Axis-Aligned Bounding Box.
AABB provides an 3D Axis-Aligned Bounding Box. It consists of a position, a size, and several utility functions. It is typically used for simple (fast) overlap tests.
Return true if this [AABB] completely encloses another one.
Return this [AABB] expanded to include a given point.
Get the area of the [AABB].
Get the position of the 8 endpoints of the [AABB] in space.
Return the normalized longest axis of the [AABB].
Return the index of the longest axis of the [AABB] (according to [Vector3]::AXIS* enum).
Return the scalar length of the longest axis of the [AABB].
Return the normalized shortest axis of the [AABB].
Return the index of the shortest axis of the [AABB] (according to [Vector3]::AXIS* enum).
Return the scalar length of the shortest axis of the [AABB].
Return the support point in a given direction. This is useful for collision detection algorithms.
Return a copy of the [AABB] grown a given amount of units towards all the sides.
Return true if the [AABB] is flat or empty.
Return true if the [AABB] is empty.
Return true if the [AABB] contains a point.
Return the intersection between two [AABB]. An empty AABB (size 0,0,0) is returned on failure.
Return true if the [AABB] overlaps with another.
Return true if the [AABB] is at both sides of a plane.
Combine this [AABB] with another, a larger one is returned that contains both.
Optional constructor, accepts position and size.
Base dialog for user notification.
This dialog is useful for small notifications to the user about an event. It can only be accepted or closed, with the same result.
Return the OK Button.
Return the label used for built-in text.
Set whether the dialog is hidden when accepted (default true).
Return true if the dialog will be hidden when accepted (default true).
Add custom button to the dialog and return the created button.
The button titled with [i]text[/i] and the [i]action[/i] will be passed to [custom_action] signal when it is pressed.
Add custom cancel button to the dialog and return the created button.
Register a [LineEdit] in the dialog. When the enter key is pressed, the dialog will be accepted.
Set the built-in label text.
Return the built-in label text.
Emitted when accepted.
Emitted with a custom button is added.
Sprite node that can use multiple textures for animation.
Sprite node that can use multiple textures for animation.
Set the [SpriteFrames] resource, which contains all frames.
Get the [SpriteFrames] resource, which contains all frames.
When turned on, offset at (0,0) is the center of the sprite, when off, the top-left corner is.
Return true when centered. See [method set_centered].
Set the offset of the sprite in the node origin. Position varies depending on whether it is centered or not.
Return the offset of the sprite in the node origin.
If true, sprite is flipped horizontally.
Return true if sprite is flipped horizontally.
If true, sprite is flipped vertically.
Return true if sprite is flipped vertically.
Set the visible sprite frame index (from the list of frames inside the [SpriteFrames] resource).
Return the visible frame index.
Change the color modulation (multiplication) for this sprite.
Return the color modulation for this sprite.
Emmited when frame is changed.
Contains data used to animate everything in the engine.
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.
Animations are just data containers, and must be added to odes such as an [AnimationPlayer] or [AnimationTreePlayer] to be played back.
Add a track to the Animation. The track type must be specified as any of the values in the TYPE_* enumeration.
Remove a track by specifying the track index.
Return the amount of tracks in the animation.
Get the type of a track.
Get the path of a track. for more information on the path format, see [method track_set_path]
Set 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 ":". Example: "character/skeleton:ankle" or "character/mesh:transform/local"
Move a track up.
Move a track down.
Insert a transform key for a transform track.
Insert a generic key in a given track.
Remove a key by index in a given track.
Remove a key by position (seconds) in a given track.
Set the value of an existing key.
Set the transition curve (easing) for a specific key (see built-in math function "ease").
Return the transition curve (easing) for a specific key (see built-in math function "ease").
Return the amount of keys in a given track.
Return the value of a given key in a given track.
Return the time at which the key is located.
Find the key index by time in a given track. Optionally, only find it if the exact time is given.
Set the interpolation type of a given track, from the INTERPOLATION_* enum.
Return the interpolation type of a given track, from the INTERPOLATION_* enum.
Return the interpolated value of a transform track at a given time (in seconds). An array consisting of 3 elements: position ([Vector3]), rotation ([Quat]) and scale ([Vector3]).
Enable or disable interpolation for a whole track. By default tracks are interpolated.
Return whether interpolation is enabled or disabled for a whole track. By default tracks are interpolated.
Return all the key indices of a value track, given a position and delta time.
Return all the key indices of a method track, given a position and delta time.
Return the method name of a method track.
Return the arguments values to be called on a method track for a given key in a given track.
Set the total length of the animation (in seconds). Note that length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping.
Return the total length of the animation (in seconds).
Set a flag indicating that the animation must loop. This is uses for correct interpolation of animation cycles, and for hinting the player that it must restart the animation.
Return whether the animation has the loop flag set.
Clear the animation (clear all tracks and reset all).
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.
No interpolation (nearest value).
Linear interpolation.
Cubic interpolation.
Container and player of [Animation] resources.
An animation player is used for general purpose playback of [Animation] 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.
Add an animation resource to the player, which will be later referenced by the "name" argument.
Remove an animation from the player (by supplying the same name used to add it).
Rename an existing animation.
Request whether an [Animation] name exist within the player.
Get an [Animation] resource by requesting a name.
Get the list of names of the animations stored in the player.
Specify a blend time (in seconds) between two animations, referenced by their names.
Get the blend time between two animations, referenced by their names.
Set the default blend time between animations.
Return the default blend time between animations.
Play a given animation by the animation name. Custom speed and blend times can be set. If custom speed is negative (-1), 'from_end' being true can play the animation backwards.
Play a given animation by the animation name in reverse.
Stop the currently playing animation.
Stop playback of animations (deprecated).
Return whether an animation is playing.
Set the current animation (even if no playback occurs). Using set_current_animation() and set_active() are similar to calling play().
Return the name of the animation being played.
Queue an animation for playback once the current one is done.
If animations are queued to play, clear them.
Set the player as active (playing). If false, it
will do nothing.
Return true if the player is active.
Set a speed scaling ratio in a given animation channel (or channel 0 if none is provided). Default ratio is [i]1[/i] (no scaling).
Get the speed scaling ratio in a given animation channel (or channel 0 if none is provided). Default ratio is [i]1[/i] (no scaling).
Set the name of the animation that will be automatically played when the scene is loaded.
Return the name of the animation that will be automatically played when the scene is loaded.
AnimationPlayer resolves animation track paths from this node (which is relative to itself), by default root is "..", but it can be changed.
Return path to root node (see [method set_root]).
Seek the animation to a given position in time (in seconds). If 'update' is true, the animation will be updated too, otherwise it will be updated at process time.
Return the playback position (in seconds) in an animation channel (or channel 0 if none is provided).
Find an animation name by resource.
The animation player creates caches for faster access to the nodes it will animate. However, if a specific node is removed, it may not notice it, so clear_caches will force the player to search for the nodes again.
Set the mode in which the animation player processes. By default, it processes on idle time (framerate dependent), but using fixed time works well for animating static collision bodies in 2D and 3D. See enum ANIMATION_PROCESS_*.
Return the mode in which the animation player processes. See [method set_animation_process_mode].
Get the position (in seconds) of the currently being played animation.
Get the length (in seconds) of the currently being played animation.
Used to skip ahead or skip back in an animation. Delta is the time in seconds to skip.
Notifies when an animation starts playing.
If the currently being played animation changes, this signal will notify of such change.
Notifies when an animation finished playing.
Process animation on fixed process. This is specially useful when animating kinematic bodies.
Process animation on idle process.
Animation Player that uses a node graph for the blending.
Animation Player that uses a node graph for the blending. This kind of player is very useful when animating character or other skeleton based rigs, because it can combine several animations to form a desired pose.
Add a node of a given type in the graph with given id.
Check if a node exists (by name).
Rename a node in the graph.
Get the node type, will return from NODE_* enum.
Return the input count for a given node. Different types of nodes have different amount of inputs.
Return the input source for a given node input.
Set the animation for an animation node.
Set the space override mode. This mode controls how an area affects gravity and damp.
AREA_SPACE_OVERRIDE_DISABLED: This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them.
AREA_SPACE_OVERRIDE_COMBINE: 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.
AREA_SPACE_OVERRIDE_COMBINE_REPLACE: 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.
AREA_SPACE_OVERRIDE_REPLACE: This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas.
AREA_SPACE_OVERRIDE_REPLACE_COMBINE: This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.
General purpose area detection and influence for 2D physics.
General purpose area detection for 2D physics. Areas can be used for detection of objects that enter/exit them, as well as overriding space parameters (changing gravity, damping, etc). For this, use any space override different from AREA_SPACE_OVERRIDE_DISABLE and point gravity at the center of mass.
Set the space override mode. This mode controls how an area affects gravity and damp.
AREA_SPACE_OVERRIDE_DISABLED: This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them.
AREA_SPACE_OVERRIDE_COMBINE: 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.
AREA_SPACE_OVERRIDE_COMBINE_REPLACE: 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.
AREA_SPACE_OVERRIDE_REPLACE: This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas.
AREA_SPACE_OVERRIDE_REPLACE_COMBINE: This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.
Return the space override mode.
When overriding space parameters, this method sets whether this area has a center of gravity. To set/get the location of the center of gravity, use [method set_gravity_vector]/[method get_gravity_vector].
Return whether gravity is a point. A point gravity will attract objects towards it, as opposed to a gravity vector, which moves them in a given direction.
Set the falloff factor for point gravity. The greater this value is, the faster the strength of gravity decreases with the square of distance.
Return the falloff factor for point gravity.
Set the gravity vector. This vector does not have to be normalized.
If gravity is a point (see [method is_gravity_a_point]), this will be the attraction center.
Return the gravity vector. If gravity is a point (see [method is_gravity_a_point]), this will be the attraction center.
Set the gravity intensity. This is useful to alter the force of gravity without altering its direction.
This value multiplies the gravity vector, whether it is the given vector ([method set_gravity_vector]), or a calculated one (when using a center of gravity).
Return the gravity intensity.
Set the rate at which objects stop moving in this area, if there are not any other forces moving it. The value is a fraction of its current speed, lost per second. Thus, a value of 1.0 should mean stopping immediately, and 0.0 means the object never stops.
In practice, as the fraction of speed lost gets smaller with each frame, a value of 1.0 does not mean the object will stop in exactly one second. Only when the physics calculations are done at 1 frame per second, it does stop in a second.
Return the linear damp rate.
Set the rate at which objects stop spinning in this area, if there are not any other forces making it spin. The value is a fraction of its current speed, lost per second. Thus, a value of 1.0 should mean stopping immediately, and 0.0 means the object never stops.
In practice, as the fraction of speed lost gets smaller with each frame, a value of 1.0 does not mean the object will stop in exactly one second. Only when the physics calculations are done at 1 frame per second, it does stop in a second.
Return the angular damp rate.
Set the order in which the area is processed. Greater values mean the area gets processed first. This is useful for areas which have an space override different from AREA_SPACE_OVERRIDE_DISABLED or AREA_SPACE_OVERRIDE_COMBINE, as they replace values, and are thus order-dependent.
Areas with the same priority value get evaluated in an unpredictable order, and should be differentiated if evaluation order is to be important.
Return the processing order of this area.
Set the physics layers this area can scan for collisions.
Return the physics layers this area can scan for collisions.
Set the physics layers this area is in.
Collidable objects can exist in any of 32 different layers. These layers are not visual, but more of a tagging system instead. A collidable can use these layers/tags to select with which objects it can collide, using [method set_collision_mask].
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.
Return the physics layer this area is in.
Set/clear individual bits on the collision mask. This makes selecting the areas scanned easier.
Return an individual bit on the collision mask.
Set/clear individual bits on the layer mask. This makes getting an area in/out of only one layer easier.
Return an individual bit on the layer mask.
Set whether this area can detect bodies/areas entering/exiting it.
Return whether this area detects bodies/areas entering/exiting it.
Set whether this area can be detected by other, monitoring, areas. Only areas need to be marked as monitorable. Bodies are always so.
Set whether this area can be detected by other, monitoring, areas.
Return a list of the bodies ([PhysicsBody2D]) that are totally or partially inside this area.
Return a list of the areas that are totally or partially inside this area.
Return whether the body passed is totally or partially inside this area.
Return whether the area passed is totally or partially inside this area.
This signal is triggered only once when a body enters this area. The only parameter passed is the body that entered this area.
This signal triggers only once when a body enters this area. The first parameter is the body's [RID]. The second one is the body as an object. The third one is the index of the shape of the body that entered this area, and the fourth one is the index of the shape in this area that reported the entering.
This signal is triggered only once when an area enters this area. The only parameter passed is the area that entered this area.
This signal triggers only once when an area enters this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering.
This signal is triggered only once when a body exits this area. The only parameter passed is the body that exited this area.
This signal triggers only once when a body exits this area. The first parameter is the body's [RID]. The second one is the body as an object. The third one is the index of the shape exiting this area, and the fourth one is the index of the shape in this area that reported the exit.
This signal is triggered only once when an area exits this area. The only parameter passed is the area that exited this area.
This signal triggers only once when an area exits this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering.
Generic array datatype.
Generic array, contains several elements of any type, accessible by numerical index starting at 0. Arrays are always passed by reference.
Append an element at the end of the array (alias of [method push_back]).
Clear the array (resize to 0).
Return true if the array is empty (size==0).
Remove the first occurrence of a value from the array.
Searches the array for a value and returns its index or -1 if not found.
Return a hashed integer value representing the array contents.
Insert a new element at a given position in the array. The position must be valid, or at the end of the array (pos==size()).
Reverse the order of the elements in the array (so first element will now be the last).
Get whether this is a shared array instance.
Remove the last element of the array.
Remove the first element of the array.
Append an element at the end of the array.
Add an element at the beginning of the array.
Remove an element from the array by index.
Resize the array to contain a different number of elements. If the array size is smaller, elements are cleared, if bigger, new elements are Null.
Return the amount of elements in the array.
Sort the array using natural order.
Sort the array using a custom method. The arguments are an object that holds the method and the name of such method. The custom method receives two arguments (a pair of elements from the array) and must return true if the first argument is less than the second, and return false otherwise.
Construct an array from a [RawArray].
Construct an array from a [RawArray].
Construct an array from a [RawArray].
Construct an array from a [RawArray].
Construct an array from a [RawArray].
Construct an array from a [RawArray].
Construct an array from a [RawArray].
Server interface for low level audio access.
AudioServer 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.
Create an audio sample, return a [RID] referencing it. The sample will be created with a given format (from the SAMPLE_FORMAT_* enum), a total length (in samples, not bytes), in either stereo or mono.
Even if a stereo sample consists of a left sample and a right sample, it still counts as one sample for length purposes.
Set the description of an audio sample. Mainly used for organization.
Return the description of an audio sample. Mainly used for organization.
Return the format of the audio sample, in the form of the SAMPLE_FORMAT_* enum.
Return whether the sample is stereo (2 channels).
Return the length in samples (not bytes) of the audio sample. Even if a stereo sample consists of a left sample and a right sample, it still counts as one sample for length purposes.
Set the sample data for a given sample as an array of floats. The length must be equal to the sample length or an error will be produced.
For this method, a stereo sample is made from two samples. Thus, in case of a stereo sample, the array length must be twice the length returned by [method sample_get_length].
Trying to alter a SAMPLE_FORMAT_IMA_ADPCM sample is not supported. It will throw an error to the console, but will not alter the sample data.
Set the sample data for a given sample as an array of bytes. The length must be equal to the sample length expected in bytes or an error will be produced. The byte length can be calculated as follows:
Get the sample length ([method sample_get_length]).
If the sample format is SAMPLE_FORMAT_PCM16, multiply it by 2.
If the sample format is SAMPLE_FORMAT_IMA_ADPCM, divide it by 2 (rounding any fraction up), then add 4.
If the sample is stereo ([method sample_is_stereo]), multiply it by 2.
Return the sample data as an array of bytes. The length will be the expected length in bytes.
Change the default mix rate of a given sample.
Return the mix rate of the given sample.
Set the loop format for a sample from the SAMPLE_LOOP_* enum. As a warning, Ping Pong loops may not be available on some hardware-mixing platforms.
Return the loop format for a sample, as a value from the SAMPLE_LOOP_* enum.
Set the initial loop point of a sample. Only has effect if sample loop is enabled. See [method sample_set_loop_format].
Return the initial loop point of a sample. Only has effect if sample loop is enabled. See [method sample_set_loop_format].
Set the final loop point of a sample. Only has effect if sample loop is enabled. See [method sample_set_loop_format].
Return the final loop point of a sample. Only has effect if sample loop is enabled. See [method sample_set_loop_format].
Allocate a voice for playback. Voices are persistent. A voice can play a single sample at the same time. See [method sample_create].
Start playback of a given voice using a given sample. If the voice was already playing it will be restarted.
Change the volume of a currently playing voice. Volume is expressed as linear gain where 0.0 is mute and 1.0 is default.
Change the pan of a currently playing voice and, optionally, the depth and height for a positional/3D sound. Panning values are expressed within the -1 to +1 range.
Set a resonant filter post processing for the voice. Filter type is a value from the FILTER_* enum.
Set chorus send post processing for the voice (from 0 to 1).
Set the reverb send post processing for the voice (from 0 to 1) and the reverb type, from the REVERB_* enum.
Set a different playback mix rate for the given voice.
Set whether a given voice is positional. This is only interpreted as a hint and used for backends that may support binaural encoding.
Return the current volume for a given voice.
Return the current pan for a given voice (-1 to +1 range).
Return the current pan height for a given voice (-1 to +1 range).
Return the current pan depth for a given voice (-1 to +1 range).
Return the current selected filter type for a given voice, from the FILTER_* enum.
Return the current filter cutoff (in hz) for a given voice.
Return the current filter resonance for a given voice.
Return the current chorus send for a given voice (0 to 1).
Return the current reverb type for a given voice from the REVERB_* enum.
Return the current reverb send for a given voice (0 to 1).
Return the current mix rate for a given voice.
Return whether the current voice is positional. See [method voice_set_positional].
Stop a given voice.
Free a [RID] resource.
Set global scale for stream playback. Default is 1.0.
Return the global scale for stream playback.
Set global scale for all voices (not including streams). Default is 1.0.
Return the global scale for all voices.
Set global scale for event-based stream ([EventStream]) playback. Default is 1.0.
Return the global scale for event-based stream playback.
Sample format is 8 bits, signed.
Sample format is 16 bits, little-endian, signed.
Sample format is IMA-ADPCM compressed.
Sample does not loop.
Sample loops in forward mode.
Sample loops in a bidirectional way.
Filter is disabled.
Filter is a resonant lowpass.
Filter is a resonant bandpass.
Filter is a resonant highpass.
Filter is a notch (band reject).
Filter is a bandlimit (resonance used as highpass).
Small reverb room (closet, bathroom, etc).
Medium reverb room (living room)
Large reverb room (warehouse).
Large reverb room with long decay.
Software implementation of [AudioServer].
This is a software audio server. It does not use any kind of hardware acceleration.
This class does not expose any new method.
Base class for audio streams.
Base class for audio streams. Audio streams are used for music playback, or other types of streamed sounds that don't fit or require more flexibility than a [Sample].
MusePack audio stream driver.
MusePack audio stream driver.
OGG Vorbis audio stream driver.
OGG Vorbis audio stream driver.
Opus Codec audio stream driver.
Opus Codec audio stream driver.
Speex audio stream driver.
Speex audio stream driver. Speex is very useful for compressed speech. It allows loading a very large amount of speech in memory at little IO/latency cost.
Provides a base class for different kinds of buttons.
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.
Called when button is pressed.
Called when button is toggled (only if toggle_mode is active).
Set the button to pressed state (only if toggle_mode is active).
If toggle_mode is active, return whether the button is toggled. If toggle_mode is not active, return whether the button is pressed down.
Return true if mouse entered the button before it exit.
Set the button toggle_mode property. Toggle mode makes the button flip state between pressed and unpressed each time its area is clicked.
Return the toggle_mode property (see [method set_toggle_mode]).
Set the button into disabled state. When a button is disabled, it can't be clicked or toggled.
Return whether the button is in disabled state (see [method set_disabled]).
Set the button click_on_press mode. This mode generates click events when a mouse button or key is just pressed (by default events are generated when the button/keys are released and both press and release occur in the visual area of the Button).
Return the state of the click_on_press property (see [method set_click_on_press]).
Return 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 DRAW_* enum.
This signal is emitted when the button was released.
This signal is emitted when the button was just toggled between pressed and normal states (only if toggle_mode is active). The new state is contained in the [i]pressed[/i] argument.
This signal is emitted every time the button is pressed or toggled.
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.
Set the total font height (ascent plus descent) in pixels.
Set the font ascent (number of pixels above the baseline).
Add a kerning pair to the [BitmapFont] as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
Return a kerning pair as a difference.
Add a texture to the [BitmapFont].
Add a character to the font, where [i]character[/i] is the unicode value, [i]texture[/i] is the texture index, [i]rect[/i] is the region in the texture (in pixels!), [i]align[/i] is the (optional) alignment for the character and [i]advance[/i] is the (optional) advance.
Return the size of a character, optionally taking kerning into account if the next character is provided.
Clear all the font data.
Base class for Box containers.
Base class for Box containers. It arranges children controls vertically or horizontally, and rearranges them automatically when their minimum size changes.
Add a control to the box as a spacer.
If [i]begin[/i] is true the spacer control will be inserted in front of other children.
Return the alignment of children in the container.
Set the alignment of children in the container(Must be one of ALIGN_BEGIN, ALIGN_CENTER or ALIGN_END).
Align children with beginning of the container.
Align children with center of the container.
Align children with end of the container.
Box shape resource.
Box shape resource, which can be set into a [PhysicsBody] or area.
Set the half extents for the shape.
Return the half extents of the shape.
Standard themed Button.
Button is the standard themed button. It can contain text and an icon, and will display them according to the current [Theme].
Set the button text, which will be displayed inside the button area.
Return the button text.
Set the icon that will be displayed next to the text inside the button area.
Return the button icon.
Set the [i]flat[/i] property of a Button. Flat buttons don't display decoration unless hovered or pressed.
Set the [i]clip_text[/i] property of a Button. When this property is enabled, text that is too large to fit the button is clipped, when disabled (default) the Button will always be wide enough to hold the text.
Return the state of the [i]clip_text[/i] property (see [method set_clip_text])
Set the text alignment policy, using one of the ALIGN_* constants.
Return the text alignment policy.
Return the state of the [i]flat[/i] property (see [method set_flat]).
Align the text to the left.
Center the text.
Align the text to the right.
Array of Buttons.
Array of Buttons. A ButtonArray is useful to have an array of buttons laid out vertically or horizontally. Only one button can be selected, and is referenced by its index in the array (first button is 0, second button is 1, etc.).
This is useful [i]e.g.[/i] for joypad-friendly interfaces and option menus.
Append a new button to the array, with the specified text.
Append a new button to the array, with the specified icon and text.
Define the text of the specified button.
Set the icon of the specified button.
Return the text of the specified button.
Return the icon of the specified button.
Return the amount of buttons in the array.
Return the index of the currently selected button in the array.
Return the index of the currently hovered button in the array.
Select a button in the array based on the given index.
Remove the specified button in the array.
Remove all buttons from the array.
A button has been selected, its index is given as the argument.
Align buttons at the beginning.
Align buttons in the middle.
Align buttons at the end.
Spread the buttons, but keep them small.
Spread the buttons, but expand them.
Group of Buttons.
Group of [Button]. All direct and indirect children buttons become radios. Only one allows being pressed.
Return the pressed button.
Return the index of the pressed button (by tree order).
Return the focused button.
Return the list of all the buttons in the group.
Set the button to be pressed.
Camera node, displays from a point of view.
Camera is a special node that displays what is visible from its current location. Cameras register themselves in the nearest [Viewport] node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the Camera will register in the global viewport. In other words, a Camera just provides [i]3D[/i] display capabilities to a [Viewport], and, without one, a scene registered in that [Viewport] (or higher viewports) can't be displayed.
Return a normal vector in worldspace, that is the result of projecting a point on the [Viewport] rectangle by the camera projection. This is useful for casting rays in the form of (origin,normal) for object intersection or picking.
Return a 3D position in worldspace, that is the result of projecting a point on the [Viewport] rectangle by the camera projection. This is useful for casting rays in the form of (origin,normal) for object intersection or picking.
Return how a 3D point in worldspace maps to a 2D coordinate in the [Viewport] rectangle.
Set the camera projection to perspective mode, by specifying a [i]FOV[/i] Y angle in degrees (FOV means Field of View), and the [i]near[/i] and [i]far[/i] clip planes in worldspace units.
Set the camera projection to orthogonal mode, by specifying a width and the [i]near[/i] and [i]far[/i] clip planes in worldspace units. (As a hint, 2D games often use this projection, with values specified in pixels)
Make this camera the current Camera for the [Viewport] (see class description). If the Camera Node is outside the scene tree, it will attempt to become current once it's added.
Return whether the Camera is the current one in the [Viewport], or plans to become current (if outside the scene tree).
Get the camera transform. Subclassed cameras (such as CharacterCamera) may provide different transforms than the [Node] transform.
Perspective Projection (object's size on the screen becomes smaller when far away).
Orthogonal Projection (objects remain the same size on the screen no matter how far away they are).
Camera node for 2D scenes.
Camera node for 2D scenes. It forces the screen (current layer) to scroll following this node. This makes it easier (and faster) to program scrollable scenes than manually changing the position of [CanvasItem] based nodes.
This node is intended to be a simple helper get get things going quickly and it may happen often that more functionality is desired to change how the camera works. To make your own custom camera node, simply inherit from [Node2D] and change the transform of the canvas by calling get_viewport().set_canvas_transform(m) in [Viewport].
Set the scroll offset. Useful for looking around or camera shake animations.
Return the scroll offset.
Make this the current 2D camera for the scene (viewport and layer), in case there's many cameras in the scene.
Return true of this is the current camera (see [method make_current]).
Set the scrolling limit in pixels.
Return the scrolling limit in pixels.
Set the margins needed to drag the camera (relative to the screen size). Margin uses the MARGIN_* enum. Drag margins of 0,0,0,0 will keep the camera at the center of the screen, while drag margins of 1,1,1,1 will only move when the camera is at the edges.
Return the margins needed to drag the camera (see [method set_drag_margin]).
Return the camera position.
Force the camera to update scroll immediately.
Base class of anything 2D.
Base class of anything 2D. Canvas items are laid out in a tree and children inherit and extend the transform of their parent. CanvasItem is extended by [Control], for anything GUI related, and by [Node2D] for anything 2D engine related.
Any CanvasItem can draw. For this, the "update" function must be called, then NOTIFICATION_DRAW will be received on idle time to request redraw. Because of this, canvas items don't need to be redraw on every frame, improving the performance significantly. Several functions for drawing on the CanvasItem are provided (see draw_* functions). They can only be used inside the notification, signal or _draw() overrides function, though.
Canvas items are draw in tree order. By default, children are on top of their parents so a root CanvasItem will be drawn behind everything (this can be changed per item though).
Canvas items can also be hidden (hiding also their subtree). They provide many means for changing standard parameters such as opacity (for it and the subtree) and self opacity, 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.
Called (if exists) to draw the canvas item.
Used for editing, returns an opaque value representing the transform state.
Used for editing, handle rotation.
Return a rect containing the editable contents of the item.
Return the canvas item RID used by [VisualServer] for this item.
Return true if this CanvasItem is visible. It may be invisible because itself or a parent canvas item is hidden.
Return true if this CanvasItem is hidden. Note that the CanvasItem may not be visible, but as long as it's not hidden ([method hide] called) the function will return false.
Show the CanvasItem currently hidden.
Hide the CanvasItem currently visible.
Queue the CanvasItem for update. NOTIFICATION_DRAW will be called on idle time to request redraw.
Set as toplevel. This means that it will not inherit transform from parent canvas items.
Return if set as toplevel. See [method set_as_toplevel].
Set the blending mode from enum BLEND_MODE_*.
Return the current blending mode from enum BLEND_MODE_*.
Set canvas item opacity. This will affect the canvas item and all the children.
Return the canvas item opacity. This affects the canvas item and all the children.
Set canvas item self-opacity. This does not affect the opacity of children items.
Return the canvas item self-opacity.
Sets whether the canvas item is drawn behind its parent.
Return whether the item is drawn behind its parent.
Draw a line from a 2D point to another, with a given color and width.
Draw a colored rectangle.
Draw a colored circle.
Draw a texture at a given position.
Draw a textured rectangle at a given position, optionally modulated by a color. Transpose swaps the x and y coordinates when reading the texture.
Draw a textured rectangle region at a given position, optionally modulated by a color. Transpose swaps the x and y coordinates when reading the texture.
Draw a styled rectangle.
Draw a custom primitive, 1 point for a point, 2 points for a line, 3 points for a triangle and 4 points for a quad.
Draw a polygon of any amount of points, convex or concave.
Draw a colored polygon of any amount of points, convex or concave.
Draw a string using a custom font.
Draw a string character using a custom font. Returns the advance, depending on the char width and kerning with an optional next char.
Set a custom transform for drawing. Anything drawn afterwards will be transformed by this.
Emitted when the item rect has changed.
Emitted when the CanvasItem must redraw. This can only be connected realtime, as deferred will not allow drawing.
Emitted when the visibility (hidden/visible) changes.
Emitted when becoming hidden.
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.
CanvasItem is requested to draw.
Canvas item visibility has changed.
Canvas item has entered the canvas.
Canvas item has exited the canvas.
Canvas item transform has changed. Only received if requested.
Canvas Item layer.
Canvas Item layer. [CanvasItem] nodes that are direct or indirect children of a [CanvasLayer] will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index 0, so a [CanvasLayer] 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).
Set the layer index, determines the draw order, a lower value will be below a higher one.
Return the layer index, determines the draw order, a lower value will be below a higher one.
Set the base transform for this layer.
Return the base transform for this layer.
Set the base offset for this layer (helper).
Return the base offset for this layer (helper).
Set the base rotation for this layer (helper).
Return the base rotation for this layer (helper).
Set the base scale for this layer (helper).
Return the base scale for this layer (helper).
Return the [World2D] used by this layer.
Return the viewport RID for this layer.
Tint the entire canvas
CanvasModulate tints the canvas elements using its asigned color
Sets the canvas tint color
Gets the canvas tint color
Capsule shape resource.
Capsule shape resource, which can be set into a [PhysicsBody] or area.
Set the capsule radius.
Return the capsule radius.
Set the capsule height.
Return the capsule height.
Capsule 2D shape resource for physics.
Capsule 2D shape resource for physics. A capsule (or sometimes called "pill") is like a line grown in all directions. It has a radius and a height, and is often useful for modeling biped characters.
Set the radius of the [CapsuleShape2D].
Return the radius of the [CapsuleShape2D].
Set the height of the [CapsuleShape2D].
Return the height of the [CapsuleShape2D].
Keeps children controls centered.
CenterContainer Keeps children controls centered. This container keeps all children to their minimum size, in the center.
This function will anchor the container children to the top left corner of the the container boundaries, moving all its children to that position, (the children new center will be the top left corner of the container).
Should put children to the top left corner instead of center of the container.
Binary choice user interface widget
A checkbox allows the user to make a binary choice (choosing only one of two posible options), for example Answer 'yes' or 'no'.
Checkable button.
CheckButton is a toggle button displayed as a check field.
Circular Shape for 2D Physics.
Circular Shape for 2D Physics. This shape is useful for modeling balls or small characters and it's collision detection with everything else is very fast.
Set the radius of the circle shape.
Return the radius of the circle shape.
Base node for 2D collisionables.
CollisionObject2D is the base class for 2D physics collisionables. They can hold any number of 2D collision shapes. Usually, they are edited by placing [CollisionShape2D] and/or [CollisionPolygon2D] nodes as children. Such nodes are for reference and not present outside the editor, so code should use the regular shape API.
This method can be used to override normal input processing. The first parameter is the viewport where the event took place. The second holds the input event received, and the third the shape of this object where it happened.
Add a [Shape2D] to the collision body, with a given custom transform.
Return the amount of shapes in the collision body. Because a [CollisionPolygon2D] can generate more than one [Shape2D], the amount returned does not have to match the sum of [CollisionShape2D] and [CollisionPolygon2D].
Change a shape in the collision body.
Change the shape transform in the collision body.
Set whether a shape is a trigger. A trigger shape detects collisions, but is otherwise unaffected by physics (i.e. colliding objects will not get blocked).
Return the shape in the given index.
Return the shape transform in the given index.
Return whether a shape is a trigger. A trigger shape detects collisions, but is otherwise unaffected by physics (i.e. colliding objects will not get blocked).
Remove the shape in the given index.
Remove all shapes.
Return the RID of this object.
Set whether this object is pickable. A pickable object can detect the mouse pointer enter/leave it and, if the mouse is inside it, report input events.
Return whether this object is pickable.
This event fires only once when the mouse pointer enters any shape of this object.
This signal triggers when an input event fires over a shape. The first parameter is the viewport where the event took place. The second holds the input event received, and the third the shape of this object where it happened.
This event fires only once when the mouse pointer exits all shapes of this object.
Editor-only class for easy editing of collision polygons.
Editor-only class. This is not present when running the game. It's used in the editor to properly edit and position collision shapes in [CollisionObject2D]. This is not accessible from regular code. This class is for editing custom shape polygons.
Set the array of points forming the polygon.
When editing the point list via the editor, depending on [method get_build_mode], it has to be a list of points (for [code]build_mode==0[/code]), or a list of lines (for [code]build_mode==1[/code]). In the second case, the even elements of the array define the start point of the line, and the odd elements the end point.
Return the list of points that define the polygon.
Set whether the polygon is to be a [ConvexPolygonShape2D] ([code]build_mode==0[/code]), or a [ConcavePolygonShape2D] ([code]build_mode==1[/code]).
Return whether the polygon is a [ConvexPolygonShape2D] ([code]build_mode==0[/code]), or a [ConcavePolygonShape2D] ([code]build_mode==1[/code]).
Set whether this polygon is a trigger. A trigger polygon detects collisions, but is otherwise unaffected by physics (i.e. colliding objects will not get blocked).
Return whether this polygon is a trigger.
Return the index of the first shape generated by the editor.
When [code]build_mode[/code] is set to generate convex polygons, the shape shown in the editor may be decomposed into many convex polygons. In that case, a range of indexes is needed to directly access the [Shape2D].
When [code]build_mode[/code] is set to generate concave polygons, there is only one [Shape2D] generated, so the start index and the end index are the same.
Return the index of the last shape generated by the editor.
Editor-only class for easy editing of shapes.
Editor-only class. This is not present when running the game. It's used in the editor to properly edit and position collision shapes in [CollisionObject2D]. This is not accessible from regular code.
Set this shape's [Shape2D]. This will not appear as a node, but can be directly edited as a property.
Return this shape's [Shape2D].
Set whether this shape is a trigger. A trigger shape detects collisions, but is otherwise unaffected by physics (i.e. will not block movement of colliding objects).
Return whether this shape is a trigger.
Return the index of this shape inside its container [CollisionObject2D]. This can be used to directly access the underlying [Shape2D].
Color in RGBA format.
A color is represented as red, green and blue (r,g,b) components. Additionally, "a" represents the alpha component, often used for transparency. Values are in floating point and usually range from 0 to 1. Some methods (such as set_modulate() ) may accept values > 1.
Return a new color blended with anothor one.
Return the most contrasting color with this one.
Convert the color to gray.
Return the inverted color (1-r, 1-g, 1-b, 1-a).
Return the linear interpolation with another color.
Convert the color to a 32 its integer (each byte represents a RGBA).
Convert color to ARGB32, more compatible with DirectX.
Return the HTML hexadecimal color string.
Construct the color from an RGBA profile.
Construct the color from an RGBA profile.
Construct the color from an RGBA profile.
Construct the color from an RGBA profile.
Array of Colors
Array of Color, can only contains colors. Optimized for memory usage, can't fragment the memory.
Append a value to the array.
Resize the array.
Set an index in the array.
Return the array size.
Create from a generic array.
Color picker control.
This is a simple color picker [Control]. It's useful for selecting a color from an RGB/RGBA colorspace.
Select the current color.
Return the current (edited) color.
When set to true, every color channel will be represented as a value from 0 to 1, insetead of 0, 255.
Returns whether this color picker is in raw mode or not
Set true if you want the color to have an alpha channel (transparency), or false if you want a solid color.
Returns whether the color has transparency or not.
Adds the current selected to color to a list of colors (presets), the presets will be displayed in the color picker and the user will be able to select them, notice that the presets list is only for this color picker.
Emitted when the color is changed.
Button that pops out a [ColorPicker]
Encapsulates a [ColorPicker] making it accesible by pressing a button, pressing the button will toggle the [ColorPicker] visibility
Sets the current color
Gets the current color
See [method ColorPicker.set_edit_alpha]
See [method ColorPicker.is_edit_alpha]
Emitted when the color is changed.
Color interpolator node
Given a set of colors, this node will interpolate them in order, meaning, that if you have color 1, color 2 and color3, the ramp will interpolate (generate the colors between two colors) from color 1 to color 2 and from color 2 to color 3. Initially the ramp will have 2 colors (black and white), one (black) at ramp lower offset offset 0 and the other (white) at the ramp higher offset 1.
Adds the specified color to the end of the ramp, with the specified offset
Removes the color at the index [i]offset[/i]
Sets the offset for the ramp color at index [i]point[/i]
Returns the offset of the ramp color at index [i]point[/i]
Sets the color of the ramp color at index [i]point[/i]
Returns the color of the ramp color at index [i]point[/i]
Returns the interpolated color specified by [i]offset[/i]
Returns the number of colors in the ramp
Sets the offset for the specified amount of elements. Calling this function with a different number of elements than previously defined causes the ramp to resize its colors and offsets array to accomodate the new elements, all new colors will be black by default.
Returns the offsets for the colors in this ramp
Sets the colors for the specified amount of elements. Calling this function with a different number of elements than previously defined causes the ramp to resize its colors and offsets array to accomodate the new elements.
Returns the colors in the ramp
Concave polygon shape.
Concave polygon shape resource, which can be set into a [PhysicsBody] or area. This shape is created by feeding a list of triangles.
Set the faces (an array of triangles).
Return the faces (an array of triangles).
Concave polygon 2D shape resource for physics.
Concave polygon 2D shape resource for physics. It is made out of segments and is very optimal for complex polygonal concave collisions. It is really not advised to use for RigidBody 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 [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] 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.
Set the array of segments.
Return the array of segments.
Dialog for confirmation of actions.
Dialog for confirmation of actions. This dialog inherits from [AcceptDialog], but has by default an OK and Cancel button (in host OS order).
Return the cancel button.
Base node for containers.
Base node for containers. A [Container] contains other controls and automatically arranges them in a certain way.
A Control can inherit this to create custom container classes.
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.
Emitted when sorting the children is needed.
Notification for when sorting the children, it must be obeyed immediately.
Control is the base node for all the GUI components.
Control is the base class Node for all the GUI components. Every GUI component inherits from it, directly or indirectly. In this way, sections of the scene tree made of contiguous control nodes, become user interfaces.
Controls are relative to the parent position and size by using anchors and margins. This ensures that they can adapt easily in most situation to changing dialog and screen sizes. When more flexibility is desired, [Container] derived nodes can be used.
Anchors work by defining which margin do they follow, and a value relative to it. Allowed anchoring modes are ANCHOR_BEGIN, where the margin is relative to the top or left margins of the parent (in pixels), ANCHOR_END for the right and bottom margins of the parent and ANCHOR_RATIO, which is a ratio from 0 to 1 in the parent range.
Input device events ([InputEvent]) are first sent to the root controls via the [method Node._input], which distribute it through the tree, then delivers them to the adequate one (under cursor or keyboard focus based) by calling [method MainLoop._input_event]. There is no need to enable input processing on controls to receive such events. To ensure that no one else will receive the event (not even [method Node._unhandled_input]), the control can accept it by calling [method accept_event].
Only one control can hold the keyboard focus (receiving keyboard events), for that the control must define the focus mode with [method set_focus_mode]. Focus is lost when another control gains it, or the current focus owner is hidden.
It is sometimes desired for a control to ignore mouse/pointer events. This is often the case when placing other controls on top of a button, in such cases. Calling [method set_ignore_mouse] enables this function.
Finally, controls are skinned according to a [Theme]. Setting a [Theme] on a control will propagate all the skinning down the tree. Optionally, skinning can be overridden per each control by calling the add_*_override functions, or from the editor.
Called when an input event reaches the control.
Return the minimum size this Control can shrink to. A control will never be displayed or resized smaller than its minimum size.
Handles the event, no other control will receive it and it will not be sent to nodes waiting on [method Node._unhandled_input] or [method Node._unhandled_key_input].
Return the minimum size this Control can shrink to. A control will never be displayed or resized smaller than its minimum size.
Change the anchor (ANCHOR_BEGIN, ANCHOR_END, ANCHOR_RATIO) type for a margin (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). Changing the anchor mode converts the current margin offset from the previous anchor mode to the new one, so margin offsets ([method set_margin]) must be done after setting anchors, or at the same time ([method set_anchor_and_margin])
Additionally, [code]keep_margin[/code] controls whether margins should be left the same, or changed to keep the same position and size on-screen.
Return the anchor type (ANCHOR_BEGIN, ANCHOR_END, ANCHOR_RATIO) for a given margin (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM).
Set a margin offset. Margin can be one of (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). Offset value being set depends on the anchor mode.
Change the anchor (ANCHOR_BEGIN, ANCHOR_END, ANCHOR_RATIO) type for a margin (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM), and also set its offset. This is a helper (see [method set_anchor] and [method set_margin]).
Sets MARGIN_LEFT and MARGIN_TOP at the same time. This is a helper (see [method set_margin]).
Sets MARGIN_RIGHT and MARGIN_BOTTOM at the same time. This is a helper (see [method set_margin]).
Move the Control to a new position, relative to the top-left corner of the parent Control, changing all margins if needed and without changing current anchor mode. This is a helper (see [method set_margin]).
Changes MARGIN_RIGHT and MARGIN_BOTTOM to fit a given size. This is a helper (see [method set_margin]).
Move the Control to a new position, relative to the top-left corner of the [i]window[/i] Control, and without changing current anchor mode. (see [method set_margin]).
Return a margin offset. Margin can be one of (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). Offset value being returned depends on the anchor mode.
Returns MARGIN_LEFT and MARGIN_TOP at the same time. This is a helper (see [method set_margin]).
Returns the Control position, relative to the top-left corner of the parent Control and independent of the anchor mode.
Returns the size of the Control, computed from all margins, however the size returned will [b]never be smaller than the minimum size reported by [method get_minimum_size][/b]. This means that even if end position of the Control rectangle is smaller than the begin position, the Control will still display and interact correctly. (see description, [method get_minimum_size], [method set_margin], [method set_anchor]).
Returns the Control position, relative to the top-left corner of the parent Control and independent of the anchor mode.
Return position and size of the Control, relative to the top-left corner of the parent Control. This is a helper (see [method get_pos], [method get_size]).
Return position and size of the Control, relative to the top-left corner of the [i]window[/i] Control. This is a helper (see [method get_global_pos], [method get_size]).
Change all margins and anchors, so this Control always takes up the same area as the parent Control. This is a helper (see [method set_anchor], [method set_margin]).
Display 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.
Set the focus access mode for the control (FOCUS_NONE, FOCUS_CLICK, FOCUS_ALL). Only one Control can be focused at the same time, and it will receive keyboard signals.
Return whether the Control is the current focused control (see [method set_focus_mode]).
Steal the focus from another control and become the focused control (see [method set_focus_mode]).
Give up the focus, no other control will be able to receive keyboard input.
Return which control is owning the keyboard focus, or null if no one.
Hint for containers, set horizontal positioning flags.
Hint for containers, return horizontal positioning flags.
Hint for containers, set the stretch ratio. This value is relative to other stretch ratio, so if this control has 2 and another has 1, this one will be twice as big.
Hint for containers, return the stretch ratio. This value is relative to other stretch ratio, so if this control has 2 and another has 1, this one will be twice as big.
Hint for containers, set vertical positioning flags.
Hint for containers, return vertical positioning flags.
Override whole the [Theme] for this Control and all its children controls.
Return a [Theme] override, if one exists (see [method set_theme]).
Override a single icon ([Texture]) in the theme of this Control. If texture is empty, override is cleared.
Override a single stylebox ([Stylebox]) in the theme of this Control. If stylebox is empty, override is cleared.
Override a single font (font) in the theme of this Control. If font is empty, override is cleared.
Override a single constant (integer) in the theme of this Control. If constant equals Theme.INVALID_CONSTANT, override is cleared.
Set a tooltip, which will appear when the cursor is resting over this control.
Return the tooltip, which will appear when the cursor is resting over this control.
Set the default cursor shape for this control. See enum CURSOR_* for the list of shapes.
Return the default cursor shape for this control. See enum CURSOR_* for the list of shapes.
Return the cursor shape at a certain position in the control.
Force a neighbour for moving the input focus to. When pressing TAB or directional/joypad directions focus is moved to the next control in that direction. However, the neighbour to move to can be forced with this function.
Return the forced neighbour for moving the input focus to. When pressing TAB or directional/joypad directions focus is moved to the next control in that direction. However, the neighbour to move to can be forced with this function.
Ignore mouse events on this control (even touchpad events send mouse events).
Return if the control is ignoring mouse events (even touchpad events send mouse events).
Emitted when keyboard focus is gained.
Emitted when the mouse enters the control area.
Emitted when the control changed size.
Emitted when the minimum size of the control changed.
Emitted when the size flags changed.
Emitted when the keyboard focus is lost.
Emitted when an input event is received. Connecting in realtime is recommended for accepting the events.
Emitted when the mouse left the control area.
X is relative to MARGIN_LEFT, Y is relative to MARGIN_TOP.
X is relative to -MARGIN_RIGHT, Y is relative to -MARGIN_BOTTOM.
X and Y are a ratio (0 to 1) relative to the parent size 0 is left/top, 1 is right/bottom.
Control can't acquire focus.
Control can acquire focus only if clicked.
Control can acquire focus if clicked, or by pressing TAB/Directionals in the keyboard from another Control.
Control changed size (get_size() reports the new size).
Mouse pointer entered the area of the Control.
Mouse pointer exited the area of the Control.
Control gained focus.
Control lost focus.
Theme changed. Redrawing is desired.
Modal control was closed.
Convex Polygon Shape.
Convex polygon shape resource, which can be set into a [PhysicsBody] or area.
Convex Polygon Shape for 2D physics.
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 [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] 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.
Currently, this method does nothing.
Set a list of points in either clockwise or counter clockwise order, forming a convex polygon.
Return a list of points in either clockwise or counter clockwise order, forming a convex polygon.
Describes a Bezier curve in 2D space.
This class describes a Bezier curve in 2D space. It is mainly used to give a shape to a [Path2D], but can be manually sampled for other purposes.
It keeps a cache of precalculated points along the curve, to speed further calculations up.
Returns the number of points describing the curve.
Adds a point to a curve, at position "pos", with control points "in" and "out".
If "atpos" is given, the point is inserted before the point number "atpos", moving that point (and every point after) after the inserted point. If "atpos" is not given, or is an illegal value (atpos <0 or atpos >= [method get_point_count]), the point will be appended at the end of the point list.
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.
Returns 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, 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.
Returns 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, and returns (0, 0).
Deletes the point "idx" from the curve. Sends an error to the console if "idx" is out of bounds.
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 [method interpolate] using the integer part of fofs as "idx", and its fractional part as "t".
Sets the distance in pixels between two adjacent cached points. Changing it forces the cache to be recomputed the next time a xxx_baked_xxx function is called. The less distance, the more points the cache will have, and the more memory it will consume, so use with care.
Returns the distance between two adjacent cached points.
Returns the total length of the curve, based on the cached points. Given enough density (see [method set_bake_interval]), 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 [Vector2Array].
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.
Describes a Bezier curve in 3D space.
This class describes a Bezier curve in 3D space. It is mainly used to give a shape to a [Path], but can be manually sampled for other purposes.
It keeps a cache of precalculated points along the curve, to speed further calculations up.
Returns the number of points describing the curve.
Adds a point to a curve, at position "pos", with control points "in" and "out".
If "atpos" is given, the point is inserted before the point number "atpos", moving that point (and every point after) after the inserted point. If "atpos" is not given, or is an illegal value (atpos <0 or atpos >= [method get_point_count]), the point will be appended at the end of the point list.
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 [PathFollow], this tilt is an offset over the natural tilt the PathFollow 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.
Returns 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, 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.
Returns 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, and returns (0, 0, 0).
Deletes the point "idx" from the curve. Sends an error to the console if "idx" is out of bounds.
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 [method interpolate] using the integer part of fofs as "idx", and its fractional part as "t".
Sets the distance in 3D units between two adjacent cached points. Changing it forces the cache to be recomputed the next time a xxx_baked_xxx function is called. The less distance, the more points the cache will have, and the more memory it will consume, so use with care.
Returns the distance between two adjacent cached points.
Returns the total length of the curve, based on the cached points. Given enough density (see [method set_bake_interval]), 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 the cache of points as a [Vector3Array].
Returns the cache of tilts as a [RealArray].
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.
Damped spring constraint for 2D physics.
Damped spring constraint for 2D physics. This resembles a spring joint that always wants to go back to a given length.
Set the maximum length of the spring joint.
Return the maximum length of the spring joint.
Set the resting length of the spring joint. The joint will always try to go to back this length when pulled apart.
Return the resting length of the spring joint. The joint will always try to go to back this length when pulled apart.
Set the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length.
Return the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length.
Set 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).
Return 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).
Dictionary type.
Dictionary type. Associative container which contains values referenced by unique keys. Dictionaries are always passed by reference.
Clear the dictionary, removing all key/value pairs.
Return true if the dictionary is empty.
Erase a dictionary key/value pair by key.
Return true if the dictionary has a given key.
Return true if the dictionary has all of the keys in the given array.
Return a hashed integer value representing the dictionary contents.
Return the list of keys in the dictionary.
Parse json text to the dictionary. Return OK when successed or the error code when failed.
Return the size of the dictionary (in pairs).
Return the dictionary as json text.
Directional Light, such as the Sun or the Moon.
A DirectionalLight is a type of [Light] node that emits light constantly in one direction (the negative z axis of the node). It is used 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 do determine light direction.
Type used to handle the filesystem.
Directory type. Is used to manage directories and their content (not restricted to the project folder).
Example for how to iterate through the files of a directory:
[codeblock]
func dir(path):
var d = Directory.new()
if d.open( path )==0:
d.list_dir_begin()
var file_name = d.get_next()
while(file_name!=""):
if d.current_is_dir():
print("Found directory: " + file_name)
else:
print("Found file:" + file_name)
file_name = d.get_next()
else:
print("Some open Error, maybe directory not found?")
[/codeblock]
Opens a directory to work with. Needs a path, example "res://folder"
Loads all file names of the current directory (prepares the get_next() function).
Is used to iterate through the files of the current directory. Returns the name(no path) of the current file/directory, it also contains "." and ".." .
Returns an empty String "" at the end of the list.
Returns true if the current file you are looking at with get_next() is a directory or "." or ".." otherwise false.
Run this to empty the list of remaining files in get_next(). You can use it to end the iteration, as soon as your goal is reached.
Needs a path or name to the next directory. When the target directory is in the current directory you can use "newfolder" otherwise you need the full path "res://currentfolder/newfolder"
Returns a path to the current directory, example: "res://folder"
Returns true if directory exists otherwise false. Needs a path, example: "res://folder"
Editor plugin to control the export process.
This plugin is added into EditorImportExport and allows to modify
the behavior of the export process for individual files.
This function is called for each file exported and
depending from the return value one of many things
might happen.
1) If returned value is null, the file is exported
as is.
2) If the returned value is a RawAray (array of
bytes), the content of that array becomes the new
file being exported.
3) If the file must also change it's name when
exported, then a [Dictionary] must be returned with
two fields: 'name' with the new filename and 'data'
with a [RawArray] containing the raw contents of the
file. Even if the name is changed, the run-time will
redirect the old file to the new file automatically
when accessed.
Import plugin for editor
Import plugins make it easy to handle importing of external assets
into a project.
They way they work is not that obvious though, so please make sure
to read the documentation, tutorials and examples.
Generally, files that are imported stay the same
when exported. The only exception is in some cases
when the file must be re-imported for different
platforms (ie. texture compression).
If you want to customize the export process, it's
recommended to use [EditorExportPlugin.custom_export]
instead.
Get the name of the import plugin, which will be
used to identify content imported by this plugin.
Try to use lowecase and underscores if possible.
Visible name for this plugin, which will be shown on
the import menu.
Perform an import of an external resources into the
project. This function is both called on import
(from the dialog) or re-import
(manual or automatic when external source files
changed).
An import process generally works like this:
1) Check the metadata for source files and options.
Metadata is either generated in the import dialog or
taken from an existing resource upon reimport.
2) Perform the import process into a new resource.
Some times the resource being re-imported may be already loaded
and in use, so checking for this by using
[ResourceLoader.has] is recommended. Otherwise
create a new resource.
3) Set the metadata from the argument into the existing or new
resource being created using
[Resource.set_import_metadata].
4) Save the resource into 'path' (function argument)
This function is called when either the user chooses
to import a resource of this type (Import menu), or
when the user chooses to re-import the resource
(from filesystem). In the later case, the path for
the existing file is supplied in the argument.
If the path is supplied, it is recommended to read
the import metadata with
[ResourceLoader.load_import_metadata] and fill in
the fields with the values contained there.
The dialog can be shown in any way (just use a
ConfirmationDialog and pop it up). Upon
confirmation, fill up a ResourceImportMetadata and
call the [EditorImportPlugin.import] function with
this information.
Used by the editor to extend it's functionality.
Plugins are used by the editor to extend functionality. The most
common types of plugins are those which edit a given node or
resource type, import plugins and export plugins.
This method is called when the editor is about to
save the project, switch to another tab, etc. It
asks the plugin to apply any pending state changes
to ensure consistency.
This is used, for example, in shader editors to let
the plugin know that it must apply the shader code
being written by the user to the object.
Clear all the state and reset the object being
edited to zero. This ensures your plugin does not
keep editing a currently existing node, or a node
fromt the wrong scene.
This is used for plugins that create gizmos used by
the spatial editor. Just check that the node passed
in the "for_spatial" argument matches your plugin.
This function is used for plugins that edit specific
object types (nodes or resources). It requests the
editor to edit the given object.
This is a low level function for plugins that edit a given
object type derived from CanvasItem to capture the input in the 2D editor
viewport. The function is only being called if your
object is being edited.
Return true if you want to capture the input,
otherwise false.
This is a low level function for plugins that edit a
given objet type derived from Spatial to capture the
input of the viewport. The function is only being
called if your object is being edited.
By using the [InputEvent] and the [Camera] arguments
it's pretty easy to do raycasts into space using
Camera functions.
Return true if you want to capture the input,
otherwise false.
This is for editors that edit script based objects.
You can return a list of breakpoints in the format
(script:line), for example: res://path_to_script.gd:25
Get the name of the editor plugin. For main scren
plugins this is what will appear in the selector
(which by default is 2D, 3D, Script).
Get the state of your plugin editor. This is used
when saving the scene (so state is kept when opening
it again) and for switching tabs (so state can be
restored when the tab returns).
Implement this function if your plugin edits a
specific type of object (Resource or Node). If you
return true, then you will get the functions
[EditorPlugin.edit] and [EditorPlugin.make_visible]
called when the editor requests them.
Return true if this is a main screen editor plugin
(it goes in the main screen selector together with
2D, 3D, Script).
This function will be called when the editor is
requested to become visible. It is used for plugins
that edit a specific object type.
Remember that you have to manage the visibility of
all your editor controls manually.
Restore the state saved by [EditorPlugin.get_state].
Add a custom control to a container (see
CONTAINER_* enum). There are many locations where
custom controls can be added in the editor UI.
Please remember that you have to manage the
visibility of your custom controls yourself (and likely
hide it after adding it).
If your plugin is being removed, also make sure to
remove your custom controls too.
Add a control to the bottom panel (together with
Output, Debug, Animation, etc).
If your plugin is being removed, also make sure to
remove your control by calling [method
remove_control_from_bottom_panel].
Add the control to a specific dock slot (see DOCK_*
enum for options).
If the dock is repositioned and as long as the
plugin is active, the editor will save the dock
position on further sessions.
If your plugin is being removed, also make sure to
remove your control by calling [method
remove_control_from_docks].
Remove the control from the dock. Don't forget to
call this if you added one, so the editor can save
the layout and remove it cleanly.
Remove the control from the bottom panel. Don't forget
to call this if you added one, so the editor can
remove it cleanly.
Add a custom type, which will appear in the list of
nodes or resources. An icon can be optionally
passed.
When given node or resource is selected, the base
type will be instanced (ie, "Spatial", "Control",
"Resource"), then the script will be loaded and set
to this object.
You can use the [EditorPlugin.handles] to check if
your custom object is being edited by checking the
script or using 'extends' keyword.
During run-time, this will be a simple object with a
script so this function does not need to be called
then.
Remove a custom type added by
[EditorPlugin.add_custom_type]
Add an import plugin. These plugins manage importing
external content (from outside the project) into
formats the engine can understand.
On exit, don't forget to remove the plugin by
calling [method remove_import_plugin]
Remove the import plugin, don't forget to call this
on exit.
Add an export plugin. Plugins of this kind can
change files being exported. On exit don't forget to
call [method remove_export_plugin].
Remove the export plugin, don't forget to call this
on exit.
Get a base control where it's safe to place dialogs.
Many plugins open dialogs and they need a control as
a base to make sure they use the editor icons and
theme.
Get the undo/redo object. Most actions in the editor
can be undoable, so use this object to make sure
this happens when it's worth it.
Get the object that handles the selection of nodes
in the Scene Tree editor.
Get the general settings for the editor (the same
window that appears in the Settings menu).
Base script for post-processing scenes being imported.
These scripts can modify scenes after being imported by the 3D Scene
import option of the Import menu.
This function is called upon import with the
imported scene.
Just do any changes desired to the scene and return
it. If null is returned, import will fail and throw
an error to the user.
Simple script to perform changes in the currently edited scene.
This script can be run from the Scene -> Run Script menu option.
Manages the SceneTree selection in the editor.
This object manages the SceneTree selection in the editor.
Clear the selection.
Add a node to the selection.
Remove a node from the selection.
Get the list of selectes nodes.
Emitted when the selection changes.
Object that holds the project-independent editor settings.
Object that holds the project-independent editor settings. These
settings are generally visible in the Editor Settings menu.
Accessing the settings is done by using the regular [Object] API,
such as.
settings.set(prop,value)
settings.get(prop)
list_of_settings = settings.get_property_list()
Erase a given setting (pass full property path).
Get the global settings path for the engine. Inside
this path you can find some standard paths such as:
settings/tmp - used for temporary storage of files
settings/templates - where export templates are
located
Get the specific project settings path. Projects all
have an unique sub-directory inside the settings
path where project specific settings are saved.
Set the list of favorite directories for this
project.
Get the list of favorite directories for this
project.
Set the list of recently visited folders in the file
dialog for this project.
Get the list of recently visited folders in the file
dialog for this project.
Custom gizmo for editing Spatial objects.
Custom gizmo that is used for providing custom visualization and
editing (handles) for 3D Spatial objects. These are created by
[method EditorPlugin.create_spatial_gizmo].
Commit a handle being edited (handles must have been
prevously added by [method add_handles]).
If the cancel parameter is true, an option to
restore the edited value to the original is
provided.
Get the name of an edited handle (handles must have
been previously added by [method add_handles]).
Handles can be named for reference to the user when editing.
Get actual value of a handle. This value can be
anything and used for eventually undoing the motion
when calling [method commit_handle]
This function is called when the Spatial this gizmo
refers to changes (the [method Spatial.update_gizmo]
is called).
This function is used when the user drags a gizmo
handle (previously added with [method add_handles])
in screen coordinates.
The [Camera] is also provided
so screen coordinates can be converted to raycasts.
Add lines to the gizmo (as sets of 2 points), with a
given material. The lines are used for visualizing
the gizmo.
Call this function during [method redraw].
Add a mesh to the gizmo, this is used for
visualization.
Call this function during [method redraw].
Add collision triangles to the gizmo for picking. A
[TriangleMesh] can be generated from a regular
[Mesh] too.
Call this function during [method redraw].
Add an unscaled billboard for visualization.
Call this function during [method redraw].
Add a list of handles (points) which can be used to
deform the object being edited.
There are virtual functions which will be called
upon editing of these handles.
Call this function during [method redraw].
Call this function once and upon creation of the
gizmo, otherwise no other function will work.
The argument is the node being edited by the gizmo.
Class for event stream playback.
Class for event stream playback. Event streams are music expressed as a series of events (note on, note off, instrument change...), as opposed to audio streams, which are just audio data. Examples of event-based streams are MIDI files, or MOD music.
Currently, only MOD, S3M, IT, and XM music is supported.
Set the [EventStream] this player will play.
Return the currently assigned stream.
Play the currently assigned stream.
Stop playing.
Return whether this player is playing.
Pause stream playback.
Return whether the playback is currently paused.
Set whether the stream will be restarted at the end.
Return whether this player will be restart the playback at the end.
Set the playback volume for this player. This is a float between 0.0 (silent) and 1.0 (full volume). Values over 1.0 may amplify sound even more, but may introduce distortion. Negative values may just invert the output waveform, which produces no audible difference.
The effect of these special values ultimately depends on the low-level implementation of the file format being played.
Return the playback volume for this player.
Set the pitch multiplier for all sounds coming from this stream. A value of 2.0 shifts all pitches one octave up, and a value of 0.5 shifts pitches one octave down.
Return the pitch scale factor for this player.
Set the tempo multiplier. This allows to slow down or speed up the music, without affecting its pitch.
Return the tempo multiplier.
Set the playback volume for this player, in decibels. This is a float between -80.0 (silent) and 0.0 (full volume). Values under -79.0 get truncated to -80, but values over 0.0 do not, so the warnings for over amplifying (see [method set_volume]) still apply.
Return the playback volume for this player, in decibels.
Return the name of the currently assigned stream. This is not the file name, but a field inside the file. If no stream is assigned, if returns "<No Stream>".
Return the number of times the playback has looped.
Return the playback position. May be in seconds, but depends on the stream type.
Set the playback position. May be in seconds, but depends on the stream type.
Return the song length. May be in seconds, but depends on the stream type.
Set whether this player will start playing as soon as it enters the scene tree.
Return whether this player will start playing as soon as it enters the scene tree.
Set the volume scale for an individual channel of the stream, with the same value range as [method set_volume]. The channel number depends on the stream format. For example, MIDIs range from 0 to 15, and MODs from 0 to 63.
Many stream formats are multichannel, so this allows to affect only a part of the music.
Return the volume scale for an individual channel of the stream.
Return the time at which the last note of a given channel in the stream plays.
Base class for all event-based stream drivers.
Base class for all event-based stream drivers. Event streams are music expressed as a series of events (note on, note off, instrument change...), as opposed to audio streams, which are just audio data. Examples of event-based streams are MIDI files, of MOD music.
This class exposes no methods.
Driver for MOD playback.
This driver plays MOD music. MOD music, as all event-based streams, is a music format defined by note events occurring at defined moments, instead of a stream of audio samples.
Currently, this driver supports the MOD, S3M, IT, and XM formats.
This class exposes no methods.
This class can return its playback position in seconds, but does not allow to set it, failing with only a console warning.
This class can not return its song length, returning 1.0 when queried.
This class does not limit its volume settings, allowing for overflow/distortion and wave inversion.
Returns on success, a md5 String representing the file of the given path.
else, empty String "".
Dialog for selecting files or directories in the filesystem.
FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks.
Clear all the added filters in the dialog.
Add a custom filter. Filter format is: "mask ; description", example (C++): dialog->add_filter("*.png ; PNG Images");
Get the current working directory of the file dialog.
Get the current selected file of the file dialog (empty if none).
Get the current selected path (directory and file) of the file dialog (empty if none).
Set the file dialog mode from the MODE_* enum.
Get the file dialog mode from the MODE_* enum.
Set the file access permission of the dialog(Must be one of [ACCESS_RESOURCES], [ACCESS_USERDATA] or [ACCESS_FILESYSTEM]).
Return the file access permission of the dialog.
Set the dialog should show hidden files.
Return true if the diaog allows show hidden files.
Event emitted when the user selects multiple files.
Event emitted when the user selects a directory.
Event emitted when the user selects a file (double clicks it or presses the OK button).
The dialog allows the selection of one, and only one file.
The dialog allows the selection of multiple files.
The dialog functions as a folder selector, disallowing the selection of any file.
The dialog will warn when a file exists.
The dialog allows the selection of file and directory.
The dialog allows ascess files under [Resource] path(res://) .
The dialog allows ascess files in whole file system.
Simple Material with a fixed parameter set.
FixedMaterial is a simple type of material [Resource], which contains a fixed amount of parameters. It is the only type of material supported in fixed-pipeline devices and APIs. It is also an often a better alternative to [ShaderMaterial] for most simple use cases.
Set a parameter, parameters are defined in the PARAM_* enum. The type of each parameter may change, so it's best to check the enum.
Return a parameter, parameters are defined in the PARAM_* enum. The type of each parameter may change, so it's best to check the enum.
Set a texture. Textures change parameters per texel and are mapped to the model depending on the texcoord mode (see [method set_texcoord_mode]).
Return a texture. Textures change parameters per texel and are mapped to the model depending on the texcoord mode (see [method set_texcoord_mode]).
Set the texture coordinate mode. Each texture param (from the PARAM_* enum) has one. It defines how the textures are mapped to the object.
Return the texture coordinate mode. Each texture param (from the PARAM_* enum) has one. It defines how the textures are mapped to the object.
Sets a special transform used to post-transform UV coordinates of the uv_xform texcoord mode: TEXCOORD_UV_TRANSFORM.
Returns the special transform used to post-transform UV coordinates of the uv_xform texcoord mode: TEXCOORD_UV_TRANSFORM.
Diffuse Lighting (light scattered from surface).
Detail Layer for diffuse lighting.
Specular Lighting (light reflected from the surface).
Emission Lighting (light emitted from the surface).
Specular Exponent (size of the specular dot).
Glow (Visible emitted scattered light).
Normal Map (irregularity map).
Maximum amount of parameters.
Read texture coordinates from the UV array.
Read texture coordinates from the UV array and transform them by uv_xform.
Read texture coordinates from the UV2 array.
Internationalized font and text drawing support.
Font contains an 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. TODO check wikipedia for graph of ascent/baseline/descent/height/etc.
Draw "string" into a canvas item using the font at a given "pos" position, with "modulate" color, and optionally clipping the width. "pos" specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis.
Return the font ascent (number of pixels above the baseline).
Return the font descent (number of pixels below the baseline).
Return the total font height (ascent plus descent) in pixels.
Return the size of a string, taking kerning and advance into account.
Draw character "char" into a canvas item using the font at a given "pos" position, with "modulate" color, and optionally kerning if "next" is passed. clipping the width. "pos" specifies the baseline, not the top. To draw from the top, [i]ascent[/i] 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.
Should put children to the top left corner instead of center of the container.
Base node for geometry based visual instances.
Base node for geometry based visual instances. Shares some common functionality like visibility and custom materials.
Set the material override for the whole geometry.
Return the material override for the whole geometry.
Contains global variables accessible from everywhere.
Contains global variables accessible from everywhere. Use the normal [Object] API, such as "Globals.get(variable)", "Globals.set(variable,value)" or "Globals.has(variable)" to access them. Variables stored in engine.cfg are also loaded into globals, making this object very useful for reading custom game configuration options.
Return true if a configuration value is present.
Set the order of a configuration value (influences when saved to the config file).
Return the order of a configuration value (influences when saved to the config file).
If set to true, this value can be saved to the configuration file. This is useful for editors.
If returns true, this value can be saved to the configuration file. This is useful for editors.
Clear the whole configuration (not recommended, may break things).
Convert a path to a localized path (res:// path).
Convert a localized path (res://) to a full native OS path.
GraphEdit is an area capable of showing various GraphNodes. It manages connection events between them.
GraphEdit manages the showing of GraphNodes it contains, as well as connections an disconnections between them. Signals are sent for each of these two events. Disconnection between GraphNodes slots is disabled by default.
It is greatly advised to enable low processor usage mode (see [method OS.set_low_processor_usage_mode]) when using GraphEdits.
Create a connection between 'from_port' slot of 'from' GraphNode and 'to_port' slot of 'to' GraphNode. If the connection already exists, no connection is created.
Return true if the 'from_port' slot of 'from' GraphNode is connected to the 'to_port' slot of 'to' GraphNode.
Remove the connection between 'from_port' slot of 'from' GraphNode and 'to_port' slot of 'to' GraphNode, if connection exists.
Return an Array containing the list of connections. A connection consists in a structure of the form {from_slot: 0, from: "GraphNode name 0", to_slot: 1, to: "GraphNode name 1" }
Return the scroll offset.
Set the zoom value of the GraphEdit. Zoom value is between [0.01; 1.728].
Return the current zoom value.
Enable the disconnection of existing connections in the visual GraphEdit by left-clicking a connection and releasing into the void.
Return true is the disconnection of connections is enable in the visual GraphEdit. False otherwise.
Signal sent when a GraphNode is attempted to be removed from the GraphEdit.
Signal sent when a GraphNode is attempted to be duplicated in the GraphEdit.
Signal sent when a popup is requested. Happens on right-clicking in the GraphEdit. 'p_position' is the position of the mouse pointer when the signal is sent.
Signal sent at the beginning of a GraphNode movement.
Signal sent to the GraphEdit when the connection between 'from_slot' slot of 'from' GraphNode and 'to_slot' slot of 'to' GraphNode is attempted to be removed.
Signal sent to the GraphEdit when the connection between 'from_slot' slot of 'from' GraphNode and 'to_slot' slot of 'to' GraphNode is attempted to be created.
Signal sent at the end of a GraphNode movement.
A GraphNode is a container with several input and output slots allowing connections between GraphNodes. Slots can have different, incompatible types.
A GraphNode is a container defined by a title. It can have 1 or more input and output slots, which can be enabled (shown) or disabled (not shown) and have different (incompatible) types. Colors can also be assigned to slots. A tuple of input and output slots is defined for each GUI element included in the GraphNode. Input and output connections are left and right slots, but only enabled slots are counted as connections.
Set the title of the GraphNode.
Return the title of the GraphNode.
Set the tuple of input/output slots defined by 'idx' ID. 'left' slots are input, 'right' are output. 'type' is an integer defining the type of the slot. Refer to description for the compatibility between slot types.
Disable input and output slot whose index is 'idx'.
Disable all input and output slots of the GraphNode.
Return true if left (input) slot 'idx' is enabled. False otherwise.
Return the (integer) type of left (input) 'idx' slot.
Return the color set to 'idx' left (input) slot.
Return true if right (output) slot 'idx' is enabled. False otherwise.
Return the (integer) type of right (output) 'idx' slot.
Return the color set to 'idx' right (output) slot.
Set the offset of the GraphNode.
Return the offset of the GraphNode.
Return the number of enabled output slots (connections) of the GraphNode.
Return the number of enabled input slots (connections) to the GraphNode.
Return the position of the output connection 'idx'.
Return the type of the output connection 'idx'.
Return the color of the output connection 'idx'.
Return the position of the input connection 'idx'.
Return the type of the input connection 'idx'.
Return the color of the input connection 'idx'.
Show the close button on the GraphNode if 'show' is true (disabled by default). If enabled, a connection on the signal close_request is needed for the close button to work.
Returns true if the close button is shown. False otherwise.
Signal sent when the GraphNode is requested to be displayed over other ones. Happens on focusing (clicking into) the GraphNode.
Signal sent on closing the GraphNode.
Signal sent when the GraphNode is dragged.
Signal sent when the GraphNode is moved.
Grid container used to arrange elements in a grid like layout
Grid container will arrange its children in a grid like structure, the grid columns are specified using the [method set_columns] method 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.
Sets the numbers of columns in the container, then reorder its children to accommodate the new layout
Returns the number of columns in this container
Groove constraint for 2D physics.
Groove constraint for 2D physics. This is useful for making a body "slide" through a segment placed in another.
Set the length of the groove.
Return the length of the groove.
Set the initial offset of the groove on body A.
Set the final offset of the groove on body A.
Horizontal box container.
Horizontal box container. See [BoxContainer].
Horizontal button array.
Horizontal button array. See [ButtonArray].
Horizontal scroll bar.
Horizontal scroll bar. See [ScrollBar]. This one goes from left (min) to right (max).
Horizontal separator.
Horizontal separator. See [Separator]. It is used to separate objects vertically, though (but it looks horizontal!).
Horizontal slider.
Horizontal slider. See [Slider]. This one goes from left (min) to right (max).
Horizontal split container.
Horizontal split container. See [SplitContainer]. This goes from left to right.
Connect 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.
verify_host will check the SSL identity of the host if set to true.
Sends a request to the connected host. The url is what is normally behind the hostname, i.e. in [code]http://somehost.com/index.php[/code], url would be "index.php".
Headers are HTTP request headers.
To create a POST request with query strings to push to the server, do:
[codeblock]
var fields = {"username" : "user", "password" : "pass"}
var queryString = httpClient.query_string_from_dict(fields)
var headers = ["Content-Type: application/x-www-form-urlencoded", "Content-Length: " + str(queryString.length())]
var result = httpClient.request(httpClient.METHOD_POST, "index.php", headers, queryString)
[/codeblock]
Stub function
Stub function
Returns all response headers as dictionary 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.
Structure: ("key":"value1; value2")
Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
Sets the size of the buffer used and maximum bytes to read per iteration
If set to true, execute will wait until all data is read from the response.
Returns a status string like STATUS_REQUESTING. Need to call [method poll] in order to get status updates.
This needs to be called in order to have any request processed. Check results with [method get_status]
Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary, e.g.:
[codeblock]
var fields = {"username": "user", "password": "pass"}
String queryString = httpClient.query_string_from_dict(fields)
returns:= "username=user&password=pass"
[/codeblock]
IP Protocol support functions.
IP contains some support functions for the IPv4 protocol. TCP/IP support is in different classes (see [StreamPeerTCP] and [TCP_Server]). IP provides hostname resolution support, both blocking and threaded.
Resolve a given hostname, blocking. Resolved hostname is returned as an IP.
Create a queue item for resolving a given hostname. The queue ID is returned, or RESOLVER_INVALID_ID on error.
Return the status of hostname queued for resolving, given it's queue ID. Returned status can be any of the RESOLVER_STATUS_* enumeration.
Return a resolved item address, or an empty string if an error happened or resolution didn't happen yet (see [method get_resolve_item_status]).
Erase a queue ID, removing it from the queue if needed. This should be used after a queue is completed to free it and enable more queries to happen.
Image datatype.
Built in native image datatype. Contains image data, which can be converted to a texture, and several functions to interact with it.
Create an empty image of a specific size and format.
A Singleton that deals with inputs.
A Singleton that deals with inputs. This includes key presses, mouse buttons and movement, joysticks, and input actions.
Returns true or false depending on whether the key is pressed or not. You can pass KEY_*, which are pre-defined constants listed in [@Global Scope].
Returns true or false depending on whether mouse button is pressed or not. You can pass BUTTON_*, which are pre-defined constants listed in [@Global Scope].
Returns if the joystick button at the given index is currently pressed. (see JOY_* constants in [@Global Scope])
Returns true or false depending on whether the action event is pressed. Actions and their events can be set in the Project Settings / Input Map tab. Or be set with [InputMap].
Add a new mapping entry (in SDL2 format) to the mapping database. Optionally update already connected devices.
Removes all mappings from the internal db that match the given uid.
Returns if the specified device is known by the system. This means that it sets all button and axis indices exactly as defined in the JOY_* constants (see [@Global Scope]). Unknown joysticks are not expected to match these constants, but you can still retrieve events from them.
Returns the current value of the joystick axis at given index (see JOY_* constants in [@Global Scope])
Returns the name of the joystick at the specified device index
Returns a SDL2 compatible device guid on platforms that use gamepad remapping. Returns "Default Gamepad" otherwise.
If the device has an accelerometer, this will return the movement.
Returns the mouse speed.
Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at the same time the bits are added together.
Set the mouse mode. See the constants for more information.
Return the mouse mode. See the constants for more information.
Sets the mouse position to the specified vector.
This will simulate pressing the specificed action.
If the specified action is already pressed, this will release it.
Set a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified.
Emitted when a joystick device has been connected or disconnected
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 unable to leave the game window. But it will still register movement and mouse button presses.
Built-in input event data.
Built-in input event data. InputEvent is a built-in engine datatype, given that it's passed around and used so much. Depending on it's type, the members contained can be different, so read the documentation well!. Input events can also represent actions (editable from the project settings).
Return if this input event matches a pre-defined action, no matter the type.
Return if this input event is an echo event (usually for key events).
Return if this input event is pressed (for key, mouse, joy button or screen press events).
Empty input event.
Key event.
Mouse motion event.
Mouse button event.
Joystick motion event.
Joystick button event.
Singleton that manages actions.
Singleton that manages actions. InputMap has a list of the actions used in InputEvent, which can be modified.
Integer Array.
Integer Array. Array of integers. Can only contain integers. Optimized for memory usage, can't fragment the memory.
Append a value to the array.
Resize the array.
Set an index in the array.
Return the array size.
Create from a generic array.
Base node for all joint constraints in 2D physics.
Base node for all joint constraints in 2D physics. Joints take 2 bodies and apply a custom constraint.
Set the path to the A node for the joint. Must be of type [PhysicsBody2D].
Return the path to the A node for the joint.
Set the path to the B node for the joint. Must be of type [PhysicsBody2D].
Return the path to the B node for the joint.
Returns whether the KinematicBody can be teleported to the destination given as an argument, checking all collision shapes of the body against potential colliders at the destination.
Kinematic body 2D node.
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 a character or a rigid body, these are the same as a static body). They have however, two main uses:
Simulated Motion: When these bodies are moved manually, either from code or from an AnimationPlayer (with process mode set to fixed), 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 [method move] method) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics.
Move the body in the given direction, stopping if there is an obstacle.
Move the body to the given position. This is not a teleport, and the body will stop if there is an obstacle.
Return true if there would be a collision if the body moved in the given direction.
Return the last movement done by the body.
Undo the last movement done by the body.
Return whether the body is colliding with another.
Return the point in space where the body is touching another. If there is no collision, this method will return (0,0), so collisions must be checked first with [method is_colliding].
Return the normal of the surface the body collided with. This is useful to implement sliding along a surface.
Return the velocity of the body that collided with this one.
Return the body that collided with this one.
Return the shape index from the body that collided with this one. If there is no collision, this method will return 0, so collisions must be checked first with [method is_colliding].
Return the metadata of the shape that collided with this body. If there is no collision, it will return 0, so collisions must be checked first with [method is_colliding]. Additionally, this metadata can not be set with [method Object.set_meta], it must be set with [method Physics2DServer.body_set_shape_metadata].
Set the collision margin for this object. A collision margin is an amount (in pixels) that all shapes will grow when computing collisions, to account for numerical imprecision.
Return the collision margin for this object.
Control that displays formatted text.
Label is a control that displays formatted text, optionally autowrapping it to the [Control] area. It inherits from range to be able to scroll wrapped text vertically.
Sets the alignment mode to any of the ALIGN_* enumeration values.
Return the alignment mode (any of the ALIGN_* enumeration values).
Sets the vertical alignment mode to any of the VALIGN_* enumeration values.
Return the vertical alignment mode (any of the VALIGN_* enumeration values).
Set the label text. Text can contain newlines.
Return the label text. Text can contain newlines.
Set [i]autowrap[/i] mode. When enabled, autowrap will fit text to the control width, breaking sentences when they exceed the available horizontal space. When disabled, the label minimum width becomes the width of the longest row, and the minimum height large enough to fit all rows.
Return the state of the [i]autowrap[/i] mode (see [method set_autowrap]).
Cuts off the rest of the text if it is too wide.
Return true if text would be cut off if it is too wide.
Display text in all capitals.
Return true if text is displayed in all capitals.
Return the height of a line.
Return the amount of lines.
Return the total length of the text.
Restricts the number of characters to display. Set to -1 to disable.
Return the restricted number of characters to display. Returns -1 if unrestricted.
Restricts the number of characters to display (as a percentage of the total text).
Return the restricted number of characters to display (as a percentage of the total text).
Sets the number of lines to skip before displaying. Useful for scrolling text.
Return the the number of lines to skipped before displaying.
Restricts the number of lines to display. Set to -1 to disable.
Return the restricted number of lines to display. Returns -1 if unrestricted.
Align rows to the left (default).
Align rows centered.
Align rows to the right (default).
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.
Provides a base class for different kinds of light nodes.
Light is the abstract base class for light nodes, so it shouldn't be used directly (It can't be instanced). Other types of light nodes inherit from it. Light contains the common variables and parameters used for lighting.
Control that provides single line string editing.
LineEdit provides a single line string editor, used for text fields.
Clear the [LineEdit] text.
Select the whole string.
Set the text in the [LineEdit], clearing the existing one and the selection.
Return the text in the [LineEdit].
Set the cursor position inside the [LineEdit], causing it to scroll if needed.
Return the cursor position inside the [LineEdit].
Set the maximum amount of characters the [LineEdit] can edit, and cropping existing text in case it exceeds that limit. Setting 0 removes the limit.
Return the maximum amount of characters the [LineEdit] can edit. If 0 is returned, no limit exists.
Append text at cursor, scrolling the [LineEdit] when needed.
Set the [i]editable[/i] status of the [LineEdit]. When disabled, existing text can't be modified and new text can't be added.
Return the [i]editable[/i] status of the [LineEdit] (see [method set_editable]).
Set the [i]secret[/i] status of the [LineEdit]. When enabled, every character is displayed as "*".
Return the [i]secret[/i] status of the [LineEdit] (see [method set_secret]).
This signal is emitted when the user presses KEY_ENTER on the [LineEdit]. This signal is often used as an alternate confirmation mechanism in dialogs.
When the text changes, this signal is emitted.
Line shape for 2D collision objects.
Line shape for 2D collision objects. It works like a 2D plane and will not allow any 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.
Set the line normal.
Return the line normal.
Set the line distance from the origin.
Return the line distance from the origin.
Simple button used to represent a link to some resource
This kind of buttons are primarily used when the interaction with the button causes a context change (like linking to a web page).
Sets the text of the button.
Returns the text of the button.
Sets the underline mode for this button, the argument must be one of the [LinkButton] constants (see constants section).
Returns the underline mode for this button.
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.
Main loop is the abstract main loop base class.
Main loop is the abstract main loop base class. All other main loop classes are derived from it. Upon application start, a [MainLoop] has to be provided to OS, else the application will exit. This happens automatically (and a [SceneTree] is created), unless a main [Script] is supplied, which may or not create and return a [MainLoop].
Simple margin container.
Simple margin container. Adds a left margin to anything contained.
Abstract base [Resource] for coloring and shading geometry.
Material is a base [Resource] used for coloring and shading geometry. All materials inherit from it and almost all [VisualInstance] derived nodes carry a Material. A few flags and parameters are shared between all material types and are configured here.
Set a [Material] flag, which toggles on or off a behavior when rendering. See enumeration FLAG_* for a list.
Return a [Material] flag, which toggles on or off a behavior when rendering. See enumeration FLAG_* for a list.
Set blend mode for the material, which can be one of BLEND_MODE_MIX (default), BLEND_MODE_ADD, BLEND_MODE_SUB. Keep in mind that only BLEND_MODE_MIX ensures that the material [i]may[/i] be opaque, any other blend mode will render with alpha blending enabled in raster-based [VisualServer] implementations.
Return blend mode for the material, which can be one of BLEND_MODE_MIX (default), BLEND_MODE_ADD, BLEND_MODE_SUB. Keep in mind that only BLEND_MODE_MIX ensures that the material [i]may[/i] be opaque, any other blend mode will render with alpha blending enabled in raster-based [VisualServer] implementations.
Set the line width for geometry drawn with FLAG_WIREFRAME enabled, or LINE primitives. Note that not all hardware or VisualServer backends support this (like DirectX).
Return the line width for geometry drawn with FLAG_WIREFRAME enabled, or LINE primitives. Note that not all hardware or VisualServer backends support this (like DirectX).
Geometry is visible when this flag is enabled (default).
Both front facing and back facing triangles are rendered when this flag is enabled.
Front facing and back facing order is swapped when this flag is enabled.
Shading (lighting) is disabled when this flag is enabled.
Maximum amount of flags.
Use the regular alpha blending equation (source and dest colors are faded) (default).
Use additive blending equation, often used for particle effects such as fire or light decals.
Use subtractive blending equation, often used for some smoke effects or types of glass.
3x3 matrix datatype.
3x3 matrix used for 3D rotation and scale. Contains 3 vector fields x,y and z. Can also be accessed as array of 3D vectors. Almost always used as orthogonal basis for a [Transform].
Return the determinant of the matrix.
Return euler angles from the matrix.
Return the affine inverse of the matrix.
Return the orthonormalized version of the matrix (useful to call from time to time to avoid rounding error).
Return the rotated version of the matrix, by a given axis and angle.
Return the scaled version of the matrix, by a 3D scale.
Transposed dot product with the x axis of the matrix.
Transposed dot product with the y axis of the matrix.
Transposed dot product with the z axis of the matrix.
Return the transposed version of the matrix.
Return a vector transformed by the matrix and return it.
Return a vector transformed by the transposed matrix and return it.
Create a matrix from 3 axis vectors.
Create a matrix from an axis vector and an angle.
Create a matrix from a quaternion.
3x2 Matrix for 2D transforms.
3x2 Matrix for 2D transforms.
Special button that brings up a [PopupMenu] when clicked.
Special button that brings up a [PopupMenu] when clicked. That's pretty much all it does, as it's just a helper class when building GUIs.
Return the [PopupMenu] contained in this button.
A [Resource] that contains vertex-array based geometry.
Mesh is a type of [Resource] that contains vertex-array based geometry, divided in [i]surfaces[/i]. 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.
Create a new surface ([method get_surface_count] that will become surf_idx for this.
Surfaces are created to be rendered using a "primitive", which may be PRIMITIVE_POINTS, PRIMITIVE_LINES, PRIMITIVE_LINE_STRIP, PRIMITIVE_LINE_LOOP, PRIMITIVE_TRIANGLES, PRIMITIVE_TRIANGLE_STRIP, PRIMITIVE_TRIANGLE_FAN. (As a note, when using indices, it is recommended to only use just points, lines or triangles).
The format of a surface determines which arrays it will allocate and hold, so "format" is a combination of ARRAY_FORMAT_* mask constants ORed together. ARRAY_FORMAT_VERTEX must be always present. "array_len" determines the amount of vertices in the array (not primitives!). if ARRAY_FORMAT_INDEX is in the format mask, then it means that an index array will be allocated and "index_array_len" must be passed.
Return the amount of surfaces that the [Mesh] holds.
Remove a surface at position surf_idx, shifting greater surfaces one surf_idx slot down.
Return the length in vertices of the vertex array in the requested surface (see [method add_surface]).
Return the length in indices of the index array in the requested surface (see [method add_surface]).
Return the format mask of the requested surface (see [method add_surface]).
Return the primitive type of the requested surface (see [method add_surface]).
Set a [Material] for a given surface. Surface will be rendered using this material.
Return a [Material] in a given surface. Surface is rendered using this material.
Default value used for index_array_len when no indices are present.
Amount of weights/bone indices per vertex (always 4).
Vertex array (array of [Vector3] vertices).
Normal array (array of [Vector3] normals).
Tangent array, array of groups of 4 floats. first 3 floats determine the tangent, and the last the binormal direction as -1 or 1.
Vertex array (array of [Color] colors).
UV array (array of [Vector3] UVs or float array of groups of 2 floats (u,v)).
Second UV array (array of [Vector3] UVs or float array of groups of 2 floats (u,v)).
Array of bone indices, as a float array. Each element in groups of 4 floats.
Array of bone weights, as a float array. Each element in groups of 4 floats.
Array of integers, used as indices referencing vertices. No index can be beyond the vertex array size.
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.
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.
Node that instances meshes into a scenario.
MeshInstance is a [Node] that takes a [Mesh] 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 [Mesh] in many places. This allows to reuse geometry and save on resources. When a [Mesh] has to be instanced more than thousands of times at close proximity, consider using a [MultiMesh] in a [MultiMeshInstance] instead.
Set the [Mesh] resource for the instance.
Return the current [Mesh] resource for the instance.
Return the AABB of the mesh, in local coordinates.
This helper creates a [StaticBody] child [Node] using the mesh geometry as collision. It's mainly used for testing.
Library of meshes.
Library of meshes. Contains a list of [Mesh] resources, each with name and ID. Useful for GridMap or painting Terrain.
Create a new item in the library, supplied an id.
Set the name of the item.
Set the mesh of the item.
Return the name of the item.
Return the mesh of the item.
Remove the item.
Clear the library.
Return the list of items.
Get an unused id for a new item.
Provides high performance mesh instancing.
MultiMesh provides low level mesh instancing. If the amount of [Mesh] instances needed goes from hundreds to thousands (and most need to be visible at close proximity) creating such a large amount of [MeshInstance] nodes may affect performance by using too much CPU or video memory.
For this case a MultiMesh becomes very useful, as it can draw thousands of instances with little 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 rendered (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, or generated with [method generate_aabb].
Set the [Mesh] resource to be drawn in multiple instances.
Return the [Mesh] resource drawn as multiple instances.
Set the amount of instances that is going to be drawn. Changing this number will erase all the existing instance transform and color data.
Return the amount of instances that is going to be drawn.
Set the transform for a specific instance.
Return the transform of a specific instance.
Set the color of a specific instance.
Get the color of a specific instance.
Set the visibility AABB. If not provided, MultiMesh will not be visible.
Return the visibility AABB.
Generate a new visibility AABB, using mesh AABB and instance transforms. Since instance information is stored in the [VisualServer], this function is VERY SLOW and must NOT be used often.
Node that instances a [MultiMesh].
MultiMeshInstance is a [Node] that takes a [MultiMesh] resource and adds it to the current scenario by creating an instance of it (yes, this is an instance of instances).
Set the [MultiMesh] to be instance.
Return the [MultiMesh] that is used for instancing.
Base class for all the "Scene" elements.
Nodes can be set as children of other nodes, resulting in a tree arrangement. Any tree of nodes is called a "Scene".
Scenes can be saved to disk, and then instanced into other scenes. This allows for very high flexibility in the architecture and data model of the projects.
[SceneTree] contains the "active" tree of nodes, and a node becomes active (receiving NOTIFICATION_ENTER_SCENE) when added to that tree.
A node can contain any number of nodes as a children (but there is only one tree root) with the requirement that no two children with the same name can exist.
Nodes can, optionally, be added to groups. This makes it easy to reach a number of nodes from the code (for example an "enemies" group).
Nodes can be set to "process" state, so they constantly receive a callback requesting them to process (do anything). Normal processing ([method _process]) happens as fast as possible and is dependent on the frame rate, so the processing time delta is variable. Fixed processing ([method _fixed_process]) happens a fixed amount of times per second (by default 60) and is useful to link itself to the physics.
Nodes can also process input events. When set, the [method _input] function will be called with every input that the program receives. Since this is usually too overkill (unless used for simple projects), an [method _unhandled_input] function is called when the input was not handled by anyone else (usually, GUI [Control] nodes).
To keep track of the scene hierarchy (specially when instancing scenes into scenes) an "owner" can be set to a node. This keeps track of who instanced what. This is mostly useful when writing editors and tools, though.
Finally, when a node is freed, it will free all its children nodes too.
Called for fixed processing (synced to the physics).
Called when any input happens (also must enable with [method set_process_input] or the property).
Called for processing. This is called every frame, with the delta time from the previous frame.
Called when ready (entered scene and children entered too).
Called when any input happens that was not handled by something else (also must enable with [method set_process_unhandled_input] or the property).
Called when any key input happens that was not handled by something else.
Set the name of the [Node]. Name must be unique within parent, and setting an already existing name will cause for the node to be automatically renamed.
Return the name of the [Node]. Name is be unique within parent.
Add a child [Node]. Nodes can have as many children as they want, but every child must have a unique name. Children nodes are automatically deleted when the parent node is deleted, so deleting a whole scene is performed by deleting its topmost node.
The optional boolean argument enforces creating child node with human-readable names, based on the name of node being instanced instead of its type only.
Remove a child [Node]. Node is NOT deleted and will have to be deleted manually.
Return the amount of children nodes.
Return a children node by it's index (see [method get_child_count]). This method is often used for iterating all children of a node.
Fetch a node. NodePath must be valid (or else error will occur) and can be either the path to child node, a relative path (from the current node to another node), or an absolute path to a node.
Note: fetching absolute paths only works when the node is inside the scene tree (see [method is_inside_tree]). Examples. Assume your current node is Character and following tree:[br]
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")
Return the parent [Node] of the current [Node], or an empty Object if the node lacks a parent.
Find a descendant of this node whose name matches [code]mask[/code] as in [method String.match] (i.e. case sensitive, but '*' matches zero or more characters and '?' matches any single character except '.'). Note that it does not match against the full path, just against individual node names.
Return [i]true[/i] if the "node" argument is a direct or indirect child of the current node, otherwise return [i]false[/i].
Return [i]true[/i] if "node" occurs later in the scene hierarchy than the current node, otherwise return [i]false[/i].
Return the absolute path of the current node. This only works if the current node is inside the scene tree (see [method is_inside_tree]).
Return the relative path from the current node to the specified node in "node" argument. Both nodes must be in the same scene, or else the function will fail.
Add a node to a group. Groups are helpers to name and organize group of nodes, like for example: "Enemies", "Collectables", etc. A [Node] can be in any number of groups. Nodes can be assigned a group at any time, but will not be added to it until they are inside the scene tree (see [method is_inside_tree]).
Remove a node from a group.
Move a child node to a different position (order) amongst the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful.
Move this node to the top of the array of nodes of the parent node. This is often useful on GUIs ([Control]), because their order of drawing fully depends on their order in the tree.
Set the node owner. A node can have any other node as owner (as long as a valid parent, grandparent, etc ascending in the tree). When saving a node (using SceneSaver) all the nodes it owns will be saved with it. This allows to create complex SceneTrees, with instancing and subinstancing.
Get the node owner (see [method set_owner]).
Remove a node and set all its children as children of the parent node (if exists). All even subscriptions that pass by the removed node will be unsubscribed.
Get the node index in the parent (assuming it has a parent).
Print the scene to stdout. Used mainly for debugging purposes.
A node can contain a filename. This filename should not be changed by the user, unless writing editors and tools. When a scene is instanced from a file, it topmost node contains the filename from where it was loaded.
Return a filename that may be containedA node can contained by the node. When a scene is instanced from a file, it topmost node contains the filename from where it was loaded (see [method set_filename]).
Notify the current node and all its children recursively by calling notification() in all of them.
Enables or disables node fixed framerate processing. When a node is being processed, it will receive a NOTIFICATION_PROCESS at a fixed (usually 60 fps, check [OS] to change that) interval (and the [method _fixed_process] callback will be called if exists). It is common to check how much time was elapsed since the previous frame by calling [method get_fixed_process_delta_time].
Return the time elapsed since the last fixed frame. This is always the same in fixed processing unless the frames per second is changed in [OS].
Return true if fixed processing is enabled (see [method set_fixed_process]).
Enables or disables node processing. When a node is being processed, it will receive a NOTIFICATION_PROCESS on every drawn frame (and the [method _process] callback will be called if exists). It is common to check how much time was elapsed since the previous frame by calling [method get_process_delta_time].
Return the time elapsed (in seconds) since the last process callback. This is almost always different each time.
Return whether processing is enabled in the current node (see [method set_process]).
Enable input processing for node. This is not required for GUI controls! It hooks up the node to receive all input (see [method _input]).
Return true if the node is processing input (see [method set_process_input]).
Enable unhandled input processing for node. This is not required for GUI controls! It hooks up the node to receive all input that was not previously handled before (usually by a [Control]). (see [method _unhandled_input]).
Return true if the node is processing unhandled input (see [method set_process_unhandled_input]).
Return true if the node can process.
Replace a node in a scene by a given one. Subscriptions that pass through this node will be lost.
Emitted when the node is renamed.
Notification received every frame when the process flag is set (see [method set_process]).
Notification received when a node is set as a child of another node. Note that this doesn't mean that a node entered the Scene Tree.
Notification received when a node is unparented (parent removed it from the list of children).
Base node for 2D system.
Base node for 2D system. Node2D contains a position, rotation and scale, which is used to position and animate. It can alternatively be used with a custom 2D transform ([Matrix32]). A tree of Node2Ds allows complex hierarchies for animation and positioning.
Set the position of the 2D node.
Set the rotation of the 2D node.
Set the scale of the 2D node.
Return the position of the 2D node.
Return the rotation of the 2D node.
Return the scale of the 2D node.
Apply a 'radians' rotation to the 2D node, starting from its current rotation.
Apply a local translation on X axis to the 2D node according to the 'delta' of the process. If 'scaled' is false, the movement is normalized.
Apply a local translation on Y axis to the 2D node according to the 'delta' of the process. If 'scaled' is false, the movement is normalized.
Apply a local translation of 'offset' to the 2D node, starting from its current local position.
Apply a global translation of 'offset' to the 2D node, starting from its current global position.
Apply the 'ratio' scale to the 2D node, according to its current scale value.
Set the global position of the 2D node to 'pos'.
Return the global position of the 2D node.
Set the local transform [Matrix32] of the 2D node.
Set the global transform [Matrix32] of the 2D node.
Rotate the 2d node so it points at 'point' position.
Return the rotation angle needed for the 2d node to point at 'point' position.
Set the Z-index value of the 2D node.
Return the Z-index of the 2D node.
Set the Z-index value as relative to the parent node of this 2D node. Thus, if this 2D node's Z-index value is 2 and its parent's effective Z-index is 3, then the effective Z-index value of this 2D node would be 3 + 2 = 5.
Return true if the Z-index value of this 2D node is relative to its parent's. Else, return false.
Set the pivot position of the 2D node to 'pivot' value. This method is implemented only in some nodes that inherit Node2D.
Return the transform [Matrix32] calculated relatively to the parent of this 2D node.
Pre-parsed scene tree path.
A pre-parsed relative or absolute path in a scene tree, for use with [method Node.get_node] and similar functions. It can reference a node, a resource within a node, or a property of a node or resource. For instance, [code]"Path2D/PathFollow2D/Sprite:texture:size"[/code] would refer to the size property of the texture resource on the node named "Sprite" which is a child of the other named nodes in the path. Note that if you want to get a resource, you must end the path with a colon, otherwise the last element will be used as a property name.
You will usually just pass a string to [method Node.get_node] and it will be automatically converted, but you may occasionally want to parse a path ahead of time with [NodePath] or the literal syntax [code]@"path"[/code]. Exporting a [NodePath] variable will give you a node selection widget in the properties panel of the editor, which can often be useful.
A [NodePath] is made up of a list of node names, a list of "subnode" (resource) names, and the name of a property in the final node or resource.
Get the node name indicated by [code]idx[/code] (0 to [method get_name_count])
Get the number of node names which make up the path.
Get the path's property name, or an empty string if the path doesn't have a property.
Get the resource name indicated by [code]idx[/code] (0 to [method get_subname_count])
Get the number of resource names in the path.
Return true if the node path is absolute (not relative).
Return true if the node path is empty.
Create a NodePath from a string, e.g. "Path2D/PathFollow2D/Sprite:texture:size". A path is absolute if it starts with a slash. Absolute paths are only valid in the global scene tree, not within individual scenes. In a relative path, [code]"."[/code] and [code]".."[/code] indicate the current node and its parent.
Operating System functions.
Operating System functions. OS Wraps the most common functionality to communicate with the host Operating System, such as:
-Mouse Grabbing
-Mouse Cursors
-Clipboard
-Video Mode
-Date " Time
-Timers
-Environment Variables
-Execution of Binaries
-Command Line
Set clipboard to the OS.
Get clipboard from the host OS.
Change the video mode.
Return the current video mode size.
Return true if the current video mode is fullscreen.
Return true if the window is resizable.
Return the list of fullscreen modes.
Returns the number of displays attached to the host machine
Returns the current screen index (0 padded).
Returns the dimensions in pixels of the specified screen.
Returns 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.
Sets the position of the window to the specified position (this function could be restricted by the window manager, meaning that there could be some unreachable areas of the screen).
Returns the size of the window (without counting window manager decorations).
Sets the window size to the specified size.
Sets window fullscreen mode to the [i]enabled[/i] argument, [i]enabled[/i] is a toggle for the fullscreen mode, calling the function with [i]enabled[/i] true when the screen is not on fullscreen mode will cause the screen to go to fullscreen mode, calling the function with [i]enabled[/i] false when the screen is in fullscreen mode will cause the window to exit the fullscreen mode.
Returns whether the window is in fullscreen mode or not.
Set the window resizable state, if the window is not resizable it will preserve the dimensions specified in the project settings.
Returns whether the window is resizable or not.
Sets the current screen orientation, the argument value must be one of the SCREEN_ORIENTATION constants in this class.
Returns the current screen orientation, the return value will be one of the SCREEN_ORIENTATION constants in this class.
Set keep screen on if true, or goes to sleep by device setting if false. (for Android/iOS)
Returns whether the screen is being kept on or not.
Set the amount of fixed iterations per second (for fixed process and physics).
Return the amount of fixed iterations per second (for fixed process and physics).
Speeds up or slows down the physics by changing the delta variable. (delta * time_scale)
Sets the window title to the specified string.
Set to true to enable the low cpu usage mode. In this mode, the screen only redraws when there are changes, and a considerable sleep time is inserted between frames. This way, editors using the engine UI only use very little cpu.
Return true if low cpu usage mode is enabled.
Returns the number of cores available in the host machine.
Return the path to the current engine executable.
Execute the binary file in given path, optionally blocking until it returns. A process ID is returned.
Kill a process ID (this method can be used to kill processes that were not spawned by the game).
Returns the game process ID
Return an environment variable.
Return true if an environment variable exists.
Return the name of the host OS. Possible values are: "Android", "BlackBerry 10", "Flash", "Haiku", "iOS", "HTML5", "OSX", "Server", "Windows", "WinRT", "X11"
Return the commandline passed to the engine.
Return the main loop object (see [MainLoop]).
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
Get a dictionary of time values when given epoch time.
Dictionary Time values will be a union of values from [method get_time] and [method get_date] dictionaries (with the exception of dst = day light standard time, as it cannot be determined from epoch).
Get an epoch time value from a dictionary of time values.
[code]datetime[/code] must be populated with the following keys: year, month, day, hour, minute, second.
You can pass the output from [method get_datetime_from_unix_time] directly into this function. Daylight savings time (dst), if present, is ignored.
Delay executing of the current thread by given microseconds.
Delay executing of the current thread by given milliseconds.
Return the amount of time passed in milliseconds since the engine started.
Return the host OS locale.
Return true if the host OS allows drawing.
Return the total amount of frames drawn.
Return true if the engine was executed with -v (verbose stdout).
Return the max amount of static memory used (only works in debug).
Return the total amount of dynamic memory used (only works in debug).
Returns the frames per second of the running game.
Base class for all non built-in types.
Base class for all non built-in types. Everything not a built-in type starts the inheritance chain from this class.
Objects do not manage memory, if inheriting from one the object will most likely have to be deleted manually (call the [method free] function from the script or delete from C++).
Some derivates add memory management, such as [Reference] (which keeps a reference count and deletes itself automatically when no longer referenced) and [Node], which deletes the children tree when deleted.
Objects export properties, which are mainly useful for storage and editing, but not really so much in programming. Properties are exported in [method _get_property_list] and handled in [method _get] and [method _set]. However, scripting languages and C++ have simpler means to export them.
Objects also receive notifications ([method _notification]). Notifications are a simple way to notify the object about simple events, so they can all be handled together.
Return a property, return null if the property does not exist.
Return the property list, array of dictionaries, dictionaries must contain: name:String, type:int (see TYPE_* enum in globals) and optionally: hint:int (see PROPERTY_HINT_* in globals), hint_string:String, usage:int (see PROPERTY_USAGE_* in globals).
Notification request, the notification id is received.
Set a property. Return true if the property was found.
Return the type of the object as a string.
Check the type of the object against a string (including inheritance).
Set property into the object.
Get a property from the object.
Return the list of properties as an array of dictionaries, dictionaries contain: name:String, type:int (see TYPE_* enum in globals) and optionally: hint:int (see PROPERTY_HINT_* in globals), hint_string:String, usage:int (see PROPERTY_USAGE_* in globals).
Notify the object of something.
Return the instance ID. All objects have a unique instance ID.
Set a script into the object, scripts extend the object functionality.
Return the object script (or null if it doesn't have one).
Set a metadata into the object. Metadata is serialized. Metadata can be [i]anything[/i].
Return a metadata from the object.
Return true if a metadata is found with the requested name.
Return the list of metadata in the object.
Add a user signal (can be added anytime). Arguments are optional, but can be added as an array of dictionaries, each containing "name" and "type" (from [@Global Scope] TYPE_*).
Emit a signal. Arguments are passed in an array.
Call a function in the object, result is returned.
Create and store a function in the object. The call will take place on idle time.
Return the list of signals as an array of dictionaries.
Connect a signal to a method at a target (member function). Binds are optional and are passed as extra arguments to the call. Flags specify optional deferred or one shot connections, see enum CONNECT_*. A signal can only be connected once to a method, and it will throw an error if already connected. If you want to avoid this, use [method is_connected] to check.
Disconnect a signal from a method.
Return true if a connection exists for a given signal and target/method.
If set to true, signal emission is blocked.
Return true if signal emission blocking is enabled.
Set true if this object can translate strings (in calls to tr() ). Default is true.
Return true if this object can translate strings.
Deprecated, will go away.
Translate a message. Only works in message translation is enabled (which is by default). See [method set_message_translation].
Called right when the object is initialized. Not available in script.
Called before the object is about to be deleted.
Connect 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 short connections disconnect themselves after emission.
OmniDirectional Light, such as a light bulb or a candle.
An OmniDirectional light is a type of [Light] node that emits lights in all directions. The light is attenuated through the distance and this attenuation can be configured by changing the energy, radius and attenuation parameters of [Light]. TODO: Image of an omnilight.
Button control that provides selectable options when pressed.
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.
Add an item, with text "label" and (optionally) id. If no "id" is passed, "id" becomes the item index. New items are appended at the end.
Add an item, with a "texture" icon, text "label" and (optionally) id. If no "id" is passed, "id" becomes the item index. New items are appended at the end.
Set the text of an item at index "idx".
Set the icon of an item at index "idx".
Set the ID of an item at index "idx".
Return the text of the item at index "idx".
Return the icon of the item at index "idx".
Return the ID of the item at index "idx".
Return the amount of items in the OptionButton.
Add a separator to the list of items. Separators help to group items. Separator also takes up an index and is appended at the end.
Clear all the items in the [OptionButton].
Select an item by index and make it the current item.
Return the current item index
This signal is emitted when the current item was changed by the user. ID of the item selected is passed as argument (if no IDs were added, ID will be just the item index).
Optimized translation.
Optimized translation. Uses real-time compressed translations, which results in very small dictionaries.
TODO: explain ownership, and that node does not need to own itself
Pack will ignore any sub-nodes not owned by given node. See [method Node.set_owner].
Abstraction and base class for packet-based protocols.
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.
Wrapper to use a PacketPeer over a StreamPeer.
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.
Set the StreamPeer object to be wrapped
Provides an opaque background for [Control] children.
Panel is a [Control] that displays an opaque background. It's commonly used as a parent and container for other types of [Control] nodes.
Panel container type.
Panel container type. This container fits controls inside of the delimited area of a stylebox. It's useful for giving controls an outline.
Particle system 3D Node
Particles is a particle system 3D [Node] that is used to simulate several types of particle effects, such as explosions, rain, snow, fireflies, or other magical-like shinny sparkles. Particles are drawn using impostors, and given their dynamic behavior, the user must provide a visibility AABB (although helpers to create one automatically exist).
Set total amount of particles in the system.
Return the total amount of particles in the system.
Set the "emitting" property state. When emitting, the particle system generates new particles at constant rate.
Return the "emitting" property state (see [method set_emitting]).
Set the visibility AABB for the particle system, since the default one will not work properly most of the time.
Return the current visibility AABB.
Set the half extents for the emission box.
Return the half extents for the emission box.
Set the normal vector towards where gravity is pulling (by default, negative Y).
Return the normal vector towards where gravity is pulling (by default, negative Y).
Set a specific variable for the particle system (see VAR_* enum).
Return a specific variable for the particle system (see VAR_* enum).
Set the randomness for a specific variable of the particle system. Randomness produces small changes from the default each time a particle is emitted.
Return the randomness for a specific variable of the particle system. Randomness produces small changes from the default each time a particle is emitted.
Set the position of a color phase (0 to 1).
Return the position of a color phase (0 to 1).
Set the color of a color phase.
Return the color of a color phase.
Set the material used to draw particles.
Return the material used to draw particles.
2D Particle emitter
Particles2D is a particle system 2D [Node] that is used to simulate several types of particle effects, such as explosions, rain, snow, fireflies, or other magical-like shinny sparkles. Particles are drawn using impostors, and given their dynamic behavior, the user must provide a visibility AABB (although helpers to create one automatically exist).
If this is set to true then the particle emitter will emit particles, if its false it will not.
Returns whether this emitter is currently emitting or not
Sets the amount of particles spawned at each emission
Returns the amount of particles spawned at each emission
Sets the amount of seconds that each particle will be visible.
Gets the amount of seconds that each particle will be visible.
Sets the increment or decrement for the particle lifetime. for example: if the time scale is set to 2, the particles will die and move twice as fast.
Returns the emitter time scale
Sets the amount of seconds during which the emitter will spawn particles, after the specified seconds the emitter state will be set to non emitting, so calling [method is_emitting] will return false. If the timeout is 0 the emitter will spawn forever.
Returns the amount of seconds during which the emitter will spawn particles
Sets the value of the specified emitter parameter (see the constants secction for the list of parameters)
Returns the value of the specified emitter parameter
Sets the randomness value of the specified emitter parameter (see the constants secction for the list of parameters), 0 means no randomness, so every particle will have the parameters specified, 1 means that the parameter will be choosen at random, the closer the randomness value gets to 0 the more conservative the variation of the parameter will be.
Returns the randomness value of the specified emitter parameter
Sets the texture for each particle
Returns the texture for emitted particles
Set the tint color for each particle.
Returns the tint color for each particle.
Sets the [ColorRamp] used to tint each particle. Particle will be tinted according to their lifetimes.
Returns the [ColorRamp] used to tint each particle
Sets the particle spawn origin position relative to the emitter center. for example if this value is set to (50, 50), the particle will spawn 50 units to the right and 50 units to the bottom of the emitter center.
Returns the particle spawn origin position relative to the emitter.
Sets the half extents of the emission box, particles will be spawned at random inside this box.
Returns the half extents of the emission box.
Direction in degrees at which the particles will be launched, Notice that when the direction is set to 0 the particles will be launched to the negative
Velocity at which the particles will be launched.
The speed at which particles will spin around its own center.
Velocity at which the particles will orbit around the emitter center
Direction in degrees at which the particles will be attracted
Strength of the gravitation attraction for each particle
Amount of damping for each particle
Initial angle at which each particle will be spawned
Initial size of each particle
Final size of each particle, the particle size will interpolate to this value during its lifetime.
Container for a [Curve3D].
This class is a container/Node-ification of a [Curve3D], so it can have [Spatial] properties and [Node] info.
Sets the [Curve3D].
Returns the [Curve3D] contained.
Container for a [Curve2D].
This class is a container/Node-ification of a [Curve2D], so it can have [Node2D] properties and [Node] info.
Sets the [Curve2D].
Returns the [Curve2D] contained.
Point sampler for a [Path].
This node takes its parent [Path], 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 descendants of this node. Then, when setting an offset in this node, the descendant nodes will move accordingly.
Sets 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.
Returns the distance along the path in 3D units.
Moves this node in the X axis. As this node's position will be set every time its offset is set, this allows many PathFollow to share the same curve (and thus the same movement pattern), yet not return the same position for a given path offset.
A similar effect may be achieved moving the this node's descendants.
Returns the X displacement this node has from its parent [Path].
Moves this node in the Y axis, for the same reasons of [method set_h_offset].
Returns the Y displacement this node has from its parent [Path].
Sets 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.
Returns the distance along the path as a number in the range 0.0 (for the first vertex) to 1.0 (for the last).
Allows or forbids rotation on one or more axes, per the constants below.
Returns the rotation mode. The constants below list which axes are allowed to rotate for each mode.
The points along the [Curve3D] of the [Path] 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.
This method controls whether the position between two cached points is interpolated linearly, or cubicly.
This method returns whether the position between two cached points (see [method set_cubic_interpolation]) is interpolated linearly, or cubicly.
If set, any offset outside the path's length (whether set by [method set_offset] or [method set_unit_offset] will wrap around, instead of stopping at the ends. Set it for cyclic paths.
Returns whether this node wraps its offsets around, or truncates them to the path ends.
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.
Point sampler for a [Path2D].
This node takes its parent [Path2D], 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 descendants of this node. Then, when setting an offset in this node, the descendant nodes will move accordingly.
Sets the distance from the first vertex, measured in pixels along the path. This sets this node's position to a point within the path.
Returns the distance along the path in pixels.
Moves this node horizontally. As this node's position will be set every time its offset is set, this allows many PathFollow2D to share the same curve (and thus the same movement pattern), yet not return the same position for a given path offset.
A similar effect may be achieved moving this node's descendants.
Returns the horizontal displacement this node has from its parent [Path2D].
Moves the PathFollow2D vertically, for the same reasons of [method set_h_offset].
Returns the vertical displacement this node has from its parent [Path2D].
Sets 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.
Returns the distance along the path as a number in the range 0.0 (for the first vertex) to 1.0 (for the last).
If set, this node rotates to follow the path, making its descendants rotate.
Returns whether this node rotates to follow the path.
The points along the [Curve2D] of the [Path2D] 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.
This method controls whether the position between two cached points is interpolated linearly, or cubicly.
This method returns whether the position between two cached points (see [method set_cubic_interpolation]) is interpolated linearly, or cubicly.
If set, any offset outside the path's length (whether set by [method set_offset] or [method set_unit_offset] will wrap around, instead of stopping at the ends. Set it for cyclic paths.
Returns whether this node wraps its offsets around, or truncates them to the path ends.
Singleton containing the list of remapped resources.
When exporting, the types of some resources may change internally so they are converted to more optimized versions. While it's not usually necessary to access to this directly (path remapping happens automatically when opening a file), it's exported just for information.
Add a remap from a file to another.
Return true if a file is being remapped.
Return the remapped new path of a file.
Erase a remap.
Clear all remaps.
Direct access object to a physics body in the [Physics2DServer].
Direct access object to a physics body in the [Physics2DServer]. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body.
Return the total gravity vector being currently applied to this body.
Return the inverse of the mass of the body.
Return the inverse of the inertia of the body.
Change the linear velocity of the body.
Return the current linear velocity of the body.
Change the angular velocity of the body.
Return the angular velocity of the body.
Change the transform matrix of the body.
Return the transform matrix of the body.
Set the sleeping state of the body, only affects character/rigid bodies.
Return true if this body is currently sleeping (not active).
Return the amount of contacts this body has with other bodies. Note that by default this returns 0 unless bodies are configured to log contacts.
Return the local position (of this body) of the contact point.
Return the local shape index of the collision.
Return the RID of the collider.
Return the contact position in the collider.
Return the object id of the collider.
Return the collider object, this depends on how it was created (will return a scene node if such was used to create it).
Return the collider shape index.
Return the linear velocity vector at contact point of the collider.
Return the timestep (delta) used for the simulation.
Call the built-in force integration code.
Return the current state of space, useful for queries.
Direct access object to a space in the [Physics2DServer].
Direct access object to a space in the [Physics2DServer]. It's used mainly to do queries against objects and areas residing in a given space.
Intersect a ray in a given space, the returned object is a dictionary with the following fields:
position: place where ray is stopped.
normal: normal of the object at the point where the ray was stopped.
shape: shape index of the object against which the ray was stopped.
collider_: collider against which the ray was stopped.
collider_id: collider id of the object against which the ray was stopped.
collider: collider object against which the ray was stopped.
rid: [RID] of the object against which the ray was stopped.
If the ray did not intersect anything, then an empty dictionary (dir.empty()==true) is returned instead.
Intersect a given shape (RID or [Shape2D]) against the space, the intersected shapes are returned in a special result object.
Physics 2D Server.
Physics 2D Server is the server responsible for all 2D physics.
Add a positioned force to the applied force and torque. As with [method body_apply_impulse], both the force and the offset from the body origin are in global coordinates.
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.
Base class for different types of Physics bodies.
PhysicsBody is an abstract base class for implementing a physics body. All PhysicsBody types inherit from it.
Base class for all objects affected by physics.
PhysicsBody2D is an abstract base class for implementing a physics body. All *Body2D types inherit from it.
Set the physics layers this area is in.
Collidable objects can exist in any of 32 different layers. These layers are not visual, but more of a tagging system instead. A collidable can use these layers/tags to select with which objects it can collide, using [method set_collision_mask].
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.
Return the physics layer this area is in.
Set the physics layers this area can scan for collisions.
Return the physics layers this area can scan for collisions.
Set/clear individual bits on the collision mask. This makes selecting the areas scanned easier.
Return an individual bit on the collision mask.
Set/clear individual bits on the layer mask. This makes getting a body in/out of only one layer easier.
Return an individual bit on the collision mask.
Set a direction in which bodies can go through this one. If this value is different from (0,0), any movement within 90 degrees of this vector is considered a valid movement. Set this direction to (0,0) to disable one-way collisions.
Return the direction used for one-way collision detection.
Set how far a body can go through this one, when it allows one-way collisions (see [method set_one_way_collision_direction]).
Return how far a body can go through this one, when it allows one-way collisions.
Adds a body to the collision exception list. This list contains bodies that this body will not collide with.
Removes a body from the collision exception list.
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.
Result of a shape query in Physics2DServer.
Pin Joint for 2D Shapes.
Pin Joint for 2D Rigid Bodies. It pins 2 bodies (rigid or static) together, or a single body to a fixed position in space.
Plane in hessian form.
Plane represents a normalized plane equation. Basically, "normal" is the normal of the plane (a,b,c normalized), and "d" is the distance from the origin to the plane (in the direction of "normal"). "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing.
Returns the center of the plane.
Returns the shortest distance from the plane to the position "point".
Returns a point on the plane.
Returns true if "point" is inside the plane (by a very minimum threshold).
Returns the intersection point of the three planes "b", "c" and this plane. If no intersection is found null is returned.
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.
Returns the intersection point of a segment from position "begin" to position "end" with this plane. If no intersection is found null is returned.
Returns true if "point" is located above the plane.
Returns a copy of the plane, normalized.
Returns the orthogonal projection of point "p" into a point in the plane.
Creates a plane from the three parameters "a", "b", "c" and "d".
Creates a plane from three points.
Creates a plane from the normal and the plane's distance to the origin.
2D polygon representation
A Polygon2D is defined by a set of n points connected together by line segments, meaning that the point 1 will be connected with point 2, point 2 with point 3 ..., point n-1 with point n and point n with point 1 in order to close the loop and define a plane.
Defines the set of points that will represent the polygon.
Returns the set of points that defines this polygon
Sets the uv value for every point of the polygon
Returns the uv value associated with every point of the polygon
Sets the polygon fill color, if the polygon has a texture defined, the defined texture will be tinted to the polygon fill color.
Returns the polygon fill color
Sets the polygon texture.
Returns the polygon texture
Sets the offset of the polygon texture. Initially the texture will appear anchored to the polygon position, the offset is used to move the texture location away from that point (notice that the texture origin is set to its top left corner, so when offset is 0,0 the top left corner of the texture is at the polygon position), for example setting the offset to 10, 10 will move the texture 10 units to the left and 10 units to the top.
Returns the polygon texture offset
Sets the amount of rotation of the polygon texture, [code]texture_rotation[/code] is specified in degrees and clockwise rotation, meaning that if the texture rotation is set to 45 degrees, the texture will be rotated 45 degrees clockwise along the polygon position plus the texture offset.
Returns the rotation in degrees of the texture polygon
Sets the polygon as the defined polygon bounding box minus the defined polygon (the defined polygon will appear as a hole on square that contains the defined polygon).
Returns whether this polygon is inverted or not
Sets the amount of distance from the polygon points from the polygon position, for example if the offset is set to 10,10 then all the polygon points will move 10 units to the right and 10 units to the bottom.
Returns the polygon points offset to the polygon position.
Base container control for popups and dialogs.
Popup is a base [Control] used to show dialogs and popups. It's a subwindow and modal by default (see [Control]) and has helpers for custom popup behavior.
Popup (show the control in modal form) in the center of the screen, at the current size, or at a size determined by "size".
Popup (show the control in modal form) in the center of the screen, scaled at a ratio of size of the screen.
Popup (show the control in modal form) in the center of the screen, ensuring the size is never smaller than [code]minsize[/code].
Popup (show the control in modal form).
Make the popup hide other popups when shown on the screen.
Returns whether the popup will hide other popups when shown on the screen.
This signal is emitted when a popup is hidden.
This signal is emitted when a popup is about to be shown. (often used in [PopupMenu] for clearing the list of options and creating a new one according to the current context).
Notification sent right after the popup is shown.
Notification sent right after the popup is hidden.
Base class for Popup Dialogs.
PopupDialog is a base class for popup dialogs, along with [WindowDialog].
PopupMenu displays a list of options.
PopupMenu is the typical Control that displays a list of options. They are popular in toolbars or context menus.
Add a new item with text "label" and icon "texture". An id can optionally be provided, as well as an accelerator keybinding. If no id is provided, one will be created from the index.
Add a new item with text "label". An id can optionally be provided, as well as an accelerator keybinding. If no id is provided, one will be created from the index.
Add a new checkable item with text "label" and icon "texture". An id can optionally be provided, as well as an accelerator. If no id is provided, one will be created from the index. Note that checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually.
Add a new checkable item with text "label". An id can optionally be provided, as well as an accelerator. If no id is provided, one will be created from the index. Note that checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually.
Adds an item with a submenu. The submenu is the name of a child PopupMenu node that would be shown when the item is clicked. An id can optionally be provided, but if is isn't provided, one will be created from the index.
Set the text of the item at index "idx".
Set the icon of the item at index "idx".
Set 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 might be of any type. You can later get it with [method get_item_metadata], which provides a simple way of assigning context data to items.
Set the checkstate status of the item at index "idx".
Sets whether the item at index "idx" is disabled or not. When it is disabled it can't be selected, or its action invoked.
Sets the submenu of the item at index "idx". The submenu is the name of a child PopupMenu node that would be shown when the item is clicked.
Mark the item at index "idx" as a seperator, which means that it would be displayed as a mere line.
Set whether the item at index "idx" has a checkbox. Note that checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually.
Set the id of the item at index "idx".
Return the text of the item at index "idx".
Return the icon of the item at index "idx".
Return the metadata of an item, which might be of any type. You can set it with [method set_item_metadata], which provides a simple way of assigning context data to items.
Return the accelerator of the item at index "idx". Accelerators are special combinations of keys that activate the item, no matter which control is focused.
Return the submenu name of the item at index "idx".
Return whether the item is a seperator. If it is, it would be displayed as a line.
Return whether the item at index "idx" has a checkbox. Note that checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually.
Return the checkstate status of the item at index "idx".
Return whether the item at index "idx" is disabled. When it is disabled it can't be selected, or its action invoked.
Return the id of the item at index "idx".
Find and return the index of the item containing a given id.
Return the amount of items.
Add a separator between items. Separators also occupy an index.
Removes the item at index "idx" from the menu. Note that the indexes of items after the removed item are going to be shifted by one.
Clear the popup menu, in effect removing all items.
This even is emitted when an item is pressed or its accelerator is activated. The id of the item is returned if it exists, else the index.
Class for displaying popups with a panel background.
Class for displaying popups with a panel background. In some cases it might be simpler to use than [Popup], since it provides a configurable background. If you are making windows, better check [WindowDialog].
Portals provide virtual openings to rooms.
Portals provide virtual openings to [VisualInstance] nodes, so cameras can look at them from the outside. Note that portals are a visibility optimization technique, and are in no way related to the game of the same name (as in, they are not used for teleportation). For more information on how rooms and portals work, see [VisualInstance]. Portals are represented as 2D convex polygon shapes (in the X,Y local plane), and are placed on the surface of the areas occupied by a [VisualInstance], to indicate that the room can be accessed or looked-at through them. If two rooms are next to each other, and two similar portals in each of them share the same world position (and are parallel and opposed to each other), they will automatically "connect" and form "doors" (for example, the portals that connect a kitchen to a living room are placed in the door they share). Portals must always have a [VisualInstance] node as a parent, grandparent or far parent, or else they will not be active.
Set the portal shape. The shape is an array of [Vector2] points, representing a convex polygon in the X,Y plane.
Return the portal shape. The shape is an array of [Vector2] points, representing a convex polygon in the X,Y plane.
Enable the portal (it is enabled by default though), disabling it will cause the parent [VisualInstance] to not be visible any longer when looking through the portal.
Return whether the portal is active. When disabled it causes the parent [VisualInstance] to not be visible any longer when looking through the portal.
Set the distance threshold for disabling the portal. Every time that the portal goes beyond "distance", it disables itself, becoming the opaque color (see [method set_disabled_color]).
Return the distance threshold for disabling the portal. Every time that the portal goes beyond "distance", it disables itself, becoming the opaque color (see [method set_disabled_color]).
When the portal goes beyond the disable distance (see [method set_disable_distance]), it becomes opaque and displayed with color "color".
Return the color for when the portal goes beyond the disable distance (see [method set_disable_distance]) and becomes disabled.
Set the range for auto-connecting two portals from different rooms sharing the same space.
Return the range for auto-connecting two portals from different rooms sharing the same space.
Generic 2D Position hint for editing.
Generic 2D Position hint for editing. It's just like a plain [Node2D] but displays as a cross in the 2D-Editor at all times.
Generic 3D Position hint for editing
Generic 3D Position hint for editing. It's just like a plain [Spatial] but displays as a cross in the 3D-Editor at all times.
General purpose progress bar.
General purpose progress bar. Shows fill percentage from right to left.
General purpose proximity-detection node.
General purpose proximity-detection node.
Quaternion.
Quaternion is a 4 dimensional vector that is used to represent a rotation. It mainly exists to perform SLERP (spherical-linear interpolation) between to rotations obtained by a Matrix3 cheaply. Adding quaternions also cheaply adds the rotations, however quaternions need to be often normalized, or else they suffer from precision issues.
Returns the dot product between two quaternions.
Returns the inverse of the quaternion (applies to the inverse rotation too).
Returns the length of the quaternion.
Returns the length of the quaternion, squared.
Returns a copy of the quaternion, normalized to unit length.
Perform a spherical-linear interpolation with another quaternion.
Abstract base class for range-based controls.
Range is a base class for [Control] nodes that change a floating point [i]value[/i] between a [i]minimum[/i] and a [i]maximum[/i], using [i]step[/i] and [i]page[/i], for example a [ScrollBar].
Return the current value.
Return the minimum value.
Return the maximum value.
Return the stepping, if step is 0, stepping is disabled.
Return the page size, if page is 0, paging is disabled.
Return value mapped to 0 to 1 (unit) range.
Set minimum value, clamped range value to it if it's less.
Set step value. If step is 0, stepping will be disabled.
Set page size. Page is mainly used for scrollbars or anything that controls text scrolling.
Set value mapped to 0 to 1 (unit) range, it will then be converted to the actual value within min and max.
This signal is emitted when value changes.
This signal is emitted when min, max, range or step change.
Raw byte array.
Raw byte array. Contains bytes. Optimized for memory usage, can't fragment the memory.
Returns a copy of the array's contents formatted as String. Fast alternative to get_string_from_utf8(), assuming the content is ASCII-only (unlike the UTF-8 function, this function maps every byte to a character in the string, so any multibyte sequence will be torn apart).
Returns a copy of the array's contents formatted as String, assuming the array is formatted as UTF-8. Slower than get_string_from_ascii(), but works for UTF-8. Usually you should prefer this function over get_string_from_ascii() to support international input.
Query the closest object intersecting a ray
A RayCast2D represents a line from its origin to its destination position [code]cast_to[/code], it is used to query the 2D space in order to find the closest object intersecting with the ray.
Enables the RayCast2D. Only enabled raycasts will be able to query the space and report collisions.
Returns whether this raycast is enabled or not
Sets the ray destination point, so that the ray will test from the ray's origin to [code]local_point[/code]
Return the destination point of this ray object
Return whether the closest object the ray is pointing to is colliding with the vector (considering the vector length).
Return the closest object the ray is pointing to. Note that this does not consider the length of the vector, so you must also use [method is_colliding] to check if the object returned is actually colliding with the ray.
Returns the collision shape of the closest object the ray is pointing to.
Returns the collision point in which the ray intersects the closest object.
Returns the normal of the intersecting object shape face containing the collision point.
Adds a collision exception so the ray does not report collisions with the specified [code]node[/code].
Removes a collision exception so the ray does report collisions with the specified [code]node[/code].
Removes all collision exception for this ray.
Returns the layer mask for this ray.
Ray 2D shape resource for physics.
Ray 2D shape resource for physics. 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.
Set the length of the ray.
Return the length of the ray.
Real Array .
Real Array. Array of floating point values. Can only contain floats. Optimized for memory usage, can't fragment the memory.
2D Axis-aligned bounding box.
Rect2 provides an 2D Axis-Aligned Bounding Box. It consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
Returns the intersection of this [Rect2] and b.
Returns true if this [Rect2] completely encloses another one.
Return this [Rect2] expanded to include a given point.
Get the area of the [Rect2].
Return a copy of the [Rect2] grown a given amount of units towards all the sides.
Return true if the [Rect2] is flat or empty.
Return true if the [Rect2] contains a point.
Return true if the [Rect2] overlaps with another.
Combine this [Rect2] with another, a larger one is returned that contains both.
Construct a [Rect2] by position and size.
Construct a [Rect2] by x, y, width and height.
Rectangle Shape for 2D Physics.
Rectangle Shape for 2D Physics. This shape is useful for modeling box-like 2D objects.
Set the half extents, the actual width and height of this shape is twice the half extents.
Return the half extents, the actual width and height of this shape is twice the half extents.
Base class for anything that keeps a reference count.
Base class for anything that keeps a reference count. Resource and many other helper objects inherit this. References keep an internal reference counter so they are only released when no longer in use.
Increase the internal reference counter. Use this only if you really know what you are doing.
Decrease the internal reference counter. Use this only if you really know what you are doing.
Reference frame for GUI.
Reference frame for GUI. It's just like an empty control, except a red box is displayed while editing around its size at all times.
Simple regular expression matcher.
Class for finding text patterns in a string using regular expressions. Regular expressions are a way to define patterns of text to be searched.
This class only finds patterns in a string. It can not perform replacements.
Usage of regular expressions is too long to be explained here, but Internet is full of tutorials and detailed explanations.
Currently supported features:
Capturing [code]()[/code] and non-capturing [code](?:)[/code] groups
Any character [code].[/code]
Shorthand character classes [code]\w \W \s \S \d \D[/code]
User-defined character classes such as [code][A-Za-z][/code]
Simple quantifiers [code]?[/code], [code]*[/code] and [code]+[/code]
Range quantifiers [code]{x,y}[/code]
Lazy (non-greedy) quantifiers [code]*?[/code]
Beginning [code]^[/code] and end [code]$[/code] anchors
Alternation [code]|[/code]
Backreferences [code]\1[/code] and [code]\g{1}[/code]
POSIX character classes [code][[:alnum:]][/code]
Lookahead [code](?=)[/code], [code](?!)[/code] and lookbehind [code](?<=)[/code], [code](?<!)[/code]
ASCII [code]\xFF[/code] and Unicode [code]\uFFFF[/code] code points (in a style similar to Python)
Word boundaries [code]\b[/code], [code]\B[/code]
Compiles and assign the regular expression pattern to use. The limit on the number of capturing groups can be specified or made unlimited if negative.
This method tries to find the pattern within the string, and returns the position where it was found. It also stores any capturing group (see [method get_capture]) for further retrieval.
This method resets the state of the object, as it was freshly created. Namely, it unassigns the regular expression of this object, and forgets all captures made by the last [method find].
Returns whether this object has a valid regular expression assigned.
Returns the number of capturing groups. A captured group is the part of a string that matches a part of the pattern delimited by parentheses (unless they are non-capturing parentheses [i](?:)[/i]).
Returns a captured group. A captured group is the part of a string that matches a part of the pattern delimited by parentheses (unless they are non-capturing parentheses [i](?:)[/i]).
Return a list of all the captures made by the regular expression.
Base class for all resources.
Resource is the base class for all resource types. Resources are primarily data containers. They are reference counted and freed when no longer in use. They are also loaded only once from disk, and further attempts to load the resource will return the same reference (all this in contrast to a [Node], 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 [Node] or another resource.
Set the path of the resource. This is useful mainly for editors when saving/loading, and shouldn't be changed by anything else.
Return the path of the resource. This is useful mainly for editors when saving/loading, and shouldn't be changed by anything else.
Set the name of the resources, any name is valid (it doesn't have to be unique). Name is for descriptive purposes only.
Return the name of the resources, any name is valid (it doesn't have to be unique). Name is for descriptive purposes only.
Return the RID of the resource (or an empty RID). Many resources (such as [Texture], [Mesh], etc) are high level abstractions of resources stored in a server, so this function will return the original RID.
Interactive Resource Loader.
Interactive Resource Loader. This object is returned by ResourceLoader when performing an interactive load. It allows to load with high granularity, so this is mainly useful for displaying load bars/percentages.
Return the loaded resource (only if loaded). Otherwise, returns null.
Poll the load. If OK is returned, this means poll will have to be called again. If ERR_EOF is returned, them the load has finished and the resource can be obtained by calling [method get_resource].
Return the load stage. The total amount of stages can be queried with [method get_stage_count]
Return the total amount of stages (calls to [method poll]) needed to completely load this resource.
Resource Loader.
Resource Loader. This is a static object accessible as [ResourceLoader]. GDScript has a simplified load() function, though.
Load a resource interactively, the returned object allows to load with high granularity.
Return the list of recognized extensions for a resource type.
Change the behavior on missing sub-resources. Default is to abort load.
Resource Preloader Node.
Resource Preloader Node. 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 be retrieved from here.
Add a resource to the preloader. Set the text-id that will be used to identify it (retrieve it/erase it/etc).
Remove a resource from the preloader by text id.
Rename a resource inside the preloader, from a text-id to a new text-id.
Return true if the preloader has a given resource.
Return the resource given a text-id.
Return the list of resources inside the preloader.
Resource Saving Interface.
Resource Saving Interface. This interface is used for saving resources to disk.
Save a resource to disk, to a given path.
Return the list of extensions available for saving a resource of a given type.
Label that displays rich text.
Label that displays rich text. Rich text can contain custom text, fonts, images and some basic formatting. It also adapts itself to given width/heights.
Set to true if selecting the text inside this richtext is allowed.
Return true if selecting the text inside this richtext is allowed.
Rigid body 2D node.
Rigid body 2D node. This node is used for placing rigid bodies in the scene. It can contain a number of shapes, and also shift state between regular Rigid body, Kinematic, Character or Static.
Character mode forbids the node from being rotated. This node can have a custom force integrator function, for writing complex physics motion behavior per node.
As a warning, don't change this node 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 will yield strange behavior.
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 [method set_use_custom_integrator] allows you to disable the default behavior and do fully custom force integration for a body.
Set the body mode, from the MODE_* enum. This allows to change to a static body or a character body.
Return the current body mode, see [method set_mode].
Set the body mass.
Return the body mass.
Return the body's moment of inertia. This is usually automatically computed from the mass and the shapes. Note that this doesn't seem to work in a [code]_ready[/code] function: it apparently has not been auto-computed yet.
Set 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 (or negative) inertia to return to automatically computing it.
Set the body weight given standard earth-weight (gravity 9.8). Not really useful for 2D since most measures for this node are in pixels.
Return the body weight given standard earth-weight (gravity 9.8).
Set the body friction, from 0 (frictionless) to 1 (full friction).
Return the body friction.
Set the body bounciness, from 0 (no bounce) to 1 (full bounce).
Return the body bounciness.
Set The gravity factor. This factor multiplies gravity intensity just for this body.
Return the gravity factor.
Set the linear damp for this body. If this value is different from -1, any linear damp derived from the world or areas will be overridden.
Return the linear damp for this body.
Set the angular damp for this body. If this value is different from -1, any angular damp derived from the world or areas will be overridden.
Return the angular damp for this body.
Set the body linear velocity. Can be used sporadically, but [b]DON'T SET THIS IN EVERY FRAME[/b], because physics may be running in another thread and definitely runs at a different granularity. Use [method _integrate_forces] as your process loop if you want to have precise control of the body state.
Return the body linear velocity. This changes by physics granularity. See [method set_linear_velocity].
Set the body angular velocity. Can be used sporadically, but [b]DON'T SET THIS IN EVERY FRAME[/b], because physics may be running in another thread and definitely runs at a different granularity. Use [method _integrate_forces] as your process loop if you want to have precise control of the body state.
Return the body angular velocity. This changes by physics granularity. See [method set_angular_velocity].
Set 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.
Return the maximum contacts that can be reported. See [method set_max_contacts_reported].
Pass true to disable the internal force integration (like gravity or air friction) for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] function, if defined.
Return true if the body is not doing any built-in force integration.
Enable contact monitoring. This allows the body to emit signals when it collides with another.
Return whether contact monitoring is enabled.
Set the continuous collision detection mode from the enum CCD_MODE_*.
Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. The first is more precise, and misses less impacts by small, fast-moving objects. The second is faster to compute, but can miss small, fat-moving objects.
Return whether this body is using continuous collision detection.
Set an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior.
Apply a positioned impulse (which will be affected by the body mass and shape). This is the equivalent of hitting a billiard ball with a cue: a force that is applied once, and only once. Both the impulse and the offset from the body origin are in global coordinates.
Set the applied force vector. This is the equivalent of pushing a box over the ground: the force applied is applied constantly.
Return the applied force vector.
Set a constant torque which will be applied to this body.
Return the torque which is being applied to this body.
Add a positioned force to the applied force and torque. As with [method apply_impulse], both the force and the offset from the body origin are in global coordinates.
Set whether a body is sleeping or not. Sleeping bodies are not affected by forces until a collision or an [method apply_impulse] / [method set_applied_force] wakes them up. Until then, they behave like a static body.
Return whether the body is sleeping.
Set the body ability to fall asleep when not moving. This saves an enormous amount of processor time when there are plenty of rigid bodies (non static) in a scene.
Sleeping bodies are not affected by forces until a collision or an [method apply_impulse] / [method set_applied_force] wakes them up. Until then, they behave like a static body.
Return true if the body has the ability to fall asleep when not moving. See [method set_can_sleep].
Return whether the body would collide, if it tried to move in the given vector. This method allows two extra parameters: A margin, which increases slightly the size of the shapes involved in the collision detection, and an object of type [Physics2DTestMotionResult], which will store additional information about the collision (should there be one).
Return a list of the bodies colliding with this one.
Emitted when a body enters into contact with this one. Contact monitor and contacts reported must be enabled for this to work.
Emitted when a body enters into contact with this one. Contact monitor and contacts reported must be enabled for this to work.
This signal not only receives the body that collided with this one, but also its [RID] (body_id), the shape index from the colliding body (body_shape), and the shape index from this body (local_shape) the other body collided with.
Emitted when a body exits contact with this one. Contact monitor and contacts reported must be enabled for this to work.
Emitted when a body shape exits contact with this one. Contact monitor and contacts reported must be enabled for this to work.
This signal not only receives the body that stopped colliding with this one, but also its [RID] (body_id), the shape index from the colliding body (body_shape), and the shape index from this body (local_shape) the other body stopped colliding with.
Static mode. The body behaves like a [StaticBody2D], and can only move by user code.
Kinematic body. The body behaves like a [KinematicBody2D], and can only move by user code.
Rigid body. This is the "natural" state of a rigid body. It is affected by forces, and can move, rotate, and be affected by user code.
Character body. This behaves like a rigid body, but can not rotate.
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.
Room data resource.
Room contains the data to define the bounds of a scene (using a BSP Tree). It is instanced by a [VisualInstance] node to create rooms. See that class documentation for more information about rooms.
Audio sample (sound) class.
Sample provides an audio sample class, containing audio data, together with some information for playback, such as format, mix rate and loop. It is used by sound playback routines.
Create new data for the sample, with format (see FORMAT_* constants), stereo hint, and length in samples (not bytes).
Calling this method overrides previously existing data. Stereo samples are interleaved pairs of left and right points (in that order), but count as one sample for length purposes.
Return the sample format.
Return whether the current sample was created as stereo.
Return the sample length in samples. Stereo samples count as one, even if they are made of a left and a right sample.
Set sample data. Data must be little endian, no matter the host platform, and exactly as long as to fit all samples. The length of this array can be calculated as follows:
Get the sample length ([method get_length]).
If the sample format is FORMAT_PCM16, multiply it by 2.
If the sample format is FORMAT_IMA_ADPCM, divide it by 2 (rounding any fraction up), then add 4.
If the sample is stereo ([method is_stereo]), multiply it by 2.
Return sample data as little endian.
Set the mix rate for the sample (expected playback frequency).
Return the mix rate for the sample.
Set the loop format (use LOOP_* constants as argument).
Return the loop format.
Set the loop begin position. It must be a valid frame and less than the loop end position.
Return the loop begin position.
Set the loop end position. It must be a valid frame and greater than the loop begin position.
Return the loop end position.
8-bits signed PCM audio.
16-bits signed little endian PCM audio.
IMA-ADPCM Audio.
No loop enabled.
Forward looping (when playback reaches loop end, goes back to loop begin).
Ping-pong looping (when playback reaches loop end, plays backward until loop begin). Not available in all platforms.
Library that contains a collection of samples.
Library that contains a collection of [Sample], each identified by a text ID. This is used as a data container for the majority of the SamplePlayer classes and derivatives.
Add a sample to the library, with a given text ID.
Return the sample from the library matching the given text ID. Return null if the sample is not found.
Return true if the sample text ID exists in the library.
Remove the sample matching the given text ID.
Set the volume (in dB) for the given sample.
Return the volume (in dB) for the given sample.
Set the pitch scale for the given sample.
Return the pitch scale for the given sample.
Sample Player node.
SamplePlayer is a [Node] meant for simple sample playback. A library of samples is loaded and played back "as is", without positioning or anything.
Set the sample library for the player.
Return the sample library used by the player.
Set the polyphony of the player (maximum amount of simultaneous voices).
Return the polyphony of the player.
Play a sample referenced by its name.
Optionally, the playback can be made "unique" to force stopping all other samples currently played. The voices allocated for playback will then be returned.
Stop a given voice.
Stop all playing voices.
Set the mix rate (in Hz) of a given voice.
Set the pitch scale of a given voice. A ratio of 1.0 is the normal scale.
Set the volume of a given voice using a linear scale.
The "volume" argument should be a positive factor ranging from 0.0 (mute) up to 16.0 (i.e. 24 dB).
A factor of 1.0 means that the voice will be played at normal system volume. Factors above 1.0 might be limited by the platform's audio output.
Set the volume of a given voice in dB.
The "dB" argument can range from -80 to 24 dB, 0 dB being the maximum volume. Every 6 dB (resp. -6 dB), the volume is increased (resp. reduced) by half.
Set the panning of a voice. Panning goes from -1.0 (left) to +1.0 (right).
Optionally, for hardware than support 3D sound, one can also set depth and height (also in range -1.0 to +1.0).
Set the filter for a given voice, using the given type (see FILTER_* constants), cutoff frequency (from 20 to 16,384 Hz) and resonance (from 0 to 4.0).
Optionally, a gain can also be given (from 0 to 2.0).
Set the chorus send level of a voice (from 0 to 1.0). For setting chorus parameters, see [AudioServer].
Set the reverberation type (see REVERB_* constants) and send level (from 0 to 1.0) of a voice.
Return the current mix rate for a given voice.
Return the current pitch scale for a given voice.
Return the current volume (on a linear scale) for a given voice.
Return the current volume (in dB) for a given voice.
Return the current panning for a given voice.
Return the current pan depth for a given voice.
Return the current pan height for a given voice.
Return the current filter type in use (see FILTER_* constants) for a given voice.
Return the current filter cutoff frequency for a given voice.
Return the current filter resonance for a given voice.
Return the current filter gain for a given voice.
Return the current chorus send level for a given voice.
Return the current reverberation room type for a given voice (see REVERB_* enum).
Return the current reverberation send level for a given voice.
Set the default pitch scale of the player. A ratio of 1.0 is the normal scale.
Set the default volume of the player using a linear scale.
The "volume" argument should be a positive factor ranging from 0.0 (mute) up to 16.0 (i.e. 24 dB).
A factor of 1.0 means that the voice will be played at normal system volume. Factors above 1.0 might be limited by the platform's audio output.
Set the default volume of the player in dB.
The "dB" argument can range from -80 to 24 dB, 0 dB being the maximum volume. Every 6 dB (resp. -6 dB), the volume is increased (resp. reduced) by half.
Set the default panning of the player. Panning goes from -1.0 (left) to +1.0 (right).
Optionally, for hardware than support 3D sound, one can also set depth and height (also in range -1.0 to +1.0).
Set the default filter for the player, using the given type (see FILTER_* constants), cutoff frequency (from 20 to 16,384 Hz) and resonance (from 0 to 4.0).
Optionally, a gain can also be given (from 0 to 2.0).
Set the default chorus send level of the player (from 0 to 1.0). For setting chorus parameters, see [AudioServer].
Set the default reverberation type (see REVERB_* constants) and send level (from 0 to 1.0) of the player.
Return the default pitch scale of the player.
Return the default volume (on a linear scale) of the player.
Return the default volume (in dB) of the player.
Return the default panning of the player.
Return the default pan depth of the player.
Return the default pan height of the player.
Return the default filter type in use (see FILTER_* constants) for the player.
Return the default filter cutoff frequency of the player.
Return the default filter resonance of the player.
Return the default filter gain of the player.
Return the default chorus send level of the player.
Return the default reverberation room type of the player (see REVERB_* enum).
Return the default reverberation send level of the player.
Return whether the player is currently active.
Return whether the given voice is currently active.
Filter is disabled for voice.
Low-pass filter is used for voice.
Band-pass filter is used for voice.
High-pass filter is used for voice.
Notch (band reject) filter is used for voice.
Peak (exclusive band) filter is used for voice.
Band-limit filter is used for voice, in this case resonance is the high-pass cutoff. A band-limit filter has a different frequency response than a notch filter, but otherwise both are band-rejecting filters.
Low-shelf filter is used for voice.
High-shelf filter is used for voice.
Small reverberation room (house room).
Medium reverberation room (street)
Large reverberation room (theatre)
Huge reverberation room (cathedral, warehouse).
Value returned if the voice ID is invalid.
Sample player for positional 2D Sound.
Sample player for positional 2D Sound. Plays sound samples positionally, left and right depending on the distance/place on the screen.
Set the sample library for the player.
Return the sample library used by the player.
Set the polyphony of the player (maximum amount of simultaneous voices).
Return the polyphony of the player.
Play a sample. An internal polyphony ID can optionally be passed, or defaults to NEXT_VOICE.
Return a voice ID which can be used to modify the voice parameters, or INVALID_VOICE if the voice or sample are invalid.
Change the pitch scale of a currently playing voice.
Change the volume scale (in dB) of a currently playing voice.
Return whether a voice is still active or has stopped playing.
Stop a given voice.
Stop all playing voices.
Set the amplitude for random pitch scale variations. If different from zero, the pitch scale will vary randomly around 1.0 in a range defined by val.
The actual pitch scale will be, with "variation" ranging from -val to val:
* variation > 0: 1.0 + variation
* variation < 0: 1.0/(1.0 - variation)
Return the amplitude used for random pitch scale variations.
Value returned if the voice or sample are invalid.
Default voice for the play method. Corresponds to the first voice following the last used voice.
Base class for scripts.
Base class for scripts. Any script that is loaded becomes one of these resources, which can then create instances.
Return true if this script can be instance (ie not a library).
Return true if a given object uses an instance of this script.
Return true if the script contains source code.
Return the script source code (if available).
Set the script source code.
Reload the script. This will fail if there are existing instances.
Base class for scroll bars.
Scrollbars are a [Range] based [Control], that display a draggable area (the size of the page). Horizontal ([HScrollBar]) and Vertical ([VScrollBar]) versions are available.
A helper node for displaying scrollable elements (e.g. lists).
A ScrollContainer node with a [Control] child and scrollbar child ([HScrollbar], [VScrollBar], or both) 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 minimum_size of the Control relative to the ScrollContainer. Works great with a [Panel] control.
Set allows horizontal scrool.
Return true if horizontal scrool is allowed.
Set allows vertical scrool.
Return true if vertical scrool is allowed.
Set horizontal scroll value.
Return current horizontal scroll value.
Set vertical scroll value.
Return current vertical scroll value.
Segment Shape for 2D Collision Detection.
Segment Shape for 2D Collision Detection, consists of two points, 'a' and 'b'.
Set the first point's position.
Return the first point's position.
Set the second point's position.
Return the second point's position.
Base class for separators.
Separator is a [Control] used for separating other controls. It's purely a visual decoration. Horizontal ([HSeparator]) and Vertical ([VSeparator]) versions are available.
To be changed, ignore.
To be changed, ignore.
Base class for all 2D Shapes.
Base class for all 2D Shapes. All 2D shape types inherit from this.
Use a custom solver bias. No need to change this unless you really know what you are doing.
The solver bias is a factor controlling how much two objects "rebound" off each other, when colliding, to avoid them getting into each other because of numerical imprecision.
Return the custom solver bias.
Return whether this shape is colliding with another.
This method needs the transformation matrix for this shape ([code]local_xform[/code]), the shape to check collisions with ([code]with_shape[/code]), and the transformation matrix of that shape ([code]shape_xform[/code]).
Return whether this shape would collide with another, if a given movement was applied.
This method needs the transformation matrix for this shape ([code]local_xform[/code]), the movement to test on this shape ([code]local_motion[/code]), the shape to check collisions with ([code]with_shape[/code]), the transformation matrix of that shape ([code]shape_xform[/code]), and the movement to test onto the other object ([code]shape_motion[/code]).
Return 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 ([code]local_xform[/code]), the shape to check collisions with ([code]with_shape[/code]), and the transformation matrix of that shape ([code]shape_xform[/code]).
Return 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 ([code]local_xform[/code]), the movement to test on this shape ([code]local_motion[/code]), the shape to check collisions with ([code]with_shape[/code]), the transformation matrix of that shape ([code]shape_xform[/code]), and the movement to test onto the other object ([code]shape_motion[/code]).
Skeleton for characters and animated objects.
Skeleton provides a hierarchical interface for managing bones, including pose, rest and animation (see [Animation]). Skeleton will support rag doll dynamics in the future.
Add a bone, with name "name". [method get_bone_count] will become the bone index.
Return the bone index that matches "name" as its name.
Return the name of the bone at index "index"
Return the bone index which is the parent of the bone at "bone_idx". If -1, then bone has no parent. Note that the parent bone returned will always be less than "bone_idx".
Set 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".
Return the amount of bones in the skeleton.
Return the rest transform for a bone "bone_idx".
Set the rest transform for bone "bone_idx"
Deprecated soon.
Deprecated soon.
Deprecated soon.
Clear all the bones in this skeleton.
Return the pose transform for bone "bone_idx".
Return the pose transform for bone "bone_idx".
Base class for GUI Sliders.
Base class for GUI Sliders.
Set amount of ticks to display in slider.
Return amounts of ticks to display on slider.
Return true if ticks are visible on borders.
Set true if ticks are visible on borders.
Base class for playing spatial 2D sound.
Base class for playing spatial 2D sound.
Base class for all 3D nodes.
Spatial is the base for every type of 3D [Node]. It contains a 3D [Transform] which can be set or get as local or global. If a Spatial [Node] has Spatial children, their transforms will be relative to the parent.
Set the transform locally, relative to the parent spatial node.
Return the local transform, relative to the bone parent.
Set the transform globally, relative to worldspace.
Return the global transform, relative to worldspace.
Return the parent [Spatial], or an empty [Object] if no parent exists or parent is not of type [Spatial].
Spatial nodes receive this notification with their global transform changes. This means that either the current or a parent node changed its transform.
Server for Spatial 2D Sound.
Server for Spatial 2D Sound.
Numerical input text field.
SpinBox is a numerical input text field. It allows entering integers and floats.
Set a specific suffix.
Return the specific suffix.
Set a prefix.
Set whether the spinbox is editable.
Return if the spinbox is editable.
Container for splitting and adjusting.
Container for splitting two controls vertically or horizontally, with a grabber that allows adjusting the split offset or ratio.
Set the split offset.
Return the split offset.
Set if the split must be collapsed.
Return true if the split is collapsed.
Set visibility of the split dragger([i]mode[/i] must be one of [DRAGGER_VISIBLE], [DRAGGER_HIDDEN] or [DRAGGER_HIDDEN_COLLAPSED]).
Return visibility of the split dragger(One of [DRAGGER_VISIBLE], [DRAGGER_HIDDEN] or [DRAGGER_HIDDEN_COLLAPSED]).
Emmited when the dragger is gragged by user.
The split dragger is visible.
The split dragger is invisible.
The split dragger is invisible and collapsed.
Spotlight [Light], such as a reflector spotlight or a lantern.
A SpotLight light is a type of [Light] node that emits lights in a specific direction, in the shape of a cone. The light is attenuated through the distance and this attenuation can be configured by changing the energy, radius and attenuation parameters of [Light]. TODO: Image of a spotlight.
General purpose Sprite node.
General purpose Sprite node. This Sprite node can show any texture as a sprite. The texture can be used as a spritesheet for animation, or only a region from a bigger texture can referenced, like an atlas.
Set the base texture for the sprite.
Return the base texture for the sprite.
Set whether the sprite should be centered on the origin.
Return if the sprite is centered at the local origin.
Set the sprite draw offset, useful for setting rotation pivots.
Return sprite draw offset.
Set true to flip the sprite horizontally.
Return true if the sprite is flipped horizontally.
Set true to flip the sprite vertically.
Return true if the sprite is flipped vertically.
Set the sprite as a sub-region of a bigger texture. Useful for texture-atlases.
Return if the sprite reads from a region.
Set the region rect to read from.
Return the region rect to read from.
Set the texture frame for a sprite-sheet, works when vframes or hframes are greater than 1.
Return the texture frame for a sprite-sheet, works when vframes or hframes are greater than 1.
Set the amount of vertical frames and converts the sprite into a sprite-sheet. This is useful for animation.
Return the amount of vertical frames. See [method set_vframes].
Set the amount of horizontal frames and converts the sprite into a sprite-sheet. This is useful for animation.
Return the amount of horizontal frames. See [method set_hframes].
Set color modulation for the sprite. All sprite pixels are multiplied by this color. Color may contain rgb values above 1 to achieve a highlight effect.
Return color modulation for the sprite. All sprite pixels are multiplied by this color.
Sprite frame library for AnimatedSprite.
Sprite frame library for [AnimatedSprite].
Add a frame (texture).
Return the amount of frames.
Return a texture (frame).
Remove a frame
Clear the frames.
PhysicsBody for static collision objects.
StaticBody implements a static collision [Node], by utilizing a rigid body in the [PhysicsServer]. Static bodies are used for static collision. For more information on physics body nodes, see [PhysicsBody].
Static body for 2D Physics.
Static body for 2D Physics. A static body is a simple body that is not intended to move. They don't consume any CPU resources in contrast to a [RigidBody2D] so they are great for scenario collision.
A static body can also be animated by using simulated motion mode. This is useful for implementing functionalities such as moving platforms. When this mode is active the body can be animated and automatically computes linear and angular velocity to apply in that frame and to influence other bodies.
Alternatively, 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).
Set a constant linear velocity for the body. This does not move the body, but affects other bodies touching it, as if it was moving.
Set a constant angular velocity for the body.
Return the constant linear velocity for the body. This does not rotate the body, but affects other bodies touching it, as if it was rotating.
Return the constant angular velocity for the body.
Set the body friction, from 0 (frictionless) to 1 (full friction).
Return the body friction.
Set the body bounciness, from 0 (not bouncy) to 1 (bouncy).
Return the body bounciness.
Abstraction and base class for stream-based protocols.
StreamPeer is an abstraction and base class for stream-based protocols (such as TCP or Unix Sockets). It provides an API for sending and receiving data through streams as raw data or strings.
Send a chunk of data through the connection, blocking if necessary until the data is done sending. This function returns an Error code.
Send 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 Error code and an integer, describing how much data was actually sent.
Return 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 Error code and a data array.
Return 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 Error code, and a data array.
TCP Stream peer.
TCP Stream peer. This object can be used to connect to TCP servers, or also is returned by a tcp server.
Base class for audio stream playback.
Base class for audio stream playback. Audio stream players inherit from it.
Set the [EventStream] this player will play.
Return the currently assigned stream.
Play the currently assigned stream, starting from a given position (in seconds).
Stop the playback.
Return whether this player is playing.
Pause stream playback.
Return whether the playback is currently paused.
Set whether the stream will be restarted at the end.
Return whether the stream will be restarted at the end.
Set the playback volume for this player. This is a float between 0.0 (silent) and 1.0 (full volume). Values over 1.0 will amplify sound even more, but may introduce distortion. Negative values will just invert the output waveform, which produces no audible difference.
Return the playback volume for this player.
Set the playback volume for this player, in decibels. This is a float between -80.0 (silent) and 0.0 (full volume). Values under -79.0 get truncated to -80, but values over 0.0 do not, so the warnings for overamplifying (see [method set_volume]) still apply.
Return the playback volume for this player, in decibels.
Set the size (in milliseconds) of the audio buffer. A long audio buffer protects better against slowdowns, but responds worse to changes (in volume, stream played...). A shorter buffer takes less time to respond to changes, but may stutter if the application suffers some slowdown.
Default is 500 milliseconds.
Return the size of the audio buffer.
Set the point in time the stream will rewind to, when looping.
Return the point in time the stream will rewind to, when looping.
Return the name of the currently assigned stream. This is not the file name, but a field inside the file. If no stream is assigned, if returns "<No Stream>".
Return the number of times the playback has looped.
Return the playback position, in seconds.
Set the playback position, in seconds.
Set whether this player will start playing as soon as it enters the scene tree.
Return whether this player will start playing as soon as it enters the scene tree.
Return the length of the stream, in seconds.
This signal triggers when the player stops playing. It will not trigger on each loop.
Built-in string class.
This is the built-in string class (and the one used by GDScript). It supports Unicode and provides all necessary means for string handling. Strings are reference counted and use a copy-on-write approach, so passing them around is cheap in resources.
If the string is a path to a file, return the path to the file without the extension.
Return true if the strings begins with the given string.
Return the string in uppercase.
Perform a case-sensitive comparison to another string, return -1 if less, 0 if equal and +1 if greater.
Return true if the string is empty.
If the string is a path to a file, return the extension.
Find the first occurrence of a substring, return the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed.
Find the last occurrence of a substring, return the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed.
Find the first occurrence of a substring but search as case-insensitive, return the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed.
If the string is a path to a file, return the base directory.
If the string is a path to a file, return the file and ignore the base directory.
Hash the string and return a 32 bits integer.
Convert a string containing an hexadecimal number into an int.
Insert a substring at a given position.
If the string is a path to a file or directory, return true if the path is absolute.
If the string is a path to a file or directory, return true if the path is relative.
Check whether the string contains a valid float.
Check whether the string contains a valid color in HTML notation.
Check whether the string contains a valid integer.
Check whether the string contains a valid IP address.
Return an amount of characters from the left of the string.
Return the length of the string in characters.
Do a simple expression match, where '*' matches zero or more arbitrary characters and '?' matches any single character except '.'.
Do a simple case insensitive expression match, using ? and * wildcards (see [method match]).
Perform a case-insensitive comparison to another string, return -1 if less, 0 if equal and +1 if greater.
Return the character code at position "at".
Replace occurrences of a substring for different ones inside the string.
Replace occurrences of a substring for different ones inside the string, but search case-insensitive.
Perform a search for a substring, but start from the end of the string instead of the beginning.
Perform a search for a substring, but start from the end of the string instead of the beginning. Also search case-insensitive.
Return the right side of the string from a given position.
Split the string by a divisor string, return an array of the substrings. Example "One,Two,Three" will return \["One","Two","Three"\] if split by ",".
Split the string in floats by using a divisor string, return an array of the substrings. Example "1,2.5,3" will return \[1,2.5,3\] if split by ",".
Return a copy of the string stripped of any non-printable character at the beginning and the end.
Return part of the string from "from", with length "len".
Convert the String (which is a character array) to RawArray (which is an array of bytes). The conversion is speeded up in comparison to to_utf8() with the assumption that all the characters the String contains are only ASCII characters.
Convert a string, containing a decimal number, into a float.
Convert a string, containing an integer number, into an int.
Return the string converted to lowercase.
Return the string converted to uppercase.
Convert the String (which is an array of characters) to RawArray (which is an array of bytes). The conversion is a bit slower than to_ascii(), but supports all UTF-8 characters. Therefore, you should prefer this function over to_ascii().
Perform XML escaping on the string.
Perform XML un-escaping of the string.
String Array.
String Array. Array of strings. Can only contain strings. Optimized for memory usage, can't fragment the memory.
Append a string element at end of the array.
Reset the size of the array.
Return the size of the array.
Base class for drawing stylized boxes for the UI.
StyleBox is [Resource] 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.
Test a position in a rectangle, return whether it passes the mask test.
Set the default offset "offset" of the margin "margin" (see MARGIN_* enum) for a StyleBox, Controls that draw styleboxes with context inside need to know the margin, so the border of the stylebox is not occluded.
Return the default offset of the margin "margin" (see MARGIN_* enum) of a StyleBox, Controls that draw styleboxes with context inside need to know the margin, so the border of the stylebox is not occluded.
Return the offset of margin "margin" (see MARGIN_* enum).
Return the minimum size that this stylebox can be shrunk to.
Return the "offset" of a stylebox, this is a helper function, like writing [code]Vector2(style.get_margin(MARGIN_LEFT), style.get_margin(MARGIN_TOP))[/code].
Empty stylebox (does not display anything).
Empty stylebox (really does not display anything).
Stylebox of a single color.
Stylebox of a single color. Displays the stylebox of a single color, alternatively a border with light/dark colors can be assigned.
Image mask based StyleBox, for mask test.
This StyleBox is similar to [StyleBoxTexture], but only meant to be used for mask testing. It takes an image and applies stretch rules to determine if the point clicked is masked or not.
Set the image used for mask testing. Pixels (converted to grey) that have a value, less than 0.5 will fail the test.
Return the image used for mask testing. (see [method set_image]).
Set the expand property (default). When expanding, the image will use the same rules as [StyleBoxTexture] for expand. If not expanding, the image will always be tested at its original size.
Return whether the expand property is set(default). When expanding, the image will use the same rules as [StyleBoxTexture] for expand. If not expanding, the image will always be tested at its original size.
Set an expand margin size (from enum MARGIN_*). Parts of the image below the size of the margin (and in the direction of the margin) will not expand.
Return the expand margin size (from enum MARGIN_*). Parts of the image below the size of the margin (and in the direction of the margin) will not expand.
Texture Based 3x3 scale style.
Texture Based 3x3 scale style. This stylebox performs a 3x3 scaling of a texture, where only the center cell is fully stretched. This allows for the easy creation of bordered styles.
Helper tool to create geometry.
Helper tool to create geometry.
TCP Server.
TCP Server class. Listens to connections on a port and returns a [StreamPeerTCP] when got a connection.
Listen on a port, alternatively give a white-list of accepted hosts.
Return true if a connection is available for taking.
If a connection is available, return a StreamPeerTCP with the connection/
Stop listening.
Tabbed Container.
Tabbed Container. Contains several children controls, but shows only one at the same time. Clicking on the top tabs allows to change the currently visible one.
Children controls of this one automatically.
Return the amount of tabs.
Bring a tab (and the Control it represents) to the front, and hide the rest.
Return the current tab that is being showed.
Set tab alignment, from the ALIGN_* enum. Moves tabs to the left, right or center.
Return tab alignment, from the ALIGN_* enum.
Set whether the tabs should be visible or hidden.
Return whether the tabs should be visible or hidden.
Set a title for the tab. Tab titles are by default the children node name, but this can be overridden.
Return the title for the tab. Tab titles are by default the children node name, but this can be overridden.
Set an icon for a tab.
Emitted when the current tab changes.
Tabs Control.
Simple tabs control, similar to [TabContainer] but is only in charge of drawing tabs, not interact with children.
Multiline text editing control.
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.
Set the entire text.
Insert a given text at the cursor position.
Return the amount of total lines in the text.
Return the whole text.
Return the text of a specific line.
Return the column the editing cursor is at.
Return the line the editing cursor is at.
Set the text editor caret to blink.
Gets whether the text editor caret is blinking.
Set the text editor caret blink speed. Cannot be less then or equal to 0.
Gets the text editor caret blink speed.
Set the text editor as read-only. Text can be displayed but not edited.
Enable text wrapping when it goes beyond he edge of what is visible.
Set the maximum amount of characters editable.
Cut the current selection.
Copy the current selection.
Paste the current selection.
Select all the text.
Perform selection, from line/column to line/column.
Return true if the selection is active.
Return the selection begin line.
Return the selection begin column.
Return the selection end line.
Return the selection end column.
Return the text inside the selection.
Perform a search inside the text. Search flags can be specified in the SEARCH_* enum.
Perform undo operation.
Perform redo operation.
Clear the undo history.
Set to enable the syntax coloring.
Return true if the syntax coloring is enabled.
Add a keyword and its color.
Add color region (given the delimiters) and its colors.
Set the color for symbols.
Set a custom background color. A background color with alpha==0 disables this.
Clear all the syntax coloring information.
Emitted when the text changes.
Emitted when the cursor changes.
Match case when searching.
Match whole words when searching.
Search from end to beginning.
Texture for 2D and 3D.
A texture works by registering an image in the video hardware, which then can be used in 3D models or 2D [Sprite] or GUI [Control].
Return the texture width.
Return the texture height.
Return the texture size.
Return the texture RID as used in the [VisualServer].
Change the texture flags.
Return the current texture flags.
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.
Texture is a video surface.
Default flags. Generate mipmaps, repeat, and filter are enabled.
Button that can be themed with textures.
Button that can be themed with textures. This is like a regular [Button] but can be themed by assigning textures to it. This button is intended to be easy to theme, however a regular button can expand (that uses styleboxes) and still be better if the interface is expect to have internationalization of texts.
Only the normal texture is required, the others are optional.
Control Frame that draws a texture.
Control frame that simply draws an assigned texture. It can stretch or not. It's a simple way to just show an image in a UI.
Textured progress bar implementation.
[ProgressBar] implementation that is easier to theme (by just passing a few textures).
Theme for controls.
Theme for skinning controls. Controls can be skinned individually, but for complex applications it's more efficient to just create a global theme that defines everything. This theme can be applied to any [Control], and it and its children will automatically use it.
Theme resources can be alternatively loaded by writing them in a .theme file, see wiki for more info.
Node for 2D tile-based games.
Node for 2D tile-based games. Tilemaps use a [TileSet] which contain a list of tiles (textures, their rect and a collision) and are used to create complex grid-based maps.
To optimize drawing and culling (sort of like [GridMap]), you can specify a quadrant size, so chunks of the map will be batched together at drawing time.
Set the current tileset.
Return the current tileset.
Set the orientation mode as square, isometric or custom (use MODE_* constants as argument).
Return the orientation mode.
Set an half offset on the X coordinate, Y coordinate, or none (use HALF_OFFSET_* constants as argument).
Half offset sets every other tile off by a half tile size in the specified direction.
Return the current half offset configuration.
Set custom transform matrix, to use in combination with the custom orientation mode.
Return the custom transform matrix.
Set the cell size.
Return the cell size.
Set the quadrant size, this optimizes drawing by batching chunks of map at draw/cull time.
Allowed values are integers ranging from 1 to 128.
Return the quadrant size.
Set the tile origin to the tile center or its top-left corner (use TILE_ORIGIN_* constants as argument).
Return the tile origin configuration.
Set tiles to be centered in x coordinate. (by default this is false and they are drawn from upper left cell corner).
Return true if tiles are to be centered in x coordinate (by default this is false and they are drawn from upper left cell corner).
Set tiles to be centered in y coordinate. (by default this is false and they are drawn from upper left cell corner).
Return true if tiles are to be centered in y coordinate (by default this is false and they are drawn from upper left cell corner).
Set the Y sort mode. Enabled Y sort mode means that children of the tilemap will be drawn in the order defined by their Y coordinate.
A tile with a higher Y coordinate will therefore be drawn later, potentially covering up the tile(s) above it if its sprite is higher than its cell size.
Return the Y sort mode.
Set the tilemap to handle collisions as a kinematic body (enabled) or a static body (disabled).
Return whether the tilemap handles collisions as a kinematic body.
Set the collision layer.
Layers are referenced by binary indexes, so allowable values to describe the 20 available layers range from 0 to 2^20-1.
Return the collision layer.
Set the collision masks.
Masks are referenced by binary indexes, so allowable values to describe the 20 available masks range from 0 to 2^20-1.
Return the collision mask.
Set the collision friction parameter.
Allowable values range from 0 to 1.
Return the collision friction parameter.
Set the collision bounce parameter.
Allowable values range from 0 to 1.
Return the collision bounce parameter.
Set the tile index for the cell referenced by its grid-based X and Y coordinates.
A tile index of -1 clears the cell.
Optionally, the tile can also be flipped over the X and Y coordinates or transposed.
Set the tile index for the cell referenced by a Vector2 of grid-based coordinates.
A tile index of -1 clears the cell.
Optionally, the tile can also be flipped over the X and Y axes or transposed.
Return the tile index of the referenced cell.
Return the tile index of the cell referenced by a Vector2.
Return whether the referenced cell is flipped over the X axis.
Return whether the referenced cell is flipped over the Y axis.
Return whether the referenced cell is transposed, i.e. the X and Y axes are swapped (mirroring with regard to the (1,1) vector).
Clear all cells.
Return an array of all cells containing a tile from the tileset (i.e. a tile index different from -1).
Return the absolute world position corresponding to the tilemap (grid-based) coordinates given as an argument.
Optionally, the tilemap's potential half offset can be ignored.
Return the tilemap (grid-based) coordinates corresponding to the absolute world position given as an argument.
Signal indicating that a tilemap setting has changed.
Returned when a cell doesn't exist.
Orthogonal orientation mode.
Isometric orientation mode.
Custom orientation mode.
Half offset on the X coordinate.
Half offset on the Y coordinate.
Half offset disabled.
Tile origin at its top-left corner.
Tile origin at its center.
Tile library for tilemaps.
A TileSet is a library of tiles for a [TileMap]. It contains a list of tiles, each consisting of a sprite and optional collision shapes.
Tiles are referenced by a unique integer ID.
Create a new tile which will be referenced by the given ID.
Set the name of the tile, for descriptive purposes.
Return the name of the tile.
Set the texture of the tile.
Return the texture of the tile.
Set the material of the tile.
Return the material of the tile.
Set the texture offset of the tile.
Return the texture offset of the tile.
Set the shape offset of the tile.
Return the shape offset of the tile.
Set the tile sub-region in the texture. This is common in texture atlases.
Return the tile sub-region in the texture.
Set a shape for the tile, enabling physics to collide with it.
Return the shape of the tile.
Set an array of shapes for the tile, enabling physics to collide with it.
Return the array of shapes of the tile.
Set a navigation polygon for the tile.
Return the navigation polygon of the tile.
Set an offset for the tile's navigation polygon.
Return the offset of the tile's navigation polygon.
Set a light occluder for the tile.
Return the light occluder of the tile.
Set an offset for the tile's light occluder.
Return the offset of the tile's light occluder.
Remove the tile referenced by the given ID.
Clear all tiles.
Return the ID following the last currently used ID, useful when creating a new tile.
Find the first tile matching the given name.
Return an array of all currently used tile IDs.
A simple Timer node.
Timer node. This is a simple node that will emit a timeout callback when the timer runs out. It can optionally be set to loop.
Set wait time in seconds. When the time is over, it will emit the timeout signal.
Return the wait time in seconds.
Set as one-shot. If enabled, the timer will stop after timeout, otherwise it will automatically restart.
Return true if configured as one-shot.
Set to automatically start when entering the scene.
Return true if set to automatically start when entering the scene.
Start the timer.
Stop (cancel) the timer.
Set whether the timer is active or not. An inactive timer will be paused until it is activated again.
Return if the timer is active or not.
Return the time left for timeout in seconds if the timer is active, 0 otherwise.
Set the timer's processing mode (fixed or idle, use TIMER_PROCESS_* constants as argument).
Return the timer's processing mode.
Emitted when the time runs out.
Update the timer at fixed intervals (framerate processing).
Update the timer during the idle time at each frame.
3D Transformation.
Transform is used to store transformations, including translations. It consists of a Matrix3 "basis" and Vector3 "origin". Transform is used to represent transformations of any object in space. It is similar to a 4x3 matrix.
Returns the inverse of the transform.
Transforms vector "v" by this transform.
Inverse-transforms vector "v" by this transform.
Language Translation.
Translations are resources that can be loaded/unloaded on demand. They map a string to another string.
Set the locale of the translation.
Return the locale of the translation.
Add a message for translation.
Return a message for translation.
Erase a message.
Return all the messages (keys).
Server that manages all translations. Translations can be set to it and removed from it.
Node useful for animations with unknown start and end points.
Node useful for animations with unknown start and end points, procedural animations, making one node follow another, and other simple behavior.
Because it is easy to get it wrong, here is a quick usage example:
[codeblock]
var tween = get_node("Tween")
tween.interpolate_property(get_node("Node2D_to_move"), "transform/pos", Vector2(0,0), Vector2(100,100), Tween.TRANS_LINEAR, Tween.EASE_IN_OUT)
tween.start()
[/codeblock]
Some of the methods of this class require a property name. You can get the property name by hovering over the property in the inspector of the editor.
Many of the methods accept [code]trans_type[/code] and [code]ease_type[/code]. The first accepts an TRANS_* constant, and refers to the way the timing of the animation is handled (you might want to see [code]http://easings.net/[/code] for some examples). The second accepts an EASE_* constant, and controls the where [code]trans_type[/code] is applied to the interpolation (in the begining, the end, or both). If you don't know which transision and easing to pick, you can try different TRANS_* constants with EASE_IN_OUT, and use the one that looks best.
Returns true if any tweens are currently running, and false otherwise. Note that this method doesn't consider tweens that have ended.
Activate/deactivate the tween. You can use this for pausing animations, though [method stop_all] and [method resume_all] might be more fit for this.
Returns true if repeat has been set from editor GUI or [method set_repeat].
Make the tween repeat after all tweens have finished.
Set the speed multiplier of the tween. Set it to 1 for normal speed, 2 for two times nromal speed, and 0.5 for half of the normal speed. Setting it to 0 would pause the animation, but you might consider using [method set_active] or [method stop_all] and [method resume_all] for this.
Returns the speed that has been set from editor GUI or [method set_repeat].
Set whether the Tween uses [code]_process[/code] or [code]_fixed_process[/code] (accepts TWEEN_PROCESS_IDLE and TWEEN_PROCESS_FIXED constants, respectively).
Returns the process mode that has been set from editor GUI or [method set_tween_process_mode]
Start the tween node. You can define tweens both before and after this.
Resets a tween to the initial value (the one given, not the one before the tween), given its object and property/method pair.
Resets all tweens to their initial values (the ones given, not those before the tween).
Stop animating a tween, given its object and property/method pair.
Stop animating all tweens.
Continue animating a stopped tween, given its object and property/method pair.
Continue animating all stopped tweens.
Stop animating and completely remove a tween, given its object and property/method pair.
Stop animating and completely remove all tweens.
Seek the animation to the given [code]time[/code] in seconds.
Returns the current time of the tween.
Returns the time needed for all tweens to end in seconds, measured from the start. Thus, if you have two tweens, one ending 10 seconds after the start and the other - 20 seconds, it would return 20 seconds, as by that time all tweens would have finished.
Animate [code]property[/code] of [code]object[/code] from [code]initial_val[/code] to [code]final_val[/code] for [code]times_in_sec[/code] seconds, [code]delay[/code] seconds later.
[code]trans_type[/code] accepts TRANS_* constants, and is the way the animation is interpolated, while [code]ease_type[/code] accepts EASE_* constants, and controls the place of the interpolation (the begining, the end, or both). You can read more about them in the class description.
Animate [code]method[/code] of [code]object[/code] from [code]initial_val[/code] to [code]final_val[/code] for [code]times_in_sec[/code] seconds, [code]delay[/code] seconds later. Methods are animated by calling them with consecuitive values.
[code]trans_type[/code] accepts TRANS_* constants, and is the way the animation is interpolated, while [code]ease_type[/code] accepts EASE_* constants, and controls the place of the interpolation (the begining, the end, or both). You can read more about them in the class description.
Call [code]callback[/code] of [code]object[/code] after [code]times_in_sec[/code]. [code]arg1[/code]-[code]arg5[/code] are arguments to be passed to the callback.
Call [code]callback[/code] of [code]object[/code] after [code]times_in_sec[/code] on the main thread (similar to [methog Object.call_deferred). [code]arg1[/code]-[code]arg5[/code] are arguments to be passed to the callback.
Follow [code]property[/code] of [code]object[/code] and apply it on [code]target_property[/code] of [code]target[/code], beginning from [code]initial_val[/code] for [code]times_in_sec[/code] seconds, [code]delay[/code] seconds later. Note that [code]target:target_property[/code] would equal [code]object:property[/code] at the end of the tween.
[code]trans_type[/code] accepts TRANS_* constants, and is the way the animation is interpolated, while [code]ease_type[/code] accepts EASE_* constants, and controls the place of the interpolation (the begining, the end, or both). You can read more about them in the class description.
Follow [code]method[/code] of [code]object[/code] and apply the returned value on [code]target_method[/code] of [code]target[/code], beginning from [code]initial_val[/code] for [code]times_in_sec[/code] seconds, [code]delay[/code] later. Methods are animated by calling them with consequitive values.
[code]trans_type[/code] accepts TRANS_* constants, and is the way the animation is interpolated, while [code]ease_type[/code] accepts EASE_* constants, and controls the place of the interpolation (the begining, the end, or both). You can read more about them in the class description.
Animate [code]property[/code] of [code]object[/code] from the current value of the [code]initial_val[/code] property of [code]initial[/code] to [code]final_val[/code] for [code]times_in_sec[/code] seconds, [code]delay[/code] seconds later.
[code]trans_type[/code] accepts TRANS_* constants, and is the way the animation is interpolated, while [code]ease_type[/code] accepts EASE_* constants, and controls the place of the interpolation (the begining, the end, or both). You can read more about them in the class description.
Animate [code]method[/code] of [code]object[/code] from the value returned by [code]initial.initial_method[/code] to [code]final_val[/code] for [code]times_in_sec[/code] seconds, [code]delay[/code] seconds later. Methods are animated by calling them with consecuitive values.
[code]trans_type[/code] accepts TRANS_* constants, and is the way the animation is interpolated, while [code]ease_type[/code] accepts EASE_* constants, and controls the place of the interpolation (the begining, the end, or both). You can read more about them in the class description.
This signal is emitted when a tween ends.
This signal is emitted each step of the tweening.
This signal is emitted when a tween starts.
The [Tween] should use [code]_fixed_process[/code] for timekeeping when this is enabled.
The [Tween] should use [code]_process[/code] for timekeeping when this is enabled (default).
Means that the animation is interpolated linearly.
Means that the animation is interpolated using a sine wave.
Means that the animation is interpolated with a quinary (to the power of 5) function.
Means that the animation is interpolated with a quartic (to the power of 4) function.
Means that the animation is interpolated with a quadratic (to the power of 2) function.
Means that the animation is interpolated with a exponential (some number to the power of x) function.
Means that the animation is interpolated with elasticity, wiggling around the edges.
Means that the animation is interpolated with a cubic (to the power of 3) function.
Means that the animation is interpolated with a function using square roots.
Means that the animation is interpolated by bouncing at, but never surpassing, the end.
Means that the animation is interpolated backing out at edges.
Signifies that the interpolation should be focused in the beginning.
Signifies that the interpolation should be focused in the end.
Signifies that the interpolation should be focused in both ends.
Signifies that the interpolation should be focused in both ends, but they should be switched (a bit hard to explain, try it for yourself to be sure).
Helper to manage UndoRedo in the editor or custom tools.
Helper to maange UndoRedo in the editor or custom tools. It works by
storing calls to functions in both 'do' an 'undo' lists.
Common behavior is to create an action, then add do/undo calls to
functions or property changes, then commiting the action.
Create a new action. After this is called, do all
your calls to [method add_do_method],
[method add_undo_method], [method add_do_property]
and [method add_undo_property].
Commit the action. All 'do' methods/properties are
called/set when this function is called.
Add a call to a method in a given object with custom
arguments.
Add a call to an undo method in a given object with
custom arguments. Undo calls are used to revert 'do'
calls.
Set a property with a custom value.
Undo setting of a property with a custom value.
Add a 'do' reference 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.
Add an 'undo' reference that will be erased if the
'undo' history is lost. This is useful mostly for
nodes rmoved with the 'do' call (not the 'undo'
call!).
Clear the undo/redo history and associated
references.
Get the name of the current action.
Get the version, each time a new action is commited,
the version number of the UndoRedo is increased
automatically.
This is useful mostly to check if something changed
from a saved version.
Vertical box container.
Vertical box container. See [BoxContainer].
Vertical button array.
Vertical button array. See [ButtonArray].
Vertical version of [ScrollBar], which goes from left (min) to right (max).
Vertical version of [Separator].
Vertical version of [Separator]. It is used to separate objects horizontally, though (but it looks vertical!).
Vertical slider.
Vertical slider. See [Slider]. This one goes from left (min) to right (max).
Vertical split container.
Vertical split container. See [SplitContainer]. This goes from left to right.
Vector used for 2D Math.
2-element structure that can be used to represent positions in 2d-space, or any other pair of numeric values.
Returns the result of atan2 when called with the Vector's x and y as parameters (Math::atan2(x,y)).
Be aware that it therefore returns an angle oriented clockwise with regard to the (0, 1) unit vector, and not an angle oriented counter-clockwise with regard to the (1, 0) unit vector (which would be the typical trigonometric representation of the angle when calling Math::atan2(y,x)).
Returns the angle in radians between the two vectors.
Returns the angle in radians between the line connecting the two points and the x coordinate.
Cubicly interpolates between this Vector and "b", using "pre_a" and "post_b" as handles, and returning the result at position "t".
Returns the squared distance to vector "b". Prefer this function over "distance_to" if you need to sort vectors or need the squared distance for some formula.
Returns the distance to vector "b".
Returns the dot product with vector "b".
Remove the fractional part of x and y.
Remove the fractional part of x and y.
Returns the ratio of X to Y.
Returns the length of the vector.
Returns the squared length of the vector. Prefer this function over "length" if you need to sort vectors or need the squared length for some formula.
Returns the result of the linear interpolation between this vector and "b", by amount "t".
Returns a normalized vector to unit length.
Like "slide", but reflects the Vector instead of continuing along the wall.
Rotates the vector by "phi" radians.
Slides the vector by the other vector.
Snaps the vector to a grid with the given size.
Returns a perpendicular vector.
Constructs a new Vector2 from the given x and y.
An Array of Vector2.
An Array specifically designed to hold Vector2.
Inserts a Vector2 at the end.
Sets the size of the Vector2Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
Changes the Vector2 at the given index.
Returns the size of the array.
Constructs a new Vector2Array. Optionally, you can pass in an Array that will be converted.
Vector class, which performs basic 3D vector math operations.
Vector3 is one of the core classes of the engine, and includes several built-in helper functions to perform basic vector math operations.
Returns a new vector with all components in absolute values (e.g. positive).
Returns a new vector with all components rounded up.
Return the cross product with b.
Perform a cubic interpolation between vectors pre_a, a, b, post_b (a is current), by the given amount (t).
Return the squared distance (distance minus the last square root) to b. Prefer this function over distance_to if you need to sort vectors or need the squared distance for some formula.
Return the distance to b.
Return the dot product with b.
Returns a new vector with all components rounded down.
Returns the inverse of the vector. This is the same as Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )
Return the length of the vector.
Return the length of the vector, squared. Prefer this function over "length" if you need to sort vectors or need the squared length for some formula.
Linearly interpolates the vector to a given one (b), by the given amount (t).
Returns AXIS_X, AXIS_Y or AXIS_Z depending on which axis is the largest.
Returns AXIS_X, AXIS_Y or AXIS_Z depending on which axis is the smallest.
Return a copy of the normalized vector to unit length. This is the same as v / v.length().
Like "slide", but reflects the Vector instead of continuing along the wall.
Rotates the vector around some axis by phi radians.
Slides the vector along a wall.
Return a copy of the vector, snapped to the lowest neared multiple.
Returns a Vector3 with the given components.
Enumerated value for the X axis. Returned by functions like max_axis or min_axis.
Enumerated value for the Y axis.
Enumerated value for the Z axis.
An Array of Vector3.
An Array specifically designed to hold Vector3.
Inserts a Vector3 at the end.
Sets the size of the Vector3Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
Changes the Vector3 at the given index.
Returns the size of the array.
Constructs a new Vector3Array. Optionally, you can pass in an Array that will be converted.
Creates a sub-view into the screen.
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 [Control], it will automatically take up its same rect and position, otherwise they 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.
Set the viewport rect. If the viewport is child of a control, it will use the same rect as the parent.
Return the viewport rect. If the viewport is child of a control, it will use the same rect as the parent. Otherwise, if the rect is empty, the viewport will use all the allowed space.
Return the final, visible rect in global screen coordinates.
If this viewport is a child of another viewport, keep the previously drawn background visible.
Return whether the viewport lets whatever is behind it to show.
Get the viewport RID from the visual server.
Server for anything visible.
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.
Holds an [Object], but does not contribute to the reference count if the object is a reference.
A weakref can hold a [Reference], without contributing to the reference counter. A weakref can be created from an [Object] using [method @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 eachother. Without weakrefs, using these classes could lead to memory leaks, since both references keep eachother from being released. Making part of the variables a weakref can prevent this cyclic dependency, and allows the references to be released.
Returns the [Object] this weakref is referring to.
Base class for window dialogs.
Windowdialog is the base class for all window-based dialogs. It's a by-default toplevel [Control] that draws a window decoration and allows motion and resizing.
Set the title of the window.
Return the title of the window.
Return the close [TextureButton].
Class that has everything pertaining to a world.
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.
Class that has everything pertaining to a 2D world.
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.
Sort all child nodes based on their Y positions.
Sort all child nodes based on their Y positions. The child node must inherit from [CanvasItem] 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.
Set whether the children nodes are sorted or not. (default true)
Returns true if the children nodes are being sorted.
Boolean built-in type
Boolean built-in type.
Cast an [int] value to a boolean value, this method will return true if called with an integer value different to 0 and false in other case.
Cast a [float] value to a boolean value, this method will return true if called with a floating point value different to 0 and false in other case.
Cast a [String] value to a boolean value, this method will return true if called with a non empty string and false in other case. Examples: [code]bool('False')[/code] returns true, [code]bool('')[/code]. returns false
Float built-in type
Float built-in type.
Cast a [bool] value to a floating point value, [code]float(true)[/code] will be equals to 1.0 and [code]float(false)[/code] will be equals to 0.0.
Cast an [int] value to a floating point value, [code]float(1)[/code] will be equals to 1.0.
Cast a [String] value to a floating point value. This method accepts float value strings like [code] '1.23' [/code] and exponential notation strings for its parameter so calling [code] float('1e3') [/code] will return 1000.0 and calling [code] float('1e-3') [/code] will return -0.001.
Integer built-in type.
Integer built-in type.
Cast a [bool] value to an integer value, [code]int(true)[/code] will be equals to 1 and [code]int(false)[/code] will be equals to 0.
Cast a float value to an integer value, this method simply removes the number fractions, so for example [code]int(2.7)[/code] will be equals to 2, [code]int(.1)[/code] will be equals to 0 and [code]int(-2.7)[/code] will be equals to -2.
Cast a [String] value to an integer value, this method is an integer parser from a string, so calling this method with an invalid integer string will return 0, a valid string will be something like [code]'1.7'[/code]. This method will ignore all non-number characters, so calling [code]int('1e3')[/code] will return 13.