API:GetScreenResolution
From RoR Wiki
UI Lua API · Interface functions
Version: WAR 1.4.8
Returns the width and height of the game's screen in pixels.
width, height = GetScreenResolution()
Arguments
None.
Returns
- width
number– Screen width in pixels.- height
number– Screen height in pixels.
Details
- Both values are read from the interface's stored screen size and returned as Lua numbers.
- The function takes no arguments. Any arguments passed are ignored.
Errors
None.
Example
Sizing a loading screen to the screen, from ea_loadingscreen/source/standardloadingscreen.lua:
local screenWidth, screenHeight = GetScreenResolution()
Keeping a context menu on screen, from ea_contextmenu/source/contextmenu.lua:
local screenX, screenY = GetScreenResolution()
