jkukuryk
I'm sorry, but the code you just provided has several problems. It might work somehow, but you are misusing several methods.
For example, this piece of code:
atlas.regions.forEach((r) => {
r.page.setTexture(new SpineTexture(pixiTexture));
});
is bad. For each region, it creates a SpineTexture
that is passed to the setTexture
of the respective page. However, this methods loops over all the regions of the page. So, if you have 10 different regions in a page, you creates 10 different SpineTexture
, but you will eventually have only the last one that is actually used.
Then, you are initializing your asset manager with a texture loader function that does not even take as input the loaded texture, it just uses a globally defined pixiTexture
.
The error on atlas.setTextures(assetManager);
is the very same error I explained you in the previous message. Did you check the content of the assetManager assets
field?
My suggestion is to restart from your previous code and follow the suggestions I already gave you.
May I ask you why are you using our Asset Manager, while PIXI has its own Asset Manager that even spine-pixi
uses?
I think you easily reach you goal with a slight modification of the basic example.