ericsm

is there a way to extract the sprite used in the skeleton?
we have a spine character that is just sprite images (for now) for animating. is there a way to extract the sprite so that I can use it for other image/sprite stuff in Unity?

thanks
ericsm
  • Postovi: 5

Harald

You can use the Texture-Unpacker in the Spine Editor to extract single sprite images from the atlas:
Texture Packing - Spine User Guide: Texture Unpacker

Or do you want to achieve something different?
Avatar
Harald

Harri
  • Postovi: 3992

ericsm

hi Harald,

I was thinking of doing it via script. so this spine has this skin. i can get the sprite from that skin
ericsm
  • Postovi: 5

Harald

Hi Eric. Oh, sorry, I misunderstood you there.

You can have a look at the class AtlasAttachmentLoader which shows how to get rectangular uv coords from an Atlas based on a name string:
spine-runtimes/AtlasAttachmentLoader.cs at 3.7
So basically you will need a call like AtlasRegion region = atlas.FindRegion(path); to query the region info of your sprite within the whole atlas image.

Then you can utilize Unity's means of copying texture regions to other textures, or map your own custom quad to this region by setting the region's uv coords, etc.

Please let me know if this is what you need!
Avatar
Harald

Harri
  • Postovi: 3992

Cuong Do

@Harald Do you know how to extract image from atlas using spine runtime typescript?
Cuong Do
  • Postovi: 12

Mario

You likely want to create thumbnails from your skins instead of assembling them manually from atlas regions. Have a look at the dress-up example: https://github.com/EsotericSoftware/spine-runtimes/blob/4.0/spine-ts/spine-webgl/example/dress-up.html#L124
Avatar
Mario

Mario
  • Postovi: 3033


Natrag na Unity