Path: blob/master/doc/classes/AnimationNodeStateMachinePlayback.xml
20871 views
<?xml version="1.0" encoding="UTF-8" ?>1<class name="AnimationNodeStateMachinePlayback" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">2<brief_description>3Provides playback control for an [AnimationNodeStateMachine].4</brief_description>5<description>6Allows control of [AnimationTree] state machines created with [AnimationNodeStateMachine]. Retrieve with [code]$AnimationTree.get("parameters/playback")[/code].7[codeblocks]8[gdscript]9var state_machine = $AnimationTree.get("parameters/playback")10state_machine.travel("some_state")11[/gdscript]12[csharp]13var stateMachine = GetNode<AnimationTree>("AnimationTree").Get("parameters/playback").As<AnimationNodeStateMachinePlayback>();14stateMachine.Travel("some_state");15[/csharp]16[/codeblocks]17</description>18<tutorials>19<link title="Using AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link>20</tutorials>21<methods>22<method name="get_current_length" qualifiers="const">23<return type="float" />24<description>25Returns the current state length.26[b]Note:[/b] It is possible that any [AnimationRootNode] can be nodes as well as animations. This means that there can be multiple animations within a single state. Which animation length has priority depends on the nodes connected inside it. Also, if a transition does not reset, the remaining length at that point will be returned.27</description>28</method>29<method name="get_current_node" qualifiers="const">30<return type="StringName" />31<description>32Returns the currently playing animation state.33[b]Note:[/b] When using a cross-fade, the current state changes to the next state immediately after the cross-fade begins.34</description>35</method>36<method name="get_current_play_position" qualifiers="const">37<return type="float" />38<description>39Returns the playback position within the current animation state.40</description>41</method>42<method name="get_fading_from_length" qualifiers="const">43<return type="float" />44<description>45Returns the playback state length of the node from [method get_fading_from_node]. Returns [code]0[/code] if no animation fade is occurring.46</description>47</method>48<method name="get_fading_from_node" qualifiers="const">49<return type="StringName" />50<description>51Returns the starting state of currently fading animation.52</description>53</method>54<method name="get_fading_from_play_position" qualifiers="const">55<return type="float" />56<description>57Returns the playback position of the node from [method get_fading_from_node]. Returns [code]0[/code] if no animation fade is occurring.58</description>59</method>60<method name="get_fading_length" qualifiers="const">61<return type="float" />62<description>63Returns the length of the current fade animation. Returns [code]0[/code] if no animation fade is occurring.64</description>65</method>66<method name="get_fading_position" qualifiers="const">67<return type="float" />68<description>69Returns the playback position of the current fade animation. Returns [code]0[/code] if no animation fade is occurring.70</description>71</method>72<method name="get_travel_path" qualifiers="const">73<return type="StringName[]" />74<description>75Returns the current travel path as computed internally by the A* algorithm.76</description>77</method>78<method name="is_playing" qualifiers="const">79<return type="bool" />80<description>81Returns [code]true[/code] if an animation is playing.82</description>83</method>84<method name="next">85<return type="void" />86<description>87If there is a next path by travel or auto advance, immediately transitions from the current state to the next state.88</description>89</method>90<method name="start">91<return type="void" />92<param index="0" name="node" type="StringName" />93<param index="1" name="reset" type="bool" default="true" />94<description>95Starts playing the given animation.96If [param reset] is [code]true[/code], the animation is played from the beginning.97</description>98</method>99<method name="stop">100<return type="void" />101<description>102Stops the currently playing animation.103</description>104</method>105<method name="travel">106<return type="void" />107<param index="0" name="to_node" type="StringName" />108<param index="1" name="reset_on_teleport" type="bool" default="true" />109<description>110Transitions from the current state to another one, following the shortest path.111If the path does not connect from the current state, the animation will play after the state teleports.112If [param reset_on_teleport] is [code]true[/code], the animation is played from the beginning when the travel cause a teleportation.113</description>114</method>115</methods>116<members>117<member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="true" />118</members>119<signals>120<signal name="state_finished">121<param index="0" name="state" type="StringName" />122<description>123Emitted when the [param state] finishes playback. If [param state] is a state machine set to grouped mode, its signals are passed through with its name prefixed.124If there is a crossfade, this will be fired when the influence of the [method get_fading_from_node] animation is no longer present.125</description>126</signal>127<signal name="state_started">128<param index="0" name="state" type="StringName" />129<description>130Emitted when the [param state] starts playback. If [param state] is a state machine set to grouped mode, its signals are passed through with its name prefixed.131</description>132</signal>133</signals>134</class>135136137