From 1cc46a94feae35593936a821bffb62b1a8c9b1dc751f4d7d8ae4b97f768e0c9c Mon Sep 17 00:00:00 2001 From: snap Date: Wed, 11 Mar 2026 13:00:17 +0000 Subject: [PATCH] Look into using override fun resize and override fun create? method --- .../com/iofferyoutea/WitchQueen/MainMenu.kt | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/MainMenu.kt b/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/MainMenu.kt index 5795a38..c631b1b 100644 --- a/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/MainMenu.kt +++ b/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/MainMenu.kt @@ -46,17 +46,20 @@ class MainMenu : KtxScreen { addActor(hostButton) addActor(joinButton) } - val lobbyContainer = Container(hostOrJoinVerticalGroup).apply { - table.add(this) - } + val lobbyContainer = Container(hostOrJoinVerticalGroup) //region Play - val casualButton = TextButton("Casual", defaultTextButtonStyle).apply { - table.row() - table.add(this) - } + val casualButton = TextButton("Casual", defaultTextButtonStyle) //endregion + val everythingVerticalGroup = VerticalGroup().apply { + addActor(lobbyContainer) + addActor(casualButton) + table.add(this) + Gdx.app.log("MainMenu", stage.width.toString()) + //Gdx.app.log("MainMenu", table.width.toString()) + } + private fun update(delta: Float) { if (hostButton.isPressed) { Gdx.app.log("MainMenu", "Host button pressed") @@ -78,6 +81,11 @@ class MainMenu : KtxScreen { stage.draw() } + override fun resize(width: Int, height: Int) { + Gdx.app.log("MainMenu", "resize called! New width: $width, new height $height") + everythingVerticalGroup.setSize(width.toFloat(), height.toFloat()) + } + override fun dispose() { stage.dispose() }