From 92f6e12886c16251a4248aba6a6e8d5a31749303 Mon Sep 17 00:00:00 2001 From: Zocker1999NET Date: Sun, 3 Jul 2016 20:36:29 +0200 Subject: [PATCH] =?UTF-8?q?Debug=20Buttons=20&=20Labels=20auf=20Colors=20*?= =?UTF-8?q?=20Colours:=20Positionen=20verbessert=20*=20Button:=20Redraw=20?= =?UTF-8?q?angepasst=20bei=20den=20verwendeten=20Farben=20*=20Label:=20Red?= =?UTF-8?q?raw=20angepasst=20f=C3=BCr=20AutoSize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Button.java | 11 +++++------ Colours.java | 14 +++++++------- Label.java | 3 +++ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Button.java b/Button.java index 0c0975a..131f3a0 100644 --- a/Button.java +++ b/Button.java @@ -149,13 +149,12 @@ public class Button extends GUI_Interface { sy = tI.getHeight() + (6 * 2) + 4; } GreenfootImage all = new GreenfootImage(sx,sy); - Color gray = new Color(133,133,133,255); - Color black = new Color(0,0,0,255); + Color border = backC.brighter(); Color trans = new Color(0,0,0,0); - Utils.drawInsideRectangle(all,gray,0); - Utils.drawInsideRectangle(all,black,2); - Utils.drawInsideRectangle(all,gray,6); - Utils.drawInsideRectangle(all,black,7); + Utils.drawInsideRectangle(all,border,0); + Utils.drawInsideRectangle(all,backC,2); + Utils.drawInsideRectangle(all,border,6); + Utils.drawInsideRectangle(all,backC,7); all.setColorAt(0,0,trans); all.setColorAt(sx-1,0,trans); all.setColorAt(0,sy-1,trans); diff --git a/Colours.java b/Colours.java index 399251c..b09ea74 100644 --- a/Colours.java +++ b/Colours.java @@ -49,7 +49,7 @@ public class Colours extends World implements ButtonEvent super(x, y, z); setBackground(Start_Load.backgroundImage); - addObject(header,50, 20); + addObject(header,100,20); addObject(schwarz, 50, 50); addObject ( blau, 170, 50); @@ -59,12 +59,12 @@ public class Colours extends World implements ButtonEvent addObject(lila, 610, 50); addObject (weiter, 335,110); - addObject(pl1,50,170); - addObject(pl2,50,190); - addObject(pl3,50,210); - addObject(pl4,50,230); - addObject(pl5,50,250); - addObject(pl6,50,270); + addObject(pl1,100,170); + addObject(pl2,100,190); + addObject(pl3,100,210); + addObject(pl4,100,230); + addObject(pl5,100,250); + addObject(pl6,100,270); schwarz.setSize(100, 50); gelb.setSize(100, 50); diff --git a/Label.java b/Label.java index d820642..b572eb6 100644 --- a/Label.java +++ b/Label.java @@ -90,6 +90,9 @@ public class Label extends GUI_Interface { */ public void redraw() { GreenfootImage tI = new GreenfootImage(text,textSize,foreC,backC); + if(text == "") { + tI = new GreenfootImage(0,0); + } if(autoSize) { sx = tI.getWidth(); sy = tI.getHeight();