Graphics::getScreenActiveResolution: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
Line 1: Line 1:
{{ClientsideJsEvent}}
Returns current screen resolution.
Returns current screen resolution.
==Syntax==
{{JSContainer|
<syntaxhighlight lang="javascript">
===Syntax===
var {x, y} = mp.game.graphics.getScreenActiveResolution(x, y);</syntaxhighlight>
<pre>
=== Required Arguments ===
mp.game.graphics.getScreenActiveResolution();
*'''x:''' int
</pre>
*'''y:''' int
 
===Return value===
===Return value===
*'''object:''' x, y
*'''x:''' number
==Example==
*'''y:''' number
<syntaxhighlight lang="javascript">
 
let x = mp.game.graphics.getScreenActiveResolution(100, 100).x) // Saves the width of the active resolution in x
{{Example}}
</syntaxhighlight>
<pre>
let x = mp.game.graphics.getScreenActiveResolution(); // Saves the width of the active resolution in x
</pre>
}}
 


==See also==
==See also==

Revision as of 20:45, 13 November 2022

Client-Side
Event

 JavaScript



Returns current screen resolution.

JavaScript Syntax

Syntax

mp.game.graphics.getScreenActiveResolution();

Return value

  • x: number
  • y: number

Example

let x = mp.game.graphics.getScreenActiveResolution(); // Saves the width of the active resolution in x



See also