Documentation
¶
Overview ¶
A resource to add to an AnimationNodeBlendTree. This animation node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters.
After setting the request and changing the animation playback, the one-shot node automatically clears the request on the next process frame by setting its request value to OneShotRequestNone.
package main import ( "graphics.gd/classdb/AnimationNodeOneShot" "graphics.gd/classdb/AnimationTree" "graphics.gd/variant/Object" ) func ExampleAnimationNodeOneShot(tree AnimationTree.Instance) { // Play child animation connected to "shot" port. Object.Set(tree, "parameters/OneShot/request", AnimationNodeOneShot.OneShotRequestFire) // Abort child animation connected to "shot" port. Object.Set(tree, "parameters/OneShot/request", AnimationNodeOneShot.OneShotRequestAbort) // Abort child animation with fading out connected to "shot" port. Object.Set(tree, "parameters/OneShot/request", AnimationNodeOneShot.OneShotRequestFadeOut) // Get current state (read-only). Object.Get(tree, "parameters/OneShot/active") // Get current internal state (read-only). Object.Get(tree, "parameters/OneShot/internal_active") }
Index ¶
- type Advanced
- type Any
- type Extension
- func (self *Extension[T]) AsAnimationNode() AnimationNode.Instance
- func (self *Extension[T]) AsAnimationNodeOneShot() Instance
- func (self *Extension[T]) AsAnimationNodeSync() AnimationNodeSync.Instance
- func (self *Extension[T]) AsObject() [1]gd.Object
- func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
- func (self *Extension[T]) AsResource() Resource.Instance
- type ID
- type Instance
- func (self Instance) AsAnimationNode() AnimationNode.Instance
- func (self Instance) AsAnimationNodeOneShot() Instance
- func (self Instance) AsAnimationNodeSync() AnimationNodeSync.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) Autorestart() bool
- func (self Instance) AutorestartDelay() Float.X
- func (self Instance) AutorestartRandomDelay() Float.X
- func (self Instance) BreakLoopAtEnd() bool
- func (self Instance) FadeinCurve() Curve.Instance
- func (self Instance) FadeinTime() Float.X
- func (self Instance) FadeoutCurve() Curve.Instance
- func (self Instance) FadeoutTime() Float.X
- func (self Instance) ID() ID
- func (self Instance) MixMode() MixMode
- func (self Instance) SetAutorestart(value bool)
- func (self Instance) SetAutorestartDelay(value Float.X)
- func (self Instance) SetAutorestartRandomDelay(value Float.X)
- func (self Instance) SetBreakLoopAtEnd(value bool)
- func (self Instance) SetFadeinCurve(value Curve.Instance)
- func (self Instance) SetFadeinTime(value Float.X)
- func (self Instance) SetFadeoutCurve(value Curve.Instance)
- func (self Instance) SetFadeoutTime(value Float.X)
- func (self Instance) SetMixMode(value MixMode)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) Virtual(name string) reflect.Value
- type MixMode
- type OneShotRequest
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 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]) AsAnimationNode ¶
func (self *Extension[T]) AsAnimationNode() AnimationNode.Instance
func (*Extension[T]) AsAnimationNodeOneShot ¶
func (*Extension[T]) AsAnimationNodeSync ¶
func (self *Extension[T]) AsAnimationNodeSync() AnimationNodeSync.Instance
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.AnimationNodeOneShot
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) AsAnimationNode ¶
func (self Instance) AsAnimationNode() AnimationNode.Instance
func (Instance) AsAnimationNodeOneShot ¶
func (Instance) AsAnimationNodeSync ¶
func (self Instance) AsAnimationNodeSync() AnimationNodeSync.Instance
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) Autorestart ¶
func (Instance) AutorestartDelay ¶
func (Instance) AutorestartRandomDelay ¶
func (Instance) BreakLoopAtEnd ¶
func (Instance) FadeinCurve ¶
func (Instance) FadeinTime ¶
func (Instance) FadeoutCurve ¶
func (Instance) FadeoutTime ¶
func (Instance) SetAutorestart ¶
func (Instance) SetAutorestartDelay ¶
func (Instance) SetAutorestartRandomDelay ¶
func (Instance) SetBreakLoopAtEnd ¶
func (Instance) SetFadeinCurve ¶
func (Instance) SetFadeinTime ¶
func (Instance) SetFadeoutCurve ¶
func (Instance) SetFadeoutTime ¶
func (Instance) SetMixMode ¶
type MixMode ¶
type MixMode int //gd:AnimationNodeOneShot.MixMode
const ( // Blends two animations. See also [AnimationNodeBlend2]. // // [AnimationNodeBlend2]: https://pkg.go.dev/graphics.gd/classdb/AnimationNodeBlend2 MixModeBlend MixMode = 0 // Blends two animations additively. See also [AnimationNodeAdd2]. // // [AnimationNodeAdd2]: https://pkg.go.dev/graphics.gd/classdb/AnimationNodeAdd2 MixModeAdd MixMode = 1 )
type OneShotRequest ¶
type OneShotRequest int //gd:AnimationNodeOneShot.OneShotRequest
const ( // The default state of the request. Nothing is done. OneShotRequestNone OneShotRequest = 0 // The request to play the animation connected to "shot" port. OneShotRequestFire OneShotRequest = 1 // The request to stop the animation connected to "shot" port. OneShotRequestAbort OneShotRequest = 2 // The request to fade out the animation connected to "shot" port. OneShotRequestFadeOut OneShotRequest = 3 )