SkeletonModification2D

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: 24 Imported by: 0

Documentation

Overview

This resource provides an interface that can be expanded so code that operates on graphics.gd/classdb/Bone2D nodes in a graphics.gd/classdb/Skeleton2D can be mixed and matched together to create complex interactions.

This is used to provide Godot with a flexible and powerful Inverse Kinematics solution that can be adapted for many different uses.

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
	AsSkeletonModification2D() 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]See Interface for methods that can be overridden by T.

func (*Extension[T]) AsObject

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

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

func (*Extension[T]) AsSkeletonModification2D

func (self *Extension[T]) AsSkeletonModification2D() 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 Implementation

type Implementation = implementation

Implementation implements Interface with empty methods.

type Instance

type Instance [1]gdclass.SkeletonModification2D

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 [SkeletonModification2D] at the passed-in index, [param mod_idx].

func New

func New() Instance

func (Instance) Add

Adds the passed-in [SkeletonModification2D] to the stack.

func (Instance) AsObject

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

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) AsSkeletonModification2D

func (self Instance) AsSkeletonModification2D() Instance

func (Instance) ClampAngle

func (self Instance) ClampAngle(angle Angle.Radians, min Angle.Radians, max Angle.Radians, invert bool) Angle.Radians

Takes an angle and clamps it so it is within the passed-in 'min' and 'max' range. 'invert' will inversely clamp the angle, clamping it to the range outside of the given bounds.

func (Instance) Enabled

func (self Instance) Enabled() bool

func (Instance) ExecutionMode

func (self Instance) ExecutionMode() int

func (Instance) GetEditorDrawGizmo

func (self Instance) GetEditorDrawGizmo() bool

Returns whether this modification will call [Interface.DrawEditorGizmo] in the Godot editor to draw modification-specific gizmos.

func (Instance) GetIsSetup

func (self Instance) GetIsSetup() bool

Returns whether this modification has been successfully setup or not.

func (Instance) GetModificationStack

func (self Instance) GetModificationStack() SkeletonModificationStack2D.Instance

Returns the graphics.gd/classdb/SkeletonModificationStack2D that this modification is bound to. Through the modification stack, you can access the Skeleton2D the modification is operating on.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) Set

func (self Instance) Set(peer SkeletonModificationStack2D.Instance, mod_idx int)

Sets the modification at [param mod_idx] to the passed-in modification, [param modification].

func (Instance) SetEditorDrawGizmo

func (self Instance) SetEditorDrawGizmo(draw_gizmo bool)

Sets whether this modification will call [Interface.DrawEditorGizmo] in the Godot editor to draw modification-specific gizmos.

func (Instance) SetEnabled

func (self Instance) SetEnabled(value bool)

func (Instance) SetExecutionMode

func (self Instance) SetExecutionMode(value int)

func (Instance) SetIsSetup

func (self Instance) SetIsSetup(is_setup bool)

Manually allows you to set the setup state of the modification. This function should only rarely be used, as the graphics.gd/classdb/SkeletonModificationStack2D the modification is bound to should handle setting the modification up.

func (*Instance) SetObject

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

func (Instance) Virtual

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

type Interface

type Interface interface {
	// Executes the given modification. This is where the modification performs whatever function it is designed to do.
	Execute(delta Float.X)
	// Called when the modification is setup. This is where the modification performs initialization.
	SetupModification(modification_stack SkeletonModificationStack2D.Instance)
	// Used for drawing editor-only modification gizmos. This function will only be called in the Godot editor and can be overridden to draw custom gizmos.
	//
	// Note: You will need to use the Skeleton2D from [graphics.gd/classdb/SkeletonModificationStack2D.Instance.GetSkeleton] and it's draw functions, as the [graphics.gd/classdb/SkeletonModification2D] resource cannot draw on its own.
	DrawEditorGizmo()
}

Jump to

Keyboard shortcuts

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