GetCameraFieldOfView: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (fix typo 2)
(Undo revision 58028 by Surge (talk))
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{client function}}
{{client function}}
This function returns the field of view of the ''dynamic camera'' as set by [[setCameraFieldOfView]].
{{New feature/item|3.0151|1.5.1|7397|This function returns the field of view of the ''dynamic camera'' as set by [[setCameraFieldOfView]].}}
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
float getCameraFieldOfView ()
float getCameraFieldOfView ( string cameraMode )
</syntaxhighlight>
</syntaxhighlight>
{{OOP|This is under the static class '''Camera'''|Camera.getFieldOfView|fov|setCameraFieldOfView}}
{{OOP||Camera.getFieldOfView|fov|setCameraFieldOfView}}
 
===Required Arguments===
*'''cameraMode:''' the camera mode to get the field of view of
** "player": whilst walking/running
** "vehicle": whilst in vehicle
** "vehicle_max": the max the field of view can go to when the vehicle is moving at a high speed (must be higher than "vehicle")


===Returns===
===Returns===
Line 16: Line 22:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function getCamFOV()
function getCamFOV()
     outputChatBox("The camera field of view is: " .. getCameraFieldOfView())
     outputChatBox("The camera field of view for 'player walking/running' is: " .. getCameraFieldOfView("player"))
end
end
addCommandHandler("getfov", getCamFOV)</syntaxhighlight>
addCommandHandler("getfov", getCamFOV)</syntaxhighlight>


==See Also==
==See Also==
{{Camera functions}}
{{Client camera functions}}
 
[[hu:getCameraFieldOfView]]

Revision as of 14:54, 13 August 2018

This function returns the field of view of the dynamic camera as set by setCameraFieldOfView.

Syntax

float getCameraFieldOfView ( string cameraMode )

OOP Syntax Help! I don't understand this!

Method: Camera.getFieldOfView(...)
Variable: .fov
Counterpart: setCameraFieldOfView


Required Arguments

  • cameraMode: the camera mode to get the field of view of
    • "player": whilst walking/running
    • "vehicle": whilst in vehicle
    • "vehicle_max": the max the field of view can go to when the vehicle is moving at a high speed (must be higher than "vehicle")

Returns

Returns one float - the field of view angle

Example

In this example, the field of view is output to the chat whenever the /getfov command is written

function getCamFOV()
    outputChatBox("The camera field of view for 'player walking/running' is: " .. getCameraFieldOfView("player"))
end
addCommandHandler("getfov", getCamFOV)

See Also