diff options
Diffstat (limited to 'doc/base')
-rw-r--r-- | doc/base/classes.xml | 1365 |
1 files changed, 1103 insertions, 262 deletions
diff --git a/doc/base/classes.xml b/doc/base/classes.xml index a097470306..3e3a170d2a 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -20,7 +20,14 @@ <argument index="3" name="a8" type="int"> </argument> <description> - Make a color from red, green, blue and alpha. Arguments can range from 0 to 255. + Returns a 32 bit color with red, green, blue and alpha channels. Each channel has 8bits of information ranging from 0 to 255. + 'r8' red channel + 'g8' green channel + 'b8' blue channel + 'a8' alpha channel + [codeblock] + red = Color8(255, 0, 0) + [/codeblock] </description> </method> <method name="ColorN"> @@ -31,7 +38,10 @@ <argument index="1" name="alpha" type="float"> </argument> <description> - Make a color from color name (color_names.inc) and alpha ranging from 0 to 1. + Returns color 'name' with alpha ranging from 0 to 1. Note: 'name' is defined in color_names.inc. + [codeblock] + red = ColorN('red') + [/codeblock] </description> </method> <method name="abs"> @@ -40,7 +50,11 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns the absolute value of parameter s (i.e. unsigned value, works for integer and float). + Returns the absolute value of parameter 's' (i.e. unsigned value, works for integer and float). + [codeblock] + # a is 1 + a = abs(-1) + [/codeblock] </description> </method> <method name="acos"> @@ -49,7 +63,11 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns the principal value of the arc cosine of s, expressed in radians. In trigonometrics, arc cosine is the inverse operation of cosine. + Returns the arc cosine of 's' in radians. Use to get the angle of cosine 's'. + [codeblock] + # c is 0.523599 or 30 degrees if converted with rad2deg(s) + c = acos(0.866025) + [/codeblock] </description> </method> <method name="asin"> @@ -58,7 +76,11 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns the principal value of the arc sine of s, expressed in radians. In trigonometrics, arc sine is the inverse operation of sine. + Returns the arc sine of 's' in radians. Use to get the angle of sine 's'. + [codeblock] + # s is 0.523599 or 30 degrees if converted with rad2deg(s) + s = asin(0.5) + [/codeblock] </description> </method> <method name="assert"> @@ -67,7 +89,6 @@ <argument index="0" name="condition" type="bool"> </argument> <description> - Assert that the condition is true. If the condition is false, generates an error. </description> </method> <method name="atan"> @@ -76,7 +97,6 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns the principal value of the arc tangent of s, expressed in radians. In trigonometrics, arc tangent is the inverse operation of tangent. Notice that because of the sign ambiguity, the function cannot determine with certainty in which quadrant the angle falls only by its tangent value. See [method atan2] for an alternative that takes a fractional argument instead. </description> </method> <method name="atan2"> @@ -87,7 +107,11 @@ <argument index="1" name="y" type="float"> </argument> <description> - Returns the principal value of the arc tangent of y/x, expressed in radians. To compute the value, the function takes into account the sign of both arguments in order to determine the quadrant. + Returns the arc tangent of y/x in radians. Use to get the angle of tangent y/x. To compute the value, the function takes into account the sign of both arguments in order to determine the quadrant. + [codeblock] + # a is 3.141593 + a = atan(0,-1) + [/codeblock] </description> </method> <method name="bytes2var"> @@ -105,7 +129,13 @@ <argument index="0" name="s" type="float"> </argument> <description> - Rounds s upward, returning the smallest integral value that is not less than s. + Rounds 's' upward, returning the smallest integral value that is not less than 's'. + [codeblock] + # i is 2 + i = ceil(1.45) + # i is 2 + i = ceil(1.001) + [/codeblock] </description> </method> <method name="char"> @@ -115,6 +145,12 @@ </argument> <description> Returns a character as String of the given ASCII code. + [codeblock] + # a is 'A' + a = char(65) + # a is 'a' + a = char(65+32) + [/codeblock] </description> </method> <method name="clamp"> @@ -127,7 +163,16 @@ <argument index="2" name="max" type="float"> </argument> <description> - Clamps a value between a minimum and maximum value. + Clamp 'val' and return a value not less than 'min' and not more than 'max'. + [codeblock] + speed = 1000 + # a is 20 + a = clamp(speed, 1, 20) + + speed = -10 + # a is 1 + a = clamp(speed, 1, 20) + [/codeblock] </description> </method> <method name="convert"> @@ -139,6 +184,15 @@ </argument> <description> Convert from a type to another in the best way possible. The "type" parameter uses the enum TYPE_* in [@Global Scope]. + [codeblock] + a = Vector2(1, 0) + # prints 1 + print(a.length()) + a = convert(a, TYPE_STRING) + # prints 6 + # (1, 0) is 6 characters + print(a.length()) + [/codeblock] </description> </method> <method name="cos"> @@ -147,7 +201,12 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns the cosine of an angle of s radians. + Returns the cosine of angle 's' in radians. + [codeblock] + # prints 1 and -1 + print(cos(PI*2)) + print(cos(PI)) + [/codeblock] </description> </method> <method name="cosh"> @@ -156,7 +215,11 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns the hyperbolic cosine of s. + Returns the hyperbolic cosine of 's' in radians. + [codeblock] + # prints 1.543081 + print(cosh(1)) + [/codeblock] </description> </method> <method name="db2linear"> @@ -174,7 +237,11 @@ <argument index="0" name="step" type="float"> </argument> <description> - Return the amount of decimals in the floating point value. + Returns the number of digit places after the decimal that the first non-zero digit occurs. + [codeblock] + # n is 2 + n = decimals(0.035) + [/codeblock] </description> </method> <method name="dectime"> @@ -187,7 +254,11 @@ <argument index="2" name="step" type="float"> </argument> <description> - Decreases time by a specified amount. + Returns the result of 'value' decreased by 'step' * 'amount'. + [codeblock] + # a = 59 + a = dectime(60, 10, 0.1)) + [/codeblock] </description> </method> <method name="deg2rad"> @@ -196,7 +267,11 @@ <argument index="0" name="deg" type="float"> </argument> <description> - Convert from degrees to radians. + Returns degrees converted to radians. + [codeblock] + # r is 3.141593 + r = deg2rad(180) + [/codeblock] </description> </method> <method name="dict2inst"> @@ -205,7 +280,7 @@ <argument index="0" name="dict" type="Dictionary"> </argument> <description> - Convert a previously converted instances to dictionary back into an instance. Useful for deserializing. + Convert a previously converted instance to dictionary back into an instance. Useful for deserializing. </description> </method> <method name="ease"> @@ -225,7 +300,7 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns the base-e exponential function of s, which is e raised to the power s: e^s. + Returns [b]e[/b] raised to the power of 's'. [b]e[/b] sometimes called "Euler's number" is a mathematical constant whose value is approximately 2.71828. </description> </method> <method name="floor"> @@ -234,7 +309,7 @@ <argument index="0" name="s" type="float"> </argument> <description> - Rounds s downward, returning the largest integral value that is not greater than s. + Returns the largest integer value (rounded down) that is less than or equal to 's'. </description> </method> <method name="fmod"> @@ -260,7 +335,6 @@ <argument index="1" name="y" type="float"> </argument> <description> - Module (remainder of x/y) that wraps equally in positive and negative. </description> </method> <method name="funcref"> @@ -271,7 +345,6 @@ <argument index="1" name="funcname" type="String"> </argument> <description> - Return a reference to the specified function. </description> </method> <method name="hash"> @@ -280,7 +353,11 @@ <argument index="0" name="var" type="Variant"> </argument> <description> - Hash the variable passed and return an integer. + Returns the integer hash of the variable passed. + [codeblock] + # print 177670 + print(hash("a")) + [/codeblock] </description> </method> <method name="inst2dict"> @@ -289,7 +366,19 @@ <argument index="0" name="inst" type="Object"> </argument> <description> - Convert a script class instance to a dictionary (useful for serializing). + Returns the passed instance converted a dictionary (useful for serializing). + [codeblock] + var foo = "bar" + func _ready(): + var d = inst2dict(self) + print(d.keys()) + print(d.values()) + [/codeblock] + Prints out: + [codeblock] + [@subpath, @path, foo] + [, res://test.gd, bar] + [/codeblock] </description> </method> <method name="instance_from_id"> @@ -298,7 +387,15 @@ <argument index="0" name="instance_id" type="int"> </argument> <description> - Get an object by its ID. + Returns the Object that corresponds to 'instance_id'. All Objects have a unique instance ID. + [codeblock] + var foo = "bar" + func _ready(): + var id = get_instance_id() + var inst = instance_from_id(id) + print(inst.foo) + [/codeblock] + Prints "bar" </description> </method> <method name="inverse_lerp"> @@ -318,21 +415,21 @@ </description> </method> <method name="is_inf"> - <return type="float"> + <return type="bool"> </return> <argument index="0" name="s" type="float"> </argument> <description> - Returns whether s is an infinity value (either positive infinity or negative infinity). + Returns True/False whether 's' is an infinity value (either positive infinity or negative infinity). </description> </method> <method name="is_nan"> - <return type="float"> + <return type="bool"> </return> <argument index="0" name="s" type="float"> </argument> <description> - Returns whether s is a NaN (Not-A-Number) value. + Returns True/False whether 's' is a NaN (Not-A-Number) value. </description> </method> <method name="len"> @@ -341,7 +438,12 @@ <argument index="0" name="var" type="Variant"> </argument> <description> - Returns the length of the given Variant if applicable. It will return character count of a String, element count of an Array, etc. + Returns length of Variant 'var'. Length is the character count of String, element count of Array, size of Dictionary, etc. Note: Generates a fatal error if Variant can not provide a length. + [codeblock] + a = [1, 2, 3, 4] + print(len(a)) + [/codeblock] + Prints 4 </description> </method> <method name="lerp"> @@ -372,7 +474,11 @@ <argument index="0" name="path" type="String"> </argument> <description> - Load a resource from the filesystem, pass a valid path as argument. + Load a resource from the filesystem located at 'path'. Note: resource paths can be obtained by right clicking on a resource in the Assets Pannel and choosing "Copy Path". + [codeblock] + # load a scene called main located in the root of the project directory + var main = load("res://main.tscn") + [/codeblock] </description> </method> <method name="log"> @@ -381,7 +487,11 @@ <argument index="0" name="s" type="float"> </argument> <description> - Natural logarithm. + Natural logarithm. The amount of time needed to reach a certain level of continuous growth. Note: This is not the same as the log funcation on your calculator which is a base 10 logarithm. + [codeblock] + # a is 2.302585 + a = log(10) + [/codeblock] </description> </method> <method name="max"> @@ -392,7 +502,13 @@ <argument index="1" name="b" type="float"> </argument> <description> - Return the maximum of two values. + Returns the maximum of two values. + [codeblock] + # a is 2 + a = max(1,2) + # a is -3.99 + a = max(-3.99, -4) + [/codeblock] </description> </method> <method name="min"> @@ -403,7 +519,13 @@ <argument index="1" name="b" type="float"> </argument> <description> - Return the minimum of two values. + Returns the minimum of two values. + [codeblock] + # a is 1 + a = min(1,2) + # a is -4 + a = min(-3.99, -4) + [/codeblock] </description> </method> <method name="nearest_po2"> @@ -412,7 +534,15 @@ <argument index="0" name="val" type="int"> </argument> <description> - Return the nearest larger power of 2 for an integer. + Returns the nearest larger power of 2 for an integer. + [codeblock] + # a is 4 + a = nearest_po2(3) + # a is 4 + a = nearest_po2(4) + # a is 8 + a = nearest_po2(5) + [/codeblock] </description> </method> <method name="parse_json"> @@ -423,6 +553,13 @@ <description> Parse JSON text to a Variant (use [method typeof] to check if it is what you expect). Be aware that the JSON specification does not define integer or float types, but only a number type. Therefore, parsing a JSON text will convert every numerical values to [float] types. + [codeblock] + p = parse_json('["a", "b", "c"]') + if typeof(p) == TYPE_ARRAY: + print(p[0]) + else: + print("unexpected results") + [/codeblock] </description> </method> <method name="pow"> @@ -433,7 +570,11 @@ <argument index="1" name="y" type="float"> </argument> <description> - Power function, x elevate to y. + Returns the result of 'x' raised to the power of 'y'. + [codeblock] + # a is 32 + a = pow(2,5) + [/codeblock] </description> </method> <method name="preload"> @@ -442,14 +583,22 @@ <argument index="0" name="path" type="String"> </argument> <description> - Preload a resource from the filesystem. The resource is loaded during script parsing. + Returns a resource from the filesystem that is loaded during script parsing. Note: resource paths can be obtained by right clicking on a resource in the Assets Pannel and choosing "Copy Path". + [codeblock] + # load a scene called main located in the root of the project directory + var main = preload("res://main.tscn") </description> </method> <method name="print" qualifiers="vararg"> <return type="void"> </return> <description> - Print one or more arguments to strings in the best way possible to a console line. + Converts one or more arguments to strings in the best way possible and prints them to the console. + [codeblock] + a = [1,2,3] + print("a","b",a) + [/codeblock] + Prints ab[1, 2, 3] </description> </method> <method name="print_stack"> @@ -751,7 +900,7 @@ <constant name="INF" value="inf" enum=""> A positive infinity. (For negative infinity, use -INF). </constant> - <constant name="NAN" value="nan" enum=""> + <constant name="NAN" value="-nan(ind)" enum=""> Macro constant that expands to an expression of type float that represents a NaN. The NaN values are used to identify undefined or non-representable values for floating-point elements, such as the square root of negative numbers or the result of 0/0. </constant> @@ -2007,32 +2156,40 @@ </class> <class name="ARVRAnchor" inherits="Spatial" category="Core"> <brief_description> + Anchor point in AR Space </brief_description> <description> + The ARVR Anchor point is a spatial node that maps a real world location identified by the AR platform to a position within the game world. For example, as long as plane detection in ARKit is on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors for them. + This node is mapped to one of the anchors through its unique id. When you receive a signal that a new anchor is available you should add this node to your scene for that anchor. You can predefine nodes and set the id and the nodes will simply remain on 0,0,0 until a plane is recognised. + Keep in mind that as long as plane detection is enable the size, placing and orientation of an anchor will be updates as the detection logic learns more about the real world out there especially if only part of the surface is in view. </description> <methods> <method name="get_anchor_id" qualifiers="const"> <return type="int"> </return> <description> + Returns the anchor id for this anchor. </description> </method> <method name="get_anchor_name" qualifiers="const"> <return type="String"> </return> <description> + Returns the name given to this anchor. </description> </method> <method name="get_is_active" qualifiers="const"> <return type="bool"> </return> <description> + Returns true if the anchor is being tracked and false if no anchor with this id is currently known. </description> </method> <method name="get_size" qualifiers="const"> <return type="Vector3"> </return> <description> + Returns the estimated size of the plane that was detected. Say when the anchor relates to a table in the real world, this is the estimated size of the surface of that table. </description> </method> <method name="set_anchor_id"> @@ -2041,6 +2198,7 @@ <argument index="0" name="anchor_id" type="int"> </argument> <description> + Binds this anchor node to an anchor with this id. You can set this before the anchor itself exists. The first anchor that is identified gets id 1, the second id 2, etc. When anchors get removed that slot remains free and can be assigned to the next anchor that is identified. The most common situation where anchors 'disappear' is when the AR server identifies that two anchors represent different parts of the same plane and merge them. </description> </method> </methods> @@ -2053,8 +2211,11 @@ </class> <class name="ARVRCamera" inherits="Camera" category="Core"> <brief_description> + A camera node with a few overrules for AR/VR applied such as location tracking. </brief_description> <description> + This is a helper spatial node for our camera, note that if stereoscopic rendering is applicable (VR-HMD) most of the camera properties are ignored as the HMD information overrides them. The only properties that can be trusted are the near and far planes. + The position and orientation of this node is automatically updated by the ARVR Server to represent the location of the HMD if such tracking is available and can thus be used by game logic. Note that in contrast to the ARVR Controller the render thread has access to the most up to date tracking data of the HMD and the location of the ARVRCamera can lag a few milliseconds behind what is used for rendering as a result. </description> <methods> </methods> @@ -2063,26 +2224,39 @@ </class> <class name="ARVRController" inherits="Spatial" category="Core"> <brief_description> + A spatial node representing a spatially tracked controller. </brief_description> <description> + This is a helper spatial node that is linked to the tracking of controllers. It also offers several handy pass throughs to the state of buttons and such on the controllers. + Controllers are linked by their id. You can create controller nodes before the controllers are available. Say your game always uses two controllers (one for each hand) you can predefine the controllers with id 1 and 2 and they will become active as soon as the controllers are identified. If you expect additional controllers to be used you should react to the signals and add ARVRController nodes to your scene. + The position of the controller node is automatically updated by the ARVR Server. This makes this node ideal to add child nodes to visualise the controller. </description> <methods> <method name="get_controller_id" qualifiers="const"> <return type="int"> </return> <description> + Returns the controller id currently assigned to this node. </description> </method> <method name="get_controller_name" qualifiers="const"> <return type="String"> </return> <description> + If active, returns the name of the associated controller if provided by the AR/VR SDK used. + </description> + </method> + <method name="get_hand" qualifiers="const"> + <return type="int" enum="ARVRPositionalTracker.TrackerHand"> + </return> + <description> </description> </method> <method name="get_is_active" qualifiers="const"> <return type="bool"> </return> <description> + Returns true if the controller bound to this node is currently active and being tracked. </description> </method> <method name="get_joystick_axis" qualifiers="const"> @@ -2091,12 +2265,14 @@ <argument index="0" name="axis" type="int"> </argument> <description> + Returns the value of the given axis for things like triggers, touchpads, etc. that are embedded into the controller. </description> </method> <method name="get_joystick_id" qualifiers="const"> <return type="int"> </return> <description> + Returns the ID of the joystick object bound to this. Every controller tracked by the ARVR Server that has buttons and axis will also be registered as a joystick within Godot. This means that all the normal joystick tracking and input mapping will work for buttons and axis found on the AR/VR controllers. This ID is purely offered as information so you can link up the controller with its joystick entry. </description> </method> <method name="is_button_pressed" qualifiers="const"> @@ -2105,6 +2281,7 @@ <argument index="0" name="button" type="int"> </argument> <description> + Is the given button currently pressed? </description> </method> <method name="set_controller_id"> @@ -2113,6 +2290,7 @@ <argument index="0" name="controller_id" type="int"> </argument> <description> + Changes the id that identifies the controller bound to this node. The first controller that the ARVR Server detects will have id 1, the second id 2, the third id 3, etc. When a controller is turned off that slot is freed ensuring that controllers will keep the same id while it is turned on even when controllers with lower ids are turned off. </description> </method> </methods> @@ -2125,12 +2303,14 @@ <argument index="0" name="button" type="int"> </argument> <description> + When a button on this controller is pressed, this signal is given. </description> </signal> <signal name="button_release"> <argument index="0" name="button" type="int"> </argument> <description> + When a button on this controller is released, this signal is given. </description> </signal> </signals> @@ -2139,50 +2319,64 @@ </class> <class name="ARVRInterface" inherits="Reference" category="Core"> <brief_description> + Base class for ARVR interface implementation. </brief_description> <description> + This class needs to be implemented to make an AR or VR platform available to Godot and these should be implemented as C++ modules or GDNative modules (note that for GDNative the subclass ARVRScriptInterface should be used). Part of the interface is exposed to GDScript so you can detect, enable and configure an AR or VR platform. + Interfaces should be written in such a way that simply enabling them will give us a working setup. You can query the available interfaces through ARVRServer. </description> <methods> <method name="get_name" qualifiers="const"> <return type="String"> </return> <description> + Returns the name of this interface (OpenVR, OpenHMD, ARKit, etc). </description> </method> <method name="get_recommended_render_targetsize"> <return type="Vector2"> </return> <description> + Returns the resolution at which we should render our intermediate results before things like lens distortion are applied by the VR platform. </description> </method> <method name="hmd_is_present"> <return type="bool"> </return> <description> + Returns true if an HMD is available for this interface. </description> </method> <method name="initialize"> <return type="bool"> </return> <description> + Call this to initialize this interface. The first interface that is initialized is identified as the primary interface and it will be used for rendering output. + After initializing the interface you want to use you then need to enable the AR/VR mode of a viewport and rendering should commence. + Note that you must enable the AR/VR mode on the main viewport for any device that uses the main output of Godot such as for mobile VR. + If you do this for a platform that handles its own output (such as OpenVR) Godot will show just one eye without distortion on screen. Alternatively you can add a separate viewport node to your scene and enable AR/VR on that viewport and it will be used to output to the HMD leaving you free to do anything you like in the main window such as using a separate camera as a spectator camera or render out something completely different. + While currently not used you can activate additional interfaces, you may wish to do this if you want to track controllers from other platforms. However at this point in time only one interface can render to an HMD. </description> </method> <method name="is_initialized"> <return type="bool"> </return> <description> + Returns true if this interface is active. </description> </method> <method name="is_installed"> <return type="bool"> </return> <description> + Returns true if this interface has been installed. Say your game is designed to work with OpenVR so you are using the OpenVR interface but the user hasn't installed SteamVR, this would return false. </description> </method> <method name="is_primary"> <return type="bool"> </return> <description> + Returns true if this interface is currently the primary interface (the interface responsible for showing the output). </description> </method> <method name="set_is_primary"> @@ -2191,18 +2385,21 @@ <argument index="0" name="enable" type="bool"> </argument> <description> + Set this interface to the primary interface (unset the old one). </description> </method> <method name="supports_hmd"> <return type="bool"> </return> <description> + Returns true if this interface supports HMDs and by extension uses stereo scopic rendering. </description> </method> <method name="uninitialize"> <return type="void"> </return> <description> + Turns the interface off. </description> </method> </methods> @@ -2212,23 +2409,32 @@ </members> <constants> <constant name="EYE_MONO" value="0"> + Mono output, this is mostly used internally when retrieving positioning information for our camera node or when stereo scopic rendering is not supported. </constant> <constant name="EYE_LEFT" value="1"> + Left eye output, this is mostly used internally when rendering the image for the left eye and obtaining positioning and projection information. </constant> <constant name="EYE_RIGHT" value="2"> + Right eye output, this is mostly used internally when rendering the image for the right eye and obtaining positioning and projection information. </constant> </constants> </class> <class name="ARVROrigin" inherits="Spatial" category="Core"> <brief_description> + Our origin point in AR/VR. </brief_description> <description> + This is a special node within the AR/VR system that maps the physical location of the center of our tracking space to the virtual location within our game world. + There should be only one of these nodes in your scene and you must have one. All the ARVRCamera, ARVRController and ARVRAnchor nodes should be direct children of this node for spatial tracking to work correctly. + It is the position of this node that you update when you're character needs to move through your game world while we're not moving in the real world. Movement in the real world is always in relation to this origin point. + So say that your character is driving a car, the ARVROrigin node should be a child node of this car. If you implement a teleport system to move your character, you change the position of this node. Etc. </description> <methods> <method name="get_world_scale" qualifiers="const"> <return type="float"> </return> <description> + Get the world scale applied to our positioning. </description> </method> <method name="set_world_scale"> @@ -2237,6 +2443,9 @@ <argument index="0" name="world_scale" type="float"> </argument> <description> + Changes the world scaling factor. + Most AR/VR platforms will assume a unit size of 1 unit in your game world = 1 meter in the real world. This scale allows you to adjust this to the unit system you use in your game. + Note that this method is a passthrough to the ARVRServer itself. </description> </method> </methods> @@ -2249,44 +2458,60 @@ </class> <class name="ARVRPositionalTracker" inherits="Object" category="Core"> <brief_description> + A tracked object </brief_description> <description> + An instance of this object represents a device that is tracked such as a controller or anchor point. HMDs aren't represented here as they are fully handled internally. + As controllers are turned on and the AR/VR interface detects them instances of this object are automatically added to this list of active tracking objects accessible through the ARVRServer + The ARVRController and ARVRAnchor both consume objects of this type and should be the objects you use in game. The positional trackers are just the under the hood objects that make this all work and are mostly exposed so GDNative based interfaces can interact with them. </description> <methods> + <method name="get_hand" qualifiers="const"> + <return type="int" enum="ARVRPositionalTracker.TrackerHand"> + </return> + <description> + </description> + </method> <method name="get_joy_id" qualifiers="const"> <return type="int"> </return> <description> + If this is a controller that is being tracked the controller will also be represented by a joystick entry with this id. </description> </method> <method name="get_name" qualifiers="const"> <return type="String"> </return> <description> + If available this returns the name of the controller or anchor point. </description> </method> <method name="get_orientation" qualifiers="const"> <return type="Basis"> </return> <description> + Returns the orientation matrix of the controller. </description> </method> <method name="get_position" qualifiers="const"> <return type="Vector3"> </return> <description> + Returns the position of the controller adjusted by world scale. </description> </method> <method name="get_tracks_orientation" qualifiers="const"> <return type="bool"> </return> <description> + Returns true if the orientation of this device is being tracked. </description> </method> <method name="get_tracks_position" qualifiers="const"> <return type="bool"> </return> <description> + Returns true if the position of this device is being tracked. </description> </method> <method name="get_transform" qualifiers="const"> @@ -2295,28 +2520,39 @@ <argument index="0" name="adjust_by_reference_frame" type="bool"> </argument> <description> + Returns the transform combining the orientation and position of this device. </description> </method> <method name="get_type" qualifiers="const"> <return type="int" enum="ARVRServer.TrackerType"> </return> <description> + Type of tracker. </description> </method> </methods> <constants> + <constant name="TRACKER_HAND_UNKNOWN" value="0"> + </constant> + <constant name="TRACKER_LEFT_HAND" value="1"> + </constant> + <constant name="TRACKER_RIGHT_HAND" value="2"> + </constant> </constants> </class> <class name="ARVRScriptInterface" inherits="ARVRInterface" category="Core"> <brief_description> + Base class for GDNative based ARVR interfaces. </brief_description> <description> + This class is used as a base class/interface class for implementing GDNative based ARVR interfaces and as a result exposes more of the internals of the ARVR server. </description> <methods> <method name="_get_projection_for_eye" qualifiers="virtual"> <return type="void"> </return> <description> + Should return the projection 4x4 matrix for the requested eye. </description> </method> <method name="commit_for_eye" qualifiers="virtual"> @@ -2327,12 +2563,14 @@ <argument index="1" name="render_target" type="RID"> </argument> <description> + Outputs a finished render buffer to the AR/VR device for the given eye. </description> </method> <method name="get_recommended_render_targetsize" qualifiers="virtual"> <return type="Vector2"> </return> <description> + Returns the size at which we should render our scene to get optimal quality on the output device. </description> </method> <method name="get_transform_for_eye" qualifiers="virtual"> @@ -2343,54 +2581,63 @@ <argument index="1" name="cam_transform" type="Transform"> </argument> <description> + Get the location and orientation transform used when rendering a specific eye. </description> </method> <method name="hmd_is_present" qualifiers="virtual"> <return type="bool"> </return> <description> + Return true is an HMD is available. </description> </method> <method name="initialize" qualifiers="virtual"> <return type="bool"> </return> <description> + Initialize this interface. </description> </method> <method name="is_initialized" qualifiers="virtual"> <return type="bool"> </return> <description> + Returns true if this interface has been initialized and is active. </description> </method> <method name="is_installed" qualifiers="virtual"> <return type="bool"> </return> <description> + Returns true if the required middleware is installed. </description> </method> <method name="is_stereo" qualifiers="virtual"> <return type="bool"> </return> <description> + Returns true if we require stereoscopic rendering for this interface. </description> </method> <method name="process" qualifiers="virtual"> <return type="void"> </return> <description> + Gets called before rendering each frame so tracking data gets updated in time. </description> </method> <method name="supports_hmd" qualifiers="virtual"> <return type="bool"> </return> <description> + Returns true if this interface supports HMDs. </description> </method> <method name="uninitialize" qualifiers="virtual"> <return type="void"> </return> <description> + Turn this interface off. </description> </method> </methods> @@ -2399,8 +2646,10 @@ </class> <class name="ARVRServer" inherits="Object" category="Core"> <brief_description> + This is our AR/VR Server. </brief_description> <description> + The AR/VR Server is the heart of our AR/VR solution and handles all the processing. </description> <methods> <method name="add_interface"> @@ -2409,6 +2658,7 @@ <argument index="0" name="arg0" type="ARVRInterface"> </argument> <description> + Mostly exposed for GDNative based interfaces, this is called to register an available interface with the AR/VR server. </description> </method> <method name="find_interface" qualifiers="const"> @@ -2417,6 +2667,7 @@ <argument index="0" name="name" type="String"> </argument> <description> + Find an interface by its name. Say that you're making a game that uses specific capabilities of an AR/VR platform you can find the interface for that platform by name and initialize it. </description> </method> <method name="get_interface" qualifiers="const"> @@ -2425,18 +2676,21 @@ <argument index="0" name="idx" type="int"> </argument> <description> + Get the interface registered at a given index in our list of interfaces. </description> </method> <method name="get_interface_count" qualifiers="const"> <return type="int"> </return> <description> + Get the number of interfaces currently registered with the AR/VR server. If you're game supports multiple AR/VR platforms you can look throught the available interface and either present the user with a selection or simply try an initialize each interface and use the first one that returns true. </description> </method> <method name="get_reference_frame" qualifiers="const"> <return type="Transform"> </return> <description> + Gets our reference frame transform, mostly used internally and exposed for GDNative build interfaces. </description> </method> <method name="get_tracker" qualifiers="const"> @@ -2445,18 +2699,21 @@ <argument index="0" name="idx" type="int"> </argument> <description> + Get the positional tracker at the given ID. </description> </method> <method name="get_tracker_count" qualifiers="const"> <return type="int"> </return> <description> + Get the number of trackers currently registered. </description> </method> <method name="get_world_scale" qualifiers="const"> <return type="float"> </return> <description> + Returns our world scale (see ARVROrigin for more information). </description> </method> <method name="remove_interface"> @@ -2465,6 +2722,7 @@ <argument index="0" name="arg0" type="ARVRInterface"> </argument> <description> + Removes a registered interface, again exposed mostly for GDNative based interfaces. </description> </method> <method name="request_reference_frame"> @@ -2475,6 +2733,12 @@ <argument index="1" name="keep_height" type="bool"> </argument> <description> + This is a really important function to understand correctly. AR and VR platforms all handle positioning slightly differently. + For platforms that do not offer spatial tracking our origin point (0,0,0) is the location of our HMD but you have little control over the direction the player is facing in the real world. + For platforms that do offer spatial tracking our origin point depends very much on the system. For OpenVR our origin point is usually the center of the tracking space, on the ground. For other platforms its often the location of the tracking camera. + This method allows you to create a reference frame, it will take the current location of the HMD and use that to adjust all our tracking data in essence realigning the real world to your players current position in your game world. + For this method to produce usable results tracking information should be available and this often takes a few frames after starting your game. + You should call this method after a few seconds have passed, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, and when implementing a teleport mechanism. </description> </method> <method name="set_primary_interface"> @@ -2483,6 +2747,7 @@ <argument index="0" name="arg0" type="ARVRInterface"> </argument> <description> + Changes the primary interface to the specified interface. Again mostly exposed for GDNative interfaces. </description> </method> <method name="set_world_scale"> @@ -2491,6 +2756,7 @@ <argument index="0" name="arg0" type="float"> </argument> <description> + Changing the world scale, see the ARVROrigin documentation for more information. </description> </method> </methods> @@ -2503,12 +2769,14 @@ <argument index="0" name="name" type="String"> </argument> <description> + Signal send when a new interface has been added. </description> </signal> <signal name="interface_removed"> <argument index="0" name="name" type="String"> </argument> <description> + Signal send when an interface is removed. </description> </signal> <signal name="tracker_added"> @@ -2516,28 +2784,42 @@ </argument> <argument index="1" name="type" type="int"> </argument> + <argument index="2" name="id" type="int"> + </argument> <description> + Signal send when a new tracker has been added. If you don't use a fixed number of controllers or if you're using ARVRAnchors for an AR solution it is important to react to this signal and add the appropriate ARVRController or ARVRAnchor node related to this new tracker. </description> </signal> <signal name="tracker_removed"> <argument index="0" name="name" type="String"> </argument> + <argument index="1" name="type" type="int"> + </argument> + <argument index="2" name="id" type="int"> + </argument> <description> + Signal send when a tracker is removed, you should remove any ARVRController or ARVRAnchor points if applicable. This is not mandatory, the nodes simply become inactive and will be made active again when a new tracker becomes available (i.e. a new controller is switched on that takes the place of the previous one). </description> </signal> </signals> <constants> <constant name="TRACKER_CONTROLLER" value="1"> + Our tracker tracks the location of a controller. </constant> <constant name="TRACKER_BASESTATION" value="2"> + Our tracker tracks the location of a base station. </constant> <constant name="TRACKER_ANCHOR" value="4"> + Our tracker tracks the location and size of an AR anchor. </constant> <constant name="TRACKER_UNKNOWN" value="128"> + Used internally if we haven't set the tracker type yet. </constant> <constant name="TRACKER_ANY_KNOWN" value="127"> + Used internally to filter trackers of any known type. </constant> <constant name="TRACKER_ANY" value="255"> + Used interally to select all trackers. </constant> </constants> </class> @@ -2558,6 +2840,7 @@ <argument index="1" name="to_id" type="int"> </argument> <description> + Called when computing the cost between two connected points. </description> </method> <method name="_estimate_cost" qualifiers="virtual"> @@ -2568,6 +2851,7 @@ <argument index="1" name="to_id" type="int"> </argument> <description> + Called when estimating the cost between a point and the path's ending point. </description> </method> <method name="add_point"> @@ -2580,7 +2864,12 @@ <argument index="2" name="weight_scale" type="float" default="1.0"> </argument> <description> - Add a new point at the given position [code]pos[/code] with the given identifier [code]id[/code]. The [code]weight_scale[/code] has to be 1 or larger. + Adds a new point at the given position with the given identifier. The algorithm prefers points with lower [code]weight_scale[/code] to form a path. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 1 or larger. + [codeblock] + var as = AStar.new() + + as.add_point(1, Vector3(1,0,0), 4) # Adds the point (1,0,0) with weight_scale=4 and id=1 + [/codeblock] </description> </method> <method name="are_points_connected" qualifiers="const"> @@ -2591,14 +2880,14 @@ <argument index="1" name="to_id" type="int"> </argument> <description> - Returns if there is a connection/segment between points [code]id[/code] and [code]from_id[/code] + Returns whether there is a connection/segment between the given points. </description> </method> <method name="clear"> <return type="void"> </return> <description> - Clear all the points and segments from AStar instance. + Clears all the points and segments. </description> </method> <method name="connect_points"> @@ -2611,7 +2900,16 @@ <argument index="2" name="bidirectional" type="bool" default="true"> </argument> <description> - Create a segment between points [code]id[/code] and [code]to_id[/code]. + Creates a segment between the given points. + [codeblock] + var as = AStar.new() + + as.add_point(1, Vector3(1,1,0)) + as.add_point(2, Vector3(0,5,0)) + + as.connect_points(1, 2, false) # If bidirectional=false it's only possible to go from point 1 to point 2 + # and not from point 2 to point 1. + [/codeblock] </description> </method> <method name="disconnect_points"> @@ -2622,13 +2920,14 @@ <argument index="1" name="to_id" type="int"> </argument> <description> - Deletes a segment between points [code]id[/code] and [code]to_id[/code]. + Deletes the segment between the given points. </description> </method> <method name="get_available_point_id" qualifiers="const"> <return type="int"> </return> <description> + Returns an id with no point associated to it. </description> </method> <method name="get_closest_point" qualifiers="const"> @@ -2637,7 +2936,7 @@ <argument index="0" name="to_pos" type="Vector3"> </argument> <description> - Returns the id of closest point of given point. -1 is returned if there are no points on AStar. + Returns the id of the closest point to [code]to_pos[/code]. Returns -1 if there are no points in the points pool. </description> </method> <method name="get_closest_pos_in_segment" qualifiers="const"> @@ -2646,7 +2945,18 @@ <argument index="0" name="to_pos" type="Vector3"> </argument> <description> - Returns the position of closest point that has segments. + Returns the closest position to [code]to_pos[/code] that resides inside a segment between two connected points. + [codeblock] + var as = AStar.new() + + as.add_point(1, Vector3(0,0,0)) + as.add_point(2, Vector3(0,5,0)) + + as.connect_points(1, 2) + + var res = as.get_closest_pos_in_segment(Vector3(3,3,0)) # returns (0, 3, 0) + [/codeblock] + The result is in the segment that goes from [code]y=0[/code] to [code]y=5[/code]. It's the closest position in the segment to the given point. </description> </method> <method name="get_id_path"> @@ -2657,7 +2967,24 @@ <argument index="1" name="to_id" type="int"> </argument> <description> - Returns an array with the point ids of path found by AStar between two given points. + Returns an array with the ids of the points that form the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path. + [codeblock] + var as = AStar.new() + + as.add_point(1, Vector3(0,0,0)) + as.add_point(2, Vector3(0,1,0), 1) # default weight is 1 + as.add_point(3, Vector3(1,1,0)) + as.add_point(4, Vector3(2,0,0)) + + as.connect_points(1, 2, false) + as.connect_points(2, 3, false) + as.connect_points(4, 3, false) + as.connect_points(1, 4, false) + as.connect_points(5, 4, false) + + var res = as.get_id_path(1, 3) # returns [1, 2, 3] + [/codeblock] + If you change the 2nd point's weight to 3, then the result will be [code][1, 4, 3][/code] instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. </description> </method> <method name="get_point_path"> @@ -2668,7 +2995,7 @@ <argument index="1" name="to_id" type="int"> </argument> <description> - Returns an array with the points of path found by AStar between two given points. + Returns an array with the points that are in the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path. </description> </method> <method name="get_point_pos" qualifiers="const"> @@ -2677,7 +3004,7 @@ <argument index="0" name="id" type="int"> </argument> <description> - Returns the position of point with given id. + Returns the position of the point associated with the given id. </description> </method> <method name="get_point_weight_scale" qualifiers="const"> @@ -2686,7 +3013,13 @@ <argument index="0" name="id" type="int"> </argument> <description> - Returns the weight scale of point with given id. + Returns the weight scale of the point associated with the given id. + </description> + </method> + <method name="get_points"> + <return type="Array"> + </return> + <description> </description> </method> <method name="has_point" qualifiers="const"> @@ -2695,7 +3028,7 @@ <argument index="0" name="id" type="int"> </argument> <description> - Returns if the point with given id exists on AStar; + Returns whether a point associated with the given id exists. </description> </method> <method name="remove_point"> @@ -2704,7 +3037,7 @@ <argument index="0" name="id" type="int"> </argument> <description> - Removes the point with given id. + Removes the point associated with the given id from the points pool. </description> </method> </methods> @@ -5083,10 +5416,10 @@ </class> <class name="Area2D" inherits="CollisionObject2D" category="Core"> <brief_description> - General purpose area detection and influence for 2D physics. + 2D area that detects nodes that enter or exit it. Can override 2D physics properties within range. </brief_description> <description> - 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. + 2D area that detects nodes that enter or exit it. Change the 'space_override' property SPACE_OVERRIDE_* to override physics parameters for nodes like [Rigidbody2D]. E.g. gravity, damping... See [CollisionObject2D] for usage. </description> <methods> <method name="get_angular_damp" qualifiers="const"> @@ -5115,14 +5448,14 @@ <argument index="0" name="bit" type="int"> </argument> <description> - Return an individual bit on the layer mask. + Return an individual bit on the layer mask. Describes whether other areas will collide with this one on the given layer. </description> </method> <method name="get_collision_mask" qualifiers="const"> <return type="int"> </return> <description> - Return the physics layers this area can scan for collisions. + Return the physics layers this area will scan to determine collisions. </description> </method> <method name="get_collision_mask_bit" qualifiers="const"> @@ -5131,7 +5464,7 @@ <argument index="0" name="bit" type="int"> </argument> <description> - Return an individual bit on the collision mask. + Return an individual bit on the collision mask. Describes whether this area will collide with others on the given layer. </description> </method> <method name="get_gravity" qualifiers="const"> @@ -5166,14 +5499,14 @@ <return type="Array"> </return> <description> - Return a list of the areas that are totally or partially inside this area. + Returns a list of the [Area2D]s that intersect with this area. </description> </method> <method name="get_overlapping_bodies" qualifiers="const"> <return type="Array"> </return> <description> - Return a list of the bodies ([PhysicsBody2D]) that are totally or partially inside this area. + Return a list of the [PhysicsBody2D]s that intersect with this area. </description> </method> <method name="get_priority" qualifiers="const"> @@ -5382,7 +5715,7 @@ <method name="set_space_override_mode"> <return type="void"> </return> - <argument index="0" name="enable" type="int" enum="Area2D.SpaceOverride"> + <argument index="0" name="space_override_mode" type="int" enum="Area2D.SpaceOverride"> </argument> <description> Set the space override mode. This mode controls how an area affects gravity and damp. @@ -5396,32 +5729,49 @@ </methods> <members> <member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" brief=""> + The rate at which objects stop spinning in this area. Represents the amount of speed lost per second. If 1.0, physics bodies in the area stop rotating immediately. If 0.0, they never slow down. Does not incorporate external forces. The physics-update's rate affects 'angular_damp'. </member> <member name="audio_bus_name" type="String" setter="set_audio_bus" getter="get_audio_bus" brief=""> + The name of the Area2D's audio bus. </member> <member name="audio_bus_override" type="bool" setter="set_audio_bus_override" getter="is_overriding_audio_bus" brief=""> + If [code]true[/code], overrides the default audio bus with the Area2D's. Defaults to [code]false[/code]. </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief=""> + The physics layer this Area2D 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 layers that object A scans. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" brief=""> + The physics layers this Area2D scans to determine collision detections. </member> <member name="gravity" type="float" setter="set_gravity" getter="get_gravity" brief=""> + The gravity intensity within the Area2D (ranges -1024 to 1024). 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). </member> <member name="gravity_distance_scale" type="float" setter="set_gravity_distance_scale" getter="get_gravity_distance_scale" brief=""> + The falloff factor for point gravity. The greater this value is, the faster the strength of gravity decreases with the square of distance. </member> <member name="gravity_point" type="bool" setter="set_gravity_is_point" getter="is_gravity_a_point" brief=""> + If [code]true[/code], calculates gravity from a particular point during a space override (see [method set_space_override_mode]). If a point, [Vector2] position is set with [method set_gravity_vector]. Defaults to [code]false[/code]. </member> <member name="gravity_vec" type="Vector2" setter="set_gravity_vector" getter="get_gravity_vector" brief=""> + The gravitational direction/strength as a vector (not normalized). If gravity is a point (see [method is_gravity_a_point]), this will be the attraction center. </member> <member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" brief=""> + The rate at which objects stop spinning in this area. Represents the amount of speed lost per second. If 1.0, physics bodies in the area stop rotating immediately. If 0.0, they never slow down. Does not incorporate external forces. The physics-update's rate affects 'angular_damp'. </member> <member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable" brief=""> + If [code]true[/code], other monitoring areas can detect this Area2D (is it undetectable at the moment?). Defaults to [code]true[/code]. </member> <member name="monitoring" type="bool" setter="set_monitoring" getter="is_monitoring" brief=""> + If [code]true[/code], this detects bodies/areas entering/exiting it (can it detect others at the moment?). Defaults to [code]true[/code]. </member> <member name="priority" type="float" setter="set_priority" getter="get_priority" brief=""> + The processing order for this priority. Ranges from 0 to 128. Defaults to 0. Higher priorities are processed first. </member> <member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" brief="" enum="Area2D.SpaceOverride"> + How to override gravity and damping calculations within this Area2D, if at all. Consult the SPACE_OVERRIDE_* constants for available options. </member> </members> <signals> @@ -5507,6 +5857,21 @@ </signal> </signals> <constants> + <constant name="SPACE_OVERRIDE_DISABLED" value="0"> + This area does not affect gravity/damp. These are areas that exist only to detect collisions and objects entering or exiting them. + </constant> + <constant name="SPACE_OVERRIDE_COMBINE" value="1"> + 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. + </constant> + <constant name="SPACE_OVERRIDE_COMBINE_REPLACE" value="2"> + 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. + </constant> + <constant name="SPACE_OVERRIDE_REPLACE" value="3"> + This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. + </constant> + <constant name="SPACE_OVERRIDE_REPLACE_COMBINE" value="4"> + This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one. + </constant> </constants> </class> <class name="Array" category="Built-In Types"> @@ -5606,6 +5971,12 @@ Return the amount of times an element is in the array. </description> </method> + <method name="duplicate"> + <return type="Array"> + </return> + <description> + </description> + </method> <method name="empty"> <return type="bool"> </return> @@ -5870,6 +6241,22 @@ Return the length in vertices of the vertex array in the requested surface (see [method add_surface]). </description> </method> + <method name="surface_get_arrays" qualifiers="const"> + <return type="Array"> + </return> + <argument index="0" name="surf_idx" type="int"> + </argument> + <description> + </description> + </method> + <method name="surface_get_blend_shape_arrays" qualifiers="const"> + <return type="Array"> + </return> + <argument index="0" name="surf_idx" type="int"> + </argument> + <description> + </description> + </method> <method name="surface_get_format" qualifiers="const"> <return type="int"> </return> @@ -6073,8 +6460,10 @@ </class> <class name="AudioEffect" inherits="Resource" category="Core"> <brief_description> + Audio Effect For Audio. </brief_description> <description> + Base resource for audio bus. Applies an audio effect on the bus that the resource is applied on. </description> <methods> </methods> @@ -6083,14 +6472,17 @@ </class> <class name="AudioEffectAmplify" inherits="AudioEffect" category="Core"> <brief_description> + Amplifies the volume of an audio source. </brief_description> <description> + Amplifies the volume of an audio source. Increase gain of the audio being routed through the bus. </description> <methods> <method name="get_volume_db" qualifiers="const"> <return type="float"> </return> <description> + Returns the set maximum volume. </description> </method> <method name="set_volume_db"> @@ -6099,11 +6491,13 @@ <argument index="0" name="volume" type="float"> </argument> <description> + Sets the maximum volume. </description> </method> </methods> <members> <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" brief=""> + The effect's volume limit. </member> </members> <constants> @@ -6131,20 +6525,24 @@ </class> <class name="AudioEffectChorus" inherits="AudioEffect" category="Core"> <brief_description> + Adds a chorus audio effect. </brief_description> <description> + Adds a chorus audio effect. The effect applies a filter with voices to duplicate the audio source and manipulate it through the filter. </description> <methods> <method name="get_dry" qualifiers="const"> <return type="float"> </return> <description> + Returns the set dry ratio. </description> </method> <method name="get_voice_count" qualifiers="const"> <return type="int"> </return> <description> + Returns the set voice count. </description> </method> <method name="get_voice_cutoff_hz" qualifiers="const"> @@ -6153,6 +6551,7 @@ <argument index="0" name="voice_idx" type="int"> </argument> <description> + Returns the voice's set cutoff frequency. </description> </method> <method name="get_voice_delay_ms" qualifiers="const"> @@ -6161,6 +6560,7 @@ <argument index="0" name="voice_idx" type="int"> </argument> <description> + Returns the voice's set delay. </description> </method> <method name="get_voice_depth_ms" qualifiers="const"> @@ -6169,6 +6569,7 @@ <argument index="0" name="voice_idx" type="int"> </argument> <description> + Returns the voice's set filter depth. </description> </method> <method name="get_voice_level_db" qualifiers="const"> @@ -6177,6 +6578,7 @@ <argument index="0" name="voice_idx" type="int"> </argument> <description> + Returns the voice's set maximum volume. </description> </method> <method name="get_voice_pan" qualifiers="const"> @@ -6185,6 +6587,7 @@ <argument index="0" name="voice_idx" type="int"> </argument> <description> + Returns the voice's set pan. </description> </method> <method name="get_voice_rate_hz" qualifiers="const"> @@ -6193,12 +6596,14 @@ <argument index="0" name="voice_idx" type="int"> </argument> <description> + Returns the voice filter's set rate in cycles. </description> </method> <method name="get_wet" qualifiers="const"> <return type="float"> </return> <description> + Returns the set applied wetness of the effect. </description> </method> <method name="set_dry"> @@ -6207,6 +6612,7 @@ <argument index="0" name="amount" type="float"> </argument> <description> + Returns the set applied dryness of the effect. </description> </method> <method name="set_voice_count"> @@ -6215,6 +6621,7 @@ <argument index="0" name="voices" type="int"> </argument> <description> + Set the number of voices in the effect's filter. </description> </method> <method name="set_voice_cutoff_hz"> @@ -6225,6 +6632,7 @@ <argument index="1" name="cutoff_hz" type="float"> </argument> <description> + Set the cutoff frequency of the voice. The maximum frequency the voice may affect. </description> </method> <method name="set_voice_delay_ms"> @@ -6235,6 +6643,7 @@ <argument index="1" name="delay_ms" type="float"> </argument> <description> + Set the delay of the voice's signal. </description> </method> <method name="set_voice_depth_ms"> @@ -6245,6 +6654,7 @@ <argument index="1" name="depth_ms" type="float"> </argument> <description> + Set the filter depth of the voice's signal. </description> </method> <method name="set_voice_level_db"> @@ -6255,6 +6665,7 @@ <argument index="1" name="level_db" type="float"> </argument> <description> + Set the volume level of the voice. </description> </method> <method name="set_voice_pan"> @@ -6265,6 +6676,7 @@ <argument index="1" name="pan" type="float"> </argument> <description> + Set the pan level of the voice. </description> </method> <method name="set_voice_rate_hz"> @@ -6275,6 +6687,7 @@ <argument index="1" name="rate_hz" type="float"> </argument> <description> + Set the voice filter's rate. </description> </method> <method name="set_wet"> @@ -6283,63 +6696,91 @@ <argument index="0" name="amount" type="float"> </argument> <description> + Set the amount of effect. </description> </method> </methods> <members> <member name="dry" type="float" setter="set_dry" getter="get_dry" brief=""> + The effect's raw signal. </member> <member name="voice/1/cutoff_hz" type="float" setter="set_voice_cutoff_hz" getter="get_voice_cutoff_hz" brief=""> + The voice's cutoff frequency. </member> <member name="voice/1/delay_ms" type="float" setter="set_voice_delay_ms" getter="get_voice_delay_ms" brief=""> + The voice's signal delay. </member> <member name="voice/1/depth_ms" type="float" setter="set_voice_depth_ms" getter="get_voice_depth_ms" brief=""> + The voice filter's depth. </member> <member name="voice/1/level_db" type="float" setter="set_voice_level_db" getter="get_voice_level_db" brief=""> + The voice's volume. </member> <member name="voice/1/pan" type="float" setter="set_voice_pan" getter="get_voice_pan" brief=""> + The voice's pan level. </member> <member name="voice/1/rate_hz" type="float" setter="set_voice_rate_hz" getter="get_voice_rate_hz" brief=""> + The voice's filter rate. </member> <member name="voice/2/cutoff_hz" type="float" setter="set_voice_cutoff_hz" getter="get_voice_cutoff_hz" brief=""> + The voice's cutoff frequency. </member> <member name="voice/2/delay_ms" type="float" setter="set_voice_delay_ms" getter="get_voice_delay_ms" brief=""> + The voice's signal delay. </member> <member name="voice/2/depth_ms" type="float" setter="set_voice_depth_ms" getter="get_voice_depth_ms" brief=""> + The voice filter's depth. </member> <member name="voice/2/level_db" type="float" setter="set_voice_level_db" getter="get_voice_level_db" brief=""> + The voice's volume. </member> <member name="voice/2/pan" type="float" setter="set_voice_pan" getter="get_voice_pan" brief=""> + The voice's pan level. </member> <member name="voice/2/rate_hz" type="float" setter="set_voice_rate_hz" getter="get_voice_rate_hz" brief=""> + The voice's filter rate. </member> <member name="voice/3/cutoff_hz" type="float" setter="set_voice_cutoff_hz" getter="get_voice_cutoff_hz" brief=""> + The voice's cutoff frequency. </member> <member name="voice/3/delay_ms" type="float" setter="set_voice_delay_ms" getter="get_voice_delay_ms" brief=""> + The voice's signal delay. </member> <member name="voice/3/depth_ms" type="float" setter="set_voice_depth_ms" getter="get_voice_depth_ms" brief=""> + The voice filter's depth. </member> <member name="voice/3/level_db" type="float" setter="set_voice_level_db" getter="get_voice_level_db" brief=""> + The voice's volume. </member> <member name="voice/3/pan" type="float" setter="set_voice_pan" getter="get_voice_pan" brief=""> + The voice's pan level. </member> <member name="voice/3/rate_hz" type="float" setter="set_voice_rate_hz" getter="get_voice_rate_hz" brief=""> + The voice's filter rate. </member> <member name="voice/4/cutoff_hz" type="float" setter="set_voice_cutoff_hz" getter="get_voice_cutoff_hz" brief=""> + The voice's cutoff frequency. </member> <member name="voice/4/delay_ms" type="float" setter="set_voice_delay_ms" getter="get_voice_delay_ms" brief=""> + The voice's signal delay. </member> <member name="voice/4/depth_ms" type="float" setter="set_voice_depth_ms" getter="get_voice_depth_ms" brief=""> + The voice filter's depth. </member> <member name="voice/4/level_db" type="float" setter="set_voice_level_db" getter="get_voice_level_db" brief=""> + The voice's volume. </member> <member name="voice/4/pan" type="float" setter="set_voice_pan" getter="get_voice_pan" brief=""> + The voice's pan level. </member> <member name="voice/4/rate_hz" type="float" setter="set_voice_rate_hz" getter="get_voice_rate_hz" brief=""> + The voice's filter rate. </member> <member name="voice_count" type="int" setter="set_voice_count" getter="get_voice_count" brief=""> + The amount of voices in the effect. </member> <member name="wet" type="float" setter="set_wet" getter="get_wet" brief=""> + The effect's processed signal. </member> </members> <constants> @@ -7903,7 +8344,7 @@ </member> <member name="mix_target" type="int" setter="set_mix_target" getter="get_mix_target" brief="" enum="AudioStreamPlayer.MixTarget"> </member> - <member name="playing" type="bool" setter="_set_playing" getter="_is_active" brief=""> + <member name="play" type="bool" setter="_set_playing" getter="_is_active" brief=""> </member> <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" brief=""> </member> @@ -8069,7 +8510,7 @@ </member> <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" brief=""> </member> - <member name="playing" type="bool" setter="_set_playing" getter="_is_active" brief=""> + <member name="play" type="bool" setter="_set_playing" getter="_is_active" brief=""> </member> <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" brief=""> </member> @@ -8377,7 +8818,7 @@ </member> <member name="out_of_range_mode" type="int" setter="set_out_of_range_mode" getter="get_out_of_range_mode" brief="" enum="AudioStreamPlayer3D.OutOfRangeMode"> </member> - <member name="playing" type="bool" setter="_set_playing" getter="_is_active" brief=""> + <member name="play" type="bool" setter="_set_playing" getter="_is_active" brief=""> </member> <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" brief=""> </member> @@ -9025,8 +9466,10 @@ </class> <class name="BitMap" inherits="Resource" category="Core"> <brief_description> + Boolean matrix. </brief_description> <description> + A two-dimensional array of boolean values, can be used to efficiently store a binary matrix (every matrix element takes only one bit) and query the values using natural cartesian coordinates. </description> <methods> <method name="create"> @@ -9035,6 +9478,7 @@ <argument index="0" name="size" type="Vector2"> </argument> <description> + Creates a bitmap with the specified size, filled with false. </description> </method> <method name="create_from_image_alpha"> @@ -9043,6 +9487,7 @@ <argument index="0" name="image" type="Image"> </argument> <description> + Creates a bitmap that matches the given image dimensions, every element of the bitmap is set to false if the alpha value of the image at that position is 0, and true in other case. </description> </method> <method name="get_bit" qualifiers="const"> @@ -9051,18 +9496,21 @@ <argument index="0" name="pos" type="Vector2"> </argument> <description> + Returns bitmap's value at the specified position. </description> </method> <method name="get_size" qualifiers="const"> <return type="Vector2"> </return> <description> + Returns bitmap's dimensions. </description> </method> <method name="get_true_bit_count" qualifiers="const"> <return type="int"> </return> <description> + Returns the amount of bitmap elements that are set to true. </description> </method> <method name="set_bit"> @@ -9073,6 +9521,7 @@ <argument index="1" name="bit" type="bool"> </argument> <description> + Sets the bitmap's element at the specified position, to the specified value. </description> </method> <method name="set_bit_rect"> @@ -9083,6 +9532,7 @@ <argument index="1" name="bit" type="bool"> </argument> <description> + Sets a rectangular portion of the bitmap to the specified value. </description> </method> </methods> @@ -9261,6 +9711,7 @@ <return type="String"> </return> <description> + Returns the name of the bone node attached to. </description> </method> <method name="set_bone_name"> @@ -9269,6 +9720,7 @@ <argument index="0" name="bone_name" type="String"> </argument> <description> + Changes the name of the bone node </description> </method> </methods> @@ -9370,35 +9822,30 @@ <return type="Texture"> </return> <description> - Return the button icon. </description> </method> <method name="get_clip_text" qualifiers="const"> <return type="bool"> </return> <description> - Return the state of the [i]clip_text[/i] property (see [method set_clip_text]) </description> </method> <method name="get_text" qualifiers="const"> <return type="String"> </return> <description> - Return the button text. </description> </method> <method name="get_text_align" qualifiers="const"> <return type="int" enum="Button.TextAlign"> </return> <description> - Return the text alignment policy. </description> </method> <method name="is_flat" qualifiers="const"> <return type="bool"> </return> <description> - Return the state of the [i]flat[/i] property (see [method set_flat]). </description> </method> <method name="set_button_icon"> @@ -9407,7 +9854,6 @@ <argument index="0" name="texture" type="Texture"> </argument> <description> - Set the icon that will be displayed next to the text inside the button area. </description> </method> <method name="set_clip_text"> @@ -9416,7 +9862,6 @@ <argument index="0" name="enabled" type="bool"> </argument> <description> - 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. </description> </method> <method name="set_flat"> @@ -9425,7 +9870,6 @@ <argument index="0" name="enabled" type="bool"> </argument> <description> - Set the [i]flat[/i] property of a Button. Flat buttons don't display decoration unless hovered or pressed. </description> </method> <method name="set_text"> @@ -9434,7 +9878,6 @@ <argument index="0" name="text" type="String"> </argument> <description> - Set the button text, which will be displayed inside the button area. </description> </method> <method name="set_text_align"> @@ -9443,20 +9886,24 @@ <argument index="0" name="align" type="int" enum="Button.TextAlign"> </argument> <description> - Set the text alignment policy, using one of the ALIGN_* constants. </description> </method> </methods> <members> <member name="align" type="int" setter="set_text_align" getter="get_text_align" brief="" enum="Button.TextAlign"> + Text alignment policy for the button's text, use one of the ALIGN_* constants. </member> <member name="clip_text" type="bool" setter="set_clip_text" getter="get_clip_text" brief=""> + When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text. This property is disabled by default. </member> <member name="flat" type="bool" setter="set_flat" getter="is_flat" brief=""> + Flat buttons don't display decoration. </member> <member name="icon" type="Texture" setter="set_button_icon" getter="get_button_icon" brief=""> + Button's icon, if text is present the icon will be placed before the text. </member> <member name="text" type="String" setter="set_text" getter="get_text" brief=""> + The button's text that will be displayed inside the button's area. </member> </members> <constants> @@ -9464,7 +9911,7 @@ Align the text to the left. </constant> <constant name="ALIGN_CENTER" value="1"> - Center the text. + Align the text to the center. </constant> <constant name="ALIGN_RIGHT" value="2"> Align the text to the right. @@ -11033,8 +11480,10 @@ </class> <class name="CapsuleMesh" inherits="PrimitiveMesh" category="Core"> <brief_description> + Class representing a capsule-shaped [PrimitiveMesh]. </brief_description> <description> + Class representing a capsule-shaped [PrimitiveMesh]. </description> <methods> <method name="get_mid_height" qualifiers="const"> @@ -11096,12 +11545,16 @@ </methods> <members> <member name="mid_height" type="float" setter="set_mid_height" getter="get_mid_height" brief=""> + Height of the capsule mesh from the center point. Defaults to 1.0. </member> <member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments" brief=""> + Number of radial segments on the capsule mesh. Defaults to 64. </member> <member name="radius" type="float" setter="set_radius" getter="get_radius" brief=""> + Radius of the capsule mesh. Defaults to 1.0. </member> <member name="rings" type="int" setter="set_rings" getter="get_rings" brief=""> + Number of rings along the height of the capsule. Defaults to 8. </member> </members> <constants> @@ -12155,8 +12608,10 @@ </class> <class name="CollisionShape" inherits="Spatial" category="Core"> <brief_description> + Node that represents collision shape data in 3D space. </brief_description> <description> + Editor facility for creating and editing collision shapes in 3D space. You can use this node to represent all sorts of collision shapes, for example, add this to an [Area] to give it a detection shape, or add it to a [PhysicsBody] to give create solid object. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method get_shape] to get the actual shape. </description> <methods> <method name="get_shape" qualifiers="const"> @@ -12175,6 +12630,7 @@ <return type="void"> </return> <description> + Sets the collision shape's shape to the addition of all its convexed [MeshInstance] siblings geometry. </description> </method> <method name="resource_changed"> @@ -12183,6 +12639,7 @@ <argument index="0" name="resource" type="Resource"> </argument> <description> + If this method exists within a script it will be called whenever the shape resource has been modified. </description> </method> <method name="set_disabled"> @@ -12204,8 +12661,10 @@ </methods> <members> <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" brief=""> + A disabled collision shape has no effect in the world. </member> <member name="shape" type="Shape" setter="set_shape" getter="get_shape" brief=""> + The actual shape owned by this collision shape. </member> </members> <constants> @@ -12213,17 +12672,16 @@ </class> <class name="CollisionShape2D" inherits="Node2D" category="Core"> <brief_description> - Editor-only class for easy editing of shapes. + Node that represents collision shape data in 2D space. </brief_description> <description> - 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. + Editor facility for creating and editing collision shapes in 2D space. You can use this node to represent all sorts of collision shapes, for example, add this to an [Area2D] to give it a detection shape, or add it to a [PhysicsBody2D] to give create solid object. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method get_shape] to get the actual shape. </description> <methods> <method name="get_shape" qualifiers="const"> <return type="Shape2D"> </return> <description> - Return this shape's [Shape2D]. </description> </method> <method name="is_disabled" qualifiers="const"> @@ -12260,16 +12718,18 @@ <argument index="0" name="shape" type="Shape2D"> </argument> <description> - Set this shape's [Shape2D]. This will not appear as a node, but can be directly edited as a property. </description> </method> </methods> <members> <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" brief=""> + A disabled collision shape has no effect in the world. </member> <member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled" brief=""> + Sets whether this collision shape should only detect collision on one side (top or bottom). </member> <member name="shape" type="Shape2D" setter="set_shape" getter="get_shape" brief=""> + The actual shape owned by this collision shape. </member> </members> <constants> @@ -12277,10 +12737,10 @@ </class> <class name="Color" category="Built-In Types"> <brief_description> - Color in RGBA format. + Color in RGBA format with some support for ARGB format. </brief_description> <description> - 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. + 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(color)) may accept values > 1. </description> <methods> <method name="Color"> @@ -12295,7 +12755,10 @@ <argument index="3" name="a" type="float"> </argument> <description> - Construct the color from an RGBA profile. + Constructs a color from an RGBA profile using values between 0 and 1 (float). + [codeblock] + var c = Color(0.2, 1.0, .7, .8) # a color of an RGBA(51, 255, 178, 204) + [/codeblock] </description> </method> <method name="Color"> @@ -12308,7 +12771,10 @@ <argument index="2" name="b" type="float"> </argument> <description> - Construct the color from an RGBA profile. + Constructs a color from an RGB profile using values between 0 and 1 (float). Alpha will always be 1. + [codeblock] + var c = Color(0.2, 1.0, .7) # a color of an RGBA(51, 255, 178, 255) + [/codeblock] </description> </method> <method name="Color"> @@ -12317,7 +12783,10 @@ <argument index="0" name="from" type="int"> </argument> <description> - Construct the color from an RGBA profile. + Constructs a color from a 32-bit integer (each byte represents a component of the RGBA profile). + [codeblock] + var c = Color(274) # a color of an RGBA(0, 0, 1, 18) + [/codeblock] </description> </method> <method name="Color"> @@ -12326,7 +12795,19 @@ <argument index="0" name="from" type="String"> </argument> <description> - Construct the color from an RGBA profile. + Constructs a color from an HTML hexadecimal color string in ARGB or RGB format. + The following string formats are supported: + [code]"#ff00ff00"[/code] - ARGB format with '#' + [code]"ff00ff00"[/code] - ARGB format + [code]"#ff00ff"[/code] - RGB format with '#' + [code]"ff00ff"[/code] - RGB format + [codeblock] + # The following code creates the same color of an RGBA(178, 217, 10, 255) + var c1 = Color("#ffb2d90a") # ARGB format with '#' + var c2 = Color("ffb2d90a") # ARGB format + var c3 = Color("#b2d90a") # RGB format with '#' + var c4 = Color("b2d90a") # RGB format + [/codeblock] </description> </method> <method name="blend"> @@ -12335,28 +12816,46 @@ <argument index="0" name="over" type="Color"> </argument> <description> - Return a new color blended with anothor one. + Returns a new color resulting from blending this color over another color. If the color is opaque, the result would also be opaque. The other color could then take a range of values with different alpha values. + [codeblock] + var bg = Color(0.0, 1.0, 0.0, 0.5) # Green with alpha of 50% + var fg = Color(1.0, 0.0, 0.0, .5) # Red with alpha of 50% + var blendedColor = bg.blend(fg) # Brown with alpha of 75% + [/codeblock] </description> </method> <method name="contrasted"> <return type="Color"> </return> <description> - Return the most contrasting color with this one. + Returns the most contrasting color. + [codeblock] + var c = Color(.3, .4, .9) + var contrastedColor = c.contrasted() # a color of an RGBA(204, 229, 102, 255) + [/codeblock] </description> </method> <method name="gray"> <return type="float"> </return> <description> - Convert the color to gray. + Returns the color's grayscale. + The gray is calculated by (r + g + b) / 3. + [codeblock] + var c = Color(0.2, 0.45, 0.82) + var gray = c.gray() # a value of 0.466667 + [/codeblock] </description> </method> <method name="inverted"> <return type="Color"> </return> <description> - Return the inverted color (1-r, 1-g, 1-b, 1-a). + Returns the inverted color (1-r, 1-g, 1-b, 1-a). + [codeblock] + var c = Color(.3, .4, .9) + var invertedColor = c.inverted() # a color of an RGBA(178, 153, 26, 255) + [/codeblock] </description> </method> <method name="linear_interpolate"> @@ -12367,21 +12866,23 @@ <argument index="1" name="t" type="float"> </argument> <description> - Return the linear interpolation with another color. - </description> - </method> - <method name="to_32"> - <return type="int"> - </return> - <description> - Convert the color to a 32 its integer (each byte represents a RGBA). + Returns the color of the linear interpolation with another color. The value t is between 0 and 1 (float). + [codeblock] + var c1 = Color(1.0, 0.0, 0.0) + var c2 = Color(0.0, 1.0, 0.0) + var li_c = c1.linear_interpolate(c2, 0.5) # a color of an RGBA(128, 128, 0, 255) + [/codeblock] </description> </method> - <method name="to_ARGB32"> + <method name="to_argb32"> <return type="int"> </return> <description> - Convert color to ARGB32, more compatible with DirectX. + Returns the color's 32-bit integer in ARGB format (each byte represents a component of the ARGB profile). More compatible with DirectX. + [codeblock] + var c = Color(1, .5, .2) + print(str(c.to_32())) # prints 4294934323 + [/codeblock] </description> </method> <method name="to_html"> @@ -12390,7 +12891,26 @@ <argument index="0" name="with_alpha" type="bool" default="True"> </argument> <description> - Return the HTML hexadecimal color string. + Returns the color's HTML hexadecimal color string in ARGB format (ex: [code]ff34f822[/code]). + Optionally flag 'false' to not include alpha in hexadecimal string. + [codeblock] + var c = Color(1, 1, 1, .5) + var s1 = c.to_html() # Results "7fffffff" + var s2 = c.to_html(false) # Results 'ffffff' + [/codeblock] + </description> + </method> + <method name="to_rgba32"> + <return type="int"> + </return> + <description> + Returns the color's 32-bit integer in ARGB format (each byte represents a component of the ARGB profile). + [codeblock] + var c = Color(1, .5, .2) + print(str(c.to_32())) # prints 4294934323 + [/codeblock] + + [i]This is same as [method to_ARGB32] but may be changed later to support RGBA format instead[/i]. </description> </method> </methods> @@ -12572,6 +13092,12 @@ <argument index="0" name="color" type="Color"> </argument> <description> + Set new color to ColorRect. + + [codeblock] + var cr = get_node("colorrect_node") + cr.set_frame_color(Color(1, 0, 0, 1)) # Set color rect node to red + [/codeblock] </description> </method> </methods> @@ -12619,14 +13145,21 @@ </class> <class name="ColorRect" inherits="Control" category="Core"> <brief_description> + Colored rect for canvas. </brief_description> <description> + An object that is represented on the canvas as a rect with color. [Color] is used to set or get color info for the rect. </description> <methods> <method name="get_frame_color" qualifiers="const"> <return type="Color"> </return> <description> + Return the color in RGBA format. + [codeblock] + var cr = get_node("colorrect_node") + var c = cr.get_frame_color() # Default color is white + [/codeblock] </description> </method> <method name="set_frame_color"> @@ -12635,6 +13168,11 @@ <argument index="0" name="color" type="Color"> </argument> <description> + Set new color to ColorRect. + [codeblock] + var cr = get_node("colorrect_node") + cr.set_frame_color(Color(1, 0, 0, 1)) # Set color rect node to red + [/codeblock] </description> </method> </methods> @@ -12934,23 +13472,23 @@ </class> <class name="Control" inherits="CanvasItem" category="Core"> <brief_description> - Control is the base node for all the GUI components. + Base node for all User Interface components. </brief_description> <description> - 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. + The base class Node for all User Interface components. Every UI node inherits from it. Any scene or portion of a scene tree composed of Control nodes is a User Interface. + Controls use anchors and margins to place themselves relative to their parent. They adapt automatically when their parent or the screen size changes. To build flexible UIs, use built-in [Container] nodes or create your own. 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 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. + Godot sends Input events to the root node first, via [method Node._input]. The method distributes it through the node tree and delivers the input events to the node under the mouse cursor or on focus with the keyboard. To do so, it calls [method MainLoop._input_event]. No need to enable [method Node.set_process_input] on Controls to receive input events. Call [method accept_event] to ensure no other node receives the event, not even [method Node._unhandled_input]. + Only the one Control node in focus receives keyboard events. To do so, the Control must get the focus mode with [method set_focus_mode]. It loses focus when another Control gets it, or if the current Control in focus is hidden. + You'll sometimes want Controls to ignore mouse or touch events. For example, if you place an icon on top of a button. Call [method set_ignore_mouse] for that. + [Theme] resources change the Control's appearance. If you change the [Theme] on a parent Control node, it will propagate to all of its children. You can override parts of the theme on each Control with the add_*_override methods, like [method add_font_override]. You can also override the theme from the editor. </description> <methods> <method name="_get_minimum_size" qualifiers="virtual"> <return type="Vector2"> </return> <description> - Return the minimum size this Control can shrink to. A control will never be displayed or resized smaller than its minimum size. + Returns the minimum size this Control can shrink to. A control will never be displayed or resized smaller than its minimum size. </description> </method> <method name="_gui_input" qualifiers="virtual"> @@ -12965,7 +13503,7 @@ <return type="void"> </return> <description> - 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]. + Marks the input event as handled. No other Control will receive it, and the input event will not propagate. Not even to nodes listening to [method Node._unhandled_input] or [method Node._unhandled_key_input]. </description> </method> <method name="add_color_override"> @@ -13820,12 +14358,12 @@ <signals> <signal name="focus_entered"> <description> - Emitted when keyboard focus is gained. + Emitted when the node gains keyboard focus. </description> </signal> <signal name="focus_exited"> <description> - Emitted when the keyboard focus is lost. + Emitted when the node loses keyboard focus. </description> </signal> <signal name="gui_input"> @@ -13836,7 +14374,7 @@ </signal> <signal name="minimum_size_changed"> <description> - Emitted when the minimum size of the control changed. + Emitted when the node's minimum size changes. </description> </signal> <signal name="modal_closed"> @@ -13845,22 +14383,22 @@ </signal> <signal name="mouse_entered"> <description> - Emitted when the mouse enters the control area. + Emitted when the mouse enters the control's area. </description> </signal> <signal name="mouse_exited"> <description> - Emitted when the mouse left the control area. + Emitted when the mouse leaves the control's area. </description> </signal> <signal name="resized"> <description> - Emitted when the control changed size. + Emitted when the control changes size. </description> </signal> <signal name="size_flags_changed"> <description> - Emitted when the size flags changed. + Emitted when the size flags change. </description> </signal> </signals> @@ -14171,8 +14709,10 @@ </class> <class name="CubeMesh" inherits="PrimitiveMesh" category="Core"> <brief_description> + Generate an axis-aligned cuboid [PrimitiveMesh]. </brief_description> <description> + Generate an axis-aligned cuboid [PrimitiveMesh]. </description> <methods> <method name="get_size" qualifiers="const"> @@ -14234,12 +14774,16 @@ </methods> <members> <member name="size" type="Vector3" setter="set_size" getter="get_size" brief=""> + Size of the cuboid mesh. Defaults to (2, 2, 2). </member> <member name="subdivide_depth" type="int" setter="set_subdivide_depth" getter="get_subdivide_depth" brief=""> + Number of extra edge loops inserted along the z-axis. Defaults to 0. </member> <member name="subdivide_height" type="int" setter="set_subdivide_height" getter="get_subdivide_height" brief=""> + Number of extra edge loops inserted along the y-axis. Defaults to 0. </member> <member name="subdivide_width" type="int" setter="set_subdivide_width" getter="get_subdivide_width" brief=""> + Number of extra edge loops inserted along the x-axis. Defaults to 0. </member> </members> <constants> @@ -14929,8 +15473,10 @@ </class> <class name="CylinderMesh" inherits="PrimitiveMesh" category="Core"> <brief_description> + Class representing a cylindrical [PrimitiveMesh]. </brief_description> <description> + Class representing a cylindrical [PrimitiveMesh]. </description> <methods> <method name="get_bottom_radius" qualifiers="const"> @@ -15006,14 +15552,19 @@ </methods> <members> <member name="bottom_radius" type="float" setter="set_bottom_radius" getter="get_bottom_radius" brief=""> + Bottom radius of the cylinder. Defaults to 1.0. </member> <member name="height" type="float" setter="set_height" getter="get_height" brief=""> + Full height of the cylinder. Defaults to 2.0. </member> <member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments" brief=""> + Number of radial segments on the cylinder. Defaults to 64. </member> <member name="rings" type="int" setter="set_rings" getter="get_rings" brief=""> + Number of edge rings along the height of the cylinder. Defaults to 4. </member> <member name="top_radius" type="float" setter="set_top_radius" getter="get_top_radius" brief=""> + Top radius of the cylinder. Defaults to 1.0. </member> </members> <constants> @@ -15190,6 +15741,12 @@ 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. </description> <methods> + <method name="get_shadow_depth_range" qualifiers="const"> + <return type="int" enum="DirectionalLight.ShadowDepthRange"> + </return> + <description> + </description> + </method> <method name="get_shadow_mode" qualifiers="const"> <return type="int" enum="DirectionalLight.ShadowMode"> </return> @@ -15210,6 +15767,14 @@ <description> </description> </method> + <method name="set_shadow_depth_range"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="DirectionalLight.ShadowDepthRange"> + </argument> + <description> + </description> + </method> <method name="set_shadow_mode"> <return type="void"> </return> @@ -15224,6 +15789,10 @@ </member> <member name="directional_shadow_blend_splits" type="bool" setter="set_blend_splits" getter="is_blend_splits_enabled" brief=""> </member> + <member name="directional_shadow_depth_range" type="int" setter="set_shadow_depth_range" getter="get_shadow_depth_range" brief="" enum="DirectionalLight.ShadowDepthRange"> + </member> + <member name="directional_shadow_max_distance" type="float" setter="set_param" getter="get_param" brief=""> + </member> <member name="directional_shadow_mode" type="int" setter="set_shadow_mode" getter="get_shadow_mode" brief="" enum="DirectionalLight.ShadowMode"> </member> <member name="directional_shadow_normal_bias" type="float" setter="set_param" getter="get_param" brief=""> @@ -15242,6 +15811,10 @@ </constant> <constant name="SHADOW_PARALLEL_4_SPLITS" value="2"> </constant> + <constant name="SHADOW_DEPTH_RANGE_STABLE" value="0"> + </constant> + <constant name="SHADOW_DEPTH_RANGE_OPTIMIZED" value="1"> + </constant> </constants> </class> <class name="Directory" inherits="Reference" category="Core"> @@ -18298,7 +18871,7 @@ </member> </members> <constants> - <constant name="BG_KEEP" value="4"> + <constant name="BG_KEEP" value="5"> </constant> <constant name="BG_CLEAR_COLOR" value="0"> </constant> @@ -18306,9 +18879,11 @@ </constant> <constant name="BG_SKY" value="2"> </constant> - <constant name="BG_CANVAS" value="3"> + <constant name="BG_COLOR_SKY" value="3"> + </constant> + <constant name="BG_CANVAS" value="4"> </constant> - <constant name="BG_MAX" value="5"> + <constant name="BG_MAX" value="6"> </constant> <constant name="GLOW_BLEND_MODE_ADDITIVE" value="0"> </constant> @@ -19249,20 +19824,31 @@ </class> <class name="GDScript" inherits="Script" category="Core"> <brief_description> + A script implemented in the GDScript programming language. </brief_description> <description> + A script implemented in the GDScript programming language. The script exends the functionality of all objects that instance it. + [method new] creates a new instance of the script. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes. </description> <methods> <method name="get_as_byte_code" qualifiers="const"> <return type="PoolByteArray"> </return> <description> + Returns byte code for the script source code. </description> </method> <method name="new" qualifiers="vararg"> <return type="Object"> </return> <description> + Returns a new instance of the script. + For example: + [codeblock] + var MyClass = load("myclass.gd") + var instance = MyClass.new() + assert(instance.get_script() == MyClass) + [/codeblock] </description> </method> </methods> @@ -20461,8 +21047,10 @@ </class> <class name="GradientTexture" inherits="Texture" category="Core"> <brief_description> + Gradient filled texture. </brief_description> <description> + Uses a [Gradient] to fill the texture data, the gradient will be filled from left to right using colors obtained from the gradient, this means that the texture does not necessarily represent an exact copy of the gradient, but instead an interpolation of samples obtained from the gradient at fixed steps (see [method set_width]). </description> <methods> <method name="get_gradient" qualifiers="const"> @@ -20490,8 +21078,10 @@ </methods> <members> <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient" brief=""> + The [Gradient] that will be used to fill the texture. </member> <member name="width" type="int" setter="set_width" getter="get_width" brief=""> + The number of color samples that will be obtained from the [Gradient]. </member> </members> <constants> @@ -22105,7 +22695,7 @@ IP Protocol support functions. </brief_description> <description> - 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. + IP contains 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. </description> <methods> <method name="clear_cache"> @@ -22114,6 +22704,7 @@ <argument index="0" name="hostname" type="String" default=""""> </argument> <description> + Removes all of a "hostname"'s cached references. If no "hostname" is given then all cached IP addresses are removed. </description> </method> <method name="erase_resolve_item"> @@ -22122,13 +22713,14 @@ <argument index="0" name="id" type="int"> </argument> <description> - 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. + Removes a given item "id" from the queue. This should be used to free a queue after it has completed to enable more queries to happen. </description> </method> <method name="get_local_addresses" qualifiers="const"> <return type="Array"> </return> <description> + Returns all of the user's current IPv4 and IPv6 addresses as an array. </description> </method> <method name="get_resolve_item_address" qualifiers="const"> @@ -22137,7 +22729,7 @@ <argument index="0" name="id" type="int"> </argument> <description> - 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]). + Returns a queued hostname's IP address, given its queue "id". Returns an empty string on error or if resolution hasn't happened yet (see [method get_resolve_item_status]). </description> </method> <method name="get_resolve_item_status" qualifiers="const"> @@ -22146,7 +22738,7 @@ <argument index="0" name="id" type="int"> </argument> <description> - Return the status of hostname queued for resolving, given its queue ID. Returned status can be any of the RESOLVER_STATUS_* enumeration. + Returns a queued hostname's status as a RESOLVER_STATUS_* constant, given its queue "id". </description> </method> <method name="resolve_hostname"> @@ -22157,7 +22749,7 @@ <argument index="1" name="ip_type" type="int" enum="IP.Type" default="3"> </argument> <description> - Resolve a given hostname, blocking. Resolved hostname is returned as an IPv4 or IPv6 depending on "ip_type". + Returns a given hostname's IPv4 or IPv6 address when resolved (blocking-type method). The address type returned depends on the TYPE_* constant given as "ip_type". </description> </method> <method name="resolve_hostname_queue_item"> @@ -22168,7 +22760,7 @@ <argument index="1" name="ip_type" type="int" enum="IP.Type" default="3"> </argument> <description> - Create a queue item for resolving a given hostname to an IPv4 or IPv6 depending on "ip_type". The queue ID is returned, or RESOLVER_INVALID_ID on error. + Creates a queue item to resolve a hostname to an IPv4 or IPv6 address depending on the TYPE_* constant given as "ip_type". Returns the queue ID if successful, or RESOLVER_INVALID_ID on error. </description> </method> </methods> @@ -23249,6 +23841,7 @@ </class> <class name="InputEvent" inherits="Resource" category="Core"> <brief_description> + Generic input event </brief_description> <description> </description> @@ -23259,24 +23852,28 @@ <argument index="0" name="event" type="InputEvent"> </argument> <description> + Returns true if this input event matches the event passed. </description> </method> <method name="as_text" qualifiers="const"> <return type="String"> </return> <description> + Returns a [String] representation of the event. </description> </method> <method name="get_device" qualifiers="const"> <return type="int"> </return> <description> + Returns the id of the device that generated the event. </description> </method> <method name="get_id" qualifiers="const"> <return type="int"> </return> <description> + Returns the id of the event. </description> </method> <method name="is_action" qualifiers="const"> @@ -23285,7 +23882,7 @@ <argument index="0" name="action" type="String"> </argument> <description> - Return if this input event matches a pre-defined action, no matter the type. + Returns true if this input event matches a pre-defined action, no matter the type. </description> </method> <method name="is_action_pressed" qualifiers="const"> @@ -23294,7 +23891,7 @@ <argument index="0" name="action" type="String"> </argument> <description> - Return whether the given action is being pressed (and is not an echo event for KEY events). Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE. + Returns true if the given action is being pressed (and is not an echo event for KEY events). Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE. </description> </method> <method name="is_action_released" qualifiers="const"> @@ -23303,7 +23900,7 @@ <argument index="0" name="action" type="String"> </argument> <description> - Return whether the given action is released (i.e. not pressed). Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE. + Returns true if the given action is released (i.e. not pressed). Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE. </description> </method> <method name="is_action_type" qualifiers="const"> @@ -23316,14 +23913,14 @@ <return type="bool"> </return> <description> - Return if this input event is an echo event (only for events of type KEY, it will return false for other types). + Returns true if this input event is an echo event (only for events of type KEY, it will return false for other types). </description> </method> <method name="is_pressed" qualifiers="const"> <return type="bool"> </return> <description> - Return if this input event is pressed. Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE. + Returns true if this input event is pressed. Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE. </description> </method> <method name="set_device"> @@ -25828,8 +26425,6 @@ </member> <member name="shadow_enabled" type="bool" setter="set_shadow" getter="has_shadow" brief=""> </member> - <member name="shadow_max_distance" type="float" setter="set_param" getter="get_param" brief=""> - </member> <member name="shadow_reverse_cull_face" type="bool" setter="set_shadow_reverse_cull_face" getter="get_shadow_reverse_cull_face" brief=""> </member> </members> @@ -26260,10 +26855,10 @@ </class> <class name="LightOccluder2D" inherits="Node2D" category="Core"> <brief_description> - Occludes light cast by a Light2D, thus casting shadows. + Occludes light cast by a Light2D, casting shadows. </brief_description> <description> - Occludes light cast by a Light2D, thus casting shadows. The LightOccluder2D must be provided with a shape (see OccluderPolygon2D) that allows the shadow to be computed. This shape affects the resulting shadow, while the shape of the representating asset shadowed does not actually affect shadows. + Occludes light cast by a Light2D, casting shadows. The LightOccluder2D must be provided with an [OccluderPolygon2D] in order for the shadow to be computed. </description> <methods> <method name="get_occluder_light_mask" qualifiers="const"> @@ -26301,8 +26896,10 @@ </methods> <members> <member name="light_mask" type="int" setter="set_occluder_light_mask" getter="get_occluder_light_mask" brief=""> + The LightOccluder2D's light mask. The LightOccluder2D will cast shadows only from Light2D(s) that have the same light mask(s). </member> <member name="occluder" type="OccluderPolygon2D" setter="set_occluder_polygon" getter="get_occluder_polygon" brief=""> + The [OccluderPolygon2D] used to compute the shadow. </member> </members> <constants> @@ -26310,8 +26907,10 @@ </class> <class name="Line2D" inherits="Node2D" category="Core"> <brief_description> + A 2D line. </brief_description> <description> + A line through several points in 2D space. </description> <methods> <method name="add_point"> @@ -26320,6 +26919,7 @@ <argument index="0" name="pos" type="Vector2"> </argument> <description> + Add a point at the x/y position in the supplied [Vector2] </description> </method> <method name="get_begin_cap_mode" qualifiers="const"> @@ -26408,6 +27008,7 @@ <argument index="0" name="i" type="int"> </argument> <description> + Remove the point at index 'i' from the line. </description> </method> <method name="set_begin_cap_mode"> @@ -27373,6 +27974,7 @@ <return type="Shape"> </return> <description> + Calculate a [ConvexPolygonShape] from the mesh. </description> </method> <method name="create_outline" qualifiers="const"> @@ -27381,24 +27983,28 @@ <argument index="0" name="margin" type="float"> </argument> <description> + Calculate an outline mesh at a defined offset (margin) from the original mesh. Note: Typically returns the vertices in reverse order (e.g. clockwise to anti-clockwise). </description> </method> <method name="create_trimesh_shape" qualifiers="const"> <return type="Shape"> </return> <description> + Calculate a [ConcavePolygonShape] from the mesh. </description> </method> <method name="generate_triangle_mesh" qualifiers="const"> <return type="TriangleMesh"> </return> <description> + Generate a [TriangleMesh] from the mesh. </description> </method> <method name="get_faces" qualifiers="const"> <return type="PoolVector3Array"> </return> <description> + Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle. </description> </method> </methods> @@ -27770,6 +28376,7 @@ <return type="void"> </return> <description> + This helper creates a [StaticBody] child [Node] with a [ConvexPolygonShape] [CollisionShape] calculated from the mesh geometry. It's mainly used for testing. </description> </method> <method name="create_debug_tangents"> @@ -27782,14 +28389,14 @@ <return type="void"> </return> <description> - This helper creates a [StaticBody] child [Node] using the mesh geometry as collision. It's mainly used for testing. + This helper creates a [StaticBody] child [Node] with a [ConcavePolygonShape] [CollisionShape] calculated from the mesh geometry. It's mainly used for testing. </description> </method> <method name="get_mesh" qualifiers="const"> <return type="Mesh"> </return> <description> - Return the current [Mesh] resource for the instance. + Returns the current [Mesh] resource for the instance. </description> </method> <method name="get_skeleton_path"> @@ -27804,6 +28411,7 @@ <argument index="0" name="surface" type="int"> </argument> <description> + Returns the [Material] for a surface of the [Mesh] resource. </description> </method> <method name="set_mesh"> @@ -27812,7 +28420,6 @@ <argument index="0" name="mesh" type="Mesh"> </argument> <description> - Set the [Mesh] resource for the instance. </description> </method> <method name="set_skeleton_path"> @@ -27831,13 +28438,16 @@ <argument index="1" name="material" type="Material"> </argument> <description> + Sets the [Material] for a surface of the [Mesh] resource. </description> </method> </methods> <members> <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" brief=""> + The [Mesh] resource for the instance. </member> <member name="skeleton" type="NodePath" setter="set_skeleton_path" getter="get_skeleton_path" brief=""> + [NodePath] to the [Skeleton] associated with the instance. </member> </members> <constants> @@ -29297,6 +29907,18 @@ The optional boolean argument enforces creating child nodes with human-readable names, based on the name of the node being instanced instead of its type only. </description> </method> + <method name="add_child_below_node"> + <return type="void"> + </return> + <argument index="0" name="node" type="Node"> + </argument> + <argument index="1" name="child_node" type="Node"> + </argument> + <argument index="2" name="legible_unique_name" type="bool" default="false"> + </argument> + <description> + </description> + </method> <method name="add_to_group"> <return type="void"> </return> @@ -29667,7 +30289,7 @@ <return type="void"> </return> <description> - Destroy this Node and its children when they are not in use. + Queues a node for deletion at the end of the current frame. When deleted, all of its children nodes will be deleted as well. This method ensures it's safe to delete the node, contrary to [method Object.free]. Use [method Object.is_queued_for_deletion] to know whether a node will be deleted at the end of the frame. </description> </method> <method name="raise"> @@ -30051,10 +30673,10 @@ </class> <class name="Node2D" inherits="CanvasItem" category="Core"> <brief_description> - Base node for 2D system. + A 2D game object, parent of all 2D related nodes. Has a position, rotation, scale and Z-index. </brief_description> <description> - 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 ([Transform2D]). A tree of Node2Ds allows complex hierarchies for animation and positioning. + A 2D game object, with a position, rotation and scale. All 2D physics nodes and sprites inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control on the node's render order. </description> <methods> <method name="apply_scale"> @@ -30063,7 +30685,7 @@ <argument index="0" name="ratio" type="Vector2"> </argument> <description> - Apply the 'ratio' scale to the 2D node, according to its current scale value. + Multiplies the current scale by the 'ratio' vector. </description> </method> <method name="edit_set_pivot"> @@ -30072,7 +30694,7 @@ <argument index="0" name="pivot" type="Vector2"> </argument> <description> - Set the pivot position of the 2D node to 'pivot' value. This method is implemented only in some nodes that inherit Node2D. + Set the pivot position of the 2D node to 'pivot' value. Only some Node2Ds implement this method. </description> </method> <method name="get_angle_to" qualifiers="const"> @@ -30081,42 +30703,42 @@ <argument index="0" name="point" type="Vector2"> </argument> <description> - Return the rotation angle in radians needed for the 2d node to point at 'point' position. + Returns the angle between the node and the 'point' in radians. </description> </method> <method name="get_global_position" qualifiers="const"> <return type="Vector2"> </return> <description> - Return the global position of the 2D node. + Returns the node's global position. </description> </method> <method name="get_global_rotation" qualifiers="const"> <return type="float"> </return> <description> - Return the global rotation in radians of the 2D node. + Returns the node's global rotation in radians. </description> </method> <method name="get_global_rotation_in_degrees" qualifiers="const"> <return type="float"> </return> <description> - Return the global rotation in degrees of the 2D node. + Return the node's global rotation in degrees. </description> </method> <method name="get_global_scale" qualifiers="const"> <return type="Vector2"> </return> <description> - Return the global scale of the 2D node. + Returns the node's global scale. </description> </method> <method name="get_position" qualifiers="const"> <return type="Vector2"> </return> <description> - Return the position of the 2D node. + Returns the node's position. </description> </method> <method name="get_relative_transform_to_parent" qualifiers="const"> @@ -30125,35 +30747,35 @@ <argument index="0" name="parent" type="Node"> </argument> <description> - Return the transform [Transform2D] calculated relatively to the parent of this 2D node. + Returns the [Transform2D] relative to this node's parent. </description> </method> <method name="get_rotation" qualifiers="const"> <return type="float"> </return> <description> - Return the rotation in radians of the 2D node. + Returns the node's rotation in radians. </description> </method> <method name="get_rotation_in_degrees" qualifiers="const"> <return type="float"> </return> <description> - Return the rotation in degrees of the 2D node. + Returns the node's rotation in degrees. </description> </method> <method name="get_scale" qualifiers="const"> <return type="Vector2"> </return> <description> - Return the scale of the 2D node. + Returns the node's scale. </description> </method> <method name="get_z" qualifiers="const"> <return type="int"> </return> <description> - Return the Z-index of the 2D node. + Returns the node's Z-index. </description> </method> <method name="global_translate"> @@ -30162,14 +30784,14 @@ <argument index="0" name="offset" type="Vector2"> </argument> <description> - Apply a global translation of 'offset' to the 2D node, starting from its current global position. + Adds the 'offset' vector to the node's global position. </description> </method> <method name="is_z_relative" qualifiers="const"> <return type="bool"> </return> <description> - Return true if the Z-index value of this 2D node is relative to its parent's. Else, return false. + Returns true if this node's Z-index is relative to its parent's. Else, returns false. </description> </method> <method name="look_at"> @@ -30178,7 +30800,7 @@ <argument index="0" name="point" type="Vector2"> </argument> <description> - Rotate the 2d node so it points at 'point' position. + Rotates the node so it points towards the 'point'. </description> </method> <method name="move_local_x"> @@ -30189,7 +30811,7 @@ <argument index="1" name="scaled" type="bool" default="false"> </argument> <description> - 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 the node's X axis based on the process's 'delta'. If 'scaled' is false, normalizes the movement. </description> </method> <method name="move_local_y"> @@ -30200,7 +30822,7 @@ <argument index="1" name="scaled" type="bool" default="false"> </argument> <description> - 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 on the node's Y axis based on the process's 'delta'. If 'scaled' is false, normalizes the movement. </description> </method> <method name="rotate"> @@ -30209,7 +30831,7 @@ <argument index="0" name="radians" type="float"> </argument> <description> - Apply a rotation (in radians) to the 2D node, starting from its current rotation. + Apply a rotation to the node, in radians, starting from its current rotation. </description> </method> <method name="set_global_position"> @@ -30218,7 +30840,7 @@ <argument index="0" name="pos" type="Vector2"> </argument> <description> - Set the global position of the 2D node. + Set the node's global position. </description> </method> <method name="set_global_rotation"> @@ -30227,7 +30849,7 @@ <argument index="0" name="radians" type="float"> </argument> <description> - Set the global rotation in radians of the 2D node + Set the node's global rotation in radians. </description> </method> <method name="set_global_rotation_in_degrees"> @@ -30236,7 +30858,7 @@ <argument index="0" name="degrees" type="float"> </argument> <description> - Set the global rotation in degrees of the 2D node + Set the node's global rotation in degrees. </description> </method> <method name="set_global_scale"> @@ -30245,7 +30867,7 @@ <argument index="0" name="scale" type="Vector2"> </argument> <description> - Set the global scale of the 2D node. + Set the node's global scale. </description> </method> <method name="set_global_transform"> @@ -30254,7 +30876,7 @@ <argument index="0" name="xform" type="Transform2D"> </argument> <description> - Set the global transform [Transform2D] of the 2D node. + Set the node's global [Transform2D]. </description> </method> <method name="set_position"> @@ -30263,7 +30885,7 @@ <argument index="0" name="pos" type="Vector2"> </argument> <description> - Set the position of the 2D node. + Set the node's position. </description> </method> <method name="set_rotation"> @@ -30272,7 +30894,7 @@ <argument index="0" name="radians" type="float"> </argument> <description> - Set the rotation in radians of the 2D node. + Set the node's rotation in radians. </description> </method> <method name="set_rotation_in_degrees"> @@ -30281,7 +30903,7 @@ <argument index="0" name="degrees" type="float"> </argument> <description> - Set the rotation in degrees of the 2D node. + Set the node's rotation in degrees. </description> </method> <method name="set_scale"> @@ -30290,7 +30912,7 @@ <argument index="0" name="scale" type="Vector2"> </argument> <description> - Set the scale of the 2D node. + Set the node's scale. </description> </method> <method name="set_transform"> @@ -30299,7 +30921,7 @@ <argument index="0" name="xform" type="Transform2D"> </argument> <description> - Set the local transform [Transform2D] of the 2D node. + Set the node's local [Transform2D]. </description> </method> <method name="set_z"> @@ -30308,7 +30930,7 @@ <argument index="0" name="z" type="int"> </argument> <description> - Set the Z-index value of the 2D node. + Set the node's Z-index. </description> </method> <method name="set_z_as_relative"> @@ -30317,7 +30939,7 @@ <argument index="0" name="enable" type="bool"> </argument> <description> - 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. + Make the node's Z-index relative to its parent's Z-index. If this node's Z-index is 2 and its parent's effective Z-index is 3, then this node's effective Z-index will be 2 + 3 = 5. </description> </method> <method name="to_global" qualifiers="const"> @@ -30342,34 +30964,46 @@ <argument index="0" name="offset" type="Vector2"> </argument> <description> - Apply a local translation of 'offset' to the 2D node, starting from its current local position. + Translate the node locally by the 'offset' vector, starting from its current local position. </description> </method> </methods> <members> <member name="global_position" type="Vector2" setter="set_global_position" getter="get_global_position" brief=""> + Global position. </member> <member name="global_rotation" type="float" setter="set_global_rotation" getter="get_global_rotation" brief=""> + Global rotation in radians. </member> <member name="global_rotation_deg" type="float" setter="set_global_rotation_in_degrees" getter="get_global_rotation_in_degrees" brief=""> + Global rotation in degrees. </member> <member name="global_scale" type="Vector2" setter="set_global_scale" getter="get_global_scale" brief=""> + Global scale. </member> <member name="global_transform" type="Transform2D" setter="set_global_transform" getter="get_global_transform" brief=""> + Global [Transform2D]. </member> <member name="position" type="Vector2" setter="set_position" getter="get_position" brief=""> + Position, relative to the node's parent. </member> <member name="rotation" type="float" setter="set_rotation" getter="get_rotation" brief=""> + Rotation in radians. </member> <member name="rotation_deg" type="float" setter="set_rotation_in_degrees" getter="get_rotation_in_degrees" brief=""> + Rotation in degrees. </member> <member name="scale" type="Vector2" setter="set_scale" getter="get_scale" brief=""> + Rotation in degrees. </member> <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" brief=""> + Local [Transform2D]. </member> <member name="z" type="int" setter="set_z" getter="get_z" brief=""> + Z-index. Controls the order in which the nodes render. A node with a higher Z-index will display in front of others. </member> <member name="z_as_relative" type="bool" setter="set_z_as_relative" getter="is_z_relative" brief=""> + Make the node's Z-index relative to its parent's Z-index. If this node's Z-index is 2 and its parent's effective Z-index is 3, then this node's effective Z-index will be 2 + 3 = 5. </member> </members> <constants> @@ -38019,8 +38653,10 @@ </class> <class name="PlaneMesh" inherits="PrimitiveMesh" category="Core"> <brief_description> + Class representing a planar [PrimitiveMesh]. </brief_description> <description> + Class representing a planar [PrimitiveMesh]. This flat mesh does not have a thickness. </description> <methods> <method name="get_size" qualifiers="const"> @@ -38068,10 +38704,13 @@ </methods> <members> <member name="size" type="Vector2" setter="set_size" getter="get_size" brief=""> + Size of the generated plane. Defaults to (2.0, 2.0). </member> <member name="subdivide_depth" type="int" setter="set_subdivide_depth" getter="get_subdivide_depth" brief=""> + Number of subdivision along the z-axis. Defaults to 0. </member> <member name="subdivide_width" type="int" setter="set_subdivide_width" getter="get_subdivide_width" brief=""> + Number of subdivision along the x-axis. Defaults to 0. </member> </members> <constants> @@ -38438,13 +39077,14 @@ <argument index="0" name="byte" type="int"> </argument> <description> + Append an element at the end of the array (alias of [method push_back]). </description> </method> <method name="append_array"> <argument index="0" name="array" type="PoolByteArray"> </argument> <description> - Append an [PoolByteArray] at the end of this array. + Append a [PoolByteArray] at the end of this array. </description> </method> <method name="compress"> @@ -38453,7 +39093,7 @@ <argument index="0" name="compression_mode" type="int" default="0"> </argument> <description> - Returns a new [PoolByteArray] with the data compressed. The compression mode can be set using one of the COMPRESS_* constants of [File]. + Returns a new [PoolByteArray] with the data compressed. Set the compression mode using one of [File]'s COMPRESS_* constants. </description> </method> <method name="decompress"> @@ -38464,21 +39104,21 @@ <argument index="1" name="compression_mode" type="int" default="0"> </argument> <description> - Returns a new [PoolByteArray] with the data decompressed. The buffer_size should be set as the size of the uncompressed data. The compression mode can be set using one of the COMPRESS_* constants of [File]. + Returns a new [PoolByteArray] with the data decompressed. Set buffer_size to the size of the uncompressed data. Set the compression mode using one of [File]'s COMPRESS_* constants. </description> </method> <method name="get_string_from_ascii"> <return type="String"> </return> <description> - 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 as [String]. Fast alternative to [method PoolByteArray.get_string_from_utf8] if the content is ASCII-only. Unlike the UTF-8 function this function maps every byte to a character in the array. Multibyte sequences will not be interpreted correctly. For parsing user input always use [method PoolByteArray.get_string_from_utf8]. </description> </method> <method name="get_string_from_utf8"> <return type="String"> </return> <description> - 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. + Returns a copy of the array's contents as [String]. Slower than [method PoolByteArray.get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. </description> </method> <method name="insert"> @@ -38515,7 +39155,7 @@ <argument index="0" name="idx" type="int"> </argument> <description> - Set the size of the [PoolByteArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array. + Set the size of the array. If the array is grown reserve elements at the end of the array. If the array is shrunk truncate the array to the new size. </description> </method> <method name="set"> @@ -38554,7 +39194,7 @@ Array of Colors </brief_description> <description> - Array of Color, can only contains colors. Optimized for memory usage, can't fragment the memory. + Array of Color, Contains colors. Optimized for memory usage, can't fragment the memory. </description> <methods> <method name="PoolColorArray"> @@ -38577,7 +39217,7 @@ <argument index="0" name="array" type="PoolColorArray"> </argument> <description> - Append an [PoolColorArray] at the end of this array. + Append a [PoolColorArray] at the end of this array. </description> </method> <method name="insert"> @@ -38614,7 +39254,7 @@ <argument index="0" name="idx" type="int"> </argument> <description> - Set the size of the [PoolColorArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array. + Set the size of the array. If the array is grown reserve elements at the end of the array. If the array is shrunk truncate the array to the new size. </description> </method> <method name="set"> @@ -38630,7 +39270,7 @@ <return type="int"> </return> <description> - Return the array size. + Return the size of the array. </description> </method> </methods> @@ -38642,7 +39282,7 @@ Integer Array. </brief_description> <description> - Integer Array. Array of integers. Can only contain integers. Optimized for memory usage, can't fragment the memory. + Integer Array. Contains integers. Optimized for memory usage, can't fragment the memory. </description> <methods> <method name="PoolIntArray"> @@ -38702,7 +39342,7 @@ <argument index="0" name="idx" type="int"> </argument> <description> - Set the size of the [PoolIntArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array. + Set the size of the array. If the array is grown reserve elements at the end of the array. If the array is shrunk truncate the array to the new size. </description> </method> <method name="set"> @@ -38790,7 +39430,7 @@ <argument index="0" name="idx" type="int"> </argument> <description> - Set the size of the [RealArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array. + Set the size of the array. If the array is grown reserve elements at the end of the array. If the array is shrunk truncate the array to the new size. </description> </method> <method name="set"> @@ -38857,15 +39497,16 @@ </method> <method name="invert"> <description> + Reverse the order of the elements in the array (so first element will now be the last). </description> </method> <method name="join"> <return type="String"> </return> - <argument index="0" name="string" type="String"> + <argument index="0" name="delimiter" type="String"> </argument> <description> - Reverse the order of the elements in the array (so first element will now be the last). + Returns a [String] with each element of the array joined with the delimiter. </description> </method> <method name="push_back"> @@ -38886,7 +39527,7 @@ <argument index="0" name="idx" type="int"> </argument> <description> - Set the size of the [StringArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array. + Set the size of the array. If the array is grown reserve elements at the end of the array. If the array is shrunk truncate the array to the new size. </description> </method> <method name="set"> @@ -38974,7 +39615,7 @@ <argument index="0" name="idx" type="int"> </argument> <description> - Set the size of the PoolVector2Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array. + Set the size of the array. If the array is grown reserve elements at the end of the array. If the array is shrunk truncate the array to the new size. </description> </method> <method name="set"> @@ -39048,7 +39689,7 @@ <argument index="0" name="vector3" type="Vector3"> </argument> <description> - Insert a Vector3 at the end. + Insert a [Vector3] at the end. </description> </method> <method name="remove"> @@ -39062,7 +39703,7 @@ <argument index="0" name="idx" type="int"> </argument> <description> - Set the size of the PoolVector3Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array. + Set the size of the array. If the array is grown reserve elements at the end of the array. If the array is shrunk truncate the array to the new size. </description> </method> <method name="set"> @@ -39729,8 +40370,10 @@ </class> <class name="PrimitiveMesh" inherits="Mesh" category="Core"> <brief_description> + Base class for all primitive meshes. Handles applying a [Material] to a primitive mesh. </brief_description> <description> + Base class for all primitive meshes. Handles applying a [Material] to a primitive mesh. </description> <methods> <method name="get_material" qualifiers="const"> @@ -39739,6 +40382,12 @@ <description> </description> </method> + <method name="get_mesh_arrays" qualifiers="const"> + <return type="Array"> + </return> + <description> + </description> + </method> <method name="set_material"> <return type="void"> </return> @@ -39750,6 +40399,7 @@ </methods> <members> <member name="material" type="Material" setter="set_material" getter="get_material" brief=""> + The current [Material] of the primitive mesh. </member> </members> <constants> @@ -39757,8 +40407,10 @@ </class> <class name="PrismMesh" inherits="PrimitiveMesh" category="Core"> <brief_description> + Class representing a prism-shaped [PrimitiveMesh]. </brief_description> <description> + Class representing a prism-shaped [PrimitiveMesh]. </description> <methods> <method name="get_left_to_right" qualifiers="const"> @@ -39834,14 +40486,19 @@ </methods> <members> <member name="left_to_right" type="float" setter="set_left_to_right" getter="get_left_to_right" brief=""> + Displacement of of the upper edge along the x-axis. 0.0 positions edge straight above the bottome left edge. Defaults to 0.5 (positioned on the midpoint). </member> <member name="size" type="Vector3" setter="set_size" getter="get_size" brief=""> + Size of the prism. Defaults to (2.0, 2.0, 2.0). </member> <member name="subdivide_depth" type="int" setter="set_subdivide_depth" getter="get_subdivide_depth" brief=""> + Number of added edge loops along the z-axis. Defaults to 0. </member> <member name="subdivide_height" type="int" setter="set_subdivide_height" getter="get_subdivide_height" brief=""> + Number of added edge loops along the y-axis. Defaults to 0. </member> <member name="subdivide_width" type="int" setter="set_subdivide_width" getter="get_subdivide_width" brief=""> + Number of added edge loops along the x-axis. Defaults to 0. </member> </members> <constants> @@ -40391,8 +41048,10 @@ </class> <class name="QuadMesh" inherits="PrimitiveMesh" category="Core"> <brief_description> + Class representing a square mesh. </brief_description> <description> + Class representing a square mesh with size (2,2,0). Consider using a [PlaneMesh] if you require a differently sized plane. </description> <methods> </methods> @@ -40752,11 +41411,11 @@ Query the closest object intersecting a ray. </brief_description> <description> - A RayCast represents a line from its origin to its destination position [code]cast_to[/code], it is used to query the 3D space in order to find the closest object intersecting with the ray. + A RayCast represents a line from its origin to its destination position, [code]cast_to[/code]. It is used to query the 3D space in order to find the closest object along the path of the ray. - RayCast can ignore some objects by adding them to the exception list via [code]add_exception[/code], setting proper filtering with layers, or by filtering object types with type masks. + RayCast can ignore some objects by adding them to the exception list via [code]add_exception[/code], by setting proper filtering with collision layers, or by filtering object types with type masks. - Only enabled raycasts will be able to query the space and report collisions! + Only enabled raycasts will be able to query the space and report collisions. RayCast calculates intersection every fixed frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between fixed frames (or during the same frame) use [method force_raycast_update] after adjusting the raycast. </description> @@ -40767,7 +41426,7 @@ <argument index="0" name="node" type="Object"> </argument> <description> - Adds a collision exception so the ray does not report collisions with the specified [code]node[/code]. + Adds a collision exception so the ray does not report collisions with the specified node. </description> </method> <method name="add_exception_rid"> @@ -40776,20 +41435,22 @@ <argument index="0" name="rid" type="RID"> </argument> <description> + Adds a collision exception so the ray does not report collisions with the specified [RID]. </description> </method> <method name="clear_exceptions"> <return type="void"> </return> <description> - Removes all collision exception for this ray. + Removes all collision exceptions for this ray. </description> </method> <method name="force_raycast_update"> <return type="void"> </return> <description> - Updates the collision information in case if this object's properties changed during the current frame (for example position, rotation or the cast_point). Note, [code]set_enabled[/code] is not required for this to work. + Updates the collision information for the ray. + Use this method to update the collision information immediately instead of waiting for the next [code]_fixed_process[/code] call, for example if the ray or its parent has changed state. Note: [code]enabled == true[/code] is not required for this to work. </description> </method> <method name="get_cast_to" qualifiers="const"> @@ -40803,14 +41464,24 @@ <return type="Object"> </return> <description> - 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. + Return the closest object the ray is pointing to. Note that this does not consider the length of the ray, so you must also use [method is_colliding] to check if the object returned is actually colliding with the ray. + Example: + [codeblock] + if RayCast.is_colliding(): + var collider = RayCast.get_collider() + [/codeblock] </description> </method> <method name="get_collider_shape" qualifiers="const"> <return type="int"> </return> <description> - Returns the collision shape of the closest object the ray is pointing to. + Returns the collision shape of the closest object the ray is pointing to. Note that this does not consider the length of the ray, so you must also use [method is_colliding] to check if the object returned is actually colliding with the ray. + Example: + [codeblock] + if RayCast.is_colliding(): + var shape = RayCast.get_collider_shape() + [/codeblock] </description> </method> <method name="get_collision_layer" qualifiers="const"> @@ -40824,14 +41495,14 @@ <return type="Vector3"> </return> <description> - Returns the normal of the intersecting object shape face containing the collision point. + Returns the normal of the intersecting object's shape at the collision point. </description> </method> <method name="get_collision_point" qualifiers="const"> <return type="Vector3"> </return> <description> - Returns collision point. This point is in [b]global[/b] coordinate system. + Returns the collision point at which the ray intersects the closest object. Note: this point is in the [b]global[/b] coordinate system. </description> </method> <method name="get_type_mask" qualifiers="const"> @@ -40852,7 +41523,7 @@ <return type="bool"> </return> <description> - Returns whether this raycast is enabled or not. + Returns whether the ray is enabled or not. </description> </method> <method name="remove_exception"> @@ -40861,7 +41532,7 @@ <argument index="0" name="node" type="Object"> </argument> <description> - Removes a collision exception so the ray does report collisions with the specified [code]node[/code]. + Removes a collision exception so the ray does report collisions with the specified node. </description> </method> <method name="remove_exception_rid"> @@ -40870,6 +41541,7 @@ <argument index="0" name="rid" type="RID"> </argument> <description> + Removes a collision exception so the ray does report collisions with the specified [RID]. </description> </method> <method name="set_cast_to"> @@ -40878,7 +41550,7 @@ <argument index="0" name="local_point" type="Vector3"> </argument> <description> - Sets to which point ray should be casted. This point is in [b]local[/b] coordinate system. + Sets the ray destination point, so that the ray will test from the ray's origin to [code]local_point[/code]. </description> </method> <method name="set_collision_layer"> @@ -40911,12 +41583,20 @@ </methods> <members> <member name="cast_to" type="Vector3" setter="set_cast_to" getter="get_cast_to" brief=""> + The ray's destination point, relative to the RayCast's [code]position[/code]. </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief=""> + The RayCast's collison layer(s). Only bodies in the same collision layer(s) will be detected. </member> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" brief=""> + If [code]true[/code], collisions will be reported. Default value: [code]false[/code]. </member> <member name="type_mask" type="int" setter="set_type_mask" getter="get_type_mask" brief=""> + Object types to detect using a logical sum (OR operation) of type constants defined in [Physics2DDirectSpaceState]. + Example: + [codeblock] + RayCast.type_mask = Physics2DDirectSpaceState.TYPE_MASK_STATIC_BODY | Physics2DDirectSpaceState.TYPE_MASK_KINEMATIC_BODY + [/codeblock] </member> </members> <constants> @@ -40927,12 +41607,9 @@ Query the closest object intersecting a ray. </brief_description> <description> - 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. - - RayCast2D can ignore some objects by adding them to the exception list via [code]add_exception[/code], setting proper filtering with layers, or by filtering object types with type masks. - - Only enabled raycasts will be able to query the space and report collisions! - + A RayCast 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 along the path of the ray. + RayCast2D can ignore some objects by adding them to the exception list via [code]add_exception[/code], by setting proper filtering with collision layers, or by filtering object types with type masks. + Only enabled raycasts will be able to query the space and report collisions. RayCast2D calculates intersection every fixed frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between fixed frames (or during the same frame) use [method force_raycast_update] after adjusting the raycast. </description> <methods> @@ -40942,7 +41619,7 @@ <argument index="0" name="node" type="Object"> </argument> <description> - Adds a collision exception so the ray does not report collisions with the specified [code]node[/code]. + Adds a collision exception so the ray does not report collisions with the specified node. </description> </method> <method name="add_exception_rid"> @@ -40951,20 +41628,21 @@ <argument index="0" name="rid" type="RID"> </argument> <description> + Adds a collision exception so the ray does not report collisions with the specified [RID]. </description> </method> <method name="clear_exceptions"> <return type="void"> </return> <description> - Removes all collision exception for this ray. + Removes all collision exceptions for this ray. </description> </method> <method name="force_raycast_update"> <return type="void"> </return> <description> - Updates the collision information in case if this object's properties changed during the current frame (for example position, rotation or the cast_point). Note, [code]set_enabled[/code] is not required for this to work. + Updates the collision information for the ray. Use this method to update the collision information immediately instead of waiting for the next [code]_fixed_process[/code] call, for example if the ray or its parent has changed state. Note: [code]enabled == true[/code] is not required for this to work. </description> </method> <method name="get_cast_to" qualifiers="const"> @@ -40978,14 +41656,24 @@ <return type="Object"> </return> <description> - 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 closest object the ray is pointing to. Note that this does not consider the length of the ray, so you must also use [method is_colliding] to check if the object returned is actually colliding with the ray. + Example: + [codeblock] + if RayCast2D.is_colliding(): + var collider = RayCast2D.get_collider() + [/codeblock] </description> </method> <method name="get_collider_shape" qualifiers="const"> <return type="int"> </return> <description> - Returns the collision shape of the closest object the ray is pointing to. + Returns the collision shape of the closest object the ray is pointing to. Note that this does not consider the length of the ray, so you must also use [method is_colliding] to check if the object returned is actually colliding with the ray. + Example: + [codeblock] + if RayCast2D.is_colliding(): + var shape = RayCast2D.get_collider_shape() + [/codeblock] </description> </method> <method name="get_collision_layer" qualifiers="const"> @@ -40999,14 +41687,14 @@ <return type="Vector2"> </return> <description> - Returns the normal of the intersecting object shape face containing the collision point. + Returns the normal of the intersecting object's shape at the collision point. </description> </method> <method name="get_collision_point" qualifiers="const"> <return type="Vector2"> </return> <description> - Returns the collision point in which the ray intersects the closest object. This point is in [b]global[/b] coordinate system. + Returns the collision point at which the ray intersects the closest object. Note: this point is in the [b]global[/b] coordinate system. </description> </method> <method name="get_exclude_parent_body" qualifiers="const"> @@ -41043,7 +41731,7 @@ <argument index="0" name="node" type="Object"> </argument> <description> - Removes a collision exception so the ray does report collisions with the specified [code]node[/code]. + Removes a collision exception so the ray does report collisions with the specified node. </description> </method> <method name="remove_exception_rid"> @@ -41052,6 +41740,7 @@ <argument index="0" name="rid" type="RID"> </argument> <description> + Removes a collision exception so the ray does report collisions with the specified [RID]. </description> </method> <method name="set_cast_to"> @@ -41102,14 +41791,23 @@ </methods> <members> <member name="cast_to" type="Vector2" setter="set_cast_to" getter="get_cast_to" brief=""> + The ray's destination point, relative to the RayCast's [code]position[/code]. </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief=""> + The RayCast2D's collison layer(s). Only bodies in the same collision layer(s) will be detected. </member> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" brief=""> + If [code]true[/code], collisions will be reported. Default value: [code]false[/code]. </member> <member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body" brief=""> + If [code]true[/code], the parent node will be excluded from collision detection. Default value: [code]true[/code]. </member> <member name="type_mask" type="int" setter="set_type_mask" getter="get_type_mask" brief=""> + Object types to detect using a logical sum (OR operation) of type constants defined in [Physics2DDirectSpaceState]. + Example: + [codeblock] + RayCast.type_mask = Physics2DDirectSpaceState.TYPE_MASK_STATIC_BODY | Physics2DDirectSpaceState.TYPE_MASK_KINEMATIC_BODY + [/codeblock] </member> </members> <constants> @@ -43248,38 +43946,55 @@ </methods> <members> <member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" brief=""> + Dampens rotational forces of the Rigid body by the 'angular_damp' rate. </member> <member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity" brief=""> + The current rotational velocity of the Rigid body </member> <member name="axis_lock" type="int" setter="set_axis_lock" getter="get_axis_lock" brief="" enum="RigidBody.AxisLock"> + Locks the rotational forces to a particular axis, preventing rotations on other axes. </member> <member name="bounce" type="float" setter="set_bounce" getter="get_bounce" brief=""> + Bounciness of the Rigid body. </member> <member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" brief=""> + If true, the Rigid body will no longer calculate forces when there is no movement and will act as a static body. It will wake up when other forces are applied through other collisions or when the 'apply_impulse' method is used. </member> <member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" brief=""> + If true, the Rigid body will emit signals when it collides with another Rigid body. </member> <member name="contacts_reported" type="int" setter="set_max_contacts_reported" getter="get_max_contacts_reported" brief=""> + 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. </member> <member name="continuous_cd" type="bool" setter="set_use_continuous_collision_detection" getter="is_using_continuous_collision_detection" brief=""> + 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, fast-moving objects. </member> <member name="custom_integrator" type="bool" setter="set_use_custom_integrator" getter="is_using_custom_integrator" brief=""> + If true, internal force integration will be disabled (like gravity or air friction) for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] function, if defined. </member> <member name="friction" type="float" setter="set_friction" getter="get_friction" brief=""> + The body friction, from 0 (frictionless) to 1 (max friction). </member> <member name="gravity_scale" type="float" setter="set_gravity_scale" getter="get_gravity_scale" brief=""> + The 'gravity_scale' for this Rigid body will be multiplied by the global 3d gravity setting found in "Project > Project Settings > Physics > 3d". A value of 1 will be normal gravity, 2 will apply double gravity, and 0.5 will apply half gravity to this object. </member> <member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" brief=""> + The linear damp for this body. Default of -1, cannot be less than -1. If this value is different from -1, any linear damp derived from the world or areas will be overridden. </member> <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" brief=""> + The body linear velocity. Can be used sporadically, but [b]DON'T SET THIS IN EVERY FRAME[/b], because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state. </member> <member name="mass" type="float" setter="set_mass" getter="get_mass" brief=""> + The body mass. </member> <member name="mode" type="int" setter="set_mode" getter="get_mode" brief="" enum="RigidBody.Mode"> + The body mode from the MODE_* enum. Modes include: MODE_STATIC, MODE_KINEMATIC, MODE_RIGID, and MODE_CHARACTER. </member> <member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" brief=""> + The current 'sleeping' state of the Rigid body. </member> <member name="weight" type="float" setter="set_weight" getter="get_weight" brief=""> + The body weight given standard earth-weight (gravity 9.8). </member> </members> <signals> @@ -44435,17 +45150,18 @@ </class> <class name="Script" inherits="Resource" category="Core"> <brief_description> - Base class for scripts. + A class stored as a resource. </brief_description> <description> - Base class for scripts. Any script that is loaded becomes one of these resources, which can then create instances. + A class stored as a resource. The script exends the functionality of all objects that instance it. + The 'new' method of a script subclass creates a new instance. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes. </description> <methods> <method name="can_instance" qualifiers="const"> <return type="bool"> </return> <description> - Return true if this script can be instance (ie not a library). + Returns true if the script can be instanced. </description> </method> <method name="get_node_type" qualifiers="const"> @@ -44458,7 +45174,7 @@ <return type="String"> </return> <description> - Return the script source code (if available). + Returns the script source code, or an empty string if source code is not available. </description> </method> <method name="has_script_signal" qualifiers="const"> @@ -44467,13 +45183,14 @@ <argument index="0" name="signal_name" type="String"> </argument> <description> + Returns true if the script, or a base class, defines a signal with the given name. </description> </method> <method name="has_source_code" qualifiers="const"> <return type="bool"> </return> <description> - Return true if the script contains source code. + Returns true if the script contains non-empty source code. </description> </method> <method name="instance_has" qualifiers="const"> @@ -44482,13 +45199,14 @@ <argument index="0" name="base_object" type="Object"> </argument> <description> - Return true if a given object uses an instance of this script. + Returns true if 'base_object' is an instance of this script. </description> </method> <method name="is_tool" qualifiers="const"> <return type="bool"> </return> <description> + Returns true if the script is a tool script. A tool script can run in the editor. </description> </method> <method name="reload"> @@ -44497,6 +45215,7 @@ <argument index="0" name="keep_state" type="bool" default="false"> </argument> <description> + Reloads the script's class implementation. Returns an error code. </description> </method> <method name="set_source_code"> @@ -44505,7 +45224,7 @@ <argument index="0" name="source" type="String"> </argument> <description> - Set the script source code. + Sets the script source code. Does not reload the class implementation. </description> </method> </methods> @@ -45473,16 +46192,17 @@ </class> <class name="Spatial" inherits="Node" category="Core"> <brief_description> - Base class for all 3D nodes. + Most basic 3D game object, parent of all 3D related nodes. </brief_description> <description> - 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. + Most basic 3D game object, with a 3D [Transform] and visibility settings. All 3D physics nodes and sprites inherit from Spatial. Use Spatial as a parent node to move, scale, rotate and show/hide children in a 3D project. </description> <methods> <method name="get_gizmo" qualifiers="const"> <return type="SpatialGizmo"> </return> <description> + Return the SpatialGizmo for this node. Used for example in [EditorSpatialGizmo] as custom visualization and editing handles in Editor. </description> </method> <method name="get_global_transform" qualifiers="const"> @@ -45536,6 +46256,7 @@ <return type="World"> </return> <description> + Return current [World] resource this Spatial node is registered to. </description> </method> <method name="global_rotate"> @@ -45546,6 +46267,7 @@ <argument index="1" name="radians" type="float"> </argument> <description> + Rotate current node along normal [Vector3] by angle in radians in Global space. </description> </method> <method name="global_translate"> @@ -45554,42 +46276,49 @@ <argument index="0" name="offset" type="Vector3"> </argument> <description> + Move current node by [Vector3] offset in Global space. </description> </method> <method name="hide"> <return type="void"> </return> <description> + Disable rendering of this node. Change Spatial Visible property to false. </description> </method> <method name="is_local_transform_notification_enabled" qualifiers="const"> <return type="bool"> </return> <description> + Returns whether node sends notification that its local transformation changed. Spatial will not propagate this by default. </description> </method> <method name="is_set_as_toplevel" qualifiers="const"> <return type="bool"> </return> <description> + Returns whether this node is set as Toplevel, ignoring its parent node transformations. </description> </method> <method name="is_transform_notification_enabled" qualifiers="const"> <return type="bool"> </return> <description> + Returns whether node sends notification that its transformation changed. Spatial will not propagate this by default. </description> </method> <method name="is_visible" qualifiers="const"> <return type="bool"> </return> <description> + Returns whether this node is set to be visible. </description> </method> <method name="is_visible_in_tree" qualifiers="const"> <return type="bool"> </return> <description> + Returns whether this node is visible, taking into consideration that its parents visibility. </description> </method> <method name="look_at"> @@ -45600,6 +46329,7 @@ <argument index="1" name="up" type="Vector3"> </argument> <description> + Rotates itself to point into direction of target position. Operations take place in global space. </description> </method> <method name="look_at_from_pos"> @@ -45612,12 +46342,14 @@ <argument index="2" name="up" type="Vector3"> </argument> <description> + Moves itself to specified position and then rotates itself to point into direction of target position. Operations take place in global space. </description> </method> <method name="orthonormalize"> <return type="void"> </return> <description> + Reset this node transformations (like scale, skew and taper) preserving its rotation and translation. Performs orthonormalization on this node [Transform3D]. </description> </method> <method name="rotate"> @@ -45628,6 +46360,7 @@ <argument index="1" name="radians" type="float"> </argument> <description> + Rotates node in local space on given normal [Vector3] by angle in radians. </description> </method> <method name="rotate_x"> @@ -45636,6 +46369,7 @@ <argument index="0" name="radians" type="float"> </argument> <description> + Rotates node in local space on X axis by angle in radians. </description> </method> <method name="rotate_y"> @@ -45644,6 +46378,7 @@ <argument index="0" name="radians" type="float"> </argument> <description> + Rotates node in local space on Y axis by angle in radians. </description> </method> <method name="rotate_z"> @@ -45652,6 +46387,7 @@ <argument index="0" name="radians" type="float"> </argument> <description> + Rotates node in local space on Z axis by angle in radians. </description> </method> <method name="set_as_toplevel"> @@ -45660,6 +46396,7 @@ <argument index="0" name="enable" type="bool"> </argument> <description> + Makes this node ignore its parents tranformations. Node tranformations are only in global space. </description> </method> <method name="set_gizmo"> @@ -45668,6 +46405,7 @@ <argument index="0" name="gizmo" type="SpatialGizmo"> </argument> <description> + Set [SpatialGizmo] for this node. Used for example in [EditorSpatialGizmo] as custom visualization and editing handles in Editor. </description> </method> <method name="set_global_transform"> @@ -45676,13 +46414,14 @@ <argument index="0" name="global" type="Transform"> </argument> <description> - Set the transform globally, relative to worldspace. + Set the transform globally, relative to world space. </description> </method> <method name="set_identity"> <return type="void"> </return> <description> + Reset all tranformations for this node. Set its [Transform3D] to identity matrix. </description> </method> <method name="set_ignore_transform_notification"> @@ -45691,6 +46430,7 @@ <argument index="0" name="enabled" type="bool"> </argument> <description> + Set whether this node ignores notification that its transformation changed. </description> </method> <method name="set_notify_local_transform"> @@ -45699,6 +46439,7 @@ <argument index="0" name="enable" type="bool"> </argument> <description> + Set whether this node sends notification that its local transformation changed. Spatial will not propagate this by default. </description> </method> <method name="set_notify_transform"> @@ -45707,6 +46448,7 @@ <argument index="0" name="enable" type="bool"> </argument> <description> + Set whether this node sends notification that its transformation changed. Spatial will not propagate this by default. </description> </method> <method name="set_rotation"> @@ -45733,6 +46475,7 @@ <argument index="0" name="scale" type="Vector3"> </argument> <description> + Set the scale. </description> </method> <method name="set_transform"> @@ -45764,6 +46507,7 @@ <return type="void"> </return> <description> + Enable rendering of this node. Change Spatial Visible property to false. </description> </method> <method name="to_global" qualifiers="const"> @@ -45772,6 +46516,7 @@ <argument index="0" name="local_point" type="Vector3"> </argument> <description> + Tranform [Vector3] from this node local space to world space. </description> </method> <method name="to_local" qualifiers="const"> @@ -45780,6 +46525,7 @@ <argument index="0" name="global_point" type="Vector3"> </argument> <description> + Tranform [Vector3] from world space to this node local space. </description> </method> <method name="translate"> @@ -45788,46 +46534,60 @@ <argument index="0" name="offset" type="Vector3"> </argument> <description> + Change node position by given offset [Vector3]. </description> </method> <method name="update_gizmo"> <return type="void"> </return> <description> + Update [SpatialGizmo] of this node. </description> </method> </methods> <members> <member name="global_transform" type="Transform" setter="set_global_transform" getter="get_global_transform" brief=""> + World space (global) [Transform] of this node. </member> <member name="rotation" type="Vector3" setter="set_rotation" getter="get_rotation" brief=""> + Local euler rotation in radians of this node. </member> <member name="rotation_deg" type="Vector3" setter="set_rotation_deg" getter="get_rotation_deg" brief=""> + Local euler rotation in degrees of this node. </member> <member name="scale" type="Vector3" setter="set_scale" getter="get_scale" brief=""> + Local scale of this node. </member> <member name="transform" type="Transform" setter="set_transform" getter="get_transform" brief=""> + Local space [Transform] of this node. </member> <member name="translation" type="Vector3" setter="set_translation" getter="get_translation" brief=""> + Local translation of this node. </member> <member name="visible" type="bool" setter="set_visible" getter="is_visible" brief=""> + Visibility of this node. Toggles if this node is rendered. </member> </members> <signals> <signal name="visibility_changed"> <description> + Emitted when node visibility changed. </description> </signal> </signals> <constants> <constant name="NOTIFICATION_TRANSFORM_CHANGED" value="29" enum=""> - Spatial nodes receive this notification with their global transform changes. This means that either the current or a parent node changed its transform. + Spatial nodes receive this notification when their global transform changes. This means that either the current or a parent node changed its transform. + In order for NOTIFICATION_TRANSFORM_CHANGED to work user first needs to ask for it, with set_notify_transform(true). </constant> <constant name="NOTIFICATION_ENTER_WORLD" value="41" enum=""> + Spatial nodes receive this notification when they are registered to new [World] resource. </constant> <constant name="NOTIFICATION_EXIT_WORLD" value="42" enum=""> + Spatial nodes receive this notification when they are unregistered from current [World] resource. </constant> <constant name="NOTIFICATION_VISIBILITY_CHANGED" value="43" enum=""> + Spatial nodes receive this notification when their visibility changes. </constant> </constants> </class> @@ -46905,8 +47665,10 @@ </class> <class name="SphereMesh" inherits="PrimitiveMesh" category="Core"> <brief_description> + Class representing a spherical [PrimitiveMesh]. </brief_description> <description> + Class representing a spherical [PrimitiveMesh]. </description> <methods> <method name="get_height" qualifiers="const"> @@ -46982,14 +47744,19 @@ </methods> <members> <member name="height" type="float" setter="set_height" getter="get_height" brief=""> + Full height of the sphere. Defaults to 2.0. </member> <member name="is_hemisphere" type="bool" setter="set_is_hemisphere" getter="get_is_hemisphere" brief=""> + Determines whether a full sphere or a hemisphere is created. Attention: To get a regular hemisphere the height and radius of the sphere have to equal. Defaults to false. </member> <member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments" brief=""> + Number of radial segments on the sphere. Defaults to 64. </member> <member name="radius" type="float" setter="set_radius" getter="get_radius" brief=""> + Radius of sphere. Defaults to 1.0. </member> <member name="rings" type="int" setter="set_rings" getter="get_rings" brief=""> + Number of segments along the height of the sphere. Defaults to 32. </member> </members> <constants> @@ -47989,12 +48756,16 @@ </methods> <members> <member name="bounce" type="float" setter="set_bounce" getter="get_bounce" brief=""> + The body bounciness. </member> <member name="constant_angular_velocity" type="Vector3" setter="set_constant_angular_velocity" getter="get_constant_angular_velocity" brief=""> + The constant angular velocity for the body. This does not rotate the body, but affects other bodies that touch it, as if it was in a state of rotation. </member> <member name="constant_linear_velocity" type="Vector3" setter="set_constant_linear_velocity" getter="get_constant_linear_velocity" brief=""> + The constant linear velocity for the body. This does not move the body, but affects other bodies that touch it, as if it was in a state of movement. </member> <member name="friction" type="float" setter="set_friction" getter="get_friction" brief=""> + The body friction, from 0 (frictionless) to 1 (full friction). </member> </members> <constants> @@ -49422,7 +50193,7 @@ - Rounded corners (individual radius for each corner) - Shadow About corner radius: - Setting corner radius to high values is allowed. As soon as corners would overlap the stylebox will switch to a relative system. Example: + Setting corner radius to high values is allowed. As soon as corners would overlap the stylebox will switch to a relative system. Example: [codeblock] height = 30 corner_radius_top_left = 50 @@ -51736,10 +52507,10 @@ </class> <class name="TextureRect" inherits="Control" category="Core"> <brief_description> - Control Frame that draws a texture. + Control that draws a texture. </brief_description> <description> - 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. + Control that draws a texture. </description> <methods> <method name="get_stretch_mode" qualifiers="const"> @@ -51787,10 +52558,13 @@ </methods> <members> <member name="expand" type="bool" setter="set_expand" getter="has_expand" brief=""> + If [code]true[/code] texture will expand to fit. Default value: [code]false[/code]. </member> <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" brief="" enum="TextureRect.StretchMode"> + Stretch mode of the texture. Use STRETCH_* constants as value. </member> <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> + The [Texture] resource for the node. </member> </members> <constants> @@ -52125,14 +52899,14 @@ <return type="String"> </return> <description> - Return the id of the thread, uniquely identifying it among all threads. + Returns the current [Thread]\ s id, uniquely identifying it among all threads. </description> </method> <method name="is_active" qualifiers="const"> <return type="bool"> </return> <description> - Whether this thread is currently active, an active Thread cannot start work on a new method but can be joined with [method wait_to_finish]. + Returns true if this [Thread] is currently active. An active [Thread] cannot start work on a new method but can be joined with [method wait_to_finish]. </description> </method> <method name="start"> @@ -52147,7 +52921,7 @@ <argument index="3" name="priority" type="int" default="1"> </argument> <description> - Start a new [Thread], it will run "method" on object "instance" using "userdata" as an argument and running with "priority", one of PRIORITY_* enum. + Starts a new [Thread] that runs "method" on object "instance" with "userdata" passed as an argument. The "priority" of the [Thread] can be changed by passing a PRIORITY_* enum. Returns OK on success, or ERR_CANT_CREATE on failure. </description> </method> @@ -52170,11 +52944,10 @@ </class> <class name="TileMap" inherits="Node2D" category="Core"> <brief_description> - Node for 2D tile-based games. + Node for 2D tile-based maps. </brief_description> <description> - 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. + Node for 2D tile-based maps. Tilemaps use a [TileSet] which contain a list of tiles (textures plus optional collision, navigation, and/or occluder shapes) which are used to create grid-based maps. </description> <methods> <method name="clear"> @@ -52617,40 +53390,55 @@ </methods> <members> <member name="cell_custom_transform" type="Transform2D" setter="set_custom_transform" getter="get_custom_transform" brief=""> + The custom [Transform2D] to be applied to the TileMap's cells. </member> <member name="cell_half_offset" type="int" setter="set_half_offset" getter="get_half_offset" brief="" enum="TileMap.HalfOffset"> + Amount to offset alternating tiles. Uses HALF_OFFSET_* constants. Default value: HALF_OFFSET_DISABLED. </member> <member name="cell_quadrant_size" type="int" setter="set_quadrant_size" getter="get_quadrant_size" brief=""> + The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size. Default value: 16. </member> <member name="cell_size" type="Vector2" setter="set_cell_size" getter="get_cell_size" brief=""> + The TileMap's cell size. </member> <member name="cell_tile_origin" type="int" setter="set_tile_origin" getter="get_tile_origin" brief="" enum="TileMap.TileOrigin"> + Position for tile origin. Uses TILE_ORIGIN_* constants. Default value: TILE_ORIGIN_TOP_LEFT. </member> <member name="cell_y_sort" type="bool" setter="set_y_sort_mode" getter="is_y_sort_mode_enabled" brief=""> + If [code]true[/code] the TileMap's children will be drawn in order of their Y coordinate. Default value: [code]false[/code]. </member> <member name="collision_bounce" type="float" setter="set_collision_bounce" getter="get_collision_bounce" brief=""> + Bounce value for static body collisions (see [code]collision_use_kinematic[/code]). Default value: 0. </member> <member name="collision_friction" type="float" setter="set_collision_friction" getter="get_collision_friction" brief=""> + Friction value for static body collisions (see [code]collision_use_kinematic[/code]). Default value: 1. </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief=""> + The collision layer(s) for all colliders in the TileMap. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" brief=""> + The collision mask(s) for all colliders in the TileMap. </member> <member name="collision_use_kinematic" type="bool" setter="set_collision_use_kinematic" getter="get_collision_use_kinematic" brief=""> + If [code]true[/code] TileMap collisions will be handled as a kinematic body. If [code]false[/code] collisions will be handled as static body. Default value: [code]false[/code]. </member> <member name="mode" type="int" setter="set_mode" getter="get_mode" brief="" enum="TileMap.Mode"> + The TileMap orientation mode. Uses MODE_* constants. Default value: MODE_SQUARE. </member> <member name="occluder_light_mask" type="int" setter="set_occluder_light_mask" getter="get_occluder_light_mask" brief=""> + The light mask assigned to all light occluders in the TileMap. The TileSet's light occluders will cast shadows only from Light2D(s) that have the same light mask(s). </member> <member name="tile_data" type="PoolIntArray" setter="_set_tile_data" getter="_get_tile_data" brief=""> + A [PoolIntArray] containing </member> <member name="tile_set" type="TileSet" setter="set_tileset" getter="get_tileset" brief=""> + The assigned [TileSet]. </member> </members> <signals> <signal name="settings_changed"> <description> - Signal indicating that a tilemap setting has changed. + Emitted when a tilemap setting has changed. </description> </signal> </signals> @@ -53055,10 +53843,10 @@ </class> <class name="Timer" inherits="Node" category="Core"> <brief_description> - A simple Timer node. + A countdown timer. </brief_description> <description> - 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. + Counts down a specified interval and emits a signal on reaching 0. Can be set to repeat or "one shot" mode. </description> <methods> <method name="get_time_left" qualifiers="const"> @@ -53158,47 +53946,58 @@ <return type="void"> </return> <description> - Start the timer. + Start the Timer. </description> </method> <method name="stop"> <return type="void"> </return> <description> - Stop (cancel) the timer. + Stop (cancel) the Timer. </description> </method> </methods> <members> <member name="autostart" type="bool" setter="set_autostart" getter="has_autostart" brief=""> + If [code]true[/code], Timer will automatically start when entering the scene tree. Default value: [code]false[/code]. </member> <member name="one_shot" type="bool" setter="set_one_shot" getter="is_one_shot" brief=""> + If [code]true[/code], Timer will stop when reaching 0. If [code]false[/code], it will restart. Default value: [code]false[/code]. </member> <member name="process_mode" type="int" setter="set_timer_process_mode" getter="get_timer_process_mode" brief="" enum="Timer.TimerProcessMode"> + Processing mode. Uses TIMER_PROCESS_* constants as value. </member> <member name="wait_time" type="float" setter="set_wait_time" getter="get_wait_time" brief=""> + Wait time in seconds. </member> </members> <signals> <signal name="timeout"> <description> - Emitted when the time runs out. + Emitted when the Timer reaches 0. </description> </signal> </signals> <constants> <constant name="TIMER_PROCESS_FIXED" value="0"> - Update the timer at fixed intervals (framerate processing). + Update the Timer at fixed intervals (framerate processing). </constant> <constant name="TIMER_PROCESS_IDLE" value="1"> - Update the timer during the idle time at each frame. + Update the Timer during the idle time at each frame. </constant> </constants> </class> <class name="ToolButton" inherits="Button" category="Core"> <brief_description> + Flat button helper class. </brief_description> <description> + This is a helper class to generate a flat [Button] (see [method Button.set_flat]), creating a ToolButton is equivalent to: + + [codeblock] + var btn = Button.new() + btn.set_flat(true) + [/codeblock] </description> <methods> </methods> @@ -53403,10 +54202,10 @@ </class> <class name="Transform" category="Built-In Types"> <brief_description> - 3D Transformation. + 3D Transformation. 3x4 matrix. </brief_description> <description> - Transform is used to store translation, rotation and scaling transformations. It consists of a Basis "basis" and Vector3 "origin". Transform is used to represent transformations of objects in space, and as such, determine their position, orientation and scale. It is similar to a 3x4 matrix. + Represents one or many transformations in 3D space such as translation, rotation, or scaling. It consists of a [Basis] "basis" and an [Vector3] "origin". It is similar to a 3x4 matrix. </description> <methods> <method name="Transform"> @@ -53421,7 +54220,7 @@ <argument index="3" name="origin" type="Vector3"> </argument> <description> - Construct the Transform from four Vector3. Each axis corresponds to local basis vectors (some of which may be scaled). + Construct the Transform from four [Vector3]. Each axis corresponds to local basis vectors (some of which may be scaled). </description> </method> <method name="Transform"> @@ -53432,7 +54231,7 @@ <argument index="1" name="origin" type="Vector3"> </argument> <description> - Construct the Transform from a Basis and Vector3. + Construct the Transform from a [Basis] and [Vector3]. </description> </method> <method name="Transform"> @@ -53441,7 +54240,7 @@ <argument index="0" name="from" type="Transform2D"> </argument> <description> - Construct the Transform from a Transform2D. + Construct the Transform from a [Transform2D]. </description> </method> <method name="Transform"> @@ -53450,7 +54249,7 @@ <argument index="0" name="from" type="Quat"> </argument> <description> - Construct the Transform from a Quat. The origin will be Vector3(0, 0, 0). + Construct the Transform from a [Quat]. The origin will be Vector3(0, 0, 0). </description> </method> <method name="Transform"> @@ -53459,7 +54258,7 @@ <argument index="0" name="from" type="Basis"> </argument> <description> - Construct the Transform from a Basis. The origin will be Vector3(0, 0, 0). + Construct the Transform from a [Basis]. The origin will be Vector3(0, 0, 0). </description> </method> <method name="affine_inverse"> @@ -53477,13 +54276,14 @@ <argument index="1" name="weight" type="float"> </argument> <description> + Interpolate to other Transform by weight amount (0-1). </description> </method> <method name="inverse"> <return type="Transform"> </return> <description> - Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling). + Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling). </description> </method> <method name="looking_at"> @@ -53530,7 +54330,7 @@ <argument index="0" name="ofs" type="Vector3"> </argument> <description> - Translate the transform by the specified displacement. + Translate the transform by the specified offset. </description> </method> <method name="xform"> @@ -53554,10 +54354,10 @@ </methods> <members> <member name="basis" type="Basis" setter="" getter="" brief=""> - The basis is a matrix containing 3 [Vector3] as its columns: X axis, Y axis, and Z axis. These vectors can be interpreted as the basis vectors of local coordinate system travelling with the object. + The basis is a matrix containing 3 [Vector3] as its columns: X axis, Y axis, and Z axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object. </member> <member name="origin" type="Vector3" setter="" getter="" brief=""> - The origin of the transform. Which is the translation offset. + The translation offset of the transform. </member> </members> <constants> @@ -53565,10 +54365,10 @@ </class> <class name="Transform2D" category="Built-In Types"> <brief_description> - 3x2 Matrix for 2D transforms. + 2D Transformation. 3x2 matrix. </brief_description> <description> - 3x2 Matrix for 2D transforms. + Represents one or many transformations in 3D space such as translation, rotation, or scaling. It consists of a two [Vector2] x, y and [Vector2] "origin". It is similar to a 3x2 matrix. </description> <methods> <method name="Transform2D"> @@ -53577,6 +54377,7 @@ <argument index="0" name="from" type="Transform"> </argument> <description> + Constructs the [Transform2D] from a 3D [Transform]. </description> </method> <method name="Transform2D"> @@ -53589,6 +54390,7 @@ <argument index="2" name="origin" type="Vector2"> </argument> <description> + Constructs the [Transform2D] from 3 [Vector2] consisting of rows x, y and origin. </description> </method> <method name="Transform2D"> @@ -53599,13 +54401,14 @@ <argument index="1" name="pos" type="Vector2"> </argument> <description> + Constructs the [Transform2D] from rotation angle in radians and position [Vector2]. </description> </method> <method name="affine_inverse"> <return type="Transform2D"> </return> <description> - Return the inverse of the matrix. + Returns the inverse of the matrix. </description> </method> <method name="basis_xform"> @@ -53614,6 +54417,7 @@ <argument index="0" name="v" type="var"> </argument> <description> + Transforms the given vector "v" by this transform basis (no translation). </description> </method> <method name="basis_xform_inv"> @@ -53622,12 +54426,14 @@ <argument index="0" name="v" type="var"> </argument> <description> + Inverse-transforms vector "v" by this transform basis (no translation). </description> </method> <method name="get_origin"> <return type="Vector2"> </return> <description> + Return the origin [Vector2] (translation). </description> </method> <method name="get_rotation"> @@ -53641,6 +54447,7 @@ <return type="Vector2"> </return> <description> + Return the scale. </description> </method> <method name="interpolate_with"> @@ -53651,18 +54458,21 @@ <argument index="1" name="weight" type="float"> </argument> <description> + Interpolate to other Transform2D by weight amount (0-1). </description> </method> <method name="inverse"> <return type="Transform2D"> </return> <description> + Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling). </description> </method> <method name="orthonormalized"> <return type="Transform2D"> </return> <description> + Returns a transfrom with the basis orthogonal (90 degrees), and normalized axis vectors. </description> </method> <method name="rotated"> @@ -53671,6 +54481,7 @@ <argument index="0" name="phi" type="float"> </argument> <description> + Rotate the transform by phi. </description> </method> <method name="scaled"> @@ -53679,6 +54490,7 @@ <argument index="0" name="scale" type="Vector2"> </argument> <description> + Scale the transform by the specified 2D scaling factors. </description> </method> <method name="translated"> @@ -53687,6 +54499,7 @@ <argument index="0" name="offset" type="Vector2"> </argument> <description> + Translate the transform by the specified offset. </description> </method> <method name="xform"> @@ -53695,6 +54508,7 @@ <argument index="0" name="v" type="var"> </argument> <description> + Transforms the given vector "v" by this transform. </description> </method> <method name="xform_inv"> @@ -53703,15 +54517,19 @@ <argument index="0" name="v" type="var"> </argument> <description> + Inverse-transforms the given vector "v" by this transform. </description> </method> </methods> <members> <member name="origin" type="Vector2" setter="" getter="" brief=""> + The translation offset of the transform. </member> <member name="x" type="Vector2" setter="" getter="" brief=""> + The X axis of 2x2 basis matrix containing 2 [Vector2] as its columns: X axis and Y axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object. </member> <member name="y" type="Vector2" setter="" getter="" brief=""> + The Y axis of 2x2 basis matrix containing 2 [Vector2] as its columns: X axis and Y axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object. </member> </members> <constants> @@ -55584,8 +56402,10 @@ </class> <class name="Variant" category="Core"> <brief_description> + The most important data type in Godot. </brief_description> <description> + A Variant takes up only 20 bytes and can store almost any engine datatype inside of it. Variants are rarely used to hold information for long periods of time, instead they are used mainly for communication, editing, serialization and moving data around. </description> <methods> </methods> @@ -56820,6 +57640,12 @@ Get the enabled status of the size strech override set with [method set_size_override_stretch]. </description> </method> + <method name="is_snap_controls_to_pixels_enabled" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="is_using_own_world" qualifiers="const"> <return type="bool"> </return> @@ -56978,6 +57804,14 @@ Set whether the size override affects stretch as well. </description> </method> + <method name="set_snap_controls_to_pixels"> + <return type="void"> + </return> + <argument index="0" name="enabled" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_transparent_background"> <return type="void"> </return> @@ -57010,6 +57844,10 @@ <argument index="0" name="use" type="bool"> </argument> <description> + If true this viewport will be bound to our ARVR Server. + If this is our main Godot viewport our AR/VR output will be displayed on screen. + If output is redirected to an HMD we'll see the output of just one of the eyes without any distortion applied else we'll see the stereo buffer with distortion applied if applicable + If this is an extra viewport output will only work if redirection to an HMD is supported by the interface. The render target will allow you to use the undistorted output for the right eye in the display. </description> </method> <method name="set_use_own_world"> @@ -57066,6 +57904,7 @@ <return type="bool"> </return> <description> + Returns whether this viewport is using our ARVR Server </description> </method> <method name="warp_mouse"> @@ -57091,6 +57930,8 @@ </member> <member name="gui_disable_input" type="bool" setter="set_disable_input" getter="is_input_disabled" brief=""> </member> + <member name="gui_snap_controls_to_pixels" type="bool" setter="set_snap_controls_to_pixels" getter="is_snap_controls_to_pixels_enabled" brief=""> + </member> <member name="hdr" type="bool" setter="set_hdr" getter="get_hdr" brief=""> </member> <member name="msaa" type="int" setter="set_msaa" getter="get_msaa" brief="" enum="Viewport.MSAA"> @@ -58038,7 +58879,7 @@ <members> <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief="" enum="Variant.Type"> </member> - <member name="constant/constant" type="String" setter="set_basic_type_constant" getter="get_basic_type_constant" brief=""> + <member name="constant" type="String" setter="set_basic_type_constant" getter="get_basic_type_constant" brief=""> </member> </members> <constants> @@ -58110,7 +58951,7 @@ <members> <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> </member> - <member name="constant/constant" type="String" setter="set_class_constant" getter="get_class_constant" brief=""> + <member name="constant" type="String" setter="set_class_constant" getter="get_class_constant" brief=""> </member> </members> <constants> @@ -58482,7 +59323,7 @@ </method> </methods> <members> - <member name="constant/constant" type="String" setter="set_singleton" getter="get_singleton" brief=""> + <member name="/constant" type="String" setter="set_singleton" getter="get_singleton" brief=""> </member> </members> <constants> @@ -58748,7 +59589,7 @@ </method> </methods> <members> - <member name="constant/constant" type="int" setter="set_global_constant" getter="get_global_constant" brief=""> + <member name="constant" type="int" setter="set_global_constant" getter="get_global_constant" brief=""> </member> </members> <constants> @@ -58938,7 +59779,7 @@ </method> </methods> <members> - <member name="constant/constant" type="int" setter="set_math_constant" getter="get_math_constant" brief="" enum="VisualScriptMathConstant.MathConstant"> + <member name="constant" type="int" setter="set_math_constant" getter="get_math_constant" brief="" enum="VisualScriptMathConstant.MathConstant"> </member> </members> <constants> |