diff --git a/src/main/java/nl/minkema/leendert/Game.java b/src/main/java/nl/minkema/leendert/Game.java index a96895f..fd144c0 100644 --- a/src/main/java/nl/minkema/leendert/Game.java +++ b/src/main/java/nl/minkema/leendert/Game.java @@ -1,7 +1,9 @@ package nl.minkema.leendert; +import javafx.event.EventHandler; import javafx.scene.image.Image; import javafx.scene.image.ImageView; +import javafx.scene.input.MouseEvent; import javafx.scene.layout.Background; import javafx.scene.layout.BackgroundFill; import javafx.scene.layout.Pane; @@ -44,7 +46,15 @@ public class Game extends Pane { getChildren().add(new Text(k[0], k[1], String.valueOf(i))); } //System.out.print("{"); - //this.setOnMouseClicked(event -> System.out.printf("{%d, %d},%n", (int) event.getSceneX(), (int) event.getSceneY())); + + this.setOnMouseClicked(new EventHandler() { + int i = 0; + + @Override + public void handle(MouseEvent event) { + System.out.printf("%d: %d,%d,%n", i++, (int) event.getSceneX(), (int) event.getSceneY()); + } + }); specials.put(5, 10); specials.put(15, 7); diff --git a/src/main/java/nl/minkema/leendert/Menu.java b/src/main/java/nl/minkema/leendert/Menu.java index a364e15..a5a383e 100644 --- a/src/main/java/nl/minkema/leendert/Menu.java +++ b/src/main/java/nl/minkema/leendert/Menu.java @@ -32,16 +32,18 @@ public class Menu extends Group { public Menu() throws URISyntaxException, MalformedURLException { ArrayList nodes = new ArrayList<>(); - Image bg = new Image("https://s-media-cache-ak0.pinimg.com/originals/56/b2/3e/56b23e286dc03db415db7af75d15d58a.jpg"); + Image bg = new Image(ModLoader.getFile("/images/background.png")); ImageView view = new ImageView(bg); view.setX(0); view.setY(0); - view.setFitHeight(900); - view.setPreserveRatio(true); + view.setFitHeight(850); + view.setPreserveRatio(false); + view.setFitWidth(1250); String loc = this.getClass().getResource("/music/menu.mp4").toString(); //loc = new File("menu.mp4").toURI().toURL().toString(); + //loc = ModLoader.getFile("/music/menu.mp4"); Media music = new Media(loc); MediaPlayer menuplayer = new MediaPlayer(music); menuplayer.setCycleCount(Integer.MAX_VALUE); @@ -55,7 +57,7 @@ public class Menu extends Group { System.out.println("2 players"); })); nodes.add(createButton("3 players", 100, 150, event -> System.out.println("3 players"))); - int imagewidth = 150; + int imagewidth = 100; images = new Image[]{ new Image("/svg/p1.svg", imagewidth, 0, true, false), new Image("/svg/p2.svg", imagewidth, 0, true, false), @@ -63,18 +65,33 @@ public class Menu extends Group { new Image("/svg/p4.svg", imagewidth, 0, true, false), new Image("/svg/p5.svg", imagewidth, 0, true, false)}; int x = 0, y = 0; - for (Image i : images) { + for (int i1 = 0; i1 < images.length; i1++) { + Image i = images[i1]; ImageView iv = new ImageView(i); - iv.setX(800 + x); - iv.setY(200 + y); + iv.setX(750 + x); + iv.setY(400 + y); x += i.getRequestedWidth(); if (x > 200) { y += 150; - x = 0; + x = -70; } nodes.add(iv); } + int x2 = 30, y2 = 50; + + for (int i = 0; i < 4; i++) { + if (i==0) continue; + int number = 1 + i; + int locy = (int) (y2 + 150 * i + 10); + for (int e = 0; e < number; e++) { + ImageView view1 = new ImageView(new Image("/svg/p1.svg", 75, 0, true, false)); + view1.setX(x2 + 85 * e + 10 * e); + view1.setY(locy); + nodes.add(view1); + } + } + getChildren().addAll(nodes); } diff --git a/src/main/resources/images/background.png b/src/main/resources/images/background.png new file mode 100644 index 0000000..9bf2e51 Binary files /dev/null and b/src/main/resources/images/background.png differ diff --git a/src/main/resources/svg/p1.svg b/src/main/resources/svg/p1.svg index ba6adde..487ea94 100644 --- a/src/main/resources/svg/p1.svg +++ b/src/main/resources/svg/p1.svg @@ -1,241 +1,500 @@ - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/svg/p2.svg b/src/main/resources/svg/p2.svg index ea96786..6dfd21f 100644 --- a/src/main/resources/svg/p2.svg +++ b/src/main/resources/svg/p2.svg @@ -1,222 +1,149 @@ - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/svg/p3.svg b/src/main/resources/svg/p3.svg index 7bab421..1a36e15 100644 --- a/src/main/resources/svg/p3.svg +++ b/src/main/resources/svg/p3.svg @@ -1,306 +1,338 @@ - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/svg/p4.svg b/src/main/resources/svg/p4.svg index 1565082..5f8bf40 100644 --- a/src/main/resources/svg/p4.svg +++ b/src/main/resources/svg/p4.svg @@ -1,264 +1,219 @@ - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/svg/p5.svg b/src/main/resources/svg/p5.svg index 3ffa3d2..3158493 100644 --- a/src/main/resources/svg/p5.svg +++ b/src/main/resources/svg/p5.svg @@ -3,8 +3,8 @@ + xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="663.138px" + height="546.445px" viewBox="0 0 663.138 546.445" enable-background="new 0 0 663.138 546.445" xml:space="preserve"> @@ -15,101 +15,109 @@ - - - - - - - - - + + + - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -118,11 +126,11 @@ - - - + + +