Package de.yaams.extensions.basemap.tiled.mapeditor.brush

Examples of de.yaams.extensions.basemap.tiled.mapeditor.brush.ShapeBrush


  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);

    tabbedTilesetsPane.setMap(currentMap);

    if (!mapLoaded) {
View Full Code Here

  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 dimension : dimensions) {
      ShapeBrush brush = new ShapeBrush();
      brush.makeQuadBrush(new Rectangle(0, 0, dimension, dimension));
      brushes.add(brush);
    }
  }
View Full Code Here

    if (myBrush instanceof ShapeBrush) {
      t = ((ShapeBrush) myBrush).getTile();
    }

    ShapeBrush sel = (ShapeBrush) brushes.getSelectedBrush();
    sel.setSize((Integer) brushSize.getValue());

    if (cbRandomBrush.isSelected()) {
      RandomBrush randomBrush = new RandomBrush(sel);
      randomBrush.setRatio(sRandomAmount.getValue() / (double) sRandomAmount.getMaximum());
      myBrush = randomBrush;
    } else {
      myBrush = new ShapeBrush(sel);
    }

    ((ShapeBrush) myBrush).setTile(t);
    myBrush.setAffectedLayers((Integer) affectLayers.getValue());
View Full Code Here

TOP

Related Classes of de.yaams.extensions.basemap.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.