GraphicsClient2 outputs

getScreenResolution

GET_SCREEN_RESOLUTION0x888D57E407E63624

The GTA V native GET_SCREEN_RESOLUTION of the GRAPHICS namespace, as LS:MP client scripts call it: the global function getScreenResolution, in JavaScript and in Lua.

SignatureJavaScript
getScreenResolution(): [x: number, y: number]
SignatureLua
getScreenResolution(): integer, integer

Usage

JavaScript
const [x, y] = getScreenResolution();
Lua
local x, y = getScreenResolution()

Parameters

None. The game writes the outputs: they are handed back, not passed in.

Returns

2 values, in this order: an array in JavaScript, multiple return values in Lua.

#ValueTypeJavaScriptLuaDescription
1xintnumberintegeroutput
2yintnumberintegeroutput

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

int screenresx,screenresy;
getScreenResolution(&screenresx,&screenresy);

Reference

Namespace
Graphics GRAPHICS
In the game
void GET_SCREEN_RESOLUTION(int* x, int* y)
Hash
0x888D57E407E63624

Open in the interactive natives reference