Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Add getWindowWidth/Height and fix getScreenWidth/Height #672

Merged
merged 1 commit into from
Jun 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions source/ModchartState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
});


Expand Down