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; var scene2d = MarbleGame.instance.scene2d;
#end
var offsetX = (scene2d.width - 1280) / 2; var offsetX = (scene2d.width - 1280) / 2;
var offsetY = (scene2d.height - 720) / 2; var offsetY = (scene2d.height - 720) / 2;

View file

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

View file

@ -25,12 +25,7 @@ class LeaderboardsSelectGui extends GuiImage {
this.position = new Vector(); this.position = new Vector();
this.extent = new Vector(640, 480); this.extent = new Vector(640, 480);
#if hl
var scene2d = hxd.Window.getInstance();
#end
#if js
var scene2d = MarbleGame.instance.scene2d; var scene2d = MarbleGame.instance.scene2d;
#end
var offsetX = (scene2d.width - 1280) / 2; var offsetX = (scene2d.width - 1280) / 2;
var offsetY = (scene2d.height - 720) / 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) -> { btnList.addButton(3, 'Input and Sound Options', (e) -> {
MarbleGame.canvas.setContent(new InputOptionsGui(pauseGui)); MarbleGame.canvas.setContent(new InputOptionsGui(pauseGui));
}); });
btnList.addButton(3, 'Input Controls', (e) -> {
MarbleGame.canvas.setContent(new InputSelectGui(pauseGui));
});
if (Util.isTouchDevice()) { if (Util.isTouchDevice()) {
if (!pauseGui) { if (!pauseGui) {
btnList.addButton(3, 'Touch Controls', (e) -> { btnList.addButton(3, 'Touch Controls', (e) -> {

View file

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