pixijs / spine-v8

PixiJS v8 port of the official spine runtime
https://pixijs.io/spine-v8/examples/
MIT License
32 stars 5 forks source link

Any example on how to use this? #3

Closed ziarmandhost closed 3 months ago

ziarmandhost commented 4 months ago

I have next setup: vite + pixijs + typescript

package.json:

"dependencies": {
    "@pixi/spine-pixi": "^1.0.8",
    "pixi.js": "^8.1.1"
  }

main.ts:

import "@pixi/spine-pixi"
import {Application, Assets} from "pixi.js"
import {Spine} from "@pixi/spine-pixi"
import "./style.css"

const app = new Application()
await app.init({
    resizeTo: document.body
})
document.body.appendChild(app.canvas)

await Assets.load("spineboy-pro.atlas")
await Assets.load("spineboy-pro.png")
await Assets.load("spineboy-pro.json")

const spineboy = Assets.get("spineboy-pro.json")
const test = new Spine(spineboy) 
console.log(test)

How to use this package? I see error on console (file attached). Any guide how to setup it?

image

ziarmandhost commented 4 months ago

сс: @GoodBoyDigital @Zyie

peterlee-dev commented 4 months ago

You can check the example here: https://github.com/pixijs/spine-v8/blob/main/examples/index.html

Zyie commented 3 months ago

Hey @ziarmandhost we have now updated all of the examples on this repo to work properly with v8

a982246809 commented 2 months ago

You can check the example here: https://github.com/pixijs/spine-v8/blob/main/examples/index.html您可以在此处查看示例:https://github.com/pixijs/spine-v8/blob/main/examples/index.html There is no example about json 没有关于json的示例