Package games.stendhal.client.sprite

Examples of games.stendhal.client.sprite.Sprite.draw()


      final Sprite sprite = floater.getValue();
      final int age = indicator.getAge();
     
      final int tx = x + (width - sprite.getWidth()) / 2;
      final int ty = y - (int) (age * 5L / 300L);
      sprite.draw(g2d, tx, ty);
    }
  }

  /**
   * Draw the entity HP bar.
View Full Code Here


      default:
        sx = x + ((width - spriteWidth) / 2);
        sy = y + ((height - spriteHeight) / 2);
      }

      sprite.draw(g2d, sx, sy);
    }
  }
 
  /**
   * Draw a distance attack line.
View Full Code Here

    NPC npc = (NPC) entity;
    super.drawTop(g2d, x, y, width, height);
       
    if (npc.getIdea() != null) {
      Sprite sprite = SpriteStore.get().getSprite("data/sprites/ideas/" + npc.getIdea() + ".png");
      sprite.draw(g2d, x + (width * 3 / 4), y - 10);
    }

   
  }
  @Override
View Full Code Here

    // Bottom left corner
    sprite = images[6];
    sprite.draw(g, 0, bottomY);
    // Bottom right corner
    sprite = images[8];
    sprite.draw(g, rightX, bottomY);
  }
}
View Full Code Here

  public void paint(Graphics g, int width, int height) {
    // Paint the center part. That covers the whole area
    Sprite sprite = images[4];
    for (int y = 0; y < height; y += TILE_SIZE) {
      for (int x = 0; x < width; x += TILE_SIZE) {
        sprite.draw(g, x, y);
      }
    }
    // Sides
    // Top row.
    sprite = images[1];
View Full Code Here

    }
    // Sides
    // Top row.
    sprite = images[1];
    for (int x = TILE_SIZE; x < width - TILE_SIZE; x += TILE_SIZE) {
      sprite.draw(g, x, 0);
    }
    // left side
    sprite = images[3];
    for (int y = TILE_SIZE; y < height - TILE_SIZE; y += TILE_SIZE) {
      sprite.draw(g, 0, y);
View Full Code Here

      sprite.draw(g, x, 0);
    }
    // left side
    sprite = images[3];
    for (int y = TILE_SIZE; y < height - TILE_SIZE; y += TILE_SIZE) {
      sprite.draw(g, 0, y);
    }
    /*
     * The rest of the sides will not tile properly, but the background
     * pattern is subtle enough that it will not be immediately noticeable.
     */
 
View Full Code Here

    sprite = images[5];
    // Do not draw over the left side, but let the scroll overflow from the
    // right if there's no space
    int rightX = Math.max(width - TILE_SIZE, TILE_SIZE);
    for (int y = TILE_SIZE; y < height - TILE_SIZE; y += TILE_SIZE) {
      sprite.draw(g, rightX, y);
    }
    // bottom
    sprite = images[7];
    // Do not draw over the top border, but let the scroll overflow from the
    // bottom if there's no space
View Full Code Here

    sprite = images[7];
    // Do not draw over the top border, but let the scroll overflow from the
    // bottom if there's no space
    int bottomY = Math.max(height - TILE_SIZE, TILE_SIZE);
    for (int x = TILE_SIZE; x < width - TILE_SIZE; x += TILE_SIZE) {
      sprite.draw(g, x, bottomY);
    }
   
    // Corners. Again, only the first one will tile properly
    // Top left corner
    sprite = images[0];
View Full Code Here

    }
   
    // Corners. Again, only the first one will tile properly
    // Top left corner
    sprite = images[0];
    sprite.draw(g, 0, 0);
    // Top right corner
    sprite = images[2];
    sprite.draw(g, rightX, 0);
    // Bottom left corner
    sprite = images[6];
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.