virtualx-engine/doc/classes/Bone2D.xml

48 lines
2 KiB
XML
Raw Normal View History

2018-05-12 09:38:00 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Bone2D" inherits="Node2D" version="3.2">
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>
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">
<return type="void">
</return>
<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">
<return type="int">
</return>
<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">
<return type="Transform2D">
</return>
<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>
<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>
<member name="rest" type="Transform2D" setter="set_rest" getter="get_rest" default="Transform2D( 0, 0, 0, 0, 0, 0 )">
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>