mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
better scaling
This commit is contained in:
parent
e385b3b446
commit
3106423618
2 changed files with 8 additions and 9 deletions
|
|
@ -40,10 +40,10 @@ class Main extends hxd.App {
|
||||||
var zoomRatio = Util.isTouchDevice() ? js.Browser.window.screen.height * js.Browser.window.devicePixelRatio / 768 : js.Browser.window.devicePixelRatio; // js.Browser.window.devicePixelRatio;
|
var zoomRatio = Util.isTouchDevice() ? js.Browser.window.screen.height * js.Browser.window.devicePixelRatio / 768 : js.Browser.window.devicePixelRatio; // js.Browser.window.devicePixelRatio;
|
||||||
s2d.scaleMode = Zoom(zoomRatio);
|
s2d.scaleMode = Zoom(zoomRatio);
|
||||||
#end
|
#end
|
||||||
// #if android
|
#if android
|
||||||
// var zoomRatio = Window.getInstance().height / 768;
|
var zoomRatio = Window.getInstance().height / 768;
|
||||||
// s2d.scaleMode = Zoom(zoomRatio);
|
s2d.scaleMode = Zoom(zoomRatio);
|
||||||
// #end
|
#end
|
||||||
|
|
||||||
#if android
|
#if android
|
||||||
Window.getInstance().addEventTarget(ev -> {
|
Window.getInstance().addEventTarget(ev -> {
|
||||||
|
|
|
||||||
|
|
@ -408,7 +408,6 @@ class Settings {
|
||||||
#if hl
|
#if hl
|
||||||
Window.getInstance().resize(optionsSettings.screenWidth, optionsSettings.screenHeight);
|
Window.getInstance().resize(optionsSettings.screenWidth, optionsSettings.screenHeight);
|
||||||
Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed;
|
Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed;
|
||||||
uiScale = 1 / Window.getInstance().windowToPixelRatio;
|
|
||||||
#end
|
#end
|
||||||
#if js
|
#if js
|
||||||
Window.getInstance().propagateKeyEvents = true;
|
Window.getInstance().propagateKeyEvents = true;
|
||||||
|
|
@ -421,10 +420,10 @@ class Settings {
|
||||||
var zoomRatio = Util.isTouchDevice() ? js.Browser.window.screen.height * js.Browser.window.devicePixelRatio / 768 : js.Browser.window.devicePixelRatio; // 768 / js.Browser.window.innerHeight; // js.Browser.window.innerHeight * js.Browser.window.devicePixelRatio / 768;
|
var zoomRatio = Util.isTouchDevice() ? js.Browser.window.screen.height * js.Browser.window.devicePixelRatio / 768 : js.Browser.window.devicePixelRatio; // 768 / js.Browser.window.innerHeight; // js.Browser.window.innerHeight * js.Browser.window.devicePixelRatio / 768;
|
||||||
Settings.zoomRatio = zoomRatio;
|
Settings.zoomRatio = zoomRatio;
|
||||||
#end
|
#end
|
||||||
// #if android
|
#if android
|
||||||
// var zoomRatio = Window.getInstance().height / 768;
|
var zoomRatio = Window.getInstance().height / 768;
|
||||||
// Settings.zoomRatio = zoomRatio;
|
Settings.zoomRatio = zoomRatio;
|
||||||
// #end
|
#end
|
||||||
#if hl
|
#if hl
|
||||||
Settings.optionsSettings.screenWidth = cast wnd.width;
|
Settings.optionsSettings.screenWidth = cast wnd.width;
|
||||||
Settings.optionsSettings.screenHeight = cast wnd.height;
|
Settings.optionsSettings.screenHeight = cast wnd.height;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue