class_skeleton2d.rst 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the Skeleton2D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_Skeleton2D:
  6. Skeleton2D
  7. ==========
  8. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Skeleton for 2D characters and animated objects.
  10. Description
  11. -----------
  12. Skeleton2D parents a hierarchy of :ref:`Bone2D<class_Bone2D>` objects. It is a requirement of :ref:`Bone2D<class_Bone2D>`. Skeleton2D holds a reference to the rest pose of its children and acts as a single point of access to its bones.
  13. Tutorials
  14. ---------
  15. - :doc:`../tutorials/animation/2d_skeletons`
  16. Methods
  17. -------
  18. +-----------------------------+-----------------------------------------------------------------------------------------+
  19. | :ref:`Bone2D<class_Bone2D>` | :ref:`get_bone<class_Skeleton2D_method_get_bone>` **(** :ref:`int<class_int>` idx **)** |
  20. +-----------------------------+-----------------------------------------------------------------------------------------+
  21. | :ref:`int<class_int>` | :ref:`get_bone_count<class_Skeleton2D_method_get_bone_count>` **(** **)** |const| |
  22. +-----------------------------+-----------------------------------------------------------------------------------------+
  23. | :ref:`RID<class_RID>` | :ref:`get_skeleton<class_Skeleton2D_method_get_skeleton>` **(** **)** |const| |
  24. +-----------------------------+-----------------------------------------------------------------------------------------+
  25. Signals
  26. -------
  27. .. _class_Skeleton2D_signal_bone_setup_changed:
  28. - **bone_setup_changed** **(** **)**
  29. Method Descriptions
  30. -------------------
  31. .. _class_Skeleton2D_method_get_bone:
  32. - :ref:`Bone2D<class_Bone2D>` **get_bone** **(** :ref:`int<class_int>` idx **)**
  33. Returns a :ref:`Bone2D<class_Bone2D>` from the node hierarchy parented by Skeleton2D. The object to return is identified by the parameter ``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.
  34. ----
  35. .. _class_Skeleton2D_method_get_bone_count:
  36. - :ref:`int<class_int>` **get_bone_count** **(** **)** |const|
  37. Returns the number of :ref:`Bone2D<class_Bone2D>` nodes in the node hierarchy parented by Skeleton2D.
  38. ----
  39. .. _class_Skeleton2D_method_get_skeleton:
  40. - :ref:`RID<class_RID>` **get_skeleton** **(** **)** |const|
  41. Returns the :ref:`RID<class_RID>` of a Skeleton2D instance.
  42. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  43. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  44. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`