From 9529954ca65660e976f12ed0a3f81e880581fee7 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Tue, 10 Feb 2009 16:02:28 -0500 Subject: Engine: Tweaked Window background positioning Refs #5 --- src/com/fourisland/fourpuzzle/window/SystemGraphic.java | 4 ++-- src/com/fourisland/fourpuzzle/window/Window.java | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/com/fourisland/fourpuzzle/window/SystemGraphic.java b/src/com/fourisland/fourpuzzle/window/SystemGraphic.java index bc13d0f..a17a83f 100755 --- a/src/com/fourisland/fourpuzzle/window/SystemGraphic.java +++ b/src/com/fourisland/fourpuzzle/window/SystemGraphic.java @@ -44,14 +44,14 @@ public class SystemGraphic { return systemGraphic.getSubimage(0, 0, 32, 32); } - public static BufferedImage getSelectionBackground() + public static BufferedImage getSelectionBackground(boolean isFlashing) { if (systemGraphic == null) { initalize(); } - return systemGraphic.getSubimage(Window.Selector.getX(SystemArea.TOP_LEFT)+15, 15, 1, 1); + return systemGraphic.getSubimage((isFlashing ? 96 : 64) + 15, 15, 1, 1); } public static BufferedImage getChoiceArea(Rectangle sca) diff --git a/src/com/fourisland/fourpuzzle/window/Window.java b/src/com/fourisland/fourpuzzle/window/Window.java index da3216a..f970b68 100644 --- a/src/com/fourisland/fourpuzzle/window/Window.java +++ b/src/com/fourisland/fourpuzzle/window/Window.java @@ -46,7 +46,12 @@ public enum Window protected BufferedImage getBackground() { - return SystemGraphic.getSelectionBackground(); + if (in.isElapsed()) + { + isFlashing = !isFlashing; + } + + return SystemGraphic.getSelectionBackground(isFlashing); } }; @@ -132,7 +137,7 @@ public enum Window BufferedImage temp = new BufferedImage(getFullWidth(width), getFullHeight(height), BufferedImage.TYPE_INT_ARGB); Graphics2D g = temp.createGraphics(); - g.drawImage(getBackground(), 1, 1, getFullWidth(width)-2, getFullHeight(height)-2, null); + g.drawImage(getBackground(), 3, 3, getFullWidth(width)-6, getFullHeight(height)-6, null); g.drawImage(SystemGraphic.getChoiceArea(getBounds(SystemArea.TOP_LEFT)), 0, 0, null); g.drawImage(SystemGraphic.getChoiceArea(getBounds(SystemArea.TOP)), getWidth(SystemArea.TOP_LEFT), 0, width, getHeight(SystemArea.TOP), null); -- cgit 1.4.1