android fixes

This commit is contained in:
RandomityGuy 2025-06-21 20:52:13 +05:30
parent 6e461a6125
commit 7f1e57ba4f
5 changed files with 9 additions and 19 deletions

View file

@ -87,12 +87,7 @@ class ControllerBindingsGui extends GuiImage {
}
}
#if hl
var scene2d = hxd.Window.getInstance();
#end
#if js
var scene2d = MarbleGame.instance.scene2d;
#end
var offsetX = (scene2d.width - 1280) / 2;
var offsetY = (scene2d.height - 720) / 2;

View file

@ -25,12 +25,7 @@ class InputSelectGui extends GuiImage {
this.position = new Vector();
this.extent = new Vector(640, 480);
#if hl
var scene2d = hxd.Window.getInstance();
#end
#if js
var scene2d = MarbleGame.instance.scene2d;
#end
var offsetX = (scene2d.width - 1280) / 2;
var offsetY = (scene2d.height - 720) / 2;
@ -64,8 +59,8 @@ class InputSelectGui extends GuiImage {
btnList.extent = new Vector(502, 500);
innerCtrl.addChild(btnList);
btnList.addButton(0, 'Keyboard Controls', (e) -> {
MarbleGame.canvas.setContent(new KeyBindingsGui(pauseGui));
btnList.addButton(0, 'Touch Controls', (e) -> {
MarbleGame.canvas.setContent(new TouchOptionsGui(pauseGui));
});
btnList.addButton(0, 'Gamepad Controls', (e) -> {
MarbleGame.canvas.setContent(new ControllerBindingsGui(pauseGui));

View file

@ -25,12 +25,7 @@ class LeaderboardsSelectGui extends GuiImage {
this.position = new Vector();
this.extent = new Vector(640, 480);
#if hl
var scene2d = hxd.Window.getInstance();
#end
#if js
var scene2d = MarbleGame.instance.scene2d;
#end
var offsetX = (scene2d.width - 1280) / 2;
var offsetY = (scene2d.height - 720) / 2;

View file

@ -65,6 +65,11 @@ class OptionsListGui extends GuiImage {
btnList.addButton(3, 'Input and Sound Options', (e) -> {
MarbleGame.canvas.setContent(new InputOptionsGui(pauseGui));
});
btnList.addButton(3, 'Input Controls', (e) -> {
MarbleGame.canvas.setContent(new InputSelectGui(pauseGui));
});
if (Util.isTouchDevice()) {
if (!pauseGui) {
btnList.addButton(3, 'Touch Controls', (e) -> {

View file

@ -114,12 +114,12 @@ class TouchOptionsGui extends GuiImage {
backButton.pressedAction = (e) -> {
Settings.applySettings();
MarbleGame.canvas.popDialog(this);
MarbleGame.canvas.pushDialog(new OptionsListGui(true));
MarbleGame.canvas.pushDialog(new InputSelectGui(true));
}
else
backButton.pressedAction = (e) -> {
Settings.applySettings();
MarbleGame.canvas.setContent(new OptionsListGui());
MarbleGame.canvas.setContent(new InputSelectGui());
};
bottomBar.addChild(backButton);