colinbou

Hello

Could I packaging animation without complex texture file ?

I just want seperate sources textures files when I load animation.

I want to draw dynamically under the texture in my application and load the new texture modified with the animation prepared with spine.

Is it possible ?

Thanks
colinbou
  • Posts: 5

Nate

The textures you use are completely separate from the skeleton data. You could use the skeleton data and poses from animations without any textures at all. For example, to position UI elements. You are in full control of loading textures at runtime.
User avatar
Nate

Nate
  • Posts: 12020

colinbou

package.JPG

Here I see one image with multiple entity.

I would like to replace dynamically in my application one entity fo example.

You confirm that is possible ?
You do not have the required permissions to view the files attached to this post.
colinbou
  • Posts: 5

Nate

It is, see:
Loading Skeleton Data - Spine Runtimes Guide: AttachmentLoader
You will need to create an attachment (or modify an existing attachment) to setup the rendererObject and other settings (UVs, width, height) to draw from a different texture. The work you need to do is very similar to AtlasAttachmentLoader, so you can look at that source code to get an idea of what you need to do. After the AttachmentLoader, the skeleton data loader (SkeletonJson or SkeletonBinary) does a little more setup, some of which you may need:
https://github.com/EsotericSoftware/spine-runtimes/blob/4.0/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonJson.java#L362

Those two things (AtlasAttachmentLoader and SkeletonJson or SkeletonBinary) are all the code that creates a new attachment. You need to do the same, but configure the attachment for your own texture rather than from the same atlas the rest of the skeleton uses.

The rendererObject depends on what game toolkit you use, so be sure to look at how the atlas attachment loader works for your game toolkit.
User avatar
Nate

Nate
  • Posts: 12020


Return to Off-topic