batch = new PolygonSpriteBatch();
renderer = new SkeletonRenderer();
renderer.setPremultipliedAlpha(true);
{
TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("spineboy/spineboy.atlas"));
SkeletonJson json = new SkeletonJson(atlas);
json.setScale(0.6f);
SkeletonData skeletonData = json.readSkeletonData(Gdx.files.internal("spineboy/spineboy.json"));
spineboy = new Skeleton(skeletonData);
spineboy.setPosition(320, 20);
AnimationStateData stateData = new AnimationStateData(skeletonData);
stateData.setMix("walk", "jump", 0.2f);
stateData.setMix("jump", "walk", 0.2f);
spineboyState = new AnimationState(stateData);
new AnimationStateAdapter() {
public void start (int trackIndex) {
spineboyState.addAnimation(0, "walk", true, 0);
spineboyState.addAnimation(0, "jump", false, 3).setListener(this);
}
}.start(0);
}
{
TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("goblins/goblins-ffd.atlas"));
SkeletonJson json = new SkeletonJson(atlas);
SkeletonData skeletonData = json.readSkeletonData(Gdx.files.internal("goblins/goblins-ffd.json"));
goblin = new Skeleton(skeletonData);
goblin.setSkin("goblin");
goblin.setSlotsToSetupPose();