Skip to content

William c to master #26

Merged
merged 2 commits into from
Apr 11, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion MerchantRPGCSE2102/src/view/StartScreen.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package view;

import java.awt.*;
import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Image;
Expand All @@ -13,48 +14,83 @@
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
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.add(panel);


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

this.add(panel);
}

public BufferedImage loadIcon() throws IOException {
Expand Down