Search in sources :

Example 1 with SkeletonBinary

use of com.esotericsoftware.spine.SkeletonBinary in project bladecoder-adventure-engine by bladecoder.

the class SkeletonDataLoader method loadAsync.

@Override
public void loadAsync(AssetManager manager, String fileName, FileHandle file, SkeletonDataLoaderParameter parameter) {
    skeletonData = null;
    TextureAtlas atlas = manager.get(parameter.atlasName, TextureAtlas.class);
    String extension = file.extension();
    if (extension.toLowerCase().equals("skel")) {
        SkeletonBinary skeletonBinary = new SkeletonBinary(atlas);
        skeletonBinary.setScale(parameter.scale);
        skeletonData = skeletonBinary.readSkeletonData(file);
    } else {
        SkeletonJson skeletonJson = new SkeletonJson(atlas);
        skeletonJson.setScale(parameter.scale);
        skeletonData = skeletonJson.readSkeletonData(file);
    }
}
Also used : TextureAtlas(com.badlogic.gdx.graphics.g2d.TextureAtlas) SkeletonJson(com.esotericsoftware.spine.SkeletonJson) SkeletonBinary(com.esotericsoftware.spine.SkeletonBinary)

Aggregations

TextureAtlas (com.badlogic.gdx.graphics.g2d.TextureAtlas)1 SkeletonBinary (com.esotericsoftware.spine.SkeletonBinary)1 SkeletonJson (com.esotericsoftware.spine.SkeletonJson)1