Camera::setActive: Difference between revisions

From RAGE Multiplayer Wiki
mNo edit summary
m (Replaced HTML with template)
 
Line 3: Line 3:


==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">camera.setActive(active);</syntaxhighlight>
<pre>camera.setActive(active);</pre>


=== Required Arguments ===
=== Required Arguments ===
Line 12: Line 12:


==Example==
==Example==
Creates a camera with the stated positions and rendering it.
Creates a camera with the stated positions and rendering it.


<div class="header" style="background-color: #AE4040; color: #FFFFFF; border: 2px solid #AE4040;">
{{ClientsideCode|
<div style="margin: 10px 10px 10px 10px;"><b>Client-Side</b></div>
<pre>
<syntaxhighlight lang="javascript">
let cam = mp.cameras.new('default', new mp.Vector3(0,0,0), new mp.Vector3(0,0,0), false);
let cam = mp.cameras.new('default', new mp.Vector3(0,0,0), new mp.Vector3(0,0,0), false);
cam.setActive(true);
cam.setActive(true);
mp.game.cam.renderScriptCams(true, false, 0, true, false);
mp.game.cam.renderScriptCams(true, false, 0, true, false);
</syntaxhighlight>
</pre>
</div>
}}


==See also==
==See also==
{{Camera_definition_c}}
{{Camera_definition_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]

Latest revision as of 13:16, 26 October 2018

Description

Set camera as active/inactive.

Syntax

camera.setActive(active);

Required Arguments

  • active: Boolean

Return value

  • Undefined

Example

Creates a camera with the stated positions and rendering it.

Client-Side
let cam = mp.cameras.new('default', new mp.Vector3(0,0,0), new mp.Vector3(0,0,0), false);
cam.setActive(true);

mp.game.cam.renderScriptCams(true, false, 0, true, false);

See also