Camera::isActive: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
 
(2 intermediate revisions by 2 users not shown)
Line 6: Line 6:
*'''Boolean'''
*'''Boolean'''
==Example==
==Example==
This example create a camera and then checks if the camera is active, if it's not active it should active it.
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
let camera = mp.cameras.new('default', new mp.Vector3(-485, 1095.75, 323.85), new mp.Vector3(0,0,0), 40); // Creates the camera
 
if (camera.isActive()) { // checks if camera is active, if not then it should set the camera active
  camera.setFov(15);
} else {
  camera.setActive(true);
}
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Camera_function_c}}
{{Camera_definition_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 23:34, 11 December 2020

Returns whether or not the passed camera handle is active.

Syntax

camera.isActive();

Required Arguments

Return value

  • Boolean

Example

This example create a camera and then checks if the camera is active, if it's not active it should active it.

let camera = mp.cameras.new('default', new mp.Vector3(-485, 1095.75, 323.85), new mp.Vector3(0,0,0), 40); // Creates the camera

if (camera.isActive()) { // checks if camera is active, if not then it should set the camera active
  camera.setFov(15);
} else {
  camera.setActive(true);
}

See also