alistar.addAnimation
calls this:
EsotericSoftware/spine-runtimesblob/4.1/spine-ts/spine-player/src/Player.ts#L700
That changes the viewport, sets animation
to an Animation
object, and then calls AnimationState addAnimationWith
, which takes an Animation
object.
That differs from AnimationState addAnimation
which takes a string that is the name of the animation, not an Animation
object. See the code for that, it just looks up the Animation
object and calls addAnimationWith
:
EsotericSoftware/spine-runtimesblob/4.1/spine-ts/spine-core/src/AnimationState.ts#L549
My guess is your animationState.addAnimation
code works, but doesn't set the viewport, so you don't see what you expect. You might try:
success: function () {
alistar.setViewport("combined");
alistar.animationState.addAnimation(0,"blackscreen",false);
alistar.animationState.addAnimation(0,"combined",true ).mixDuration = 6;
alistar.play();
}
Re: showLoading: false
what do you expect to see?
Never use JSON unless you need to look at or manipulate the data. Use binary. It's smaller and loads faster.
You can use gzip and/or brotli to compress your atlas and binary files. This requires your web server to do the right things though.
Your atlas is massive. Export with a lower scale unless it's really needed. You might try exporting smaller and see if it still looks good enough. The player doesn't have a way to set the scale of the SkeletonJson or SkeletonBinary loader. I'll add that in 4.2-beta.
You can make an atlas that multiple skeletons share, then use Downloader
so the atlas is only parsed once. See my post above.