AnimationNodeStateMachine

package
v0.0.0-...-e9402f6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package AnimationNodeStateMachine provides methods for working with AnimationNodeStateMachine object instances.

Index

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 Any

type Any interface {
	gd.IsClass
	AsAnimationNodeStateMachine() Instance
}

type Instance

Contains multiple [AnimationRootNode]s representing animation states, connected in a graph. State transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the [AnimationNodeStateMachinePlayback] object from the [AnimationTree] node to control it programmatically. [b]Example:[/b] [codeblocks] [gdscript] var state_machine = $AnimationTree.get("parameters/playback") state_machine.travel("some_state") [/gdscript] [csharp] var stateMachine = GetNode<AnimationTree>("AnimationTree").Get("parameters/playback") as AnimationNodeStateMachinePlayback; stateMachine.Travel("some_state"); [/csharp] [/codeblocks]

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AddNode

func (self Instance) AddNode(name string, node [1]gdclass.AnimationNode)

Adds a new animation node to the graph. The [param position] is used for display in the editor.

func (Instance) AddTransition

func (self Instance) AddTransition(from string, to string, transition [1]gdclass.AnimationNodeStateMachineTransition)

Adds a transition between the given animation nodes.

func (Instance) AllowTransitionToSelf

func (self Instance) AllowTransitionToSelf() bool

func (Instance) AsAnimationNode

func (self Instance) AsAnimationNode() AnimationNode.Instance

func (Instance) AsAnimationNodeStateMachine

func (self Instance) AsAnimationNodeStateMachine() Instance

func (Instance) AsAnimationRootNode

func (self Instance) AsAnimationRootNode() AnimationRootNode.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) GetGraphOffset

func (self Instance) GetGraphOffset() Vector2.XY

Returns the draw offset of the graph. Used for display in the editor.

func (Instance) GetNode

func (self Instance) GetNode(name string) [1]gdclass.AnimationNode

Returns the animation node with the given name.

func (Instance) GetNodeName

func (self Instance) GetNodeName(node [1]gdclass.AnimationNode) string

Returns the given animation node's name.

func (Instance) GetNodePosition

func (self Instance) GetNodePosition(name string) Vector2.XY

Returns the given animation node's coordinates. Used for display in the editor.

func (Instance) GetTransition

func (self Instance) GetTransition(idx int) [1]gdclass.AnimationNodeStateMachineTransition

Returns the given transition.

func (Instance) GetTransitionCount

func (self Instance) GetTransitionCount() int

Returns the number of connections in the graph.

func (Instance) GetTransitionFrom

func (self Instance) GetTransitionFrom(idx int) string

Returns the given transition's start node.

func (Instance) GetTransitionTo

func (self Instance) GetTransitionTo(idx int) string

Returns the given transition's end node.

func (Instance) HasNode

func (self Instance) HasNode(name string) bool

Returns [code]true[/code] if the graph contains the given animation node.

func (Instance) HasTransition

func (self Instance) HasTransition(from string, to string) bool

Returns [code]true[/code] if there is a transition between the given animation nodes.

func (Instance) RemoveNode

func (self Instance) RemoveNode(name string)

Deletes the given animation node from the graph.

func (Instance) RemoveTransition

func (self Instance) RemoveTransition(from string, to string)

Deletes the transition between the two specified animation nodes.

func (Instance) RemoveTransitionByIndex

func (self Instance) RemoveTransitionByIndex(idx int)

Deletes the given transition by index.

func (Instance) RenameNode

func (self Instance) RenameNode(name string, new_name string)

Renames the given animation node.

func (Instance) ReplaceNode

func (self Instance) ReplaceNode(name string, node [1]gdclass.AnimationNode)

Replaces the given animation node with a new animation node.

func (Instance) ResetEnds

func (self Instance) ResetEnds() bool

func (Instance) SetAllowTransitionToSelf

func (self Instance) SetAllowTransitionToSelf(value bool)

func (Instance) SetGraphOffset

func (self Instance) SetGraphOffset(offset Vector2.XY)

Sets the draw offset of the graph. Used for display in the editor.

func (Instance) SetNodePosition

func (self Instance) SetNodePosition(name string, position Vector2.XY)

Sets the animation node's coordinates. Used for display in the editor.

func (Instance) SetResetEnds

func (self Instance) SetResetEnds(value bool)

func (Instance) SetStateMachineType

func (self Instance) SetStateMachineType(value gdclass.AnimationNodeStateMachineStateMachineType)

func (Instance) StateMachineType

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type StateMachineType

type StateMachineType = gdclass.AnimationNodeStateMachineStateMachineType //gd:AnimationNodeStateMachine.StateMachineType
const (
	/*Seeking to the beginning is treated as playing from the start state. Transition to the end state is treated as exiting the state machine.*/
	StateMachineTypeRoot StateMachineType = 0
	/*Seeking to the beginning is treated as seeking to the beginning of the animation in the current state. Transition to the end state, or the absence of transitions in each state, is treated as exiting the state machine.*/
	StateMachineTypeNested StateMachineType = 1
	/*This is a grouped state machine that can be controlled from a parent state machine. It does not work independently. There must be a state machine with [member state_machine_type] of [constant STATE_MACHINE_TYPE_ROOT] or [constant STATE_MACHINE_TYPE_NESTED] in the parent or ancestor.*/
	StateMachineTypeGrouped StateMachineType = 2
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL