2018-05-12 07:38:00 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2022-08-05 16:51:38 +00:00
<class name= "Bone2D" inherits= "Node2D" version= "3.6" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
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-14 22:04:55 +00:00
Use a hierarchy of [code]Bone2D[/code] bound to a [Skeleton2D] to control, and animate other [Node2D] nodes.
2019-06-12 10:58:13 +00:00
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" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2018-05-12 07:38:00 +00:00
<description >
2023-11-29 11:17:04 +00:00
Resets the bone to the rest pose. This is equivalent to setting [member Node2D.transform] to [member rest].
2018-05-12 07:38:00 +00:00
</description>
</method>
<method name= "get_index_in_skeleton" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
2018-05-12 07:38:00 +00:00
<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" >
2021-07-30 13:28:05 +00:00
<return type= "Transform2D" />
2018-05-12 07:38:00 +00:00
<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 >
2019-06-29 10:38:01 +00:00
<member name= "default_length" type= "float" setter= "set_default_length" getter= "get_default_length" default= "16.0" >
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>
2019-06-29 10:38:01 +00:00
<member name= "rest" type= "Transform2D" setter= "set_rest" getter= "get_rest" default= "Transform2D( 0, 0, 0, 0, 0, 0 )" >
2019-06-14 22:04:55 +00:00
Rest transform of the bone. You can reset the node's transforms to this value using [method apply_rest].
2018-05-12 07:38:00 +00:00
</member>
</members>
<constants >
</constants>
</class>