Table of Contents

Class SpineInstance

Namespace
AO
Assembly
CoreAssembly.dll

Backing instance of a spine skeleton. See SpineSkeletonAsset.

public class SpineInstance
Inheritance
SpineInstance
Inherited Members
Extension Methods

Properties

ColorMultiplier

Color multiplier to use when rendering.

public Vector4 ColorMultiplier { get; set; }

Property Value

Vector4

Scale

Get/set the scale of the spine instance

public Vector2 Scale { get; set; }

Property Value

Vector2

Speed

Animation speed of the spine instance.

public float Speed { get; set; }

Property Value

float

StateMachine

Get the state machine for the spine instance

public StateMachine StateMachine { get; }

Property Value

StateMachine

Methods

Destroy()

Destroy the spine instance

public void Destroy()

DisableAllSkins()

Disable all skins for the spine instance

public void DisableAllSkins()

Remarks

You must call RefreshSkins after this to see the changes

DisableSkin(string)

Disable a skin for the spine instance

public bool DisableSkin(string skin)

Parameters

skin string

Returns

bool

Remarks

You must call RefreshSkins after this to see the changes

EnableSkin(string)

Additively enable a skin for the spine instance

public bool EnableSkin(string skin)

Parameters

skin string

Returns

bool

Remarks

You must call RefreshSkins after this to see the changes

GetBonePosition(string)

public Vector2 GetBonePosition(string bone)

Parameters

bone string

Returns

Vector2

GetSkins()

public string[] GetSkins()

Returns

string[]

Make()

Create a new spine instance

public static SpineInstance Make()

Returns

SpineInstance

RefreshSkins()

Refresh the skins for the spine instance.

public void RefreshSkins()

SetAnimation(string, bool, int, float)

Set the animation for the spine instance

public bool SetAnimation(string animation, bool loop, int track = 0, float speed = 1)

Parameters

animation string
loop bool
track int
speed float

Returns

bool

SetBonePosition(string, Vector2)

public void SetBonePosition(string bone, Vector2 position)

Parameters

bone string
position Vector2

SetSkeleton(SpineSkeletonAsset)

Set the skeleton for the spine instance

public void SetSkeleton(SpineSkeletonAsset asset)

Parameters

asset SpineSkeletonAsset

SetSkin(string)

Disable all other skins and set this one

public bool SetSkin(string skin)

Parameters

skin string

Returns

bool

Remarks

You must call RefreshSkins after this to see the changes

SetStateMachine(StateMachine, Entity)

Set the state machine for the spine instance

public void SetStateMachine(StateMachine sm, Entity owner)

Parameters

sm StateMachine
owner Entity

SetTransformConstraintPosition(string, Vector2)

Set the position of a transform constraint

public void SetTransformConstraintPosition(string name, Vector2 value)

Parameters

name string
value Vector2

SetTransformConstraintRotation(string, float)

Set the rotation of a transform constraint

public void SetTransformConstraintRotation(string name, float value)

Parameters

name string
value float

SetTransformConstraintScale(string, Vector2)

Set the scale of a transform constraint

public void SetTransformConstraintScale(string name, Vector2 value)

Parameters

name string
value Vector2

TrySetToPlayerRig(string, Player)

Attempts to find a player rig (as defined in Edit -> Game Config) that matches rigName.

public bool TrySetToPlayerRig(string rigName, Player player)

Parameters

rigName string
player Player

Returns

bool

Update(float)

Update the spine instance. Usually called every frame

public void Update(float dt)

Parameters

dt float

Events

OnAnimationEnd

public event Action<string> OnAnimationEnd

Event Type

Action<string>

OnAnimationStart

public event Action<string> OnAnimationStart

Event Type

Action<string>

OnEvent

public event Action<string> OnEvent

Event Type

Action<string>