crookedbard

Hello,
I am creating a character with many animations for a game that allows to customise the character. You would be able to change hair, eyes, clothes etc.
Unfortunately I can't figure out how to have separate texture atlas per skin, because all images will not fit into 1 texture atlas, so I would prefer to have 1 for hair sprites, other for clothes, another for accessories etc.
Is it possible to achieve something like that?

I had some ideas, but it seems to not work so far:
1) Have separate skeletons and then export separate texture atlas per skeleton, there is such option. The problem is if I create separate skeleton then I can't use them both in 1 animation.
2) Change sprites programatically, but this unfortunately is not supported by spine runtime. "setAttachment(new sprite from path)".

Any ideas appreciated.
crookedbard
  • Postovi: 2

Misaki

Hello, you can pack the image files per folder by choosing Image folders:
Texture packing - Spine User Guide: Packing during data export

Packing settings can be configured for each page by placing pack.json in each folder:
Texture packing - Spine User Guide: JSON Configuration

If the images you want to pack on separate pages (hair, clothes, etc.) are currently in the same folder hierarchy, you will need to modify the image paths, but this can be easily accomplished using Find and Replace:
Tree view - Spine User Guide: Find and replace

After selecting the attachments you want to change the image paths, open the Find and Replace window, enter "^" in the Find field, enter the folder name you want to add before the images name in the Replace field, such as "subfolder/", check the Regular expression, set the Scope to Tree selection, set the Field to Path, and press the Replace button to modify the paths of all selected images at once.

If there is anything that is not clear, please feel free to ask!
Avatar
Misaki

Misaki
  • Postovi: 759

crookedbard

Thank you for the answer. Pack "Image Folders" option really works as I want to :)
crookedbard
  • Postovi: 2

Misaki

I'm happy to hear that! :D
Avatar
Misaki

Misaki
  • Postovi: 759


Natrag na Editor