Documentation
¶
Overview ¶
Package AnimationNode provides methods for working with AnimationNode object instances.
Index ¶
- type Advanced
- type Any
- type FilterAction
- type Implementation
- type Instance
- func (self Instance) AddInput(name string) bool
- func (self Instance) AsAnimationNode() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) BlendAnimation(animation string, time Float.X, delta Float.X, seeked bool, ...)
- func (self Instance) BlendInput(input_index int, time Float.X, seek bool, is_external_seeking bool, ...) Float.X
- func (self Instance) BlendNode(name string, node [1]gdclass.AnimationNode, time Float.X, seek bool, ...) Float.X
- func (self Instance) FilterEnabled() bool
- func (self Instance) FindInput(name string) int
- func (self Instance) GetInputCount() int
- func (self Instance) GetInputName(input int) string
- func (self Instance) GetParameter(name string) any
- func (self Instance) IsPathFiltered(path string) bool
- func (self Instance) OnAnimationNodeRemoved(cb func(object_id int, name string))
- func (self Instance) OnAnimationNodeRenamed(cb func(object_id int, old_name string, new_name string))
- func (self Instance) OnTreeChanged(cb func())
- func (self Instance) RemoveInput(index int)
- func (self Instance) SetFilterEnabled(value bool)
- func (self Instance) SetFilterPath(path string, enable bool)
- func (self Instance) SetInputName(input int, name string) bool
- func (self Instance) SetParameter(name string, value any)
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
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 FilterAction ¶
type FilterAction = gdclass.AnimationNodeFilterAction //gd:AnimationNode.FilterAction
const ( /*Do not use filtering.*/ FilterIgnore FilterAction = 0 /*Paths matching the filter will be allowed to pass.*/ FilterPass FilterAction = 1 /*Paths matching the filter will be discarded.*/ FilterStop FilterAction = 2 /*Paths matching the filter will be blended (by the blend value).*/ FilterBlend FilterAction = 3 )
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
type Instance [1]gdclass.AnimationNode
Base resource for [AnimationTree] nodes. In general, it's not used directly, but you can create custom ones with custom blending formulas. Inherit this when creating animation nodes mainly for use in [AnimationNodeBlendTree], otherwise [AnimationRootNode] should be used instead. You can access the time information as read-only parameter which is processed and stored in the previous frame for all nodes except [AnimationNodeOutput]. [b]Note:[/b] If multiple inputs exist in the [AnimationNode], which time information takes precedence depends on the type of [AnimationNode]. [codeblock] var current_length = $AnimationTree[parameters/AnimationNodeName/current_length] var current_position = $AnimationTree[parameters/AnimationNodeName/current_position] var current_delta = $AnimationTree[parameters/AnimationNodeName/current_delta] [/codeblock]
See [Interface] for methods that can be overridden by a [Class] that extends it.
%!(EXTRA string=AnimationNode)
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddInput ¶
Adds an input to the animation node. This is only useful for animation nodes created for use in an [AnimationNodeBlendTree]. If the addition fails, returns [code]false[/code].
func (Instance) AsAnimationNode ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) BlendAnimation ¶
func (self Instance) BlendAnimation(animation string, time Float.X, delta Float.X, seeked bool, is_external_seeking bool, blend Float.X)
Blend an animation by [param blend] amount (name must be valid in the linked [AnimationPlayer]). A [param time] and [param delta] may be passed, as well as whether [param seeked] happened. A [param looped_flag] is used by internal processing immediately after the loop. See also [enum Animation.LoopedFlag].
func (Instance) BlendInput ¶
func (self Instance) BlendInput(input_index int, time Float.X, seek bool, is_external_seeking bool, blend Float.X) Float.X
Blend an input. This is only useful for animation nodes created for an [AnimationNodeBlendTree]. The [param time] parameter is a relative delta, unless [param seek] is [code]true[/code], in which case it is absolute. A filter mode may be optionally passed (see [enum FilterAction] for options).
func (Instance) BlendNode ¶
func (self Instance) BlendNode(name string, node [1]gdclass.AnimationNode, time Float.X, seek bool, is_external_seeking bool, blend Float.X) Float.X
Blend another animation node (in case this animation node contains child animation nodes). This function is only useful if you inherit from [AnimationRootNode] instead, otherwise editors will not display your animation node for addition.
func (Instance) FilterEnabled ¶
func (Instance) FindInput ¶
Returns the input index which corresponds to [param name]. If not found, returns [code]-1[/code].
func (Instance) GetInputCount ¶
Amount of inputs in this animation node, only useful for animation nodes that go into [AnimationNodeBlendTree].
func (Instance) GetInputName ¶
Gets the name of an input by index.
func (Instance) GetParameter ¶
Gets the value of a parameter. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees.
func (Instance) IsPathFiltered ¶
Returns whether the given path is filtered.
func (Instance) OnAnimationNodeRemoved ¶
func (Instance) OnAnimationNodeRenamed ¶
func (Instance) OnTreeChanged ¶
func (self Instance) OnTreeChanged(cb func())
func (Instance) RemoveInput ¶
Removes an input, call this only when inactive.
func (Instance) SetFilterEnabled ¶
func (Instance) SetFilterPath ¶
Adds or removes a path for the filter.
func (Instance) SetInputName ¶
Sets the name of the input at the given [param input] index. If the setting fails, returns [code]false[/code].
func (Instance) SetParameter ¶
Sets a custom parameter. These are used as local memory, because resources can be reused across the tree or scenes.
func (*Instance) UnsafePointer ¶
type Interface ¶
type Interface interface { //When inheriting from [AnimationRootNode], implement this virtual method to return all child animation nodes in order as a [code]name: node[/code] dictionary. GetChildNodes() map[any]any //When inheriting from [AnimationRootNode], implement this virtual method to return a list of the properties on this animation node. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees. Format is similar to [method Object.get_property_list]. GetParameterList() []any //When inheriting from [AnimationRootNode], implement this virtual method to return a child animation node by its [param name]. GetChildByName(name string) [1]gdclass.AnimationNode //When inheriting from [AnimationRootNode], implement this virtual method to return the default value of a [param parameter]. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees. GetParameterDefaultValue(parameter string) any //When inheriting from [AnimationRootNode], implement this virtual method to return whether the [param parameter] is read-only. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees. IsParameterReadOnly(parameter string) bool //When inheriting from [AnimationRootNode], implement this virtual method to run some code when this animation node is processed. The [param time] parameter is a relative delta, unless [param seek] is [code]true[/code], in which case it is absolute. //Here, call the [method blend_input], [method blend_node] or [method blend_animation] functions. You can also use [method get_parameter] and [method set_parameter] to modify local memory. //This function should return the delta. Process(time Float.X, seek bool, is_external_seeking bool, test_only bool) Float.X //When inheriting from [AnimationRootNode], implement this virtual method to override the text caption for this animation node. GetCaption() string //When inheriting from [AnimationRootNode], implement this virtual method to return whether the blend tree editor should display filter editing on this animation node. HasFilter() bool }