Skip to main content

MagicLayout

Main entry point — a Pixi.js Container that manages a hierarchy of Spine skeletons. Exposes five sub-controllers via getters and provides high-level lifecycle methods.

Methods

constructor

constructor(options?: SpineLayoutOptions)

Creates the layout and its five controllers. If options.manifest is provided the spines are instantiated immediately.


createInstancesFromManifest

createInstancesFromManifest(manifest: AssetsManifest, folderName?: string): void

Parses a Pixi.js AssetsManifest for spine assets, creates single and multiple instances (based on multipleInstancesPatterns), then calls render() to wire the full scene.


createInstancesFromDataArray

createInstancesFromDataArray(data: SpineInstanceData[]): void

Creates spine instances from raw skeleton data objects (atlas text + texture map). Used when assets are loaded outside the Pixi.js asset pipeline.


createInstanceFromData

createInstanceFromData(data: SpineInstanceData, skipAttachBones?: boolean, skipMultipleInstances?: boolean): void

Creates a single spine instance from raw data. Handles multiple-instance patterns by looking up bone counts with the spine_<id> prefix convention.


reset

reset(): void

Destroys all spine instances, clears controller state, and removes all children from the container.


destroy

destroy(): void

Calls reset() then the parent Pixi.js Container.destroy().


getSpinesByNamePattern

getSpinesByNamePattern(pattern: string, options?: { not?: string[] }): Map<string, Spine>

Returns all registered spines whose IDs start with pattern. Delegates to SpineController.