Package com.badlogic.gdx.utils

Examples of com.badlogic.gdx.utils.Json.readValue()


        json.writeObjectEnd();
      }

      public Object read (Json json, Object jsonData, Class type) {
        String name = json.readValue("name", String.class, jsonData);
        Color color = json.readValue("color", Color.class, jsonData);
        return new NinePatch(getResource(name, NinePatch.class), color);
      }
    });

    return json;
View Full Code Here


      }

      private void readNamedObjects (Json json, Class type, ObjectMap<String, ObjectMap> valueMap, boolean isResource) {
        for (Entry<String, ObjectMap> valueEntry : valueMap.entries()) {
          String name = valueEntry.key;
          Object object = json.readValue(type, valueEntry.value);
          if (object == null) continue;
          try {
            if (isResource)
              addResource(name, object);
            else
View Full Code Here

        json.writeObjectEnd();
      }

      public TextureRegion read (Json json, Object jsonData, Class type) {
        if (jsonData instanceof String) return getResource((String)jsonData, TextureRegion.class);
        int x = json.readValue("x", int.class, jsonData);
        int y = json.readValue("y", int.class, jsonData);
        int width = json.readValue("width", int.class, jsonData);
        int height = json.readValue("height", int.class, jsonData);
        return new TextureRegion(skin.texture, x, y, width, height);
      }
View Full Code Here

      }

      public TextureRegion read (Json json, Object jsonData, Class type) {
        if (jsonData instanceof String) return getResource((String)jsonData, TextureRegion.class);
        int x = json.readValue("x", int.class, jsonData);
        int y = json.readValue("y", int.class, jsonData);
        int width = json.readValue("width", int.class, jsonData);
        int height = json.readValue("height", int.class, jsonData);
        return new TextureRegion(skin.texture, x, y, width, height);
      }
    });
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.