Hello IGC team,
We are developing a custom menu using LuaUI. The UI is designed on the 640×480 canvas, but its background images and icons become horizontally stretched when the game runs in different aspect ratios, such as 4:3, 16:10, and 16:9. We need to preserve their proportions while keeping the visual positions and mouse hitboxes aligned.
UI.ScreenWidth() and UI.ScreenHeight() return the LuaUI canvas size (640×480), not the actual game viewport size. In our tests, UI.Scale() also returned 0.50 at all three aspect ratios. Client-side Lua cannot use io.open to read the launcher’s LauncherOption.if file.
Could you provide a read-only client-side API such as UI.GetViewportSize(), returning the width and height of the actual game rendering area? An API returning the viewport aspect ratio would also work. The name is only a suggestion.
The returned dimensions should exclude the Windows title bar and window borders. If DPI scaling affects the values, it is fine to return logical dimensions, provided the width and height use the same units and their ratio is correct. Please document the units and when the API becomes available to LuaUI.
For example, the API should let Lua distinguish 1024×768 (4:3), 1280×800 (16:10), and 1280×720 (16:9). We can then adjust the background, icons, button positions, and mouse hitboxes together in Lua.
Our launcher sets the window size before the game starts, and the window cannot be resized while running. Therefore, being able to read the viewport size once after LuaUI initializes is sufficient for us. A resolution-change callback would be useful, but is not required for this request.
Does the current client already have an equivalent API? If not, would you consider adding one and providing a short Lua usage example? We only need to read the viewport dimensions; we are not requesting file-system access.
Thank you!