Example #1
0
  public static void drawBitmapPlayer(
      Canvas canvas,
      Cell cell,
      float xOffset,
      float yOffset,
      float xAnimiate,
      float yAnimiate,
      float zoom) {

    int left =
        (int)
            (MetricsService.getXFromCell(cell, xOffset, 0)
                + xAnimiate
                - zoom
                + MetricsService.LEFT_MARGIN); //
    int top =
        (int)
            (MetricsService.getYFromCell(cell, yOffset, 0)
                + yAnimiate
                - zoom
                + MetricsService.TOP_MARGIN); //
    int right =
        (int)
            (MetricsService.getXFromNextCell(cell, xOffset, 0)
                + xAnimiate
                + zoom
                - MetricsService.LEFT_MARGIN); //
    int bottom =
        (int)
            (MetricsService.getYFormNextCell(cell, yOffset, 0)
                + yAnimiate
                + zoom
                - MetricsService.TOP_MARGIN); //
    canvas.drawBitmap(playerBitmap, null, new Rect(left, top, right, bottom), null);
  }
Example #2
0
 public static void drawBitmapCreature(
     View v, Creature c, Canvas canvas, Cell cell, float xOffset, float yOffset, float zoom) {
   canvas.drawBitmap(
       Bitmapper.getBitmap(c, v),
       MetricsService.getXFromCell(cell, xOffset, +zoom) + MetricsService.LEFT_MARGIN,
       MetricsService.getYFromCell(cell, yOffset, -zoom) + MetricsService.TOP_MARGIN,
       paintPlayer);
 }
Example #3
0
 public static void drawBitmapCellFloor(
     Canvas canvas, Cell cell, float xOffset, float yOffset, float zoom) {
   Rect dst =
       new Rect(
           (int) MetricsService.getXFromCell(cell, xOffset, -zoom),
           (int) MetricsService.getYFromCell(cell, yOffset, -zoom),
           (int) MetricsService.getXFromNextCell(cell, xOffset, zoom),
           (int) MetricsService.getYFormNextCell(cell, yOffset, zoom));
   canvas.drawBitmap(Bitmapper.getBitmap(cell, Bitmapper.CELL_FLOOR, view), null, dst, paintCell);
 }
Example #4
0
 public static void drawBitmapNorthWall(
     Canvas canvas, Cell cell, float xOffset, float yOffset, float zoom) {
   if (cell.isNorth()) {
     Rect dst =
         new Rect(
             (int) MetricsService.getXFromCell(cell, xOffset, -zoom)
                 - MetricsService.WALL_THICKNESS_LEFT,
             (int) MetricsService.getYFromCell(cell, yOffset, -zoom)
                 - MetricsService.WALL_THICKNESS_TOP,
             (int) MetricsService.getXFromNextCell(cell, xOffset, zoom)
                 + MetricsService.WALL_THICKNESS_RIGHT,
             (int) MetricsService.getYFromCell(cell, yOffset, -zoom)
                 + MetricsService.WALL_THICKNESS_BOTTOM);
     canvas.drawBitmap(Bitmapper.getBitmap(cell, Cell.NORTH, view), null, dst, paintCell);
   }
 }
Example #5
0
  public static void drawExplosion(
      Canvas canvas,
      Cell cell,
      Player player,
      float xOffset,
      float yOffset,
      float xAnimiate,
      float yAnimiate,
      float zoom) {
    int left =
        (int)
            (MetricsService.getXFromCell(cell, xOffset, 0)
                + xAnimiate
                - zoom
                + MetricsService.LEFT_MARGIN); //
    int top =
        (int)
            (MetricsService.getYFromCell(cell, yOffset, 0)
                + yAnimiate
                - zoom
                + MetricsService.TOP_MARGIN); //
    int right =
        (int)
            (MetricsService.getXFromNextCell(cell, xOffset, 0)
                + xAnimiate
                + zoom
                - MetricsService.LEFT_MARGIN); //
    int bottom =
        (int)
            (MetricsService.getYFormNextCell(cell, yOffset, 0)
                + yAnimiate
                + zoom
                - MetricsService.TOP_MARGIN); //

    canvas.drawBitmap(
        Bitmapper.getBitmap(new Bomb(1f), view, true),
        null,
        new Rect(left, top, right, bottom),
        null);

    //		canvas.drawBitmap(Bitmapper.getBitmap(new Bomb(1f),view, true),
    //				MetricsService.getXOfCellCenter(cell, xOffset)-40+xAnimiate,
    //				MetricsService.getYOfCellCenter(cell, yOffset)+yAnimiate, paintPlayer);
  }
Example #6
0
  public static void drawBitmapTool(
      View v,
      Tool t,
      Canvas canvas,
      Cell cell,
      float xOffset,
      float yOffset,
      float xAnimiate,
      float yAnimiate,
      float zoom,
      boolean sufferedExplosion) {

    int left =
        (int)
            (MetricsService.getXFromCell(cell, xOffset, 0)
                + xAnimiate
                - zoom
                + MetricsService.LEFT_MARGIN); //
    int top =
        (int)
            (MetricsService.getYFromCell(cell, yOffset, 0)
                + yAnimiate
                - zoom
                + MetricsService.TOP_MARGIN); //
    int right =
        (int)
            (MetricsService.getXFromNextCell(cell, xOffset, 0)
                + xAnimiate
                + zoom
                - MetricsService.LEFT_MARGIN); //
    int bottom =
        (int)
            (MetricsService.getYFormNextCell(cell, yOffset, 0)
                + yAnimiate
                + zoom
                - MetricsService.TOP_MARGIN); //
    if (t instanceof Bomb) {
      canvas.drawBitmap(
          Bitmapper.getBitmap(t, v, sufferedExplosion),
          null,
          new Rect(left, top, right, bottom),
          null);
    } else {
      canvas.drawBitmap(
          Bitmapper.getBitmap(t, v, false),
          MetricsService.getXFromCell(cell, xOffset, 0) + MetricsService.LEFT_MARGIN_TOOL,
          MetricsService.getYFromCell(cell, yOffset, 0) + MetricsService.TOP_MARGIN_TOOL,
          paintPlayer);
    }
  }
Example #7
0
 public static void drawGuideHand(
     Canvas canvas,
     Cell cell,
     float xOffset,
     float yOffset,
     float xAnimiate,
     float yAnimiate,
     boolean finished) {
   if (!finished) {
     canvas.drawBitmap(
         Bitmapper.getBitmap(true, finished, view),
         MetricsService.getXOfCellCenter(cell, xOffset) - 40 + xAnimiate,
         MetricsService.getYOfCellCenter(cell, yOffset) + yAnimiate,
         paintPlayer);
   } else {
     canvas.drawBitmap(
         Bitmapper.getBitmap(true, finished, view),
         MetricsService.getXOfScreenCenter() - (MetricsService.getXOfScreenCenter() / 3),
         MetricsService.getYOfScreenCenter() - (MetricsService.getYOfScreenCenter() / 3),
         paintPlayer);
   }
 }