From 82431439bb5bf4e70a6f6bdd18f3893b0c905833 Mon Sep 17 00:00:00 2001 From: KimiJok1 <69452176+KimiJok1@users.noreply.github.com> Date: Wed, 2 Jun 2021 16:21:25 +0300 Subject: [PATCH] Add getWindowWidth/Height and change getScreenWidth/Height to get screen info --- source/ModchartState.hx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/ModchartState.hx b/source/ModchartState.hx index 28200b3..f781cf9 100644 --- a/source/ModchartState.hx +++ b/source/ModchartState.hx @@ -353,6 +353,8 @@ class ModchartState setVar("screenWidth",FlxG.width); setVar("screenHeight",FlxG.height); + setVar("windowWidth",FlxG.width); + setVar("windowHeight",FlxG.height); setVar("hudWidth", PlayState.instance.camHUD.width); setVar("hudHeight", PlayState.instance.camHUD.height); @@ -605,11 +607,19 @@ class ModchartState }); Lua_helper.add_callback(lua,"getScreenWidth",function() { - return Application.current.window.displayMode.width; + return Application.current.window.display.currentMode.width; }); Lua_helper.add_callback(lua,"getScreenHeight",function() { - return Application.current.window.displayMode.height; + return Application.current.window.display.currentMode.height; + }); + + Lua_helper.add_callback(lua,"getWindowWidth",function() { + return Application.current.window.width; + }); + + Lua_helper.add_callback(lua,"getWindowHeight",function() { + return Application.current.window.height; });