reckfellENGINE

Skeleton2D

Groups bones, their rest pose and 2D skeleton modifiers.

On this page
class Skeleton2DReckfellSharpInherits Entity2D

Skeleton2D registers direct Bone2D chains and supplies their poses for polygon skinning. Assign Polygon2D.Skeleton, bone paths and weights: the hierarchy alone does not produce deformation.

Call GetBoneCount() and GetBone() after the skeleton enters the tree. Bone indices belong to the current skeleton layout; do not use them as persistent save identifiers. A SkeletonModificationStack2D can run gameplay IK. This API is marked experimental; recheck behavior when changing engine versions.

Working example.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

Skeleton2DConstructor
# Skeleton2D
C#
public Skeleton2D();

Methods8

ExecuteModificationsvoid
# ExecuteModifications
C#
public void ExecuteModifications(float delta, int executionMode);

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

Parameters
NameTypeDefault
deltafloat—
executionModeint—
GetBoneBone2D
# GetBone
C#
public Bone2D GetBone(int idx);

Returns a bone by its current index. Requires the skeleton in the tree and an index from 0 to GetBoneCount() - 1; an error returns null. After changing a chain, update setup through GetBoneCount() first.

Parameters
NameTypeDefault
idxint—
Returns Bone2D
GetBoneCountint
# GetBoneCount
C#
public int GetBoneCount();

Returns the registered bone count and updates pending bone setup when necessary. Requires the skeleton inside the tree; otherwise reports an error and returns 0. Use after AddChild() or in _Ready().

Returns int
GetBoneLocalPoseOverrideTransform2D
# GetBoneLocalPoseOverride
C#
public Transform2D GetBoneLocalPoseOverride(int boneIdx);

Returns the local pose override transform for bone_idx.

Parameters
NameTypeDefault
boneIdxint—
Returns Transform2D
GetModificationStackSkeletonModificationStack2D
# GetModificationStack
C#
public SkeletonModificationStack2D GetModificationStack();

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

Returns SkeletonModificationStack2D
GetSkeletonRid
# GetSkeleton
C#
public Rid GetSkeleton();

Returns the Rid of a Skeleton2D instance.

Returns Rid
SetBoneLocalPoseOverridevoid
# SetBoneLocalPoseOverride
C#
public void SetBoneLocalPoseOverride(int boneIdx, Transform2D overridePose, float strength, bool persistent);

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

Parameters
NameTypeDefault
boneIdxint—
overridePoseTransform2D—
strengthfloat—
persistentbool—
SetModificationStackvoid
# SetModificationStack
C#
public void SetModificationStack(SkeletonModificationStack2D modificationStack);

Replaces the modification stack. If the skeleton is inside the tree, binds the new stack to it and runs setup. For IK, enable both the stack and modifier and assign valid paths and Strength. The 2D stack API remains experimental.

Parameters
NameTypeDefault
modificationStackSkeletonModificationStack2D—

Signals and events1

BoneSetupChangedEvent
# BoneSetupChanged
C#
public event Action BoneSetupChanged;

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

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.