class_animationlibrary.rst 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. Description
  12. -----------
  13. An animation library stores a set of animations accessible through :ref:`StringName<class_StringName>` keys, for use with :ref:`AnimationPlayer<class_AnimationPlayer>` nodes.
  14. Tutorials
  15. ---------
  16. - :doc:`Animation tutorial index <../tutorials/animation/index>`
  17. Properties
  18. ----------
  19. +-------------------------------------+-----------------------------------------------------+--------+
  20. | :ref:`Dictionary<class_Dictionary>` | :ref:`_data<class_AnimationLibrary_property__data>` | ``{}`` |
  21. +-------------------------------------+-----------------------------------------------------+--------+
  22. Methods
  23. -------
  24. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`add_animation<class_AnimationLibrary_method_add_animation>` **(** :ref:`StringName<class_StringName>` name, :ref:`Animation<class_Animation>` animation **)** |
  26. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`Animation<class_Animation>` | :ref:`get_animation<class_AnimationLibrary_method_get_animation>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
  28. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`StringName[]<class_StringName>` | :ref:`get_animation_list<class_AnimationLibrary_method_get_animation_list>` **(** **)** |const| |
  30. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`has_animation<class_AnimationLibrary_method_has_animation>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
  32. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`remove_animation<class_AnimationLibrary_method_remove_animation>` **(** :ref:`StringName<class_StringName>` name **)** |
  34. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`rename_animation<class_AnimationLibrary_method_rename_animation>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` newname **)** |
  36. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. Signals
  38. -------
  39. .. _class_AnimationLibrary_signal_animation_added:
  40. - **animation_added** **(** :ref:`StringName<class_StringName>` name **)**
  41. Emitted when an :ref:`Animation<class_Animation>` is added, under the key ``name``.
  42. ----
  43. .. _class_AnimationLibrary_signal_animation_removed:
  44. - **animation_removed** **(** :ref:`StringName<class_StringName>` name **)**
  45. Emitted when an :ref:`Animation<class_Animation>` stored with the key ``name`` is removed.
  46. ----
  47. .. _class_AnimationLibrary_signal_animation_renamed:
  48. - **animation_renamed** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` to_name **)**
  49. Emitted when the key for an :ref:`Animation<class_Animation>` is changed, from ``name`` to ``to_name``.
  50. Property Descriptions
  51. ---------------------
  52. .. _class_AnimationLibrary_property__data:
  53. - :ref:`Dictionary<class_Dictionary>` **_data**
  54. +-----------+--------+
  55. | *Default* | ``{}`` |
  56. +-----------+--------+
  57. .. container:: contribute
  58. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  59. Method Descriptions
  60. -------------------
  61. .. _class_AnimationLibrary_method_add_animation:
  62. - :ref:`Error<enum_@GlobalScope_Error>` **add_animation** **(** :ref:`StringName<class_StringName>` name, :ref:`Animation<class_Animation>` animation **)**
  63. Adds the ``animation`` to the library, accessible by the key ``name``.
  64. ----
  65. .. _class_AnimationLibrary_method_get_animation:
  66. - :ref:`Animation<class_Animation>` **get_animation** **(** :ref:`StringName<class_StringName>` name **)** |const|
  67. Returns the :ref:`Animation<class_Animation>` with the key ``name``. If the animation does not exist, ``null`` is returned and an error is logged.
  68. ----
  69. .. _class_AnimationLibrary_method_get_animation_list:
  70. - :ref:`StringName[]<class_StringName>` **get_animation_list** **(** **)** |const|
  71. Returns the keys for the :ref:`Animation<class_Animation>`\ s stored in the library.
  72. ----
  73. .. _class_AnimationLibrary_method_has_animation:
  74. - :ref:`bool<class_bool>` **has_animation** **(** :ref:`StringName<class_StringName>` name **)** |const|
  75. Returns ``true`` if the library stores an :ref:`Animation<class_Animation>` with ``name`` as the key.
  76. ----
  77. .. _class_AnimationLibrary_method_remove_animation:
  78. - void **remove_animation** **(** :ref:`StringName<class_StringName>` name **)**
  79. Removes the :ref:`Animation<class_Animation>` with the key ``name``.
  80. ----
  81. .. _class_AnimationLibrary_method_rename_animation:
  82. - void **rename_animation** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` newname **)**
  83. Changes the key of the :ref:`Animation<class_Animation>` associated with the key ``name`` to ``newname``.
  84. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  85. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  86. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  87. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  88. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  89. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`