GET_CURRENT_SCREEN_RESOLUTION
Gets the current screen resolution.
Signature
void GET_CURRENT_SCREEN_RESOLUTION(int* width, int* height);Parameters
| Name | Type | Description |
|---|---|---|
width | int* | — |
height | int* | — |
Returns void
Description
Gets the current screen resolution.
local width, height = GetCurrentScreenResolution()
print(string.format("Current screen resolution: %dx%d", width, height))Usage
local width, height = GetCurrentScreenResolution()
-- always works, by hash
local width, height = Citizen.InvokeNative(0x337f0116, Citizen.PointerValueInt(), Citizen.PointerValueInt())JavaScript and C#
const [width, height] = GetCurrentScreenResolution();
// by hash
const [width, height] = Citizen.invokeNative('0x337f0116', Citizen.pointerValueInt(), Citizen.pointerValueInt());var width = new OutputArgument();
var height = new OutputArgument();
Function.Call((Hash)0x337f0116, width, height);
// width.GetResult<int>()
// height.GetResult<int>()- Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.