class_animationnodestatemachineplayback.rst 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 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:`RefCounted<class_RefCounted>` **<** :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. .. tabs::
  15. .. code-tab:: gdscript
  16. var state_machine = $AnimationTree.get("parameters/playback")
  17. state_machine.travel("some_state")
  18. .. code-tab:: csharp
  19. var stateMachine = GetNode<AnimationTree>("AnimationTree").Get("parameters/playback") as AnimationNodeStateMachinePlayback;
  20. stateMachine.Travel("some_state");
  21. Tutorials
  22. ---------
  23. - :doc:`../tutorials/animation/animation_tree`
  24. Properties
  25. ----------
  26. +-------------------------+-------------------------+------------------------------+
  27. | :ref:`bool<class_bool>` | resource_local_to_scene | ``true`` *(parent override)* |
  28. +-------------------------+-------------------------+------------------------------+
  29. Methods
  30. -------
  31. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`float<class_float>` | :ref:`get_current_length<class_AnimationNodeStateMachinePlayback_method_get_current_length>` **(** **)** |const| |
  33. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`StringName<class_StringName>` | :ref:`get_current_node<class_AnimationNodeStateMachinePlayback_method_get_current_node>` **(** **)** |const| |
  35. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`float<class_float>` | :ref:`get_current_play_position<class_AnimationNodeStateMachinePlayback_method_get_current_play_position>` **(** **)** |const| |
  37. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_travel_path<class_AnimationNodeStateMachinePlayback_method_get_travel_path>` **(** **)** |const| |
  39. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimationNodeStateMachinePlayback_method_is_playing>` **(** **)** |const| |
  41. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`start<class_AnimationNodeStateMachinePlayback_method_start>` **(** :ref:`StringName<class_StringName>` node **)** |
  43. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  44. | void | :ref:`stop<class_AnimationNodeStateMachinePlayback_method_stop>` **(** **)** |
  45. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  46. | void | :ref:`travel<class_AnimationNodeStateMachinePlayback_method_travel>` **(** :ref:`StringName<class_StringName>` to_node **)** |
  47. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
  48. Method Descriptions
  49. -------------------
  50. .. _class_AnimationNodeStateMachinePlayback_method_get_current_length:
  51. - :ref:`float<class_float>` **get_current_length** **(** **)** |const|
  52. ----
  53. .. _class_AnimationNodeStateMachinePlayback_method_get_current_node:
  54. - :ref:`StringName<class_StringName>` **get_current_node** **(** **)** |const|
  55. Returns the currently playing animation state.
  56. ----
  57. .. _class_AnimationNodeStateMachinePlayback_method_get_current_play_position:
  58. - :ref:`float<class_float>` **get_current_play_position** **(** **)** |const|
  59. Returns the playback position within the current animation state.
  60. ----
  61. .. _class_AnimationNodeStateMachinePlayback_method_get_travel_path:
  62. - :ref:`PackedStringArray<class_PackedStringArray>` **get_travel_path** **(** **)** |const|
  63. Returns the current travel path as computed internally by the A\* algorithm.
  64. ----
  65. .. _class_AnimationNodeStateMachinePlayback_method_is_playing:
  66. - :ref:`bool<class_bool>` **is_playing** **(** **)** |const|
  67. Returns ``true`` if an animation is playing.
  68. ----
  69. .. _class_AnimationNodeStateMachinePlayback_method_start:
  70. - void **start** **(** :ref:`StringName<class_StringName>` node **)**
  71. Starts playing the given animation.
  72. ----
  73. .. _class_AnimationNodeStateMachinePlayback_method_stop:
  74. - void **stop** **(** **)**
  75. Stops the currently playing animation.
  76. ----
  77. .. _class_AnimationNodeStateMachinePlayback_method_travel:
  78. - void **travel** **(** :ref:`StringName<class_StringName>` to_node **)**
  79. Transitions from the current state to another one, following the shortest path.
  80. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  81. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  82. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  83. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  84. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  85. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`