class_animationlibrary.rst 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationLibrary.xml.
  6. .. _class_AnimationLibrary:
  7. AnimationLibrary
  8. ================
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Container for :ref:`Animation<class_Animation>` resources.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. An animation library stores a set of animations accessible through :ref:`StringName<class_StringName>` keys, for use with :ref:`AnimationPlayer<class_AnimationPlayer>` nodes.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - :doc:`Animation tutorial index <../tutorials/animation/index>`
  19. .. rst-class:: classref-reftable-group
  20. Methods
  21. -------
  22. .. table::
  23. :widths: auto
  24. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`add_animation<class_AnimationLibrary_method_add_animation>`\ (\ name\: :ref:`StringName<class_StringName>`, animation\: :ref:`Animation<class_Animation>`\ ) |
  26. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`Animation<class_Animation>` | :ref:`get_animation<class_AnimationLibrary_method_get_animation>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  28. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] | :ref:`get_animation_list<class_AnimationLibrary_method_get_animation_list>`\ (\ ) |const| |
  30. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`int<class_int>` | :ref:`get_animation_list_size<class_AnimationLibrary_method_get_animation_list_size>`\ (\ ) |const| |
  32. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`has_animation<class_AnimationLibrary_method_has_animation>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  34. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | |void| | :ref:`remove_animation<class_AnimationLibrary_method_remove_animation>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  36. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | |void| | :ref:`rename_animation<class_AnimationLibrary_method_rename_animation>`\ (\ name\: :ref:`StringName<class_StringName>`, newname\: :ref:`StringName<class_StringName>`\ ) |
  38. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. .. rst-class:: classref-section-separator
  40. ----
  41. .. rst-class:: classref-descriptions-group
  42. Signals
  43. -------
  44. .. _class_AnimationLibrary_signal_animation_added:
  45. .. rst-class:: classref-signal
  46. **animation_added**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationLibrary_signal_animation_added>`
  47. Emitted when an :ref:`Animation<class_Animation>` is added, under the key ``name``.
  48. .. rst-class:: classref-item-separator
  49. ----
  50. .. _class_AnimationLibrary_signal_animation_changed:
  51. .. rst-class:: classref-signal
  52. **animation_changed**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationLibrary_signal_animation_changed>`
  53. Emitted when there's a change in one of the animations, e.g. tracks are added, moved or have changed paths. ``name`` is the key of the animation that was changed.
  54. See also :ref:`Resource.changed<class_Resource_signal_changed>`, which this acts as a relay for.
  55. .. rst-class:: classref-item-separator
  56. ----
  57. .. _class_AnimationLibrary_signal_animation_removed:
  58. .. rst-class:: classref-signal
  59. **animation_removed**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationLibrary_signal_animation_removed>`
  60. Emitted when an :ref:`Animation<class_Animation>` stored with the key ``name`` is removed.
  61. .. rst-class:: classref-item-separator
  62. ----
  63. .. _class_AnimationLibrary_signal_animation_renamed:
  64. .. rst-class:: classref-signal
  65. **animation_renamed**\ (\ name\: :ref:`StringName<class_StringName>`, to_name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationLibrary_signal_animation_renamed>`
  66. Emitted when the key for an :ref:`Animation<class_Animation>` is changed, from ``name`` to ``to_name``.
  67. .. rst-class:: classref-section-separator
  68. ----
  69. .. rst-class:: classref-descriptions-group
  70. Method Descriptions
  71. -------------------
  72. .. _class_AnimationLibrary_method_add_animation:
  73. .. rst-class:: classref-method
  74. :ref:`Error<enum_@GlobalScope_Error>` **add_animation**\ (\ name\: :ref:`StringName<class_StringName>`, animation\: :ref:`Animation<class_Animation>`\ ) :ref:`🔗<class_AnimationLibrary_method_add_animation>`
  75. Adds the ``animation`` to the library, accessible by the key ``name``.
  76. .. rst-class:: classref-item-separator
  77. ----
  78. .. _class_AnimationLibrary_method_get_animation:
  79. .. rst-class:: classref-method
  80. :ref:`Animation<class_Animation>` **get_animation**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_AnimationLibrary_method_get_animation>`
  81. Returns the :ref:`Animation<class_Animation>` with the key ``name``. If the animation does not exist, ``null`` is returned and an error is logged.
  82. .. rst-class:: classref-item-separator
  83. ----
  84. .. _class_AnimationLibrary_method_get_animation_list:
  85. .. rst-class:: classref-method
  86. :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] **get_animation_list**\ (\ ) |const| :ref:`🔗<class_AnimationLibrary_method_get_animation_list>`
  87. Returns the keys for the :ref:`Animation<class_Animation>`\ s stored in the library.
  88. .. rst-class:: classref-item-separator
  89. ----
  90. .. _class_AnimationLibrary_method_get_animation_list_size:
  91. .. rst-class:: classref-method
  92. :ref:`int<class_int>` **get_animation_list_size**\ (\ ) |const| :ref:`🔗<class_AnimationLibrary_method_get_animation_list_size>`
  93. Returns the key count for the :ref:`Animation<class_Animation>`\ s stored in the library.
  94. .. rst-class:: classref-item-separator
  95. ----
  96. .. _class_AnimationLibrary_method_has_animation:
  97. .. rst-class:: classref-method
  98. :ref:`bool<class_bool>` **has_animation**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_AnimationLibrary_method_has_animation>`
  99. Returns ``true`` if the library stores an :ref:`Animation<class_Animation>` with ``name`` as the key.
  100. .. rst-class:: classref-item-separator
  101. ----
  102. .. _class_AnimationLibrary_method_remove_animation:
  103. .. rst-class:: classref-method
  104. |void| **remove_animation**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationLibrary_method_remove_animation>`
  105. Removes the :ref:`Animation<class_Animation>` with the key ``name``.
  106. .. rst-class:: classref-item-separator
  107. ----
  108. .. _class_AnimationLibrary_method_rename_animation:
  109. .. rst-class:: classref-method
  110. |void| **rename_animation**\ (\ name\: :ref:`StringName<class_StringName>`, newname\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationLibrary_method_rename_animation>`
  111. Changes the key of the :ref:`Animation<class_Animation>` associated with the key ``name`` to ``newname``.
  112. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  113. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  114. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  115. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  116. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  117. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  118. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  119. .. |void| replace:: :abbr:`void (No return value.)`