I need to be able to change Spine characters on the fly. User can select which character to use and the json
and atlas
are updated accordingly.
I figured it would be as simple as to replace the SkeletonData, Atlas and related objects in my ApplicationAdapter
and it almost was, but the result is just black meshes. For some reason the textures are not updated. The shape is there because the meshes are loaded correctly, but it's just filled black.
I did not change or recreate OrthographicCamera
, SkeletonRenderer
or PolygonSpriteBatch
objects. I tried to dispose PolygonSpriteBatch
and create a new one, but I got the following error: java.lang.IllegalArgumentException: Error compiling shader
.
I can't use skins because the skeletons and animations are so different. Is there something that need to be disposed that I didn't? I assume I'm just missing something obvious. What would be the recommended way to do something like this?
EDIT:
Turns out replacing the whole fragment (extends AndroidFragmentApplication
) works.