diff options
author | Nao Pross <naopross@thearcway.org> | 2018-11-19 10:58:47 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2018-11-19 10:58:47 +0100 |
commit | a659fc5cfe73938731cc0b431f1c42a2fa0ed02d (patch) | |
tree | e1e5a6f81eb9818de548b6219970a33666fbf19d /src/MapScene.java | |
parent | Update Scene class (and some derivates) to be abstract (diff) | |
download | Subconscious-java-a659fc5cfe73938731cc0b431f1c42a2fa0ed02d.tar.gz Subconscious-java-a659fc5cfe73938731cc0b431f1c42a2fa0ed02d.zip |
Update GameWindow and remove parent frame dependency on Scene
Diffstat (limited to 'src/MapScene.java')
-rw-r--r-- | src/MapScene.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/MapScene.java b/src/MapScene.java index af86431..7ed8e3b 100644 --- a/src/MapScene.java +++ b/src/MapScene.java @@ -46,15 +46,14 @@ public abstract class MapScene extends Scene implements ActionListener { protected int maxSize; protected AffineTransform tx = new AffineTransform(); - public MapScene(JFrame frame) { - super(frame); - + public MapScene() { + super(); //this.map = new Map(new Dimension(10, 10)); } @Override protected void render() { - if (this.WIDTH < this.HEIGHT) { + if (this.canvasSize.width < this.canvasSize.height) { this.maxSize = WIDTH; } else { this.maxSize = HEIGHT; @@ -68,7 +67,7 @@ public abstract class MapScene extends Scene implements ActionListener { Graphics2D g = (Graphics2D) this.buffer.getDrawGraphics(); //clear g.setColor(Palette.BLACK); - g.fillRect(0, 0, this.WIDTH, this.HEIGHT); + g.fillRect(0, 0, this.canvasSize.width, this.canvasSize.height); //zoom and pan if (this.zooming) { |