2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
<class name= "Node2D" inherits= "CanvasItem" category= "Core" version= "3.0.alpha.custom_build" >
<brief_description >
A 2D game object, parent of all 2D related nodes. Has a position, rotation, scale and Z-index.
</brief_description>
<description >
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>
<tutorials >
</tutorials>
<demos >
</demos>
<methods >
<method name= "apply_scale" >
<return type= "void" >
</return>
<argument index= "0" name= "ratio" type= "Vector2" >
</argument>
<description >
Multiplies the current scale by the 'ratio' vector.
</description>
</method>
<method name= "edit_set_pivot" >
<return type= "void" >
</return>
<argument index= "0" name= "pivot" type= "Vector2" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Sets the node's pivot position.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_angle_to" qualifiers= "const" >
<return type= "float" >
</return>
<argument index= "0" name= "point" type= "Vector2" >
</argument>
<description >
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 >
Returns the node's global position.
</description>
</method>
<method name= "get_global_rotation" qualifiers= "const" >
<return type= "float" >
</return>
<description >
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 node's global rotation in degrees.
</description>
</method>
<method name= "get_global_scale" qualifiers= "const" >
<return type= "Vector2" >
</return>
<description >
Returns the node's global scale.
</description>
</method>
<method name= "get_position" qualifiers= "const" >
<return type= "Vector2" >
</return>
<description >
Returns the node's position.
</description>
</method>
<method name= "get_relative_transform_to_parent" qualifiers= "const" >
<return type= "Transform2D" >
</return>
<argument index= "0" name= "parent" type= "Node" >
</argument>
<description >
Returns the [Transform2D] relative to this node's parent.
</description>
</method>
<method name= "get_rotation" qualifiers= "const" >
<return type= "float" >
</return>
<description >
Returns the node's rotation in radians.
</description>
</method>
<method name= "get_rotation_in_degrees" qualifiers= "const" >
<return type= "float" >
</return>
<description >
Returns the node's rotation in degrees.
</description>
</method>
<method name= "get_scale" qualifiers= "const" >
<return type= "Vector2" >
</return>
<description >
Returns the node's scale.
</description>
</method>
<method name= "get_z" qualifiers= "const" >
<return type= "int" >
</return>
<description >
Returns the node's Z-index.
</description>
</method>
<method name= "global_translate" >
<return type= "void" >
</return>
<argument index= "0" name= "offset" type= "Vector2" >
</argument>
<description >
Adds the 'offset' vector to the node's global position.
</description>
</method>
<method name= "is_z_relative" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
Returns true if this node's Z-index is relative to its parent's. Else, returns false.
</description>
</method>
<method name= "look_at" >
<return type= "void" >
</return>
<argument index= "0" name= "point" type= "Vector2" >
</argument>
<description >
Rotates the node so it points towards the 'point'.
</description>
</method>
<method name= "move_local_x" >
<return type= "void" >
</return>
<argument index= "0" name= "delta" type= "float" >
</argument>
<argument index= "1" name= "scaled" type= "bool" default= "false" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Applies a local translation on the node's X axis based on the [method Node._process]'s [code]delta[/code]. If [code]scaled[/code] is false, normalizes the movement.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "move_local_y" >
<return type= "void" >
</return>
<argument index= "0" name= "delta" type= "float" >
</argument>
<argument index= "1" name= "scaled" type= "bool" default= "false" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Applies a local translation on the node's Y axis based on the [method Node._process]'s [code]delta[/code]. If [code]scaled[/code] is false, normalizes the movement.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "rotate" >
<return type= "void" >
</return>
<argument index= "0" name= "radians" type= "float" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Applies a rotation to the node, in radians, starting from its current rotation.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_global_position" >
<return type= "void" >
</return>
2017-09-10 13:37:49 +00:00
<argument index= "0" name= "position" type= "Vector2" >
2017-09-12 20:42:36 +00:00
</argument>
<description >
2017-10-22 20:43:35 +00:00
Sets the node's global position.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_global_rotation" >
<return type= "void" >
</return>
<argument index= "0" name= "radians" type= "float" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Sets the node's global rotation in radians.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_global_rotation_in_degrees" >
<return type= "void" >
</return>
<argument index= "0" name= "degrees" type= "float" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Sets the node's global rotation in degrees.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_global_scale" >
<return type= "void" >
</return>
<argument index= "0" name= "scale" type= "Vector2" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Sets the node's global scale.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_global_transform" >
<return type= "void" >
</return>
<argument index= "0" name= "xform" type= "Transform2D" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Sets the node's global [Transform2D].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_position" >
<return type= "void" >
</return>
2017-09-10 13:37:49 +00:00
<argument index= "0" name= "position" type= "Vector2" >
2017-09-12 20:42:36 +00:00
</argument>
<description >
2017-10-22 20:43:35 +00:00
Sets the node's position.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_rotation" >
<return type= "void" >
</return>
<argument index= "0" name= "radians" type= "float" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Sets the node's rotation in radians.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_rotation_in_degrees" >
<return type= "void" >
</return>
<argument index= "0" name= "degrees" type= "float" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Sets the node's rotation in degrees.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_scale" >
<return type= "void" >
</return>
<argument index= "0" name= "scale" type= "Vector2" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Sets the node's scale.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_transform" >
<return type= "void" >
</return>
<argument index= "0" name= "xform" type= "Transform2D" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Sets the node's local [Transform2D].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_z" >
<return type= "void" >
</return>
<argument index= "0" name= "z" type= "int" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Sets the node's Z-index.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_z_as_relative" >
<return type= "void" >
</return>
<argument index= "0" name= "enable" type= "bool" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Makes 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.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "to_global" qualifiers= "const" >
<return type= "Vector2" >
</return>
<argument index= "0" name= "local_point" type= "Vector2" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Converts a local point's coordinates to global coordinates.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "to_local" qualifiers= "const" >
<return type= "Vector2" >
</return>
<argument index= "0" name= "global_point" type= "Vector2" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Converts a global point's coordinates to local coordinates.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "translate" >
<return type= "void" >
</return>
<argument index= "0" name= "offset" type= "Vector2" >
</argument>
<description >
2017-10-22 20:43:35 +00:00
Translates the node by the given [code]offset[/code] in local coordinates.
2017-09-12 20:42:36 +00:00
</description>
</method>
</methods>
<members >
2017-09-13 06:49:40 +00:00
<member name= "global_position" type= "Vector2" setter= "set_global_position" getter= "get_global_position" >
2017-09-12 20:42:36 +00:00
Global position.
</member>
2017-09-13 06:49:40 +00:00
<member name= "global_rotation" type= "float" setter= "set_global_rotation" getter= "get_global_rotation" >
2017-09-12 20:42:36 +00:00
Global rotation in radians.
</member>
2017-09-13 06:49:40 +00:00
<member name= "global_rotation_deg" type= "float" setter= "set_global_rotation_in_degrees" getter= "get_global_rotation_in_degrees" >
2017-09-12 20:42:36 +00:00
Global rotation in degrees.
</member>
2017-09-13 06:49:40 +00:00
<member name= "global_scale" type= "Vector2" setter= "set_global_scale" getter= "get_global_scale" >
2017-09-12 20:42:36 +00:00
Global scale.
</member>
2017-09-13 06:49:40 +00:00
<member name= "global_transform" type= "Transform2D" setter= "set_global_transform" getter= "get_global_transform" >
2017-09-12 20:42:36 +00:00
Global [Transform2D].
</member>
2017-09-13 06:49:40 +00:00
<member name= "position" type= "Vector2" setter= "set_position" getter= "get_position" >
2017-09-12 20:42:36 +00:00
Position, relative to the node's parent.
</member>
2017-09-13 06:49:40 +00:00
<member name= "rotation" type= "float" setter= "set_rotation" getter= "get_rotation" >
2017-09-12 20:42:36 +00:00
Rotation in radians.
</member>
2017-09-13 06:49:40 +00:00
<member name= "rotation_deg" type= "float" setter= "set_rotation_in_degrees" getter= "get_rotation_in_degrees" >
2017-09-12 20:42:36 +00:00
Rotation in degrees.
</member>
2017-09-13 06:49:40 +00:00
<member name= "scale" type= "Vector2" setter= "set_scale" getter= "get_scale" >
2017-09-12 20:42:36 +00:00
Rotation in degrees.
</member>
2017-09-13 06:49:40 +00:00
<member name= "transform" type= "Transform2D" setter= "set_transform" getter= "get_transform" >
2017-09-12 20:42:36 +00:00
Local [Transform2D].
</member>
2017-09-13 06:49:40 +00:00
<member name= "z" type= "int" setter= "set_z" getter= "get_z" >
2017-09-12 20:42:36 +00:00
Z-index. Controls the order in which the nodes render. A node with a higher Z-index will display in front of others.
</member>
2017-09-13 06:49:40 +00:00
<member name= "z_as_relative" type= "bool" setter= "set_z_as_relative" getter= "is_z_relative" >
2017-09-12 20:42:36 +00:00
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 >
</constants>
</class>