In the Spine editor everything works as expected. I can scale the root bone and it scales the whole skeleton without issues.
I haven't disabled inherit scale.
It happens only when scaling the root bone at runtime.
I just tried the stretchyman example and I can reproduce the issue.
Just try the following minimum sample and you should also see the issue. I used the files from here: Stretchyman example
public class SpineTest implements ApplicationListener {
private Skeleton skeleton;
private AnimationState animationState;
private SkeletonRenderer renderer;
private PolygonSpriteBatch batch;
@Override
public void create() {
TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("stretchyman.atlas"));
SkeletonJson json = new SkeletonJson(atlas);
SkeletonData data = json.readSkeletonData(Gdx.files.internal("stretchyman-pro.json"));
skeleton = new Skeleton(data);
AnimationStateData stateData = new AnimationStateData(data);
stateData.setDefaultMix(0.2f);
animationState = new AnimationState(stateData);
renderer = new SkeletonRenderer();
batch = new PolygonSpriteBatch();
}
@Override
public void resize(int width, int height) {}
@Override
public void render() {
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
Gdx.gl.glClearColor(0, 0, 0, 1);
float delta = Gdx.graphics.getDeltaTime();
animationState.update(delta);
animationState.apply(skeleton);
skeleton.setPosition(250, 250);
skeleton.getRootBone().setScale(0.5f);
skeleton.updateWorldTransform();
batch.begin();
renderer.draw(batch, skeleton);
batch.end();
}
@Override
public void pause() {}
@Override
public void resume() {}
@Override
public void dispose() {}
}
I would expect that the whole skeleton will be drawn at half its size but as you can see yourself it's totally off.
As a workaround to the issue, is it maybe possible to scale the viewport camera or the batch before drawing the skeleton and directly afterwards reset it again?