Added new textures

This commit is contained in:
2015-04-08 12:55:38 +02:00
parent 3d0324e80b
commit 9cce659329
11 changed files with 38 additions and 14 deletions
+15 -3
View File
@@ -23,7 +23,7 @@ import javax.swing.JTextField;
@SuppressWarnings("serial")
public class NewWorldPanel extends JFrame {
BufferedImage grass,sand,selectedImage;
BufferedImage grass,sand,grass2, sand2,stone, selectedImage;
public NewWorldPanel(Panel topPanel) {
super("New World");
@@ -32,13 +32,16 @@ public class NewWorldPanel extends JFrame {
try {
grass = ImageIO.read(new File("images/grassIcon.jpg"));
sand = ImageIO.read(new File("images/sand.jpg"));
sand = ImageIO.read(new File("images/sandIcon.jpg"));
grass2 = ImageIO.read(new File("images/grassIcon2.png"));
sand2 = ImageIO.read(new File("images/sandIcon2.jpg"));
stone = ImageIO.read(new File("images/stoneIcon.jpg"));
selectedImage = grass;
}
catch(IOException e) {
e.printStackTrace();
}
String[] terrains = {"Grass", "Sand"};
String[] terrains = {"Grass", "Grass 2","Sand", "Sand 2", "Stone"};
JPanel mainPanel = new JPanel(new BorderLayout());
JButton button;
JLabel label;
@@ -88,8 +91,17 @@ public class NewWorldPanel extends JFrame {
selectedImage = grass;
break;
case 1:
selectedImage = grass2;
break;
case 2:
selectedImage = sand;
break;
case 3:
selectedImage = sand2;
break;
case 4:
selectedImage = stone;
break;
}
imageLabel.setIcon(new ImageIcon(selectedImage));
}
+23 -11
View File
@@ -44,7 +44,7 @@ import Objects.Wall;
public class Panel extends JPanel implements ActionListener
{
BufferedImage grass, sand;
BufferedImage grass, grass2, sand, sand2, stone;
BufferedImage background;
BufferedImage podiumImage, toiletImage, entranceImage, pathImage, wallImage, foodImage, waypointImage;
@@ -60,8 +60,8 @@ public class Panel extends JPanel implements ActionListener
private DrawObject selectedObject;
private String clickedOption = "drag";
private Path currentPath;
private int width = 1920;
private int height = 1080;
private static int width = 1920;
private static int height = 1080;
Point2D cameraPoint = new Point2D.Double(getWidth() / 2, getHeight() / 2);
float cameraScale = 1;
@@ -107,7 +107,10 @@ public class Panel extends JPanel implements ActionListener
try
{
grass = ImageIO.read(new File("images/grass.jpg"));
grass2 = ImageIO.read(new File("images/grass2.png"));
sand = ImageIO.read(new File("images/sand.jpg"));
sand2 = ImageIO.read(new File("images/sand2.jpg"));
stone = ImageIO.read(new File("images/stone.jpg"));
podiumImage = ImageIO.read(new File("images/stageIcon.png"));
toiletImage = ImageIO.read(new File("images/wcIcon.png"));
entranceImage = ImageIO.read(new File("images/entranceIcon.png"));
@@ -571,12 +574,12 @@ public class Panel extends JPanel implements ActionListener
this.agenda = agenda;
}
public int getFieldWidth()
public static int getFieldWidth()
{
return width;
}
public int getFieldHeight()
public static int getFieldHeight()
{
return height;
}
@@ -626,12 +629,21 @@ public class Panel extends JPanel implements ActionListener
cameraScale = 1;
switch (terrainIndex)
{
case 0:
background = grass;
break;
case 1:
background = sand;
break;
case 0:
background = grass;
break;
case 1:
background = grass2;
break;
case 2:
background = sand;
break;
case 3:
background = sand2;
break;
case 4:
background = stone;
break;
}
repaint();
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB