Table View
Functions to manage camera and game view.
Functions
| FadeIn([speed]) | Do a full-screen fade-in from black. |
| FadeOut([speed]) | Do a full-screen fade-to-black. |
| SetCineBars([height], [speed]) | Animate black cinematic bars in from the top and bottom of the game window. |
| GetFOV() | Get field of view. |
| SetFOV(angle) | Set field of view. |
| GetDOF() | Get a set of 4 depth of field parameters. |
| SetDOF(mode, [distance], [range], [strength]) | Set depth of field parameters. |
| SetRoll(angle) | Set the camera roll. |
| GetRoll() | Get the current roll of camera. |
| GetCameraType() | Shows the mode of the game camera. |
| GetCameraPosition() | Gets current camera position. |
| GetCameraTarget() | Gets current camera target. |
| GetCameraRoom() | Gets current room where camera is positioned. |
| GetPostProcess() | Gets the post-process effect mode and strength. |
| SetPostProcess(effect, [strength]) | Sets the post-process effect, like negative or monochrome. |
| GetPostProcessTint() | Gets the post-process tint. |
| SetPostProcessTint(tint) | Sets the post-process tint. |
| PlayVideo(fileName, [background], [silent], [loop]) | Play a video file. |
| StopVideo() | Stop the currently playing video. |
| GetVideoPosition() | Gets the currently playing video position. |
| SetVideoPosition(position) | Sets the currently playing video position. |
| GetVideoDominantColor() | Gets the dominant color for the current video frame. |
| IsVideoPlaying([name]) | Checks if video is currently playing. |
| PlayFlyby(seqID) | Play a flyby sequence. |
| GetFlybyPosition(seqID, progress, [loop]) | Get a flyby sequence's position at a specified progress point in percent. |
| GetFlybyRotation(seqID, progress, [loop]) | Get a flyby sequence's rotation at a specified progress point in percent. |
| ResetObjCamera() | Reset object camera back to Lara and deactivate object camera. |
| FlashScreen([color], [speed]) | Flash screen. |
| SaveScreenshot() | Save a screenshot to the Screenshots folder. |
| GetAspectRatio() | Get the display resolution's aspect ratio. |
Functions
- FadeIn([speed])
-
Do a full-screen fade-in from black.
Parameters:
- speed float Speed in units per second. A value of 1 will make the fade take one second. Default: 1.
- FadeOut([speed])
-
Do a full-screen fade-to-black. The screen will remain black until a call to FadeIn.
Parameters:
- speed float Speed in units per second. A value of 1 will make the fade take one second. Default: 1.
- SetCineBars([height], [speed])
-
Animate black cinematic bars in from the top and bottom of the game window.
Parameters:
- height float Percentage of the screen to be covered. Default: 30.
- speed float Speed in units per second. A value of 1 will make the animation take one second. Default: 1.
- GetFOV()
-
Get field of view.
Returns:
-
float
Current FOV angle in degrees.
- SetFOV(angle)
-
Set field of view.
Parameters:
- angle float Angle in degrees (clamped to [10, 170]).
- GetDOF()
-
Get a set of 4 depth of field parameters.
Returns:
- DOFMode Current depth of field mode.
- float Current focus distance in world units.
- float Current sharp focus width in world units.
- float Current maximum bokeh radius.
Usage:
local mode, distance, range, strength = View.GetDOF() - SetDOF(mode, [distance], [range], [strength])
-
Set depth of field parameters.
Parameters:
- mode DOFMode Specifies depth of field mode to use. Set to View.DOFMode.NONE to disable depth of field.
- distance float Focus distance in world units. Default: 1536.
- range float Width of the sharp focus region in world units. Default: 2048.
- strength float Maximum bokeh radius (clamped to [0, 1]). Default: 0.2.
- SetRoll(angle)
-
Set the camera roll.
Parameters:
- angle float Angle in degrees.
- GetRoll()
-
Get the current roll of camera.
Returns:
-
float
Current roll angle in degrees.
- GetCameraType()
-
Shows the mode of the game camera.
Returns:
-
CameraType
Value used by the game camera.
Usage:
LevelFuncs.OnLoop = function() if (View.GetCameraType() == CameraType.COMBAT) then --Do your Actions here. end end
- GetCameraPosition()
-
Gets current camera position.
Returns:
-
Vec3
Current camera position.
- GetCameraTarget()
-
Gets current camera target.
Returns:
-
Vec3
Current camera target.
- GetCameraRoom()
-
Gets current room where camera is positioned.
Returns:
-
Room
Current room of the camera.
- GetPostProcess()
-
Gets the post-process effect mode and strength.
Returns:
- PostProcessMode Current post process mode.
- float strength How strong the current effect is.
- SetPostProcess(effect, [strength])
-
Sets the post-process effect, like negative or monochrome.
Parameters:
- effect PostProcessMode Effect type to set.
- strength float How strong the effect is. Default: 1.
- GetPostProcessTint()
-
Gets the post-process tint.
Returns:
-
Color
Current tint value.
- SetPostProcessTint(tint)
-
Sets the post-process tint.
Parameters:
- tint Color Tint value to use.
- PlayVideo(fileName, [background], [silent], [loop])
-
Play a video file. File should be placed in the
FMVfolder.Parameters:
- fileName string Video file name. Can be provided without extension, if type is mp4, mkv, mov or avi.
- background bool Play video in the background mode. In such case, video won't play in fullscreen, but must be shown using special animated texture type in Tomb Editor, or using View.DisplaySprite. Default: false.
- silent bool Play video without sound. Default: false.
- loop bool Play video in a loop. Default: false.
- StopVideo()
- Stop the currently playing video. Only possible if video is playing in the background mode.
- GetVideoPosition()
-
Gets the currently playing video position.
Returns:
-
Time
Current video position.
- SetVideoPosition(position)
-
Sets the currently playing video position.
Parameters:
- position Time New video position.
- GetVideoDominantColor()
-
Gets the dominant color for the current video frame. If no video is playing, returns black.
Returns:
-
Color
Dominant video color.
- IsVideoPlaying([name])
-
Checks if video is currently playing.
Parameters:
- name string Video file name. If provided, checks if the currently playing video file name is the same as the provided one. Optional.
Returns:
-
bool
True if video is currently playing.
- PlayFlyby(seqID)
-
Play a flyby sequence.
Parameters:
- seqID int Flyby sequence ID.
- GetFlybyPosition(seqID, progress, [loop])
-
Get a flyby sequence's position at a specified progress point in percent.
Parameters:
- seqID int Flyby sequence ID.
- progress float Progress point in percent. Clamped to [0, 100].
- loop bool Smooth the position near start and end points, as if the sequence is looped. Optional.
Returns:
-
Vec3
Position at the given progress point.
- GetFlybyRotation(seqID, progress, [loop])
-
Get a flyby sequence's rotation at a specified progress point in percent.
Parameters:
- seqID int Flyby sequence ID.
- progress float Progress point in percent. Clamped to [0, 100].
- loop bool Smooth the position near start and end points, as if the sequence is looped. Optional.
Returns:
-
Rotation
Rotation at the given progress point.
- ResetObjCamera()
- Reset object camera back to Lara and deactivate object camera. Can be used after Objects.Moveable.AttachObjCamera.
- FlashScreen([color], [speed])
-
Flash screen.
Parameters:
- color Color Color. Default: Color(255, 255, 255).
- speed float Speed in units per second. Value of 1 will make flash take one second. Clamped to [0.005, 1.0]. Default: 1.
- SaveScreenshot()
-
Save a screenshot to the Screenshots folder.
Name of the screenshot is generated automatically based on the current date and time.
Returns:
-
string
Path to the saved screenshot file.
nilif saving failed. - GetAspectRatio()
-
Get the display resolution's aspect ratio.
Returns:
-
float
Display resolution's aspect ratio.
