Package com.badlogic.gdx.utils

Examples of com.badlogic.gdx.utils.JsonReader


    if (file == null) throw new IllegalArgumentException("file cannot be null.");

    SkeletonData skeletonData = new SkeletonData();
    skeletonData.setName(file.nameWithoutExtension());

    JsonValue root = new JsonReader().parse(file);

    // Bones.
    for (JsonValue boneMap = root.getChild("bones"); boneMap != null; boneMap = boneMap.next()) {
      BoneData parent = null;
      String parentName = boneMap.getString("parent", null);
View Full Code Here


          ModelLoader modelLoader = null;
          if(resource.endsWith(".obj")){
            modelLoader = new ObjLoader(new AbsoluteFileHandleResolver());
          }
          else if(resource.endsWith(".g3dj")){
            modelLoader = new G3dModelLoader(new JsonReader(), new AbsoluteFileHandleResolver());
          }
          else if(resource.endsWith(".g3db")){
            modelLoader = new G3dModelLoader(new UBJsonReader(), new AbsoluteFileHandleResolver());
          }
          else throw new Exception();
View Full Code Here

    return super.process(inputFile, outputRoot);
  }

  private void merge (Settings settings, File settingsFile) {
    try {
      json.readFields(settings, new JsonReader().parse(new FileReader(settingsFile)));
    } catch (Exception ex) {
      throw new GdxRuntimeException("Error reading settings file: " + settingsFile, ex);
    }
  }
View Full Code Here

        }
      }
      if (settings == null) settings = new Settings(defaultSettings);
      // Merge settings from current directory.
      try {
        json.readFields(settings, new JsonReader().parse(new FileReader(settingsFile)));
      } catch (SerializationException ex) {
        throw new GdxRuntimeException("Error reading settings file: " + settingsFile, ex);
      }
      dirToSettings.put(settingsFile.getParentFile(), settings);
    }
View Full Code Here

    setLoader(Texture.class, new TextureLoader(resolver));
    setLoader(Skin.class, new SkinLoader(resolver));
    setLoader(ParticleEffect.class, new ParticleEffectLoader(resolver));
    setLoader(PolygonRegion.class, new PolygonRegionLoader(resolver));
    setLoader(I18NBundle.class, new I18NBundleLoader(resolver));
    setLoader(Model.class, ".g3dj", new G3dModelLoader(new JsonReader(), resolver));
    setLoader(Model.class, ".g3db", new G3dModelLoader(new UBJsonReader(), resolver));
    setLoader(Model.class, ".obj", new ObjLoader(resolver));
    executor = new AsyncExecutor(1);
  }
View Full Code Here

    float scale = this.scale;

    SkeletonData skeletonData = new SkeletonData();
    skeletonData.name = file.nameWithoutExtension();

    JsonValue root = new JsonReader().parse(file);

    // Skeleton.
    JsonValue skeletonMap = root.get("skeleton");
    if (skeletonMap != null) {
      skeletonData.hash = skeletonMap.getString("hash", null);
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.utils.JsonReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.