GetCameraFieldOfView: Difference between revisions
Jump to navigation
Jump to search
m (fix typo 2) |
m (Deleted default values, they are independent from server) Tag: Manual revert |
||
(14 intermediate revisions by 6 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| | {{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== | ||
{{ | {{Client camera functions}} | ||
[[hu:getCameraFieldOfView]] | |||
[[RO:getCameraFieldOfView]] |
Latest revision as of 19:41, 14 January 2022
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)