Examples of Tile


Examples of tiled.core.Tile

                        set.importTileBitmap(sourcePath, new BasicTileCutter(
                                tileWidth, tileHeight, tileSpacing, tileMargin));
                    }
                }
                else if (child.getNodeName().equalsIgnoreCase("tile")) {
                    Tile tile = unmarshalTile(set, child, tilesetBaseDir);
                    if (!hasTilesetImage || tile.getId() > set.getMaxTileId()) {
                        set.addTile(tile);
                    } else {
                        Tile myTile = set.getTile(tile.getId());
                        myTile.setProperties(tile.getProperties());
                        //TODO: there is the possibility here of overlaying images,
                        //      which some people may want
                    }
                }
            }
View Full Code Here

Examples of tiled.core.Tile

    }

    private Tile unmarshalTile(TileSet set, Node t, String baseDir)
        throws Exception
    {
        Tile tile = null;
        NodeList children = t.getChildNodes();
        boolean isAnimated = false;

        for (int i = 0; i < children.getLength(); i++) {
            Node child = children.item(i);
            if ("animation".equalsIgnoreCase(child.getNodeName())) {
                isAnimated = true;
                break;
            }
        }

        try {
            if (isAnimated) {
                tile = (Tile) unmarshalClass(AnimatedTile.class, t);
            } else {
                tile = (Tile) unmarshalClass(Tile.class, t);
            }
        } catch (Exception e) {
            error = "Failed creating tile: " + e.getLocalizedMessage();
            return tile;
        }

        tile.setTileSet(set);

        readProperties(children, tile.getProperties());

        for (int i = 0; i < children.getLength(); i++) {
            Node child = children.item(i);
            if ("image".equalsIgnoreCase(child.getNodeName())) {
                Image img = unmarshalImage(child, baseDir);
                tile.setImage(img);
            } else if ("animation".equalsIgnoreCase(child.getNodeName())) {
                // TODO: fill this in once TMXMapWriter is complete
            }
        }
View Full Code Here

Examples of tiled.core.Tile

     * Helper method to get the tile based on its global id
     * @param tileId    global id of the tile
     * @return    <ul><li>{@link Tile} object corresponding to the global id, if found</li><li><code>null</code>, otherwise</li></ul>
     */
    private Tile getTileForTileGID(int tileId) {
        Tile tile = null;
        java.util.Map.Entry<Integer, TileSet> ts = findTileSetForTileGID(tileId);
        if (ts != null) {
            tile = ts.getValue().getTile(tileId - ts.getKey());
        }
        return tile;
View Full Code Here

Examples of tiled.core.Tile

        final int endY = Math.min(layer.getHeight(),
                (int) Math.ceil(clip.getMaxY() / tileHeight));

        for (int x = startX; x < endX; ++x) {
            for (int y = startY; y < endY; ++y) {
                final Tile tile = layer.getTileAt(x, y);
                if (tile == null)
                    continue;
                final Image image = tile.getImage();
                if (image == null)
                    continue;

                g.drawImage(
                        image,
View Full Code Here

Examples of trackerModule.sim.tracker.World.Tile

    if( xTile < 0 || yTile < 0 || xTile >= width || yTile >= height )
      return;
   
    World.This().setTile(xTile, yTile, str);
         
    Tile t = World.This().getLocation(str);
    if( t != null ){
      t.x = xTile;
      t.y = yTile;
    }
  }
View Full Code Here

Examples of transientlibs.maps.tiles.Tile

        for (double x = x1; x <= x2; x += xStep) {
            for (double y = y1; y <= y2; y += yStep) {
                int ix = (int) x;
                int iy = (int) y;
                Tile targetTile = mo.onMap.getTile(ix, iy);
                result = result || (targetTile != null && targetTile.terrain.moveCost == -1);
            }
        }

        }
View Full Code Here

Examples of vindinium.Board.Tile

    public Direction nearestAvailableMine(final Hero player, final Board board) {
        return new PathFinder(false, player, board).findNearest(new Predicate<PathFinder.State>() {
            @Override
            public boolean apply(PathFinder.State state) {
                Tile t = board.tileAt(state.hero.position);
                return t instanceof Mine && !((Mine) t).isOwnedBy(player);
            }
        });
    }
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.