Skip to main content

Spine Class

Description:

  A class for creating instances of the 'Spine' record.

getLooks

Type: Function.

Description:

  Returns a list of available looks for the specified Spine2D file string.

Signature:

getLooks: function(self: SpineClass, spineStr: string): {string}

Parameters:

ParameterTypeDescription
spineStrstringThe Spine2D file string to get the looks for.

Returns:

Return TypeDescription
tableA table of strings representing the available looks.

getAnimations

Type: Function.

Description:

  Returns a list of available animations for the specified Spine2D file string.

Signature:

getAnimations: function(self: SpineClass, spineStr: string): {string}

Parameters:

ParameterTypeDescription
spineStrstringThe Spine2D file string to get the animations for.

Returns:

Return TypeDescription
tableA table of strings representing the available animations.

__call

Type: Metamethod.

Description:

  Creates a new instance of 'Spine' using the specified Spine string.

Signature:

metamethod __call: function(self: SpineClass, spineStr: string): Spine | nil

Parameters:

ParameterTypeDescription
spineStrstringThe Spine file string for the new instance.A Spine file string can be a file path with the target file extention like "Spine/item" or file paths with all the related files like "Spine/item.skel

Returns:

Return TypeDescription
SpineA new instance of 'Spine'. Returns nil if the Spine file could not be loaded.

__call

Type: Metamethod.

Description:

  Creates a new instance of 'Spine' using the specified skeleton file and atlas file.

Signature:

metamethod __call: function(self: SpineClass, skelFile: string, atlasFile: string): Spine | nil

Parameters:

ParameterTypeDescription
skelFilestringthe filename of the skeleton file to load.
atlasFilestringthe filename of the atlas file to load.

Returns:

Return TypeDescription
Spinea new instance of 'Spine' with the specified skeleton file and atlas file. Returns nil if the skeleton file or atlas file could not be loaded.