spine icon indicating copy to clipboard operation
spine copied to clipboard

Support for Spine v4.2

Open CTOStone opened this issue 1 year ago • 2 comments

Spine v4.2 was officially released April 18, 2024

With the 4.1 loader we get:

Spine 4.1 loader cant load version 4.2.20. Please configure your pixi-spine bundle

With the uni loader we get:

Unsupported version of spine model 4.2.20, please update pixi-spine

CTOStone avatar May 10 '24 19:05 CTOStone

Hey @st0nerhat not sure if this will help you but fyi you can use the other package @esotericsoftware/spine-pixi instead. Hope this saves you some time

import * as pixiSpine from "@esotericsoftware/spine-pixi";

(async ()=>{
  let imagesToLoad = require('./assets/spine/*.png');
  PIXI.Assets.addBundle('spineImages', imagesToLoad); // name of bundle doesn't matter
  await PIXI.Assets.loadBundle('spineImages');
  PIXI.Assets.add({alias: 'skeleton', src: require("./assets/spine/background.json")});
  PIXI.Assets.add({alias: 'atlas', src: require("./assets/spine/spine.atlas")});
  await PIXI.Assets.load(['skeleton', 'atlas']);
  const boy = pixiSpine.Spine.from('skeleton', 'atlas', {autoUpdate: true});

/* add to stage etc normal PIXI business */

})()

BernsteinA avatar May 11 '24 01:05 BernsteinA

That’s a hot lead. Thank you!

CTOStone avatar May 11 '24 18:05 CTOStone