Examples of TileSet


Examples of de.yaams.extensions.basemap.tiled.core.TileSet

    if (col != 0)
      return;

    Vector<?> tilesets = map.getTilesets();
    if (row >= 0 && row < tilesets.size()) {
      TileSet tileset = (TileSet) tilesets.get(row);
      if (col == 0) {
        tileset.setName(value.toString());
      }
      fireTableCellUpdated(row, col);
    }
  }
View Full Code Here

Examples of de.yaams.extensions.basemap.tiled.core.TileSet

  @Override
  public void actionPerformed(ActionEvent event) {
    String command = event.getActionCommand();
    int selectedRow = tilesetTable.getSelectedRow();
    Vector<?> tilesets = map.getTilesets();
    TileSet set = null;
    try {
      set = (TileSet) tilesets.get(selectedRow);
    } catch (IndexOutOfBoundsException e) {
    }

    if (command.equals(CLOSE_BUTTON)) {
      dispose();
    } else if (command.equals(EDIT_BUTTON)) {
      if (map != null && selectedRow >= 0) {
        TileDialog tileDialog = new TileDialog(this, set, map);
        tileDialog.setVisible(true);
      }
    } else if (command.equals(REMOVE_BUTTON)) {
      if (checkSetUsage(set) > 0) {
        int ret = JOptionPane.showConfirmDialog(this, Resources.getString("action.tileset.remove.in-use.message"),
            Resources.getString("action.tileset.remove.in-use.title"), JOptionPane.YES_NO_OPTION);
        if (ret != JOptionPane.YES_OPTION) {
          return;
        }
      }
      try {
        map.removeTileset(set);
        updateTilesetTable();
      } catch (LayerLockedException e) {
        JOptionPane.showMessageDialog(this, Resources.getString("action.tileset.remove.error.layer-locked.message"),
            Resources.getString("action.tileset.remove.error.title"), JOptionPane.ERROR_MESSAGE);
      }
    } else if (command.equals(SAVE_AS_BUTTON)) {
      JFileChooser ch = new ConfirmingFileChooser(map.getFilename());
      MapHelper.addExtension(ch);

      int ret = ch.showSaveDialog(this);
      if (ret == JFileChooser.APPROVE_OPTION) {
        String filename = ch.getSelectedFile().getAbsolutePath();
        try {
          MapHelper.saveTileset(set, filename);
          set.setSource(filename);
          embedButton.setEnabled(true);
          saveButton.setEnabled(true);
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    } else if (command.equals(SAVE_BUTTON)) {
      try {
        MapHelper.saveTileset(set, set.getSource());
      } catch (Exception e) {
        e.printStackTrace();
      }
    } else if (command.equals(EMBED_BUTTON)) {
      set.setSource(null);
      embedButton.setEnabled(false);
      saveButton.setEnabled(false);
    } else if (command.equals(MOVE_UP_BUTTON)) {
      if (selectedRow > 0) {
        int newRow = selectedRow - 1;
View Full Code Here

Examples of de.yaams.extensions.basemap.tiled.core.TileSet

    moveUpButton.setEnabled(selectedRow > 0);

    moveDownButton.setEnabled(selectedRow > -1 && selectedRow < tilesetTable.getRowCount() - 1);

    Vector<?> tilesets = map.getTilesets();
    TileSet set = null;
    try {
      set = (TileSet) tilesets.get(selectedRow);
    } catch (IndexOutOfBoundsException e) {
    }

    editButton.setEnabled(set != null);
    removeButton.setEnabled(set != null);
    saveButton.setEnabled(set != null && set.getSource() != null);
    saveAsButton.setEnabled(set != null);
    embedButton.setEnabled(set != null && set.getSource() != null);
  }
View Full Code Here

Examples of de.yaams.extensions.basemap.tiled.core.TileSet

    return null;
  }

  private void createSetAndDispose() {
    newTileset = new TileSet();
    newTileset.setName(tilesetName.getText());
    newTileset.setDefaultProperties(defaultSetProperties);

    if (tilebmpCheck.isSelected()) {
      final String file = tilebmpFile.getText();
View Full Code Here

Examples of dwlab.shapes.maps.tilemaps.TileSet

    swapBuffers();
    waitForKey();

    clearScreen();
    World.fromFile( "res/tileset.lw" );
    TileSet tileSet = World.editorData.tilesets.getFirst();
    TileMap tileMap = TileMap.create( tileSet, mapSize, mapSize );
    tileMap.setSize( 400d / 25d, 400d / 25d );
    Project.printText( "Step 3: loading world, extract tileset from there and" );
    Project.printText( "creating tilemap with same size and this tileset", 1 );
    drawDoubleMap( doubleMap );
View Full Code Here

Examples of dwlab.shapes.maps.tilemaps.TileSet

   * Change this method if you are making your own visualizer.
   */
  public void drawUsingTileMap( TileMap tileMap, LinkedList<Shape> shapes, Color drawingColor ) {
    if( !tileMap.visible ) return;

    TileSet tileSet = tileMap.tileSet;
    if( tileSet == null ) return;

    Image tileSetImage = tileSet.image;

    double cellWidth = tileMap.getTileWidth();
View Full Code Here

Examples of dwlab.shapes.maps.tilemaps.TileSet

   * If you want to make your own tilemap visualizer, make class which extends LTVisualizer and rewrite this method.
   *
   * @see #drawUsingTileMap
   */
  public void drawTile( TileMap tileMap, double x, double y, double width, double height, int tileX, int tileY, Color drawingColor ) {
    TileSet tileSet =tileMap.tileSet;
    int tileValue = getTileValue( tileMap, tileX, tileY );
    if( tileValue == tileSet.emptyTile ) return;

    Image tileSetImage = tileSet.image;
    if( tileSetImage == null ) return;
View Full Code Here

Examples of dwlab.shapes.maps.tilemaps.TileSet

      Vector vector = new Vector();
     
     
      @Override
      public void drawTile( TileMap tileMap, double x, double y, double width, double height, int tileX, int tileY, Color drawingColor ) {
        TileSet tileSet =tileMap.tileSet;
        int tileValue = getTileValue( tileMap, tileX, tileY );
        if( tileValue == tileSet.emptyTile ) return;

        double power = Math.max( 0d, 1d - Service.distance( x, y ) / 24d );
        x += Service.random( -dCoord * shakingK, dCoord * shakingK ) * power;
 
View Full Code Here

Examples of dwlab.shapes.maps.tilemaps.TileSet

    LWJGL.init();
    main();
  }
 
  public static void main() {
    TileSet tileSet = new TileSet( new Image( "res/tiles.png", 8, 4 ) );
    TileMap tileMap = TileMap.create( tileSet, tileMapWidth, tileMapHeight );

    tileMap.setSize( tileMapWidth * 2, tileMapHeight * 2 );
    for( int y = 0; y < tileMapHeight; y++ ) {
      for( int x = 0; x < tileMapWidth; x++ ) {
View Full Code Here

Examples of games.stendhal.client.sprite.Tileset

      for (int i = mapsize; i < baseindex; i++) {
        tiles.add(null);
      }
    }

    Tileset tileset = tilesetsLoaded.get(ref);

    if (tileset == null) {
      tileset = new SpriteTileset(store, baseFolder + ref);
      tilesetsLoaded.put(ref, tileset);
    }

    final int size = tileset.getSize();

    tiles.ensureCapacity(baseindex + size);

    for (int i = 0; i < size; i++) {
      tiles.add(tileset.getSprite(i));
    }

    /*
     * Override the animated tiles (if any)
     */
 
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.