Package com.badlogic.gdx.utils

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


          && patches[4] != null && patches[5] == null && patches[6] == null && patches[7] == null && patches[8] == null;
        if (ninePatch.getColor() != null) {
          json.writeObjectStart();
          json.writeValue("color", ninePatch.getColor());
          if (singlePatch)
            json.writeValue("region", patches[4]);
          else
            json.writeValue("regions", patches);
          json.writeObjectEnd();
        } else {
          if (singlePatch)
View Full Code Here


          json.writeObjectStart();
          json.writeValue("color", ninePatch.getColor());
          if (singlePatch)
            json.writeValue("region", patches[4]);
          else
            json.writeValue("regions", patches);
          json.writeObjectEnd();
        } else {
          if (singlePatch)
            json.writeValue(patches[4]);
          else
View Full Code Here

          else
            json.writeValue("regions", patches);
          json.writeObjectEnd();
        } else {
          if (singlePatch)
            json.writeValue(patches[4]);
          else
            json.writeValue(patches);
        }
      }
View Full Code Here

          json.writeObjectEnd();
        } else {
          if (singlePatch)
            json.writeValue(patches[4]);
          else
            json.writeValue(patches);
        }
      }

      public NinePatch read (Json json, Object jsonData, Class type) {
        if (jsonData instanceof String) return getResource((String)jsonData, NinePatch.class);
View Full Code Here

      }

      public void write (Json json, Object object, Class valueType) {
        for (Entry<String, ?> entry : map.entries()) {
          if (entry.value.equals(object)) {
            json.writeValue(entry.key);
            return;
          }
        }
        throw new SerializationException(object.getClass().getSimpleName() + " not found: " + object);
      }
View Full Code Here

    }

    json.setSerializer(Skin.class, new Serializer<Skin>() {
      public void write (Json json, Skin skin, Class valueType) {
        json.writeObjectStart();
        json.writeValue("resources", skin.resources);
        for (Entry<Class, ObjectMap<String, Object>> entry : resources.entries())
          json.setSerializer(entry.key, new AliasWriter(entry.key));
        json.writeField(skin, "styles");
        json.writeObjectEnd();
      }
View Full Code Here

    });

    json.setSerializer(TextureRegion.class, new Serializer<TextureRegion>() {
      public void write (Json json, TextureRegion region, Class valueType) {
        json.writeObjectStart();
        json.writeValue("x", region.getRegionX());
        json.writeValue("y", region.getRegionY());
        json.writeValue("width", region.getRegionWidth());
        json.writeValue("height", region.getRegionHeight());
        json.writeObjectEnd();
      }
View Full Code Here

    json.setSerializer(TextureRegion.class, new Serializer<TextureRegion>() {
      public void write (Json json, TextureRegion region, Class valueType) {
        json.writeObjectStart();
        json.writeValue("x", region.getRegionX());
        json.writeValue("y", region.getRegionY());
        json.writeValue("width", region.getRegionWidth());
        json.writeValue("height", region.getRegionHeight());
        json.writeObjectEnd();
      }
View Full Code Here

    json.setSerializer(TextureRegion.class, new Serializer<TextureRegion>() {
      public void write (Json json, TextureRegion region, Class valueType) {
        json.writeObjectStart();
        json.writeValue("x", region.getRegionX());
        json.writeValue("y", region.getRegionY());
        json.writeValue("width", region.getRegionWidth());
        json.writeValue("height", region.getRegionHeight());
        json.writeObjectEnd();
      }

      public TextureRegion read (Json json, Object jsonData, Class type) {
View Full Code Here

      public void write (Json json, TextureRegion region, Class valueType) {
        json.writeObjectStart();
        json.writeValue("x", region.getRegionX());
        json.writeValue("y", region.getRegionY());
        json.writeValue("width", region.getRegionWidth());
        json.writeValue("height", region.getRegionHeight());
        json.writeObjectEnd();
      }

      public TextureRegion read (Json json, Object jsonData, Class type) {
        if (jsonData instanceof String) return getResource((String)jsonData, TextureRegion.class);
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.