private void loadProperties (MapProperties properties, Element element) { if (element.getName().equals("Properties")) { for (Element property : element.getChildrenByName("Property")) { String key = property.getAttribute("Key", null); String type = property.getAttribute("Type", null); String value = property.getText(); if (type.equals("Int32")) { properties.put(key, Integer.parseInt(value)); } else if (type.equals("String")) { properties.put(key, value); } else if (type.equals("Boolean")) { properties.put(key, value.equalsIgnoreCase("true")); } else { properties.put(key, value); } } } }
private void loadProperties (MapProperties properties, Element element) { if (element.getName().equals("Properties")) { for (Element property : element.getChildrenByName("Property")) { String key = property.getAttribute("Key", null); String type = property.getAttribute("Type", null); String value = property.getText(); if (type.equals("Int32")) { properties.put(key, Integer.parseInt(value)); } else if (type.equals("String")) { properties.put(key, value); } else if (type.equals("Boolean")) { properties.put(key, value.equalsIgnoreCase("true")); } else { properties.put(key, value); } } } }
mapProperties.put("orientation", mapOrientation); mapProperties.put("width", mapWidth); mapProperties.put("height", mapHeight); mapProperties.put("tilewidth", tileWidth); mapProperties.put("tileheight", tileHeight); if (mapBackgroundColor != null) { mapProperties.put("backgroundcolor", mapBackgroundColor);
mapProperties.put("orientation", mapOrientation); mapProperties.put("width", mapWidth); mapProperties.put("height", mapHeight); mapProperties.put("tilewidth", tileWidth); mapProperties.put("tileheight", tileHeight); if (mapBackgroundColor != null) { mapProperties.put("backgroundcolor", mapBackgroundColor);
mapProperties.put("orientation", mapOrientation); mapProperties.put("width", mapWidth); mapProperties.put("height", mapHeight); mapProperties.put("tilewidth", tileWidth); mapProperties.put("tileheight", tileHeight); mapProperties.put("hexsidelength", hexSideLength); if (staggerAxis != null) { mapProperties.put("staggeraxis", staggerAxis); mapProperties.put("staggerindex", staggerIndex); mapProperties.put("backgroundcolor", mapBackgroundColor);
mapProperties.put("orientation", mapOrientation); mapProperties.put("width", mapWidth); mapProperties.put("height", mapHeight); mapProperties.put("tilewidth", tileWidth); mapProperties.put("tileheight", tileHeight); mapProperties.put("hexsidelength", hexSideLength); if (staggerAxis != null) { mapProperties.put("staggeraxis", staggerAxis); mapProperties.put("staggerindex", staggerIndex); mapProperties.put("backgroundcolor", mapBackgroundColor);
protected void loadProperties (MapProperties properties, Element element) { if (element == null) return; if (element.getName().equals("properties")) { for (Element property : element.getChildrenByName("property")) { String name = property.getAttribute("name", null); String value = property.getAttribute("value", null); String type = property.getAttribute("type", null); if (value == null) { value = property.getText(); } Object castValue = castProperty(name, value, type); properties.put(name, castValue); } } }
protected void loadProperties (MapProperties properties, Element element) { if (element == null) return; if (element.getName().equals("properties")) { for (Element property : element.getChildrenByName("property")) { String name = property.getAttribute("name", null); String value = property.getAttribute("value", null); String type = property.getAttribute("type", null); if (value == null) { value = property.getText(); } Object castValue = castProperty(name, value, type); properties.put(name, castValue); } } }
tileset.getProperties().put("firstgid", firstgid); int gid = firstgid;
tileset.getProperties().put("firstgid", firstgid); int gid = firstgid;
TiledMapTileMapObject tiledMapTileMapObject = new TiledMapTileMapObject(tile, flipHorizontally, flipVertically); TextureRegion textureRegion = tiledMapTileMapObject.getTextureRegion(); tiledMapTileMapObject.getProperties().put("gid", id); tiledMapTileMapObject.setX(x); tiledMapTileMapObject.setY(flipY ? y : y - height); String rotation = element.getAttribute("rotation", null); if (rotation != null) { object.getProperties().put("rotation", Float.parseFloat(rotation)); object.getProperties().put("type", type); object.getProperties().put("id", id); object.getProperties().put("x", x); object.getProperties().put("y", y); } else { object.getProperties().put("y", (flipY ? y - height : y)); object.getProperties().put("width", width); object.getProperties().put("height", height); object.setVisible(element.getIntAttribute("visible", 1) == 1); Element properties = element.getChildByName("properties");
TiledMapTileMapObject tiledMapTileMapObject = new TiledMapTileMapObject(tile, flipHorizontally, flipVertically); TextureRegion textureRegion = tiledMapTileMapObject.getTextureRegion(); tiledMapTileMapObject.getProperties().put("gid", id); tiledMapTileMapObject.setX(x); tiledMapTileMapObject.setY(flipY ? y : y - height); String rotation = element.getAttribute("rotation", null); if (rotation != null) { object.getProperties().put("rotation", Float.parseFloat(rotation)); object.getProperties().put("type", type); object.getProperties().put("id", id); object.getProperties().put("x", x); object.getProperties().put("y", y); } else { object.getProperties().put("y", (flipY ? y - height : y)); object.getProperties().put("width", width); object.getProperties().put("height", height); object.setVisible(element.getIntAttribute("visible", 1) == 1); Element properties = element.getChildByName("properties");
MapProperties props = tileset.getProperties(); tileset.setName(name); props.put("firstgid", firstgid); props.put("imagesource", imageSource); props.put("imagewidth", imageWidth); props.put("imageheight", imageHeight); props.put("tilewidth", tilewidth); props.put("tileheight", tileheight); props.put("margin", margin); props.put("spacing", spacing); String terrain = tileElement.getAttribute("terrain", null); if (terrain != null) { tile.getProperties().put("terrain", terrain); tile.getProperties().put("probability", probability); tile.getProperties().put("terrain", terrain); tile.getProperties().put("probability", probability);
MapProperties props = tileset.getProperties(); tileset.setName(name); props.put("firstgid", firstgid); props.put("imagesource", imageSource); props.put("imagewidth", imageWidth); props.put("imageheight", imageHeight); props.put("tilewidth", tilewidth); props.put("tileheight", tileheight); props.put("margin", margin); props.put("spacing", spacing); String terrain = tileElement.getAttribute("terrain", null); if (terrain != null) { tile.getProperties().put("terrain", terrain); tile.getProperties().put("probability", probability); tile.getProperties().put("terrain", terrain); tile.getProperties().put("probability", probability);
tileset.getProperties().put("firstgid", firstgid); if (image != null) { TextureRegion texture = imageResolver.getImage(image.path()); props.put("imagesource", imageSource); props.put("imagewidth", imageWidth); props.put("imageheight", imageHeight); props.put("tilewidth", tilewidth); props.put("tileheight", tileheight); props.put("margin", margin); props.put("spacing", spacing); tile.getProperties().put("terrain", terrain); tile.getProperties().put("probability", probability);
tileset.getProperties().put("firstgid", firstgid); if (image != null) { TextureRegion texture = imageResolver.getImage(image.path()); props.put("imagesource", imageSource); props.put("imagewidth", imageWidth); props.put("imageheight", imageHeight); props.put("tilewidth", tilewidth); props.put("tileheight", tileheight); props.put("margin", margin); props.put("spacing", spacing); tile.getProperties().put("terrain", terrain); tile.getProperties().put("probability", probability);
private void loadProperties (MapProperties properties, Element element) { if (element.getName().equals("Properties")) { for (Element property : element.getChildrenByName("Property")) { String key = property.getAttribute("Key", null); String type = property.getAttribute("Type", null); String value = property.getText(); if (type.equals("Int32")) { properties.put(key, Integer.parseInt(value)); } else if (type.equals("String")) { properties.put(key, value); } else if (type.equals("Boolean")) { properties.put(key, value.equalsIgnoreCase("true")); } else { properties.put(key, value); } } } }
protected void loadProperties (MapProperties properties, Element element) { if (element.getName().equals("properties")) { for (Element property : element.getChildrenByName("property")) { String name = property.getAttribute("name", null); String value = property.getAttribute("value", null); if (value == null) { value = property.getText(); } properties.put(name, value); } } }
mapProperties.put("orientation", mapOrientation); mapProperties.put("width", mapWidth); mapProperties.put("height", mapHeight); mapProperties.put("tilewidth", tileWidth); mapProperties.put("tileheight", tileHeight); if (mapBackgroundColor != null) { mapProperties.put("backgroundcolor", mapBackgroundColor);
protected void loadProperties (MapProperties properties, Element element) { if (element == null) return; if (element.getName().equals("properties")) { for (Element property : element.getChildrenByName("property")) { String name = property.getAttribute("name", null); String value = property.getAttribute("value", null); String type = property.getAttribute("type", null); if (value == null) { value = property.getText(); } Object castValue = castProperty(name, value, type); properties.put(name, castValue); } } }