Table of Contents

Class Skeleton2D

Namespace
Godot
Assembly
GodotSharp.dll

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 ModificationCount and creating the desired number of modifications.

public class Skeleton2D : Node2D, IDisposable
Inheritance
Skeleton2D
Implements
Inherited Members

Constructors

Skeleton2D()

public Skeleton2D()

Methods

ExecuteModifications(float, int)

Executes all the modifications on the SkeletonModificationStack2D, if the Skeleton2D has one assigned.

public void ExecuteModifications(float delta, int executionMode)

Parameters

delta float
executionMode int

GetBone(int)

Returns a 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.

public Bone2D GetBone(int idx)

Parameters

idx int

Returns

Bone2D

GetBoneCount()

Returns the number of Bone2D nodes in the node hierarchy parented by Skeleton2D.

public int GetBoneCount()

Returns

int

GetBoneLocalPoseOverride(int)

Returns the local pose override transform for boneIdx.

public Transform2D GetBoneLocalPoseOverride(int boneIdx)

Parameters

boneIdx int

Returns

Transform2D

GetModificationStack()

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

public SkeletonModificationStack2D GetModificationStack()

Returns

SkeletonModificationStack2D

GetSkeleton()

Returns the Rid of a Skeleton2D instance.

public Rid GetSkeleton()

Returns

Rid

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

SetBoneLocalPoseOverride(int, Transform2D, float, bool)

Sets the local pose transform, overridePose, for the bone at boneIdx.

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 Bone2D node at boneIdx!

public void SetBoneLocalPoseOverride(int boneIdx, Transform2D overridePose, float strength, bool persistent)

Parameters

boneIdx int
overridePose Transform2D
strength float
persistent bool

SetModificationStack(SkeletonModificationStack2D)

Sets the SkeletonModificationStack2D attached to this skeleton.

public void SetModificationStack(SkeletonModificationStack2D modificationStack)

Parameters

modificationStack SkeletonModificationStack2D

Events

BoneSetupChanged

Emitted when the Bone2D setup attached to this skeletons changes. This is primarily used internally within the skeleton.

public event Action BoneSetupChanged

Event Type

Action