class_animationnodestatemachineplayback.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the AnimationNodeStateMachinePlayback.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_AnimationNodeStateMachinePlayback:
  6. AnimationNodeStateMachinePlayback
  7. =================================
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. Playback control for :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`.
  10. Description
  11. -----------
  12. Allows control of :ref:`AnimationTree<class_AnimationTree>` state machines created with :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`. Retrieve with ``$AnimationTree.get("parameters/playback")``.
  13. **Example:**
  14. ::
  15. var state_machine = $AnimationTree.get("parameters/playback")
  16. state_machine.travel("some_state")
  17. Tutorials
  18. ---------
  19. - :doc:`../tutorials/animation/animation_tree`
  20. Properties
  21. ----------
  22. +-------------------------+-------------------------+-----------------+
  23. | :ref:`bool<class_bool>` | resource_local_to_scene | **O:** ``true`` |
  24. +-------------------------+-------------------------+-----------------+
  25. Methods
  26. -------
  27. +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`StringName<class_StringName>` | :ref:`get_current_node<class_AnimationNodeStateMachinePlayback_method_get_current_node>` **(** **)** const |
  29. +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_travel_path<class_AnimationNodeStateMachinePlayback_method_get_travel_path>` **(** **)** const |
  31. +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimationNodeStateMachinePlayback_method_is_playing>` **(** **)** const |
  33. +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`start<class_AnimationNodeStateMachinePlayback_method_start>` **(** :ref:`StringName<class_StringName>` node **)** |
  35. +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`stop<class_AnimationNodeStateMachinePlayback_method_stop>` **(** **)** |
  37. +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`travel<class_AnimationNodeStateMachinePlayback_method_travel>` **(** :ref:`StringName<class_StringName>` to_node **)** |
  39. +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+
  40. Method Descriptions
  41. -------------------
  42. .. _class_AnimationNodeStateMachinePlayback_method_get_current_node:
  43. - :ref:`StringName<class_StringName>` **get_current_node** **(** **)** const
  44. Returns the currently playing animation state.
  45. ----
  46. .. _class_AnimationNodeStateMachinePlayback_method_get_travel_path:
  47. - :ref:`PackedStringArray<class_PackedStringArray>` **get_travel_path** **(** **)** const
  48. Returns the current travel path as computed internally by the A\* algorithm.
  49. ----
  50. .. _class_AnimationNodeStateMachinePlayback_method_is_playing:
  51. - :ref:`bool<class_bool>` **is_playing** **(** **)** const
  52. Returns ``true`` if an animation is playing.
  53. ----
  54. .. _class_AnimationNodeStateMachinePlayback_method_start:
  55. - void **start** **(** :ref:`StringName<class_StringName>` node **)**
  56. Starts playing the given animation.
  57. ----
  58. .. _class_AnimationNodeStateMachinePlayback_method_stop:
  59. - void **stop** **(** **)**
  60. Stops the currently playing animation.
  61. ----
  62. .. _class_AnimationNodeStateMachinePlayback_method_travel:
  63. - void **travel** **(** :ref:`StringName<class_StringName>` to_node **)**
  64. Transitions from the current state to another one, following the shortest path.