2
0

SkeletonModification2D.xml 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="SkeletonModification2D" inherits="Resource" version="4.0">
  3. <brief_description>
  4. A resource that operates on [Bone2D] nodes in a [Skeleton2D].
  5. </brief_description>
  6. <description>
  7. This resource provides an interface that can be expanded so code that operates on [Bone2D] nodes in a [Skeleton2D] can be mixed and matched together to create complex interactions.
  8. This is used to provide Godot with a flexible and powerful Inverse Kinematics solution that can be adapted for many different uses.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <methods>
  13. <method name="_draw_editor_gizmo" qualifiers="virtual">
  14. <return type="void" />
  15. <description>
  16. Used for drawing [b]editor-only[/b] modification gizmos. This function will only be called in the Godot editor and can be overridden to draw custom gizmos.
  17. [b]Note:[/b] You will need to use the Skeleton2D from [method SkeletonModificationStack2D.get_skeleton] and it's draw functions, as the [SkeletonModification2D] resource cannot draw on its own.
  18. </description>
  19. </method>
  20. <method name="_execute" qualifiers="virtual">
  21. <return type="void" />
  22. <argument index="0" name="delta" type="float" />
  23. <description>
  24. Executes the given modification. This is where the modification performs whatever function it is designed to do.
  25. </description>
  26. </method>
  27. <method name="_setup_modification" qualifiers="virtual">
  28. <return type="void" />
  29. <argument index="0" name="modification_stack" type="SkeletonModificationStack2D" />
  30. <description>
  31. Called when the modification is setup. This is where the modification performs initialization.
  32. </description>
  33. </method>
  34. <method name="clamp_angle">
  35. <return type="float" />
  36. <argument index="0" name="angle" type="float" />
  37. <argument index="1" name="min" type="float" />
  38. <argument index="2" name="max" type="float" />
  39. <argument index="3" name="invert" type="bool" />
  40. <description>
  41. Takes a angle and clamps it so it is within the passed-in [code]min[/code] and [code]max[/code] range. [code]invert[/code] will inversely clamp the angle, clamping it to the range outside of the given bounds.
  42. </description>
  43. </method>
  44. <method name="get_editor_draw_gizmo" qualifiers="const">
  45. <return type="bool" />
  46. <description>
  47. Returns whether this modification will call [method _draw_editor_gizmo] in the Godot editor to draw modification-specific gizmos.
  48. </description>
  49. </method>
  50. <method name="get_is_setup" qualifiers="const">
  51. <return type="bool" />
  52. <description>
  53. Returns whether this modification has been successfully setup or not.
  54. </description>
  55. </method>
  56. <method name="get_modification_stack">
  57. <return type="SkeletonModificationStack2D" />
  58. <description>
  59. Returns the [SkeletonModificationStack2D] that this modification is bound to. Through the modification stack, you can access the Skeleton3D the modification is operating on.
  60. </description>
  61. </method>
  62. <method name="set_editor_draw_gizmo">
  63. <return type="void" />
  64. <argument index="0" name="draw_gizmo" type="bool" />
  65. <description>
  66. Sets whether this modification will call [method _draw_editor_gizmo] in the Godot editor to draw modification-specific gizmos.
  67. </description>
  68. </method>
  69. <method name="set_is_setup">
  70. <return type="void" />
  71. <argument index="0" name="is_setup" type="bool" />
  72. <description>
  73. Manually allows you to set the setup state of the modification. This function should only rarely be used, as the [SkeletonModificationStack2D] the modification is bound to should handle setting the modification up.
  74. </description>
  75. </method>
  76. </methods>
  77. <members>
  78. <member name="enabled" type="bool" setter="set_enabled" getter="get_enabled" default="true">
  79. If [code]true[/code], the modification's [method _execute] function will be called by the [SkeletonModificationStack2D].
  80. </member>
  81. <member name="execution_mode" type="int" setter="set_execution_mode" getter="get_execution_mode" default="0">
  82. The execution mode for the modification. This tells the modification stack when to execute the modification. Some modifications have settings that are only available in certain execution modes.
  83. </member>
  84. </members>
  85. </class>