2
0

class_animationnodestatemachineplayback.rst 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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/AnimationNodeStateMachinePlayback.xml.
  6. .. _class_AnimationNodeStateMachinePlayback:
  7. AnimationNodeStateMachinePlayback
  8. =================================
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Playback control for :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Allows control of :ref:`AnimationTree<class_AnimationTree>` state machines created with :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`. Retrieve with ``$AnimationTree.get("parameters/playback")``.
  15. \ **Example:**\
  16. .. tabs::
  17. .. code-tab:: gdscript
  18. var state_machine = $AnimationTree.get("parameters/playback")
  19. state_machine.travel("some_state")
  20. .. code-tab:: csharp
  21. var stateMachine = GetNode<AnimationTree>("AnimationTree").Get("parameters/playback") as AnimationNodeStateMachinePlayback;
  22. stateMachine.Travel("some_state");
  23. .. rst-class:: classref-introduction-group
  24. Tutorials
  25. ---------
  26. - :doc:`AnimationTree <../tutorials/animation/animation_tree>`
  27. .. rst-class:: classref-reftable-group
  28. Properties
  29. ----------
  30. .. table::
  31. :widths: auto
  32. +-------------------------+-------------------------+---------------------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | resource_local_to_scene | ``true`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
  34. +-------------------------+-------------------------+---------------------------------------------------------------------------------------+
  35. .. rst-class:: classref-reftable-group
  36. Methods
  37. -------
  38. .. table::
  39. :widths: auto
  40. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`float<class_float>` | :ref:`get_current_length<class_AnimationNodeStateMachinePlayback_method_get_current_length>` **(** **)** |const| |
  42. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`StringName<class_StringName>` | :ref:`get_current_node<class_AnimationNodeStateMachinePlayback_method_get_current_node>` **(** **)** |const| |
  44. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`float<class_float>` | :ref:`get_current_play_position<class_AnimationNodeStateMachinePlayback_method_get_current_play_position>` **(** **)** |const| |
  46. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_travel_path<class_AnimationNodeStateMachinePlayback_method_get_travel_path>` **(** **)** |const| |
  48. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimationNodeStateMachinePlayback_method_is_playing>` **(** **)** |const| |
  50. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`start<class_AnimationNodeStateMachinePlayback_method_start>` **(** :ref:`StringName<class_StringName>` node **)** |
  52. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`stop<class_AnimationNodeStateMachinePlayback_method_stop>` **(** **)** |
  54. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`travel<class_AnimationNodeStateMachinePlayback_method_travel>` **(** :ref:`StringName<class_StringName>` to_node **)** |
  56. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  57. .. rst-class:: classref-section-separator
  58. ----
  59. .. rst-class:: classref-descriptions-group
  60. Method Descriptions
  61. -------------------
  62. .. _class_AnimationNodeStateMachinePlayback_method_get_current_length:
  63. .. rst-class:: classref-method
  64. :ref:`float<class_float>` **get_current_length** **(** **)** |const|
  65. .. container:: contribute
  66. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  67. .. rst-class:: classref-item-separator
  68. ----
  69. .. _class_AnimationNodeStateMachinePlayback_method_get_current_node:
  70. .. rst-class:: classref-method
  71. :ref:`StringName<class_StringName>` **get_current_node** **(** **)** |const|
  72. Returns the currently playing animation state.
  73. .. rst-class:: classref-item-separator
  74. ----
  75. .. _class_AnimationNodeStateMachinePlayback_method_get_current_play_position:
  76. .. rst-class:: classref-method
  77. :ref:`float<class_float>` **get_current_play_position** **(** **)** |const|
  78. Returns the playback position within the current animation state.
  79. .. rst-class:: classref-item-separator
  80. ----
  81. .. _class_AnimationNodeStateMachinePlayback_method_get_travel_path:
  82. .. rst-class:: classref-method
  83. :ref:`PackedStringArray<class_PackedStringArray>` **get_travel_path** **(** **)** |const|
  84. Returns the current travel path as computed internally by the A\* algorithm.
  85. .. rst-class:: classref-item-separator
  86. ----
  87. .. _class_AnimationNodeStateMachinePlayback_method_is_playing:
  88. .. rst-class:: classref-method
  89. :ref:`bool<class_bool>` **is_playing** **(** **)** |const|
  90. Returns ``true`` if an animation is playing.
  91. .. rst-class:: classref-item-separator
  92. ----
  93. .. _class_AnimationNodeStateMachinePlayback_method_start:
  94. .. rst-class:: classref-method
  95. void **start** **(** :ref:`StringName<class_StringName>` node **)**
  96. Starts playing the given animation.
  97. .. rst-class:: classref-item-separator
  98. ----
  99. .. _class_AnimationNodeStateMachinePlayback_method_stop:
  100. .. rst-class:: classref-method
  101. void **stop** **(** **)**
  102. Stops the currently playing animation.
  103. .. rst-class:: classref-item-separator
  104. ----
  105. .. _class_AnimationNodeStateMachinePlayback_method_travel:
  106. .. rst-class:: classref-method
  107. void **travel** **(** :ref:`StringName<class_StringName>` to_node **)**
  108. Transitions from the current state to another one, following the shortest path.
  109. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  110. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  111. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  112. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  113. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  114. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`