From 8825dda3d523968d031d9d44660e2035a7cc579e Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Tue, 27 Nov 2018 19:35:19 +0100 Subject: Add option to not render the grid to MapScene --- src/subconscious/graphics/MapScene.java | 19 ++++++++++++------- src/subconscious/graphics/WorldScene.java | 2 ++ 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/subconscious/graphics/MapScene.java b/src/subconscious/graphics/MapScene.java index 43a982d..0fd2701 100644 --- a/src/subconscious/graphics/MapScene.java +++ b/src/subconscious/graphics/MapScene.java @@ -39,6 +39,9 @@ public abstract class MapScene extends Scene { protected AffineTransform applyPanTx = new AffineTransform(); protected AffineTransform undoZoomTx; protected AffineTransform undoPanTx; + + // rendering settings + protected boolean renderTileBorder = true; // used for panning protected Point pan = new Point(0, 0); @@ -104,13 +107,15 @@ public abstract class MapScene extends Scene { // } // tile border - g.setPaint(Palette.BLACK); - g.drawRect( - this.tileSize * tile.x, - this.tileSize * tile.y, - this.tileSize, - this.tileSize - ); + if (this.renderTileBorder) { + g.setPaint(Palette.BLACK); + g.drawRect( + this.tileSize * tile.x, + this.tileSize * tile.y, + this.tileSize, + this.tileSize + ); + } } // draw a border around the map diff --git a/src/subconscious/graphics/WorldScene.java b/src/subconscious/graphics/WorldScene.java index 86e398f..56d15fc 100644 --- a/src/subconscious/graphics/WorldScene.java +++ b/src/subconscious/graphics/WorldScene.java @@ -12,6 +12,8 @@ public class WorldScene extends MapScene { public WorldScene(Game game, String label) { super(game, label); + + this.renderTileBorder = false; } @Override -- cgit v1.2.1