Documentation
¶
Overview ¶
A resource used by graphics.gd/classdb/AnimationNodeBlendTree.
graphics.gd/classdb/AnimationNodeBlendSpace2D represents a virtual 2D space on which [graphics.gd/classdb/AnimationRootNode]s are placed. Outputs the linear blend of the three adjacent animations using a [Vector2.XY] weight. Adjacent in this context means the three [graphics.gd/classdb/AnimationRootNode]s making up the triangle that contains the current value.
You can add vertices to the blend space with Instance.AddBlendPoint and automatically triangulate it by setting Instance.AutoTriangles to true. Otherwise, use Instance.AddTriangle and Instance.RemoveTriangle to triangulate the blend space by hand.
Index ¶
- type Advanced
- type Any
- type BlendMode
- type Expanded
- type Extension
- func (self *Extension[T]) AsAnimationNode() AnimationNode.Instance
- func (self *Extension[T]) AsAnimationNodeBlendSpace2D() Instance
- func (self *Extension[T]) AsAnimationRootNode() AnimationRootNode.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) AddBlendPoint(node AnimationRootNode.Instance, pos Vector2.XY)
- func (self Instance) AddTriangle(x int, y int, z int)
- func (self Instance) AsAnimationNode() AnimationNode.Instance
- func (self Instance) AsAnimationNodeBlendSpace2D() Instance
- func (self Instance) AsAnimationRootNode() AnimationRootNode.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) AutoTriangles() bool
- func (self Instance) BlendMode() BlendMode
- func (self Instance) GetBlendPointCount() int
- func (self Instance) GetBlendPointNode(point int) AnimationRootNode.Instance
- func (self Instance) GetBlendPointPosition(point int) Vector2.XY
- func (self Instance) GetTriangleCount() int
- func (self Instance) GetTrianglePoint(triangle int, point int) int
- func (self Instance) ID() ID
- func (self Instance) MaxSpace() Vector2.XY
- func (self Instance) MinSpace() Vector2.XY
- func (self Instance) OnTrianglesUpdated(cb func(), flags ...Signal.Flags)
- func (self Instance) RemoveBlendPoint(point int)
- func (self Instance) RemoveTriangle(triangle int)
- func (self Instance) SetAutoTriangles(value bool)
- func (self Instance) SetBlendMode(value BlendMode)
- func (self Instance) SetBlendPointNode(point int, node AnimationRootNode.Instance)
- func (self Instance) SetBlendPointPosition(point int, pos Vector2.XY)
- func (self Instance) SetMaxSpace(value Vector2.XY)
- func (self Instance) SetMinSpace(value Vector2.XY)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetSnap(value Vector2.XY)
- func (self Instance) SetSync(value bool)
- func (self Instance) SetXLabel(value string)
- func (self Instance) SetYLabel(value string)
- func (self Instance) Snap() Vector2.XY
- func (self Instance) Sync() bool
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) XLabel() string
- func (self Instance) YLabel() string
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 BlendMode ¶
type BlendMode int //gd:AnimationNodeBlendSpace2D.BlendMode
const ( // The interpolation between animations is linear. BlendModeInterpolated BlendMode = 0 // The blend space plays the animation of the animation node which blending position is closest to. Useful for frame-by-frame 2D animations. BlendModeDiscrete BlendMode = 1 // Similar to [BlendModeDiscrete], but starts the new animation at the last animation's playback position. BlendModeDiscreteCarry BlendMode = 2 )
type Expanded ¶
type Expanded [1]gdclass.AnimationNodeBlendSpace2D
func (Expanded) AddBlendPoint ¶
Adds a new point that represents a 'node' at the position set by 'pos'. You can insert it at a specific index using the 'at_index' argument. If you use the default value for 'at_index', the point is inserted at the end of the blend points array.
func (Expanded) AddTriangle ¶
Creates a new triangle using three points 'x', 'y', and 'z'. Triangles can overlap. You can insert the triangle at a specific index using the 'at_index' argument. If you use the default value for 'at_index', the point is inserted at the end of the blend points array.
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]) AsAnimationNodeBlendSpace2D ¶
func (*Extension[T]) AsAnimationRootNode ¶
func (self *Extension[T]) AsAnimationRootNode() AnimationRootNode.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.AnimationNodeBlendSpace2D
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) AddBlendPoint ¶
func (self Instance) AddBlendPoint(node AnimationRootNode.Instance, pos Vector2.XY)
Adds a new point that represents a 'node' at the position set by 'pos'. You can insert it at a specific index using the 'at_index' argument. If you use the default value for 'at_index', the point is inserted at the end of the blend points array.
func (Instance) AddTriangle ¶
Creates a new triangle using three points 'x', 'y', and 'z'. Triangles can overlap. You can insert the triangle at a specific index using the 'at_index' argument. If you use the default value for 'at_index', the point is inserted at the end of the blend points array.
func (Instance) AsAnimationNode ¶
func (self Instance) AsAnimationNode() AnimationNode.Instance
func (Instance) AsAnimationNodeBlendSpace2D ¶
func (Instance) AsAnimationRootNode ¶
func (self Instance) AsAnimationRootNode() AnimationRootNode.Instance
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) AutoTriangles ¶
func (Instance) GetBlendPointCount ¶
Returns the number of points in the blend space.
func (Instance) GetBlendPointNode ¶
func (self Instance) GetBlendPointNode(point int) AnimationRootNode.Instance
Returns the graphics.gd/classdb/AnimationRootNode referenced by the point at index 'point'.
func (Instance) GetBlendPointPosition ¶
Returns the position of the point at index 'point'.
func (Instance) GetTriangleCount ¶
Returns the number of triangles in the blend space.
func (Instance) GetTrianglePoint ¶
Returns the position of the point at index 'point' in the triangle of index 'triangle'.
func (Instance) OnTrianglesUpdated ¶
func (Instance) RemoveBlendPoint ¶
Removes the point at index 'point' from the blend space.
func (Instance) RemoveTriangle ¶
Removes the triangle at index 'triangle' from the blend space.
func (Instance) SetAutoTriangles ¶
func (Instance) SetBlendMode ¶
func (Instance) SetBlendPointNode ¶
func (self Instance) SetBlendPointNode(point int, node AnimationRootNode.Instance)
Changes the graphics.gd/classdb/AnimationNode referenced by the point at index 'point'.
func (Instance) SetBlendPointPosition ¶
Updates the position of the point at index 'point' in the blend space.