Got it! We made it to work now... but we have calculate the offsets and rotate the Texture at the end which I'm not sure is the correct approach.
export const createTexturesFromSpineAtlas = (
atlas: string,
assets: string[]
) => {
const regions = Assets.get(atlas)['regions'];
regions
.filter((region: TextureAtlasRegion) => assets.includes(region.name))
.forEach((region: TextureAtlasRegion) => {
const frame = new Rectangle(
region.x,
region.y,
region.degrees !== 0 ? region.height : region.width,
region.degrees !== 0 ? region.width : region.height
);
const orig = new Rectangle(
0,
0,
region.originalWidth,
region.originalHeight
);
const offsetY = region.originalHeight - region.height - region.offsetY; // spine stores data from the bottom-left corner, and we need to adjust for that
const trim = new Rectangle(
region.offsetX,
offsetY,
region.width,
region.height
);
const texture = new Texture(
region.texture.texture,
frame,
orig,
trim,
Pixi.groupD8.N
);
Texture.addToCache(texture, region.name);
});
};