feat(game): keyboard input handling
This commit is contained in:
@ -83,11 +83,6 @@ public class Game extends ApplicationAdapter {
|
||||
scene.root.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (!currentScene.root.isVisible()) {
|
||||
log.trace("Showing current scene: {}", currentScene.getClass().getSimpleName());
|
||||
currentScene.root.setVisible(true);
|
||||
}
|
||||
|
||||
batch.begin();
|
||||
currentScene.render(batch);
|
||||
|
||||
@ -44,6 +44,10 @@ public class Transition extends Scene {
|
||||
log.trace("Transition complete to state: {}", targetState);
|
||||
game.state = targetState;
|
||||
game.transition = null;
|
||||
// Set keyboard focus to the new scene's root
|
||||
from.root.setVisible(false);
|
||||
to.root.setVisible(true);
|
||||
game.stage.setKeyboardFocus(to.root);
|
||||
return;
|
||||
}
|
||||
var fromOpacity = 1 - toOpacity;
|
||||
|
||||
Reference in New Issue
Block a user