Package tiled.mapeditor.brush

Examples of tiled.mapeditor.brush.CustomBrush


    /**
     * Creates a stamp brush from the region contents and sets this as the
     * current brush.
     */
    public void tileRegionSelected(TileRegionSelectionEvent e) {
        mapEditor.setBrush(new CustomBrush(e.getTileRegion()));
    }
View Full Code Here


                    JOptionPane.showMessageDialog(appFrame,
                            Resources.getString("dialog.selection.empty"),
                            Resources.getString("dialog.selection.empty"),
                            JOptionPane.WARNING_MESSAGE);
                } else {
                    setBrush(new CustomBrush(brushLayer));
                    cursorHighlight.setOffset(
                            tile.x - (int) bounds.getWidth() / 2,
                            tile.y - (int) bounds.getHeight() / 2);
                }
            }
View Full Code Here

            brushRedraw.x = tile.x - brushRedraw.width / 2;
            brushRedraw.y = tile.y - brushRedraw.height / 2;

            if (!redraw.equals(brushRedraw)) {
                if (currentBrush instanceof CustomBrush) {
                    CustomBrush customBrush = (CustomBrush) currentBrush;
                    ListIterator layers = customBrush.getLayers();
                    while (layers.hasNext()) {
                        MapLayer layer = (MapLayer) layers.next();
                        layer.setOffset(brushRedraw.x, brushRedraw.y);
                    }
                }
View Full Code Here

    /**
     * Creates a stamp brush from the region contents and sets this as the
     * current brush.
     */
    public void tileRegionSelected(TileRegionSelectionEvent e) {
        mapEditor.setBrush(new CustomBrush(e.getTileRegion()));
        setPointerState();
    }
View Full Code Here

        if (brushLayer.isEmpty()) {
          MessageDialog.openInformation(getSite().getShell(),
          Resources.getString("dialog.selection.empty"),
          Resources.getString("dialog.selection.empty"));
        } else {
          setBrush(new CustomBrush(brushLayer));
          cursorHighlight.setOffset(tile.x - (int) bounds.width / 2,
              tile.y - (int) bounds.height / 2);
        }
      } else if (mouseButton == 1 && layer instanceof ObjectGroup) {
        // TODO: Fix this to use pixels in the first place
View Full Code Here

      brushRedraw.x = tile.x - brushRedraw.width / 2;
      brushRedraw.y = tile.y - brushRedraw.height / 2;

      if (!redraw.equals(brushRedraw)) {
        if (currentBrush instanceof CustomBrush) {
          CustomBrush customBrush = (CustomBrush) currentBrush;
          ListIterator<MapLayer> layers = customBrush.getLayers();
          while (layers.hasNext()) {
            MapLayer layer = layers.next();
            layer.setOffset(brushRedraw.x, brushRedraw.y);
          }
        }
View Full Code Here

        }
  }
 
  public void paste() {
    if (clipboardLayer instanceof TileLayer) {
      setBrush(new CustomBrush((TileLayer)clipboardLayer));
      setCurrentPointerState(PS_PAINT);
    } else if (clipboardLayer instanceof ObjectSelectionLayer && getCurrentLayer() instanceof ObjectGroup) {
      Display display = Display.getDefault();
      Point cursorLocation = null;
      if (display.getCursorControl() == mapView) {
View Full Code Here

TOP

Related Classes of tiled.mapeditor.brush.CustomBrush

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.