Skeleton2D.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Skeleton2D" inherits="Node2D" version="4.0">
  3. <brief_description>
  4. Skeleton for 2D characters and animated objects.
  5. </brief_description>
  6. <description>
  7. Skeleton2D parents a hierarchy of [Bone2D] objects. It is a requirement of [Bone2D]. Skeleton2D holds a reference to the rest pose of its children and acts as a single point of access to its bones.
  8. To setup different types of inverse kinematics for the given Skeleton2D, a [SkeletonModificationStack2D] should be created. They can be applied by creating the desired number of modifications, which can be done by increasing [member SkeletonModificationStack2D.modification_count].
  9. </description>
  10. <tutorials>
  11. <link title="2D skeletons">https://docs.godotengine.org/en/latest/tutorials/animation/2d_skeletons.html</link>
  12. </tutorials>
  13. <methods>
  14. <method name="execute_modifications">
  15. <return type="void" />
  16. <argument index="0" name="delta" type="float" />
  17. <argument index="1" name="execution_mode" type="int" />
  18. <description>
  19. Executes all the modifications on the [SkeletonModificationStack2D], if the Skeleton3D has one assigned.
  20. </description>
  21. </method>
  22. <method name="get_bone">
  23. <return type="Bone2D" />
  24. <argument 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 [code]idx[/code]. 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. <argument index="0" name="bone_idx" type="int" />
  38. <description>
  39. Returns the local pose override transform for [code]bone_idx[/code].
  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. <argument index="0" name="bone_idx" type="int" />
  57. <argument index="1" name="override_pose" type="Transform2D" />
  58. <argument index="2" name="strength" type="float" />
  59. <argument index="3" name="persistent" type="bool" />
  60. <description>
  61. Sets the local pose transform, [code]pose[/code], for the bone at [code]bone_idx[/code].
  62. [code]amount[/code] is the interpolation strength that will be used when applying the pose, and [code]persistent[/code] 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 [code]bone_idx[/code]!
  64. </description>
  65. </method>
  66. <method name="set_modification_stack">
  67. <return type="void" />
  68. <argument 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>