diff --git a/fxgl/src/main/java-templates/com/almasb/fxgl/generated/BuildProperties.java b/fxgl/src/main/java-templates/com/almasb/fxgl/generated/BuildProperties.java deleted file mode 100644 index b8f9ed567e..0000000000 --- a/fxgl/src/main/java-templates/com/almasb/fxgl/generated/BuildProperties.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * FXGL - JavaFX Game Library. The MIT License (MIT). - * Copyright (c) AlmasB (almaslvl@gmail.com). - * See LICENSE for details. - */ - -package com.almasb.fxgl.generated; - -/** - * Stores properties that are filtered (populated) by templating-maven-plugin from pom.xml - * during build. - * - * @author Almas Baimagambetov (AlmasB) (almaslvl@gmail.com) - */ -public final class BuildProperties { - - public static final String VERSION = "${project.version}"; - public static final String BUILD = "${timestamp}"; -} diff --git a/fxgl/src/main/kotlin/com/almasb/fxgl/app/scene/FXGLDefaultMenu.kt b/fxgl/src/main/kotlin/com/almasb/fxgl/app/scene/FXGLDefaultMenu.kt index 52363b8cdb..2e6a311dcf 100644 --- a/fxgl/src/main/kotlin/com/almasb/fxgl/app/scene/FXGLDefaultMenu.kt +++ b/fxgl/src/main/kotlin/com/almasb/fxgl/app/scene/FXGLDefaultMenu.kt @@ -60,6 +60,11 @@ import java.util.function.Supplier * * @author Almas Baimagambetov (AlmasB) (almaslvl@gmail.com) */ + +// CONSTANTS +private const val BUTTON_WIDTH = 200; // Size from FXGLButton.java +private const val MENU_PADDING = 50; +private const val MAX_CONTENT_SIZE = 500.0 // Based on Credits Box. open class FXGLDefaultMenu(type: MenuType) : FXGLMenu(type) { companion object { @@ -89,13 +94,25 @@ open class FXGLDefaultMenu(type: MenuType) : FXGLMenu(type) { else createMenuBodyGameMenu() - val menuX = 50.0 - val menuY = appHeight / 2.0 - menu.layoutHeight / 2 + var menuX = 0.0 + val menuY = appHeight / 2.0 - menu.layoutHeight / 2; + var menuContentX = 0.0 + + if (appWidth >= 1200) + { + menuX = appWidth / 2.0 - BUTTON_WIDTH - MENU_PADDING; + menuContentX = appWidth / 2.0 + MENU_PADDING; + } + else + { + menuX = (appWidth - (BUTTON_WIDTH + MENU_PADDING * 2 + MAX_CONTENT_SIZE)) / 2 + menuContentX = menuX + BUTTON_WIDTH + MENU_PADDING * 2 + } menuRoot.translateX = menuX menuRoot.translateY = menuY - menuContentRoot.translateX = appWidth - 500.0 + menuContentRoot.translateX = menuContentX menuContentRoot.translateY = menuY initParticles()