From bd3c2cbf4b21d6e35e41a28c488f297ffe2d7fa0 Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Wed, 15 Oct 2025 12:55:34 +0200 Subject: [PATCH] [ts][pixi-v7] Add allowMissingRegions param to game object factory. --- spine-ts/spine-pixi-v7/src/Spine.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spine-ts/spine-pixi-v7/src/Spine.ts b/spine-ts/spine-pixi-v7/src/Spine.ts index d944ae996..4bf86c032 100644 --- a/spine-ts/spine-pixi-v7/src/Spine.ts +++ b/spine-ts/spine-pixi-v7/src/Spine.ts @@ -82,6 +82,9 @@ export interface SpineFromOptions { /** The bounds provider to use. If undefined the bounds will be dynamic, calculated when requested and based on the current frame. */ boundsProvider?: SpineBoundsProvider, + + /** Set {@link AtlasAttachmentLoader.allowMissingRegions} property on the AtlasAttachmentLoader. */ + allowMissingRegions?: boolean; }; export interface SpineOptions { @@ -871,7 +874,7 @@ export class Spine extends Container { * @param options - Options to configure the Spine game object. See {@link SpineFromOptions} * @returns {Spine} The Spine game object instantiated */ - public static from ({ skeleton, atlas, scale = 1, darkTint, autoUpdate = true, boundsProvider }: SpineFromOptions) { + public static from ({ skeleton, atlas, scale = 1, darkTint, autoUpdate = true, boundsProvider, allowMissingRegions }: SpineFromOptions) { const cacheKey = `${skeleton}-${atlas}-${scale}`; let skeletonData = Spine.skeletonCache[cacheKey]; @@ -879,7 +882,7 @@ export class Spine extends Container { // biome-ignore lint/suspicious/noExplicitAny: json skeleton is any const skeletonAsset = Assets.get(skeleton); const atlasAsset = Assets.get(atlas); - const attachmentLoader = new AtlasAttachmentLoader(atlasAsset); + const attachmentLoader = new AtlasAttachmentLoader(atlasAsset, allowMissingRegions); const parser = skeletonAsset instanceof Uint8Array ? new SkeletonBinary(attachmentLoader) : new SkeletonJson(attachmentLoader); parser.scale = scale; skeletonData = parser.readSkeletonData(skeletonAsset);