Documentation
¶
Overview ¶
Package Skeleton2D provides methods for working with Skeleton2D object instances.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode2D() Node2D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsSkeleton2D() Instance
- func (self Instance) ExecuteModifications(delta Float.X, execution_mode int)
- func (self Instance) GetBone(idx int) Bone2D.Instance
- func (self Instance) GetBoneCount() int
- func (self Instance) GetBoneLocalPoseOverride(bone_idx int) Transform2D.OriginXY
- func (self Instance) GetModificationStack() SkeletonModificationStack2D.Instance
- func (self Instance) GetSkeleton() RID.Skeleton
- func (self Instance) ID() ID
- func (self Instance) OnBoneSetupChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) SetBoneLocalPoseOverride(bone_idx int, override_pose Transform2D.OriginXY, strength Float.X, ...)
- func (self Instance) SetModificationStack(modification_stack SkeletonModificationStack2D.Instance)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) Virtual(name string) reflect.Value
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]) AsCanvasItem ¶
func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
func (*Extension[T]) AsSkeleton2D ¶
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.Skeleton2D
[Skeleton2D] parents a hierarchy of [Bone2D] nodes. It holds a reference to each [Bone2D]'s rest pose and acts as a single point of access to its bones. To set up different types of inverse kinematics for the given Skeleton2D, a [SkeletonModificationStack2D] should be created. The inverse kinematics be applied by increasing [member SkeletonModificationStack2D.modification_count] and creating the desired number of modifications.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func Get ¶
func Get(peer SkeletonModificationStack2D.Instance) Instance
Returns the [Skeleton2D] node that the SkeletonModificationStack2D is bound to.
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) AsSkeleton2D ¶
func (Instance) ExecuteModifications ¶
Executes all the modifications on the [SkeletonModificationStack2D], if the Skeleton2D has one assigned.
func (Instance) GetBone ¶
Returns a [Bone2D] from the node hierarchy parented by Skeleton2D. The object to return is identified by the parameter [param idx]. Bones are indexed by descending the node hierarchy from top to bottom, adding the children of each branch before moving to the next sibling.
func (Instance) GetBoneCount ¶
Returns the number of [Bone2D] nodes in the node hierarchy parented by Skeleton2D.
func (Instance) GetBoneLocalPoseOverride ¶
func (self Instance) GetBoneLocalPoseOverride(bone_idx int) Transform2D.OriginXY
Returns the local pose override transform for [param bone_idx].
func (Instance) GetModificationStack ¶
func (self Instance) GetModificationStack() SkeletonModificationStack2D.Instance
Returns the [SkeletonModificationStack2D] attached to this skeleton, if one exists.
func (Instance) GetSkeleton ¶
Returns the [RID] of a Skeleton2D instance.
func (Instance) OnBoneSetupChanged ¶
func (Instance) SetBoneLocalPoseOverride ¶
func (self Instance) SetBoneLocalPoseOverride(bone_idx int, override_pose Transform2D.OriginXY, strength Float.X, persistent bool)
Sets the local pose transform, [param override_pose], for the bone at [param bone_idx]. [param strength] is the interpolation strength that will be used when applying the pose, and [param persistent] determines if the applied pose will remain. [b]Note:[/b] The pose transform needs to be a local transform relative to the [Bone2D] node at [param bone_idx]!
func (Instance) SetModificationStack ¶
func (self Instance) SetModificationStack(modification_stack SkeletonModificationStack2D.Instance)
Sets the [SkeletonModificationStack2D] attached to this skeleton.