Skeleton2D

package
v0.0.0-...-c858641 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

graphics.gd/classdb/Skeleton2D parents a hierarchy of graphics.gd/classdb/Bone2D nodes. It holds a reference to each graphics.gd/classdb/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 graphics.gd/classdb/SkeletonModificationStack2D should be created. The inverse kinematics be applied by increasing graphics.gd/classdb/SkeletonModificationStack2D.Instance.ModificationCount and creating the desired number of modifications.

Index

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 Any

type Any interface {
	gd.IsClass
	AsSkeleton2D() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsNode2D

func (self *Extension[T]) AsNode2D() Node2D.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsSkeleton2D

func (self *Extension[T]) AsSkeleton2D() Instance

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.Skeleton2D

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 Get

Returns the [Skeleton2D] node that the SkeletonModificationStack2D is bound to.

func New

func New() Instance

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode2D

func (self Instance) AsNode2D() Node2D.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsSkeleton2D

func (self Instance) AsSkeleton2D() Instance

func (Instance) ExecuteModifications

func (self Instance) ExecuteModifications(delta Float.X, execution_mode int)

Executes all the modifications on the graphics.gd/classdb/SkeletonModificationStack2D, if the Skeleton2D has one assigned.

func (Instance) GetBone

func (self Instance) GetBone(idx int) Bone2D.Instance

Returns a graphics.gd/classdb/Bone2D from the node hierarchy parented by Skeleton2D. The object to return is identified by the parameter '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

func (self Instance) GetBoneCount() int

Returns the number of graphics.gd/classdb/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 'bone_idx'.

func (Instance) GetModificationStack

func (self Instance) GetModificationStack() SkeletonModificationStack2D.Instance

Returns the graphics.gd/classdb/SkeletonModificationStack2D attached to this skeleton, if one exists.

func (Instance) GetSkeleton

func (self Instance) GetSkeleton() RID.Skeleton

Returns the [Resource.ID] of a Skeleton2D instance.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) OnBoneSetupChanged

func (self Instance) OnBoneSetupChanged(cb func(), flags ...Signal.Flags)

func (Instance) SetBoneLocalPoseOverride

func (self Instance) SetBoneLocalPoseOverride(bone_idx int, override_pose Transform2D.OriginXY, strength Float.X, persistent bool)

Sets the local pose transform, 'override_pose', for the bone at 'bone_idx'.

'strength' is the interpolation strength that will be used when applying the pose, and 'persistent' determines if the applied pose will remain.

Note: The pose transform needs to be a local transform relative to the graphics.gd/classdb/Bone2D node at 'bone_idx'!

func (Instance) SetModificationStack

func (self Instance) SetModificationStack(modification_stack SkeletonModificationStack2D.Instance)

Sets the graphics.gd/classdb/SkeletonModificationStack2D attached to this skeleton.

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL