Tabnine Logo
TiledMapTileSet.getProperties
Code IndexAdd Tabnine to your IDE (free)

How to use
getProperties
method
in
com.badlogic.gdx.maps.tiled.TiledMapTileSet

Best Java code snippets using com.badlogic.gdx.maps.tiled.TiledMapTileSet.getProperties (Showing top 20 results out of 315)

origin: libgdx/libgdx

/** Constructs a Tile Set layout. The tile set image contained in the baseDir should be the original tile set images before
 * being processed by {@link TiledMapPacker} (the ones actually read by Tiled).
 * @param tileset the tile set to process
 * @param baseDir the directory in which the tile set image is stored */
protected TileSetLayout (int firstgid, TiledMapTileSet tileset, FileHandle baseDir) throws IOException {
  int tileWidth = tileset.getProperties().get("tilewidth", Integer.class);
  int tileHeight = tileset.getProperties().get("tileheight", Integer.class);
  int margin = tileset.getProperties().get("margin", Integer.class);
  int spacing = tileset.getProperties().get("spacing", Integer.class);
  this.firstgid = firstgid;
  image = ImageIO.read(baseDir.child(tileset.getProperties().get("imagesource", String.class)).read());
  imageTilePositions = new IntMap<Vector2>();
  // fill the tile regions
  int x, y, tile = 0;
  numRows = 0;
  numCols = 0;
  int stopWidth = image.getWidth() - tileWidth;
  int stopHeight = image.getHeight() - tileHeight;
  for (y = margin; y <= stopHeight; y += tileHeight + spacing) {
    for (x = margin; x <= stopWidth; x += tileWidth + spacing) {
      if (y == margin) numCols++;
      imageTilePositions.put(tile, new Vector2(x, y));
      tile++;
    }
    numRows++;
  }
  numTiles = numRows * numCols;
}
origin: libgdx/libgdx

/** Constructs a Tile Set layout. The tile set image contained in the baseDir should be the original tile set images before
 * being processed by {@link TiledMapPacker} (the ones actually read by Tiled).
 * @param tileset the tile set to process
 * @param baseDir the directory in which the tile set image is stored */
protected TileSetLayout (int firstgid, TiledMapTileSet tileset, FileHandle baseDir) throws IOException {
  int tileWidth = tileset.getProperties().get("tilewidth", Integer.class);
  int tileHeight = tileset.getProperties().get("tileheight", Integer.class);
  int margin = tileset.getProperties().get("margin", Integer.class);
  int spacing = tileset.getProperties().get("spacing", Integer.class);
  this.firstgid = firstgid;
  image = ImageIO.read(baseDir.child(tileset.getProperties().get("imagesource", String.class)).read());
  imageTilePositions = new IntMap<Vector2>();
  // fill the tile regions
  int x, y, tile = 0;
  numRows = 0;
  numCols = 0;
  int stopWidth = image.getWidth() - tileWidth;
  int stopHeight = image.getHeight() - tileHeight;
  for (y = margin; y <= stopHeight; y += tileHeight + spacing) {
    for (x = margin; x <= stopWidth; x += tileWidth + spacing) {
      if (y == margin) numCols++;
      imageTilePositions.put(tile, new Vector2(x, y));
      tile++;
    }
    numRows++;
  }
  numTiles = numRows * numCols;
}
origin: libgdx/libgdx

private String tilesetNameFromTileId (TiledMap map, int tileid) {
  String name = "";
  if (tileid == 0) {
    return "";
  }
  for (TiledMapTileSet tileset : map.getTileSets()) {
    int firstgid = tileset.getProperties().get("firstgid", -1, Integer.class);
    if (firstgid == -1) continue; // skip this tileset
    if (tileid >= firstgid) {
      name = tileset.getName();
    } else {
      return name;
    }
  }
  return name;
}
origin: libgdx/libgdx

private String tilesetNameFromTileId (TiledMap map, int tileid) {
  String name = "";
  if (tileid == 0) {
    return "";
  }
  for (TiledMapTileSet tileset : map.getTileSets()) {
    int firstgid = tileset.getProperties().get("firstgid", -1, Integer.class);
    if (firstgid == -1) continue; // skip this tileset
    if (tileid >= firstgid) {
      name = tileset.getName();
    } else {
      return name;
    }
  }
  return name;
}
origin: libgdx/libgdx

int tileWidth = set.getProperties().get("tilewidth", Integer.class);
int tileHeight = set.getProperties().get("tileheight", Integer.class);
int firstgid = set.getProperties().get("firstgid", Integer.class);
String imageName = set.getProperties().get("imagesource", String.class);
origin: libgdx/libgdx

int tileWidth = set.getProperties().get("tilewidth", Integer.class);
int tileHeight = set.getProperties().get("tileheight", Integer.class);
int firstgid = set.getProperties().get("firstgid", Integer.class);
String imageName = set.getProperties().get("imagesource", String.class);
origin: libgdx/libgdx

tileset.getProperties().put("firstgid", firstgid);
int gid = firstgid;
  loadProperties(tileset.getProperties(), properties);
origin: libgdx/libgdx

tileset.getProperties().put("firstgid", firstgid);
int gid = firstgid;
  loadProperties(tileset.getProperties(), properties);
origin: libgdx/libgdx

if (name.equals("TileSheet")) {
  currentTileSet = tilesets.getTileSet(currentChild.getAttribute("Ref"));
  firstgid = currentTileSet.getProperties().get("firstgid", Integer.class);
} else if (name.equals("Null")) {
  x += currentChild.getIntAttribute("Count");
    if (frameName.equals("TileSheet")) {
      currentTileSet = tilesets.getTileSet(frame.getAttribute("Ref"));
      firstgid = currentTileSet.getProperties().get("firstgid", Integer.class);
    } else if (frameName.equals("Static")) {
      frameTiles.add((StaticTiledMapTile)currentTileSet.getTile(firstgid + frame.getIntAttribute("Index")));
origin: libgdx/libgdx

if (name.equals("TileSheet")) {
  currentTileSet = tilesets.getTileSet(currentChild.getAttribute("Ref"));
  firstgid = currentTileSet.getProperties().get("firstgid", Integer.class);
} else if (name.equals("Null")) {
  x += currentChild.getIntAttribute("Count");
    if (frameName.equals("TileSheet")) {
      currentTileSet = tilesets.getTileSet(frame.getAttribute("Ref"));
      firstgid = currentTileSet.getProperties().get("firstgid", Integer.class);
    } else if (frameName.equals("Static")) {
      frameTiles.add((StaticTiledMapTile)currentTileSet.getTile(firstgid + frame.getIntAttribute("Index")));
origin: libgdx/libgdx

String tilesetCustomValue = tileset.getProperties().get(TILESET_PROPERTY_NAME, String.class);
if (!TILESET_PROPERTY_VALUE.equals(tilesetCustomValue)) {
  throw new RuntimeException("Failed to get tileset properties");
origin: libgdx/libgdx

tileset.getProperties().put("firstgid", firstgid);
if (image != null) {
  TextureRegion texture = imageResolver.getImage(image.path());
  MapProperties props = tileset.getProperties();
  props.put("imagesource", imageSource);
  props.put("imagewidth", imageWidth);
  loadProperties(tileset.getProperties(), properties);
origin: libgdx/libgdx

MapProperties props = tileset.getProperties();
tileset.setName(name);
props.put("firstgid", firstgid);
  loadProperties(tileset.getProperties(), properties);
origin: libgdx/libgdx

tileset.getProperties().put("firstgid", firstgid);
if (image != null) {
  TextureRegion texture = imageResolver.getImage(image.path());
  MapProperties props = tileset.getProperties();
  props.put("imagesource", imageSource);
  props.put("imagewidth", imageWidth);
  loadProperties(tileset.getProperties(), properties);
origin: libgdx/libgdx

MapProperties props = tileset.getProperties();
tileset.setName(name);
props.put("firstgid", firstgid);
  loadProperties(tileset.getProperties(), properties);
origin: com.badlogicgames.gdx/gdx-tools

/** Constructs a Tile Set layout. The tile set image contained in the baseDir should be the original tile set images before
 * being processed by {@link TiledMapPacker} (the ones actually read by Tiled).
 * @param tileset the tile set to process
 * @param baseDir the directory in which the tile set image is stored */
protected TileSetLayout (int firstgid, TiledMapTileSet tileset, FileHandle baseDir) throws IOException {
  int tileWidth = tileset.getProperties().get("tilewidth", Integer.class);
  int tileHeight = tileset.getProperties().get("tileheight", Integer.class);
  int margin = tileset.getProperties().get("margin", Integer.class);
  int spacing = tileset.getProperties().get("spacing", Integer.class);
  this.firstgid = firstgid;
  image = ImageIO.read(baseDir.child(tileset.getProperties().get("imagesource", String.class)).read());
  imageTilePositions = new IntMap<Vector2>();
  // fill the tile regions
  int x, y, tile = 0;
  numRows = 0;
  numCols = 0;
  int stopWidth = image.getWidth() - tileWidth;
  int stopHeight = image.getHeight() - tileHeight;
  for (y = margin; y <= stopHeight; y += tileHeight + spacing) {
    for (x = margin; x <= stopWidth; x += tileWidth + spacing) {
      if (y == margin) numCols++;
      imageTilePositions.put(tile, new Vector2(x, y));
      tile++;
    }
    numRows++;
  }
  numTiles = numRows * numCols;
}
origin: com.badlogicgames.gdx/gdx-tools

private String tilesetNameFromTileId (TiledMap map, int tileid) {
  String name = "";
  if (tileid == 0) {
    return "";
  }
  for (TiledMapTileSet tileset : map.getTileSets()) {
    int firstgid = tileset.getProperties().get("firstgid", -1, Integer.class);
    if (firstgid == -1) continue; // skip this tileset
    if (tileid >= firstgid) {
      name = tileset.getName();
    } else {
      return name;
    }
  }
  return name;
}
origin: com.badlogicgames.gdx/gdx-tools

int tileWidth = set.getProperties().get("tilewidth", Integer.class);
int tileHeight = set.getProperties().get("tileheight", Integer.class);
int firstgid = set.getProperties().get("firstgid", Integer.class);
String imageName = set.getProperties().get("imagesource", String.class);
origin: com.badlogicgames.gdx/gdx

tileset.getProperties().put("firstgid", firstgid);
int gid = firstgid;
  loadProperties(tileset.getProperties(), properties);
origin: com.badlogicgames.gdx/gdx

if (name.equals("TileSheet")) {
  currentTileSet = tilesets.getTileSet(currentChild.getAttribute("Ref"));
  firstgid = currentTileSet.getProperties().get("firstgid", Integer.class);
} else if (name.equals("Null")) {
  x += currentChild.getIntAttribute("Count");
    if (frameName.equals("TileSheet")) {
      currentTileSet = tilesets.getTileSet(frame.getAttribute("Ref"));
      firstgid = currentTileSet.getProperties().get("firstgid", Integer.class);
    } else if (frameName.equals("Static")) {
      frameTiles.add((StaticTiledMapTile)currentTileSet.getTile(firstgid + frame.getIntAttribute("Index")));
com.badlogic.gdx.maps.tiledTiledMapTileSetgetProperties

Popular methods of TiledMapTileSet

  • getTile
    Gets the TiledMapTile that has the given id.
  • getName
  • <init>
    Creates empty tileset
  • putTile
    Adds or replaces tile with that id
  • setName
  • size

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • Kernel (java.awt.image)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now