Documentation
¶
Overview ¶
Allows control of graphics.gd/classdb/AnimationTree state machines created with graphics.gd/classdb/AnimationNodeStateMachine. Retrieve with $AnimationTree.get("parameters/playback").
package main import ( "graphics.gd/classdb/AnimationNodeStateMachinePlayback" "graphics.gd/classdb/AnimationTree" "graphics.gd/variant/Object" ) func ExampleAnimationNodeStateMachinePlayback(tree AnimationTree.Instance) { var stateMachine = Object.Get(tree, "parameters/playback").(AnimationNodeStateMachinePlayback.Instance) stateMachine.Travel("some_state") }
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AsAnimationNodeStateMachinePlayback() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) GetCurrentLength() Float.X
- func (self Instance) GetCurrentNode() string
- func (self Instance) GetCurrentPlayPosition() Float.X
- func (self Instance) GetFadingFromNode() string
- func (self Instance) GetTravelPath() []string
- func (self Instance) ID() ID
- func (self Instance) IsPlaying() bool
- func (self Instance) Next()
- func (self Instance) OnStateFinished(cb func(state string), flags ...Signal.Flags)
- func (self Instance) OnStateStarted(cb func(state string), flags ...Signal.Flags)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) Start(node string)
- func (self Instance) Stop()
- func (self Instance) Travel(to_node string)
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Expanded ¶
type Expanded [1]gdclass.AnimationNodeStateMachinePlayback
func (Expanded) Start ¶
Starts playing the given animation.
If 'reset' is true, the animation is played from the beginning.
func (Expanded) Travel ¶
Transitions from the current state to another one, following the shortest path.
If the path does not connect from the current state, the animation will play after the state teleports.
If 'reset_on_teleport' is true, the animation is played from the beginning when the travel cause a teleportation.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsAnimationNodeStateMachinePlayback ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.AnimationNodeStateMachinePlayback
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsAnimationNodeStateMachinePlayback ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) GetCurrentLength ¶
Returns the current state length.
Note: It is possible that any graphics.gd/classdb/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.
func (Instance) GetCurrentNode ¶
Returns the currently playing animation state.
Note: When using a cross-fade, the current state changes to the next state immediately after the cross-fade begins.
func (Instance) GetCurrentPlayPosition ¶
Returns the playback position within the current animation state.
func (Instance) GetFadingFromNode ¶
Returns the starting state of currently fading animation.
func (Instance) GetTravelPath ¶
Returns the current travel path as computed internally by the A* algorithm.
func (Instance) Next ¶
func (self Instance) Next()
If there is a next path by travel or auto advance, immediately transitions from the current state to the next state.
func (Instance) OnStateFinished ¶
func (Instance) OnStateStarted ¶
func (Instance) Start ¶
Starts playing the given animation.
If 'reset' is true, the animation is played from the beginning.
func (Instance) Travel ¶
Transitions from the current state to another one, following the shortest path.
If the path does not connect from the current state, the animation will play after the state teleports.
If 'reset_on_teleport' is true, the animation is played from the beginning when the travel cause a teleportation.