2018-05-12 07:38:00 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2019-07-05 09:32:53 +00:00
<class name= "Bone2D" inherits= "Node2D" category= "Core" version= "3.1.2" >
2018-05-12 07:38:00 +00:00
<brief_description >
2019-06-12 10:58:13 +00:00
Joint used with [Skeleton2D] to control and animate other nodes.
2018-05-12 07:38:00 +00:00
</brief_description>
<description >
2019-06-12 10:58:13 +00:00
Use a hierarchy of [code]Bone2D[/code] bound to a [Skeleton2D] to control, and animate other [class Node2D] nodes.
You can use [code]Bone2D[/code] and [code]Skeleton2D[/code] nodes to animate 2D meshes created with the Polygon 2D UV editor.
Each bone has a [member rest] transform that you can reset to with [method apply_rest]. These rest poses are relative to the bone's parent.
If in the editor, you can set the rest pose of an entire skeleton using a menu option, from the code, you need to iterate over the bones to set their individual rest poses.
2018-05-12 07:38:00 +00:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "apply_rest" >
<return type= "void" >
</return>
<description >
2019-06-12 10:58:13 +00:00
Stores the node's current transforms in [member rest].
2018-05-12 07:38:00 +00:00
</description>
</method>
<method name= "get_index_in_skeleton" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2019-06-12 10:58:13 +00:00
Returns the node's index as part of the entire skeleton. See [Skeleton2D].
2018-05-12 07:38:00 +00:00
</description>
</method>
<method name= "get_skeleton_rest" qualifiers= "const" >
<return type= "Transform2D" >
</return>
<description >
2019-06-12 10:58:13 +00:00
Returns the node's [member rest] [code]Transform2D[/code] if it doesn't have a parent, or its rest pose relative to its parent.
2018-05-12 07:38:00 +00:00
</description>
</method>
</methods>
<members >
<member name= "default_length" type= "float" setter= "set_default_length" getter= "get_default_length" >
2019-06-12 10:58:13 +00:00
Length of the bone's representation drawn in the editor's viewport in pixels.
2018-05-12 07:38:00 +00:00
</member>
<member name= "rest" type= "Transform2D" setter= "set_rest" getter= "get_rest" >
2019-06-12 10:58:13 +00:00
Rest transform of the bone. You can reset the node's transforms to this value using [member apply_rest].
2018-05-12 07:38:00 +00:00
</member>
</members>
<constants >
</constants>
</class>