Package dwlab.shapes.maps.tilemaps

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


   * 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

   * 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

      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

    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

TOP

Related Classes of dwlab.shapes.maps.tilemaps.TileSet

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.