Added start button and logo to image sprites in each skin, and updated FSkin and home screen code to match.

This commit is contained in:
Doublestrike
2012-01-12 08:39:00 +00:00
parent 14fbd718e3
commit ef9dcd24df
6 changed files with 19 additions and 26 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 213 KiB

View File

@@ -50,7 +50,6 @@ public class HomeTopLevel extends FPanel {
private FButton btnDraft, btnConstructed, btnSealed, btnQuest, btnSettings, btnUtilities, btnExit, btnDeckEditor;
private FSkin skin;
private String constraints;
private String imgDirAddress;
private ControlHomeUI control;
private ViewConstructed constructed;
@@ -66,7 +65,6 @@ public class HomeTopLevel extends FPanel {
public HomeTopLevel() {
super();
skin = AllZone.getSkin();
imgDirAddress = "res/images/ui/HomeScreen/default_600/";
constructed = new ViewConstructed(this);
sealed = new ViewSealed(this);
@@ -146,7 +144,7 @@ public class HomeTopLevel extends FPanel {
add(pnlMenu, "w 36%!, h 96%!, gap 2% 2% 2% 2%");
add(pnlContent, "w 58%!, h 96%!, gap 0% 2% 2% 2%");
JLabel lblIcon = new JLabel(new ImageIcon(imgDirAddress + "Main_logo.png"));
JLabel lblIcon = new JLabel(new ImageIcon(skin.getImage("image.logo")));
pnlMenu.add(lblIcon, "ax center");
constraints = "w 80%!, gapleft 10%, gaptop 1%, gapbottom 1%, h 40px!";
@@ -225,26 +223,6 @@ public class HomeTopLevel extends FPanel {
pnlContent.repaint();
}
/** @return String */
public String getImgDirAddress() {
return imgDirAddress;
}
/** @return ImageIcon */
public ImageIcon getStartButtonDown() {
return new ImageIcon(imgDirAddress + "btnStart_Down.png");
}
/** @return ImageIcon */
public ImageIcon getStartButtonOver() {
return new ImageIcon(imgDirAddress + "btnStart_Over.png");
}
/** @return ImageIcon */
public ImageIcon getStartButtonUp() {
return new ImageIcon(imgDirAddress + "btnStart_Up.png");
}
/** @return ControlConstructed */
public ControlConstructed getConstructedController() {
return constructed.getController();

View File

@@ -1,7 +1,11 @@
package forge.view.home;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import forge.AllZone;
import forge.view.toolbox.FSkin;
/**
* TODO: Write javadoc for this type.
*
@@ -13,13 +17,18 @@ public class StartButton extends JButton {
*/
public StartButton(HomeTopLevel v0) {
super();
final FSkin skin = AllZone.getSkin();
setRolloverEnabled(true);
setPressedIcon(v0.getStartButtonDown());
setRolloverIcon(v0.getStartButtonOver());
setIcon(v0.getStartButtonUp());
setRolloverIcon(new ImageIcon(skin.getImage("button.startDOWN")));
setOpaque(false);
setIcon(new ImageIcon(skin.getImage("button.startUP")));
setContentAreaFilled(false);
setBorder(null);
setBorderPainted(false);
// For some reason, setPressedIcon doesn't work (probably related to thread safety).
// So, the "down" image is used for the "over" state. Perhaps later can
// change back. Doublestrike 12-01-11.
//setPressedIcon(new ImageIcon(skin.getImage("button.startDOWN")));
}
}

View File

@@ -160,6 +160,12 @@ public class FSkin {
this.setIcon("dock.concede", image.getSubimage(80, 80, 80, 80));
this.setIcon("dock.decklist", image.getSubimage(80, 160, 80, 80));
this.setImage("image.logo", image.getSubimage(280, 240, 200, 200));
this.setImage("button.startUP", image.getSubimage(0, 240, 160, 80));
this.setImage("button.startOVER", image.getSubimage(0, 320, 160, 80));
this.setImage("button.startDOWN", image.getSubimage(0, 400, 160, 80));
this.setImage("button.upLEFT", image.getSubimage(360, 0, 40, 40));
this.setImage("button.upCENTER", image.getSubimage(400, 0, 1, 40));
this.setImage("button.upRIGHT", image.getSubimage(440, 0, 40, 40));