Package tiled.mapeditor.brush

Examples of tiled.mapeditor.brush.ShapeBrush


    private void initPresets() {
        int[] dimensions = { 1, 2, 4, 8, 12, 20 };

        for (int n = 1; n < dimensions.length; n++) {
            ShapeBrush brush = new ShapeBrush();
            brush.makeCircleBrush(dimensions[n] / 2);
            brushes.add(brush);
        }

        for (int n = 0; n < dimensions.length; n++) {
            ShapeBrush brush = new ShapeBrush();
            brush.makeQuadBrush(new Rectangle(0, 0, dimensions[n], dimensions[n]));
            brushes.add(brush);
        }
    }
View Full Code Here


    public void resetBrush() {
        //FIXME: this is an in-elegant hack, but it gets the user out
        //       of custom brush mode
        //(reset the brush if necessary)
        if (currentBrush instanceof CustomBrush) {
            ShapeBrush sb = new ShapeBrush();
            sb.makeQuadBrush(new Rectangle(0, 0, 1, 1));
            sb.setTile(currentTile);
            setBrush(sb);
        }
    }
View Full Code Here

      if(currentMap == newMap) return;
        currentMap = newMap;
        boolean mapLoaded = currentMap != null;

        // Create a default brush (protect against a bug with custom brushes)
        ShapeBrush sb = new ShapeBrush();
        sb.makeQuadBrush(new Rectangle(0, 0, 1, 1));
        setBrush(sb);

        tabbedTilesetsPane.setMap(currentMap);

        if (!mapLoaded) {
View Full Code Here

    cursorHighlight = new SelectionLayer(1, 1);
    cursorHighlight.select(0, 0);
    cursorHighlight.setVisible(prefs.getBoolean("cursorhighlight", true));

    ShapeBrush sb = new ShapeBrush();
    sb.makeQuadBrush(new Rectangle(0, 0, 1, 1));
    setBrush(sb);
    setCurrentMap(currentMap);
    init = false;
   
    Display.getDefault().asyncExec(new Runnable() {
View Full Code Here

  public void resetBrush() {
    // FIXME: this is an in-elegant hack, but it gets the user out
    // of custom brush mode
    // (reset the brush if necessary)
    if (currentBrush instanceof CustomBrush) {
      ShapeBrush sb = new ShapeBrush();
      sb.makeQuadBrush(new Rectangle(0, 0, 1, 1));
      sb.setTile(currentTile);
      setBrush(sb);
    }
  }
View Full Code Here

    currentMap = newMap;
//    boolean mapLoaded = currentMap != null;

    // Create a default brush (protect against a bug with custom brushes)
    ShapeBrush sb = new ShapeBrush();
    sb.makeQuadBrush(new Rectangle(0, 0, 1, 1));
    setBrush(sb);

    // Get the first non-null tile from the first tileset containing
    // non-null tiles.
    Vector<TileSet> tilesets = currentMap.getTilesets();
View Full Code Here

TOP

Related Classes of tiled.mapeditor.brush.ShapeBrush

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.