class_animationnodestatemachineplayback.rst 7.0 KB

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