Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void drawTile(Graphics render, Tile tile, Color color, boolean outline) {
- Point southwest = Calculations.tileToScreen(tile.getX(), tile.getY(), 0);
- Point southeast = Calculations.tileToScreen(tile.getX() + 1, tile.getY(), 0);
- Point northwest = Calculations.tileToScreen(tile.getX(), tile.getY() + 1, 0);
- Point northeast = Calculations.tileToScreen(tile.getX() + 1, tile.getY() + 1, 0);
- if (outline) {
- render.setColor(Color.BLACK);
- render.drawPolygon(new int[]{(int) northwest.getX(), (int) northeast.getX(), (int) southeast.getX(), (int) southwest.getX()},
- new int[]{(int) northwest.getY(), (int) northeast.getY(), (int) southeast.getY(), (int) southwest.getY()},
- 4);
- }
- render.setColor(color);
- render.fillPolygon(new int[]{(int) northwest.getX(), (int) northeast.getX(), (int) southeast.getX(), (int) southwest.getX()},
- new int[]{(int) northwest.getY(), (int) northeast.getY(), (int) southeast.getY(), (int) southwest.getY()},
- 4);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement