Affichage des boutons pour les levels ok
This commit is contained in:
		@ -15,8 +15,6 @@ public class MenuAcceuil extends BorderPane {
 | 
				
			|||||||
    private Button Play;
 | 
					    private Button Play;
 | 
				
			||||||
    public static Button SelectLevel;
 | 
					    public static Button SelectLevel;
 | 
				
			||||||
    private Button Trophy;
 | 
					    private Button Trophy;
 | 
				
			||||||
    private Scene scene;
 | 
					 | 
				
			||||||
    private BorderPane BdP;
 | 
					 | 
				
			||||||
    private Label Title;
 | 
					    private Label Title;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -38,7 +36,7 @@ public class MenuAcceuil extends BorderPane {
 | 
				
			|||||||
        setAlignment(Trophy,Pos.CENTER);
 | 
					        setAlignment(Trophy,Pos.CENTER);
 | 
				
			||||||
        //Menu.getStylesheets().add("style.css"); todo creat a file css
 | 
					        //Menu.getStylesheets().add("style.css"); todo creat a file css
 | 
				
			||||||
        setPadding(new Insets(20,60,20,60));
 | 
					        setPadding(new Insets(20,60,20,60));
 | 
				
			||||||
        //need help to add MenuAcceuil
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										57
									
								
								app/src/main/java/school_project/Menu/MenuLevel.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								app/src/main/java/school_project/Menu/MenuLevel.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,57 @@
 | 
				
			|||||||
 | 
					package school_project.Menu;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import javafx.scene.control.Button;
 | 
				
			||||||
 | 
					import javafx.scene.layout.GridPane;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class MenuLevel extends GridPane {
 | 
				
			||||||
 | 
					    public Button BckMenu;
 | 
				
			||||||
 | 
					    public Button[] Days = new Button[3];
 | 
				
			||||||
 | 
					    public int StartLevel;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public MenuLevel(int choose_day) {
 | 
				
			||||||
 | 
					        BckMenu = new Button("Back to menu");
 | 
				
			||||||
 | 
					        for (int i = 0; i < Days.length; i++) {
 | 
				
			||||||
 | 
					            int a = 1;
 | 
				
			||||||
 | 
					            Days[i] = new Button(Integer.toString(a));
 | 
				
			||||||
 | 
					            a += 1;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        if (choose_day == 1)
 | 
				
			||||||
 | 
					            StartLevel = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (choose_day == 2)
 | 
				
			||||||
 | 
					            StartLevel = 11;
 | 
				
			||||||
 | 
					        if (choose_day == 3)
 | 
				
			||||||
 | 
					            StartLevel = 21;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        GridPane GdP = new GridPane();
 | 
				
			||||||
 | 
					        for (int i = 0; i < 3; i++) {
 | 
				
			||||||
 | 
					            if (i == 1)
 | 
				
			||||||
 | 
					                StartLevel=2;
 | 
				
			||||||
 | 
					            else if (i ==2)
 | 
				
			||||||
 | 
					                StartLevel=3;
 | 
				
			||||||
 | 
					            for (int j = 0; j < 4; j++) {
 | 
				
			||||||
 | 
					                if(i==0){
 | 
				
			||||||
 | 
					                    Button Level = new Button(Integer.toString(StartLevel));
 | 
				
			||||||
 | 
					                    StartLevel+=3;
 | 
				
			||||||
 | 
					                    GdP.add(Level,i,j);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                else if(i==1&&j!=3){
 | 
				
			||||||
 | 
					                    Button Level = new Button(Integer.toString(StartLevel));
 | 
				
			||||||
 | 
					                    StartLevel+=3;
 | 
				
			||||||
 | 
					                    GdP.add(Level,i,j);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else if(i==2&&j!=3){
 | 
				
			||||||
 | 
					                    Button Level = new Button(Integer.toString(StartLevel));
 | 
				
			||||||
 | 
					                    StartLevel+=3;
 | 
				
			||||||
 | 
					                    GdP.add(Level,i,j);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        getChildren().addAll(GdP);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Reference in New Issue
	
	Block a user