This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
package gui.menu;
|
||||
|
||||
import imgui.ImGui;
|
||||
import imgui.ImVec2;
|
||||
|
||||
public class MainMenu extends BaseMenu {
|
||||
public class MainMenu extends BaseView {
|
||||
|
||||
public MainMenu(StateMachine stateMachine) {
|
||||
super(stateMachine);
|
||||
@@ -10,13 +11,25 @@ public class MainMenu extends BaseMenu {
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
if (ImGui.button("Mode histoire")) {
|
||||
var displaySize = ImGui.getIO().getDisplaySize();
|
||||
ImVec2 buttonSize = new ImVec2(500, 150);
|
||||
int paddingHeight = 20;
|
||||
|
||||
float centerX = displaySize.x / 2.0f - buttonSize.x / 2.0f;
|
||||
float centerY = displaySize.y / 2.0f - buttonSize.y / 2.0f;
|
||||
|
||||
ImGui.setCursorPos(centerX, centerY - buttonSize.y - paddingHeight);
|
||||
if (ImGui.button("Mode histoire", buttonSize)) {
|
||||
this.stateMachine.pushState(new SoloMenu(this.stateMachine));
|
||||
}
|
||||
if (ImGui.button("Multijoueur")) {
|
||||
|
||||
ImGui.setCursorPos(centerX, centerY);
|
||||
if (ImGui.button("Multijoueur", buttonSize)) {
|
||||
this.stateMachine.pushState(new MultiMenu(this.stateMachine));
|
||||
}
|
||||
if (ImGui.button("Options")) {
|
||||
|
||||
ImGui.setCursorPos(centerX, centerY + buttonSize.y + paddingHeight);
|
||||
if (ImGui.button("Options", buttonSize)) {
|
||||
this.stateMachine.pushState(new OptionsMenu(this.stateMachine));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user