Package tiled.mapeditor.util.cutter

Examples of tiled.mapeditor.util.cutter.BasicTileCutter


     
      if (!setByName.containsKey(name)) {
        // The tileset's not yet included. Add it to the map
        TileSet set = new TileSet();
        set.setName(constructTilesetName(name));
        BasicTileCutter cutter = new BasicTileCutter(32, 32, 0, 0);
        set.importTileBitmap(name, cutter);
       
        setByName.put(name, set);
        map.addTileset(set);
      }
View Full Code Here


        cutter.setImage(tilebmp);

        tileDimensions = new Rectangle(cutter.getTileDimensions());
        if (cutter instanceof BasicTileCutter) {
            BasicTileCutter basicTileCutter = (BasicTileCutter) cutter;
            tileSpacing = basicTileCutter.getTileSpacing();
            tilesPerRow = basicTileCutter.getTilesPerRow();
        }

        Image tile = cutter.getNextTile();
        while (tile != null) {
            Tile newTile = new Tile();
View Full Code Here

                            int colorInt = Integer.parseInt(transStr, 16);
                            Color color = new Color(colorInt);
                            set.setTransparentColor(color);
                        }

                        set.importTileBitmap(sourcePath, new BasicTileCutter(
                                tileWidth, tileHeight, tileSpacing, 0));
                    } else {
                        Image image = unmarshalImage(child, tilesetBaseDir);
                        String idValue = getAttributeValue(child, "id");
                        int imageId = Integer.parseInt(idValue);
View Full Code Here

                            int colorInt = Integer.parseInt(transStr, 16);
                            Color color = new Color(colorInt);
                            set.setTransparentColor(color);
                        }

                        set.importTileBitmap(sourcePath, new BasicTileCutter(
                                tileWidth, tileHeight, tileSpacing, 0));
                    } else {
                        Image image = unmarshalImage(child, tilesetBaseDir);
                        String idValue = getAttributeValue(child, "id");
                        int imageId = Integer.parseInt(idValue);
View Full Code Here

    }

    public TileCutter getCutter(int w, int h, int s) {
        final String selectedItem = (String) cutterBox.getSelectedItem();
        if (selectedItem.equalsIgnoreCase("basic")) {
            return new BasicTileCutter(w, h, s, 0);
        } else if (selectedItem.equalsIgnoreCase("border")) {
            return new BorderTileCutter();
        }

        return null;
View Full Code Here

        cutter.setImage(tileBitmap);

        Point size = cutter.getTileDimensions();
    tileDimensions = new Rectangle(0,0,size.x,size.y);
        if (cutter instanceof BasicTileCutter) {
            BasicTileCutter basicTileCutter = (BasicTileCutter) cutter;
            tileSpacing = basicTileCutter.getTileSpacing();
            tileMargin = basicTileCutter.getTileMargin();
            tilesPerRow = basicTileCutter.getTilesPerRow();
        }

        Image tileImage = cutter.getNextTile();
        while (tileImage != null) {
            Tile tile = new Tile();
View Full Code Here

//                      Color color = colorButton.getColor();
//                      newTileset.setTransparentColor(color);
//                  }

                  newTileset.importTileBitmap(file,
                          new BasicTileCutter(width, height, spacing, margin));
                  return newTileset;
              }
              catch (IOException e) {
                MessageDialog.openError(getParentShell(),"Error importing tileset",IMPORT_ERROR_MSG);
              }
View Full Code Here

                        if (transStr != null) {
                            int colorInt = Integer.parseInt(transStr, 16);
                            set.setTransparentColor(Converter.intToRGB(colorInt));
                        }

                        set.importTileBitmap(sourcePath, new BasicTileCutter(
                                tileWidth, tileHeight, tileSpacing, tileMargin));
                    } else {
                        Image image = unmarshalImage(child, tilesetBaseDir);
                        String idValue = getAttributeValue(child, "id");
                        int imageId = Integer.parseInt(idValue);
View Full Code Here

        cutter.setImage(tilebmp);

        Point size = cutter.getTileDimensions();
    tileDimensions = new Rectangle(0,0,size.x,size.y);
        if (cutter instanceof BasicTileCutter) {
            BasicTileCutter basicTileCutter = (BasicTileCutter) cutter;
            tileSpacing = basicTileCutter.getTileSpacing();
            tileMargin = basicTileCutter.getTileMargin();
            tilesPerRow = basicTileCutter.getTilesPerRow();
        }

        Image tile = cutter.getNextTile();
        while (tile != null) {
            Tile newTile = new Tile();
View Full Code Here

                            int colorInt = Integer.parseInt(transStr, 16);
                            set.setTransparentColor(Converter.intToRGB(colorInt));
                        }

                        set.importTileBitmap(sourcePath, new BasicTileCutter(
                                tileWidth, tileHeight, tileSpacing, tileMargin));
                    }
                }
                else if (child.getNodeName().equalsIgnoreCase("tile")) {
                    Tile tile = unmarshalTile(set, child, tilesetBaseDir);
View Full Code Here

TOP

Related Classes of tiled.mapeditor.util.cutter.BasicTileCutter

Copyright © 2018 www.massapicom. 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.