/
AnimationNodeStateMachine.hx
184 lines (151 loc) · 4.97 KB
/
AnimationNodeStateMachine.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
Contains multiple nodes representing animation states, connected in a graph. Node transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the `godot.AnimationNodeStateMachinePlayback` object from the `godot.AnimationTree` node to control it programmatically.
Example:
```
var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")
```
**/
@:libType
@:csNative
@:native("Godot.AnimationNodeStateMachine")
@:autoBuild(godot.Godot.buildUserClass())
extern class AnimationNodeStateMachine extends godot.AnimationRootNode {
@:native("new")
public function new():Void;
#if doc_gen
/**
Adds a new node to the graph. The `position` is used for display in the editor.
@param position If the parameter is null, then the default value is new Vector2(0, 0)
**/
@:native("AddNode")
public function addNode(name:std.String, node:godot.AnimationNode, ?position:Null<godot.Vector2>):Void;
#else
/**
Adds a new node to the graph. The `position` is used for display in the editor.
@param position If the parameter is null, then the default value is new Vector2(0, 0)
**/
@:native("AddNode")
public overload function addNode(name:std.String, node:godot.AnimationNode):Void;
/**
Adds a new node to the graph. The `position` is used for display in the editor.
@param position If the parameter is null, then the default value is new Vector2(0, 0)
**/
@:native("AddNode")
public overload function addNode(name:std.String, node:godot.AnimationNode, position:Nullable1<godot.Vector2>):Void;
#end
/**
Replaces the node and keeps its transitions unchanged.
**/
@:native("ReplaceNode")
public function replaceNode(name:std.String, node:godot.AnimationNode):Void;
/**
Returns the animation node with the given name.
**/
@:native("GetNode")
public function getNode(name:std.String):godot.AnimationNode;
/**
Deletes the given node from the graph.
**/
@:native("RemoveNode")
public function removeNode(name:std.String):Void;
/**
Renames the given node.
**/
@:native("RenameNode")
public function renameNode(name:std.String, newName:std.String):Void;
/**
Returns `true` if the graph contains the given node.
**/
@:native("HasNode")
public function hasNode(name:std.String):Bool;
/**
Returns the given animation node's name.
**/
@:native("GetNodeName")
public function getNodeName(node:godot.AnimationNode):std.String;
/**
Sets the node's coordinates. Used for display in the editor.
**/
@:native("SetNodePosition")
public function setNodePosition(name:std.String, position:godot.Vector2):Void;
/**
Returns the given node's coordinates. Used for display in the editor.
**/
@:native("GetNodePosition")
public function getNodePosition(name:std.String):godot.Vector2;
/**
Returns `true` if there is a transition between the given nodes.
**/
@:native("HasTransition")
public function hasTransition(from:std.String, to:std.String):Bool;
/**
Adds a transition between the given nodes.
**/
@:native("AddTransition")
public function addTransition(from:std.String, to:std.String, transition:godot.AnimationNodeStateMachineTransition):Void;
/**
Returns the given transition.
**/
@:native("GetTransition")
public function getTransition(idx:Int):godot.AnimationNodeStateMachineTransition;
/**
Returns the given transition's start node.
**/
@:native("GetTransitionFrom")
public function getTransitionFrom(idx:Int):std.String;
/**
Returns the given transition's end node.
**/
@:native("GetTransitionTo")
public function getTransitionTo(idx:Int):std.String;
/**
Returns the number of connections in the graph.
**/
@:native("GetTransitionCount")
public function getTransitionCount():Int;
/**
Deletes the given transition by index.
**/
@:native("RemoveTransitionByIndex")
public function removeTransitionByIndex(idx:Int):Void;
/**
Deletes the transition between the two specified nodes.
**/
@:native("RemoveTransition")
public function removeTransition(from:std.String, to:std.String):Void;
/**
Sets the given node as the graph start point.
**/
@:native("SetStartNode")
public function setStartNode(name:std.String):Void;
/**
Returns the graph's end node.
**/
@:native("GetStartNode")
public function getStartNode():std.String;
/**
Sets the given node as the graph end point.
**/
@:native("SetEndNode")
public function setEndNode(name:std.String):Void;
/**
Returns the graph's end node.
**/
@:native("GetEndNode")
public function getEndNode():std.String;
/**
Sets the draw offset of the graph. Used for display in the editor.
**/
@:native("SetGraphOffset")
public function setGraphOffset(offset:godot.Vector2):Void;
/**
Returns the draw offset of the graph. Used for display in the editor.
**/
@:native("GetGraphOffset")
public function getGraphOffset():godot.Vector2;
}