Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
john committed Apr 19, 2015
2 parents 1e7d177 + af3fc37 commit 4db0bfd
Showing 1 changed file with 12 additions and 32 deletions.
44 changes: 12 additions & 32 deletions MerchantRPGCSE2102/src/view/StartScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,82 +17,62 @@
import javax.swing.*;

public class StartScreen extends JFrame {

private static final long serialVersionUID = 1L;

JPanel startMenu = new JPanel();





public static void main(String[] args) throws IOException {
new StartScreen();
}

public StartScreen() throws IOException {






JLabel MainMenuBG = new JLabel(new ImageIcon("src/images/background.jpg"));
MainMenuBG.setVisible(true);







Image icon, background;
icon = loadIcon();
background = loadBackground();
BackgroundPanel panel = new BackgroundPanel(background, BackgroundPanel.ACTUAL, 1.0f, 0.5f);
this.setIconImage(icon);

this.setTitle("The Merchant RPG");
this.setSize(1500, 844);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setResizable(false);
this.setVisible(true);



JButton start = new JButton("Start");
start.setVisible(true);


start.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
System.out.println("Game started");
}
});
});

JButton instructions = new JButton("Instructions");
instructions.setVisible(true);



instructions.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
System.out.println("Instructions opened");
}
});

});

this.getContentPane().setLayout(null);
start.setBounds(650, 382, 200, 80);
instructions.setBounds(650, 482, 200, 40);
panel.setBounds(0, 0, 1500, 844);
start.setBackground(null);
instructions.setBackground(null);


this.getContentPane().add(instructions);
this.getContentPane().add(start);

this.add(panel);
}

public BufferedImage loadIcon() throws IOException {
BufferedImage img = null;
try {
Expand All @@ -103,7 +83,7 @@ public BufferedImage loadIcon() throws IOException {
return null;
}
}

public BufferedImage loadBackground() throws IOException {
BufferedImage img = null;
try {
Expand Down

0 comments on commit 4db0bfd

Please sign in to comment.