pixijs/spine

Support for Spine v4.2

st0nerhat opened this issue · 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

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 */

})()

That’s a hot lead. Thank you!