0.2.0-dev Download ZIP
81 lines ·3.7 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="Skeleton2D" inherits="Node2D" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | The parent of a hierarchy of [Bone2D]s, used to create a 2D skeletal animation. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | [Skeleton2D] parents a hierarchy of [Bone2D] nodes. It holds a reference to each [Bone2D]'s rest pose and acts as a single point of access to its bones. |
| 8 | To set up different types of inverse kinematics for the given Skeleton2D, a [SkeletonModificationStack2D] should be created. The inverse kinematics be applied by increasing [member SkeletonModificationStack2D.modification_count] and creating the desired number of modifications. |
| 9 | </description> |
| 10 | <tutorials> |
| 11 | <link title="2D skeletons">$DOCS_URL/tutorials/animation/2d_skeletons.html</link> |
| 12 | </tutorials> |
| 13 | <methods> |
| 14 | <method name="execute_modifications"> |
| 15 | <return type="void" /> |
| 16 | <param index="0" name="delta" type="float" /> |
| 17 | <param index="1" name="execution_mode" type="int" /> |
| 18 | <description> |
| 19 | Executes all the modifications on the [SkeletonModificationStack2D], if the Skeleton2D has one assigned. |
| 20 | </description> |
| 21 | </method> |
| 22 | <method name="get_bone"> |
| 23 | <return type="Bone2D" /> |
| 24 | <param index="0" name="idx" type="int" /> |
| 25 | <description> |
| 26 | Returns a [Bone2D] from the node hierarchy parented by Skeleton2D. The object to return is identified by the parameter [param idx]. Bones are indexed by descending the node hierarchy from top to bottom, adding the children of each branch before moving to the next sibling. |
| 27 | </description> |
| 28 | </method> |
| 29 | <method name="get_bone_count" qualifiers="const"> |
| 30 | <return type="int" /> |
| 31 | <description> |
| 32 | Returns the number of [Bone2D] nodes in the node hierarchy parented by Skeleton2D. |
| 33 | </description> |
| 34 | </method> |
| 35 | <method name="get_bone_local_pose_override"> |
| 36 | <return type="Transform2D" /> |
| 37 | <param index="0" name="bone_idx" type="int" /> |
| 38 | <description> |
| 39 | Returns the local pose override transform for [param bone_idx]. |
| 40 | </description> |
| 41 | </method> |
| 42 | <method name="get_modification_stack" qualifiers="const"> |
| 43 | <return type="SkeletonModificationStack2D" /> |
| 44 | <description> |
| 45 | Returns the [SkeletonModificationStack2D] attached to this skeleton, if one exists. |
| 46 | </description> |
| 47 | </method> |
| 48 | <method name="get_skeleton" qualifiers="const"> |
| 49 | <return type="RID" /> |
| 50 | <description> |
| 51 | Returns the [RID] of a Skeleton2D instance. |
| 52 | </description> |
| 53 | </method> |
| 54 | <method name="set_bone_local_pose_override"> |
| 55 | <return type="void" /> |
| 56 | <param index="0" name="bone_idx" type="int" /> |
| 57 | <param index="1" name="override_pose" type="Transform2D" /> |
| 58 | <param index="2" name="strength" type="float" /> |
| 59 | <param index="3" name="persistent" type="bool" /> |
| 60 | <description> |
| 61 | Sets the local pose transform, [param override_pose], for the bone at [param bone_idx]. |
| 62 | [param strength] is the interpolation strength that will be used when applying the pose, and [param persistent] determines if the applied pose will remain. |
| 63 | [b]Note:[/b] The pose transform needs to be a local transform relative to the [Bone2D] node at [param bone_idx]! |
| 64 | </description> |
| 65 | </method> |
| 66 | <method name="set_modification_stack"> |
| 67 | <return type="void" /> |
| 68 | <param index="0" name="modification_stack" type="SkeletonModificationStack2D" /> |
| 69 | <description> |
| 70 | Sets the [SkeletonModificationStack2D] attached to this skeleton. |
| 71 | </description> |
| 72 | </method> |
| 73 | </methods> |
| 74 | <signals> |
| 75 | <signal name="bone_setup_changed"> |
| 76 | <description> |
| 77 | Emitted when the [Bone2D] setup attached to this skeletons changes. This is primarily used internally within the skeleton. |
| 78 | </description> |
| 79 | </signal> |
| 80 | </signals> |
| 81 | </class> |