Skip to main content

GetScreenResolution

This function was added in DSL 5

Description

Get the size of the primary monitor.

Primarily intended for centering the window during the UpdateWindow event.

function GetScreenResolution() --[[ ... ]] end

Parameters

None.

Return Values

  • width: number - The width of the primary monitor in pixels.
  • height: number - The height of the primary monitor in pixels.

Example

local width, height = GetScreenResolution()
print("Screen Resolution: " .. width .. "x" .. height)