StartCameraFade: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Client|1.0}} | {{Info|Function|Client|1.0}} | ||
{{FuncDescription|Smoothly fade in or out, | {{FuncDescription|Smoothly fade in or out, setting CameraFade will overwrite any other started camera fades which were called before. The fading will no persist after the fade duration.}} | ||
{{FuncSyntax|StartCameraFade(FromAlpha, ToAlpha, Duration [, | {{FuncSyntax|StartCameraFade(FromAlpha, ToAlpha, Duration [, IntColor])}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|FromAlpha|Starting alpha (0-1)}} | {{FuncParam|FromAlpha|Starting alpha (0-1)}} | ||
{{FuncParam|ToAlpha|Alpha you want to fade to (0-1)}} | {{FuncParam|ToAlpha|Alpha you want to fade to (0-1)}} | ||
{{FuncParam|Duration |Duration of the fade in seconds}} | {{FuncParam|Duration|Duration of the fade in seconds}} | ||
{{FuncParamOptional| | {{FuncParamOptional|IntColor|Color as an integer from [[RGBA]].}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns '''true'''.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | <syntaxhighlight lang="Lua"> | ||
StartCameraFade(1.0, 0.0, | StartCameraFade(0.0, 1.0, 2.0, RGB(0, 0, 0)) | ||
-- The fading to black from above will not persist. So start a timer that does a full black background later. | |||
Delay(1900, function() | |||
StartCameraFade(1.0, 1.0, 10000.0, RGB(0, 0, 0)) | |||
end) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{CameraFunctions}} |
Latest revision as of 20:41, 30 August 2020
Description
Smoothly fade in or out, setting CameraFade will overwrite any other started camera fades which were called before. The fading will no persist after the fade duration.
Syntax
StartCameraFade(FromAlpha, ToAlpha, Duration [, IntColor])
Parameters
- FromAlpha
Starting alpha (0-1) - ToAlpha
Alpha you want to fade to (0-1) - Duration
Duration of the fade in seconds - IntColor (optional)
Color as an integer from RGBA.
Return Value
- Returns true.
Example
StartCameraFade(0.0, 1.0, 2.0, RGB(0, 0, 0))
-- The fading to black from above will not persist. So start a timer that does a full black background later.
Delay(1900, function()
StartCameraFade(1.0, 1.0, 10000.0, RGB(0, 0, 0))
end)
See also
- StartCameraFade
- StopCameraFade
- PlayCameraShake
- StopCameraShake
- SetCameraShakeLocation
- SetCameraShakeRotation
- SetCameraShakeFOV
- GetScreenSize
- SetCameraLocation
- GetCameraLocation
- SetCameraRotation
- GetCameraRotation
- GetCameraForwardVector
- GetCameraRightVector
- GetCameraUpVector
- GetInputAxisValue
- SetCameraViewDistance
- GetCameraViewDistance