这是我使用的版本
"@esotericsoftware/spine-core": "^4.2.4",
"@esotericsoftware/spine-player": "^4.2.4",
初始化player
initPlayer(){
return new Promise(async(resolve,reject)=>{
new spine.SpinePlayer('player-container', {
jsonUrl: 'sketch/jj/jj.json',
atlasUrl: 'sketch/jj/jj.atlas',
animation: 'idle',
skin:'',
premultipliedAlpha: true,
alpha: true,
backgroundColor: "#00000000",
// defaultMix:0.3,
viewport: {
debugRender: false,
width: this.width,
height: this.height,
x: -this.width/2,
y: 0,
padLeft: "0%",
padRight: "0%",
padTop: "0%",
padBottom: "0%",
},
showControls: false,
showLoading:false,
success: async(player)=>{
this.player = player;
resolve()
}).catch(err=>{
console.error(err)
})
},
error: (player, reason)=>{
reject(reason);
}
});
})
},
是否需要额外的配置项呢,这个动画在spine-libgdx上可以渲染正常
我测试发现使用官网的原生spine-player.js可以渲染出该动画效果,引入npm包的项目不行