[pixi-spine@3.1.2 / Spine 3.8] Frame does not fit inside the base Texture dimensions
Kloen opened this issue · 3 comments
Hi,
I'm having the following issue while using PixiJS and Pixi Spine, it just happens for one of the multiple Live2D we work with.
frame does not fit inside the base Texture dimensions: X: 2 + 922 = 924 > 2048 or Y: 2 + 1109 = 1111 > 1024
On our setup we are using:
nuxt@3.5.3
pixi.js@6.5.9
pixi-spine@3.1.2
And here's the code we were using so far (Note the .skel file is being loaded from our CDN):
Atlas file: https://cdn.kimaris.gg/alchemystars-global/live2d/91081/1701081_spine_idle.atlas
<template>
<canvas id="app"></canvas>
</template>
<script>
import 'pixi-spine'
import * as PIXI from 'pixi.js'
import { Spine } from 'pixi-spine'
export default {
mounted() {
const app = new PIXI.Application({
view: document.querySelector('#app'),
})
app.loader.add('spineCharacter', `https://cdn.kimaris.gg/alchemystars-global/live2d/91081/1701081_spine_idle.skel`)
app.loader.load((loader, resources) => {
const animation = new Spine(resources.spineCharacter.spineData)
const scale = Math.min(app.view.width / animation.width, app.view.height / animation.height)
animation.scale.set(scale)
animation.x = app.view.width / 2
animation.y = app.view.height / 2
animation.state.setAnimation(0, 'idle', true)
app.stage.addChild(animation)
})
},
}
</script>
Worth mention that there's a working version with this same assets at:
https://alchemystars.kloenlansfiel.com/live2d/Frostfire/spine3
In addition this Live2D belong to a game that uses Spine 3.8 runtime for C#, and it does work there without any modification to the runtime as far as I'm aware.
This working version uses directly the Spine 3.8 runtime, but modified:
I wanted to find where to fix it on the pixi-spine
repo so I could submit a PR or just generate a version for ourselves, but to be honest, was kinda lost trying to do so...
If it's something that needs to be fix, or you could guide me on how to introduce our changes within pixi-spine, even if we have to do a custom version of it, that'd be fine for us.
The error is that one of the textures in your atlas is larger than the atlas Itself. It might be that you are using the wrong .atlas or the wrong .PNG image.
Look at the error, it says you are trying to make a rectangle taller than 1024 (the height of the texture)
Yeah, I'm well aware of that, thing is that's what Spine itself generated, and it does work on the C# runtime, at least within Unity 🤷🏼 (main reason why we modified the spine-3.8 runtime for JavaScript back then)
I was trying to perform the same changes on pixi-spine
and generate a version to our private npm repository and call it a day.
Thing is I wasn't able to locate a branch or commit to use as a base for that purpose (pixi-spine@3.1.2
), it was not stated on the CONTRIBUTING.md
either, so I just decided to open an issue (because is fast to ask than dig on a codebase I'm not familiar with), explain what was the problem and what I would like to do.
If it's a problem within spine and could be fixed, cool for me, if it's just something else we need to generate a custom version for it, fine for me too. Just point me to a commit I could use as a base, since not even on the releases on github there's a 3.1.2 version I could check the base commit.
Nevermind, I just saw there's an actual tag for 3.1.2, just not a release... Will generate a custom from there. TY anyway :D