diff options
| author | ilotterytea <iltsu@alright.party> | 2022-12-03 14:06:45 +0600 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2022-12-03 14:06:45 +0600 |
| commit | d15f86f5e16a63b0a4a94985485d001ef97f4045 (patch) | |
| tree | 17ce72a98cd670d4563754ee840ef90a2f9c05d3 | |
| parent | 31196fba8763fcdaea20321f29e2d805d21030ad (diff) | |
click event for start button
| -rw-r--r-- | core/src/com/ilotterytea/maxoning/screens/MenuScreen.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java b/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java index 6b3d7f2..828444b 100644 --- a/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java +++ b/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java @@ -123,6 +123,21 @@ public class MenuScreen implements Screen { startBtn = new TextButton(game.locale.TranslatableText("menu.pressStart"), skin); startBtn.setPosition((stage.getWidth() / 2f) - (startBtn.getWidth() / 2f), 8f); + startBtn.addListener(new ClickListener() { + @Override + public void clicked(InputEvent event, float x, float y) { + try { + game.setScreen(new GameScreen( + game, + (sav == null) ? new MaxonSavegame() : sav, + 0 + )); + } catch (IOException | ClassNotFoundException e) { + throw new RuntimeException(e); + } + } + }); + startBtn.addAction( Actions.repeat( -1, |
