Search in sources :

Example 1 with SceneJson

use of io.github.voidzombie.nhglib.data.models.serialization.SceneJson in project nhglib by VoidZombie.

the class SceneLoader method getScene.

private Scene getScene(byte[] bytes) {
    Scene scene = null;
    try {
        String json = new String(bytes, "UTF-8");
        SceneJson sceneJson = new SceneJson(entities);
        sceneJson.parse(new JsonReader().parse(json).get("scene"));
        scene = sceneJson.get();
    } catch (UnsupportedEncodingException e) {
        if (Nhg.debugLogs)
            e.printStackTrace();
    }
    return scene;
}
Also used : SceneJson(io.github.voidzombie.nhglib.data.models.serialization.SceneJson) JsonReader(com.badlogic.gdx.utils.JsonReader) UnsupportedEncodingException(java.io.UnsupportedEncodingException) Scene(io.github.voidzombie.nhglib.graphics.scenes.Scene)

Aggregations

JsonReader (com.badlogic.gdx.utils.JsonReader)1 SceneJson (io.github.voidzombie.nhglib.data.models.serialization.SceneJson)1 Scene (io.github.voidzombie.nhglib.graphics.scenes.Scene)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1