Skeleton2D

package
v0.0.0-...-ae8aae0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package Skeleton2D provides methods for working with Skeleton2D object instances.

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 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 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 [SkeletonModificationStack2D], if the Skeleton2D has one assigned.

func (Instance) GetBone

func (self Instance) GetBone(idx int) [1]gdclass.Bone2D

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

func (self Instance) GetBoneCount() int

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() [1]gdclass.SkeletonModificationStack2D

Returns the [SkeletonModificationStack2D] attached to this skeleton, if one exists.

func (Instance) GetSkeleton

func (self Instance) GetSkeleton() RID.Skeleton

Returns the [RID] of a Skeleton2D instance.

func (Instance) OnBoneSetupChanged

func (self Instance) OnBoneSetupChanged(cb func())

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 [1]gdclass.SkeletonModificationStack2D)

Sets the [SkeletonModificationStack2D] attached to this skeleton.

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

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