SpineMontageSpineSettings

ceramic.SpineMontageSpineSettings (Class)

Configuration for the Spine instance used by a SpineMontage.

This class allows you to either provide an existing Spine instance or create a new one with specific settings. It also controls the lifecycle relationship between the montage and its Spine instance, as well as visual properties like scale and rendering depth.

The configuration follows a priority system: if an instance is provided, it will be used and the data field will be ignored. Otherwise, a new Spine instance will be created using the provided SpineData.

Using an existing Spine instance

var existingSpine = new Spine();
existingSpine.spineData = heroData;

var settings:SpineMontageSpineSettings = {
    instance: existingSpine,
    bound: false,  // Don't destroy spine when montage is destroyed
    scale: 0.5,
    depth: 10
};

Creating a new Spine instance

var settings:SpineMontageSpineSettings = {
    data: heroSpineData,
    bound: true,   // Destroy spine when montage is destroyed
    scale: 0.75,
    depth: 5,
    depthRange: 2
};

Instance Members

spine
instance: Null<Spine>

An existing Spine instance to use with this montage.

When provided, this instance will be used directly and the data field will be ignored. This is useful when you want to:

  • Share a Spine instance between multiple montages
  • Use a pre-configured Spine instance with specific settings
  • Maintain direct control over the Spine instance lifecycle

The instance will still have its scale, depth, and depthRange properties set according to this configuration.


spine
data: Null<SpineData>

SpineData used to create a new Spine instance.

This field is only used when instance is null. A new Spine instance will be created with this data and configured according to the other settings in this configuration.

The created instance will be inactive by default until an animation is played through the montage.


spine
bound: Bool

Controls the lifecycle binding between the montage and Spine instance.

When true (default):

  • Destroying the montage will also destroy the Spine instance
  • Destroying the Spine instance will also destroy the montage
  • Creates a strong ownership relationship

When false:

  • The montage and Spine instance have independent lifecycles
  • You must manually manage the Spine instance destruction
  • Useful when sharing a Spine instance between multiple systems

This applies whether using an existing instance or creating a new one.


spine
scale: Float

The scale factor applied to the Spine skeleton.

This sets the skeletonScale property of the Spine instance, which uniformly scales all bone positions and renders. Useful for:

  • Adjusting character sizes without re-exporting from Spine
  • Creating different sized variants of the same character
  • Matching your game's coordinate system

Default: 1.0 (original size)

scale: 0.5 // Half size scale: 2.0 // Double size


spine
depth: Float

The rendering depth (z-order) of the Spine instance.

Higher values render on top of lower values. This determines the base rendering order of the entire Spine skeleton relative to other visuals in your scene.

Default: 0.0

See: depthRange for controlling depth of individual Spine parts

spine
depthRange: Float

The depth range available for Spine attachment rendering.

Spine uses this range to distribute the depth of individual attachments (slots) within the skeleton. This allows proper layering of body parts while keeping them as a cohesive unit.

The actual depth of attachments will be:

  • Minimum: depth
  • Maximum: depth + depthRange

Default: 1.0

depth: 10, depthRange: 5 // Attachments will render between depths 10 and 15


spine
new(?instance: Null<Null<Spine>>, ?data: Null<Null<SpineData>>, ?bound: Null<Bool>, ?scale: Null<Float>, ?depth: Null<Float>, ?depthRange: Null<Float>): Void
See: depthRange for controlling depth of individual Spine parts
Name Type Default Description
instance Null<Null<Spine>> (optional) * An existing Spine instance to use with this montage. * When provided, this instance will be used directly and the data field will be ignored. This is useful when you want to: - Share a Spine instance between multiple montages - Use a pre-configured Spine instance with specific settings - Maintain direct control over the Spine instance lifecycle * The instance will still have its scale, depth, and depthRange properties set according to this configuration.
data Null<Null<SpineData>> (optional) * SpineData used to create a new Spine instance. * This field is only used when instance is null. A new Spine instance will be created with this data and configured according to the other settings in this configuration. * The created instance will be inactive by default until an animation is played through the montage.
bound Null<Bool> (optional) * Controls the lifecycle binding between the montage and Spine instance. * When true (default): - Destroying the montage will also destroy the Spine instance - Destroying the Spine instance will also destroy the montage - Creates a strong ownership relationship * When false: - The montage and Spine instance have independent lifecycles - You must manually manage the Spine instance destruction - Useful when sharing a Spine instance between multiple systems * This applies whether using an existing instance or creating a new one.
scale Null<Float> (optional) * The scale factor applied to the Spine skeleton. * This sets the skeletonScale property of the Spine instance, which uniformly scales all bone positions and renders. Useful for: - Adjusting character sizes without re-exporting from Spine - Creating different sized variants of the same character - Matching your game's coordinate system * Default: 1.0 (original size) * scale: 0.5 // Half size scale: 2.0 // Double size
depth Null<Float> (optional) * The rendering depth (z-order) of the Spine instance. * Higher values render on top of lower values. This determines the base rendering order of the entire Spine skeleton relative to other visuals in your scene. * Default: 0.0 *
depthRange Null<Float> (optional) * The depth range available for Spine attachment rendering. * Spine uses this range to distribute the depth of individual attachments (slots) within the skeleton. This allows proper layering of body parts while keeping them as a cohesive unit. * The actual depth of attachments will be: - Minimum: depth - Maximum: depth + depthRange * Default: 1.0 * depth: 10, depthRange: 5 // Attachments will render between depths 10 and 15

Metadata

Name Parameters
:structInit -