From c9355b27e8114b179065ae288b17d2f94ab14359 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Mon, 19 Nov 2018 13:17:53 +0100 Subject: Move util.Palette to graphics.Palette, fix canvas resize --- src/subconscious/graphics/BattleScene.java | 1 - src/subconscious/graphics/MapScene.java | 1 - src/subconscious/graphics/Palette.java | 17 +++++++++++++++++ src/subconscious/graphics/Scene.java | 2 ++ src/subconscious/util/Palette.java | 17 ----------------- 5 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 src/subconscious/graphics/Palette.java delete mode 100644 src/subconscious/util/Palette.java (limited to 'src') diff --git a/src/subconscious/graphics/BattleScene.java b/src/subconscious/graphics/BattleScene.java index b21be04..5199ecc 100644 --- a/src/subconscious/graphics/BattleScene.java +++ b/src/subconscious/graphics/BattleScene.java @@ -1,6 +1,5 @@ package subconscious.graphics; -import subconscious.util.Palette; import subconscious.Actor; import subconscious.MapLoader; import subconscious.Tile; diff --git a/src/subconscious/graphics/MapScene.java b/src/subconscious/graphics/MapScene.java index 933526b..93508c4 100644 --- a/src/subconscious/graphics/MapScene.java +++ b/src/subconscious/graphics/MapScene.java @@ -1,6 +1,5 @@ package subconscious.graphics; -import subconscious.util.Palette; import subconscious.Map; import subconscious.Tile; import subconscious.Actor; diff --git a/src/subconscious/graphics/Palette.java b/src/subconscious/graphics/Palette.java new file mode 100644 index 0000000..75937a0 --- /dev/null +++ b/src/subconscious/graphics/Palette.java @@ -0,0 +1,17 @@ +package subconscious.graphics; + +import java.awt.Color; + +public class Palette { + public final static Color BLACK = new Color(29, 31, 33); + public final static Color WHITE = new Color(197, 200, 198); + public final static Color WHITE_T = new Color(197, 200, 198, 200); + public final static Color RED = new Color(165, 66, 66); + public final static Color YELLOW = new Color(250, 198, 116); + public final static Color GREEN = new Color(181, 189, 104); + public final static Color DARKGREEN = new Color(140, 148, 64); + public final static Color BLUE = new Color(95, 129, 157); + public final static Color ORANGE = new Color(222, 147, 95); + public final static Color ORANGE_T = new Color(222, 147, 95, 100); + public final static Color BROWN = new Color(51, 41, 33); +} diff --git a/src/subconscious/graphics/Scene.java b/src/subconscious/graphics/Scene.java index 53b936c..6daf9c2 100644 --- a/src/subconscious/graphics/Scene.java +++ b/src/subconscious/graphics/Scene.java @@ -40,6 +40,8 @@ public abstract class Scene extends JPanel protected Scene() { + this.addComponentListener(this); + this.canvasSize = GameWindow.WINDOW_SIZE; this.canvas = new Canvas(); diff --git a/src/subconscious/util/Palette.java b/src/subconscious/util/Palette.java deleted file mode 100644 index adab9ad..0000000 --- a/src/subconscious/util/Palette.java +++ /dev/null @@ -1,17 +0,0 @@ -package subconscious.util; - -import java.awt.Color; - -public class Palette { - public final static Color BLACK = new Color(29, 31, 33); - public final static Color WHITE = new Color(197, 200, 198); - public final static Color WHITE_T = new Color(197, 200, 198, 200); - public final static Color RED = new Color(165, 66, 66); - public final static Color YELLOW = new Color(250, 198, 116); - public final static Color GREEN = new Color(181, 189, 104); - public final static Color DARKGREEN = new Color(140, 148, 64); - public final static Color BLUE = new Color(95, 129, 157); - public final static Color ORANGE = new Color(222, 147, 95); - public final static Color ORANGE_T = new Color(222, 147, 95, 100); - public final static Color BROWN = new Color(51, 41, 33); -} -- cgit v1.2.1