2018-05-12 09:38:00 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2022-03-16 23:01:02 +01:00
<class name= "Bone2D" inherits= "Node2D" version= "3.5" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2018-05-12 09:38:00 +02:00
<brief_description >
2019-06-12 12:58:13 +02:00
Joint used with [Skeleton2D] to control and animate other nodes.
2018-05-12 09:38:00 +02:00
</brief_description>
<description >
2019-06-15 00:04:55 +02:00
Use a hierarchy of [code]Bone2D[/code] bound to a [Skeleton2D] to control, and animate other [Node2D] nodes.
2019-06-12 12:58:13 +02: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 09:38:00 +02:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "apply_rest" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2018-05-12 09:38:00 +02:00
<description >
2019-06-12 12:58:13 +02:00
Stores the node's current transforms in [member rest].
2018-05-12 09:38:00 +02:00
</description>
</method>
<method name= "get_index_in_skeleton" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2018-05-12 09:38:00 +02:00
<description >
2019-06-12 12:58:13 +02:00
Returns the node's index as part of the entire skeleton. See [Skeleton2D].
2018-05-12 09:38:00 +02:00
</description>
</method>
<method name= "get_skeleton_rest" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Transform2D" />
2018-05-12 09:38:00 +02:00
<description >
2019-06-12 12:58:13 +02: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 09:38:00 +02:00
</description>
</method>
</methods>
<members >
2019-06-29 12:38:01 +02:00
<member name= "default_length" type= "float" setter= "set_default_length" getter= "get_default_length" default= "16.0" >
2019-06-12 12:58:13 +02:00
Length of the bone's representation drawn in the editor's viewport in pixels.
2018-05-12 09:38:00 +02:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "rest" type= "Transform2D" setter= "set_rest" getter= "get_rest" default= "Transform2D( 0, 0, 0, 0, 0, 0 )" >
2019-06-15 00:04:55 +02:00
Rest transform of the bone. You can reset the node's transforms to this value using [method apply_rest].
2018-05-12 09:38:00 +02:00
</member>
</members>
<constants >
</constants>
</class>