Camera Functions
Functions to change camera points and apply effects.
makeLuaCamera
makeLuaCamera(tag:String, ?defaultDrawTarget:Bool = false):Void
Creates a new Lua-accessible camera and registers it for later use.
-
tag – Name used to reference the camera in other camera functions.
-
defaultDrawTarget (Optional) –
If true, game objects render to this camera by default.
If false, only objects explicitly assigned to it will render.
The camera is created with a fully transparent background and stored internally,
allowing it to be referenced by name in functions such as
cameraShake, cameraFlash, and cameraFade.
Examples:
-
makeLuaCamera('cinematic') – Creates a new transparent camera.
-
makeLuaCamera('overlay', true) – Creates a camera as a default draw target.
cameraShake
cameraShake(camera:String, intensity:Float, duration:Float):Void
Shakes an identified camera.
- camera - Can be "game", "hud", "other" or your created camera.
- intensity - Shake intensity.
- duration - How much time the shake lasts for (in seconds).
Examples:
- cameraShake('game', 0.025, 0.35) - Shakes Game Camera for 0.35 seconds, intensity 0.025.
cameraFlash
cameraFlash(camera:String, color:String, duration:Float, forceReset:Bool):Void
Flashes an identified camera.
- camera - Can be "game", "hud", "other" or your created camera.
- color - Color hexadecimal string or color name.
- duration - How much time the shake lasts for (in seconds).
- forceReset - If false, won't flash if there's still a previous flash active.
Examples:
- cameraFlash('game', 'FFFFFF', 0.5, true) - Flashbangs you, lasts for 0.5 seconds, color #FFFFFF (White).
- cameraFlash('game', 'red', 0.25, true) - Flashes red, lasts for 0.25 seconds.
cameraFade
cameraFade(camera:String, color:String, duration:Float, forceReset:Bool, ?fadeOut:Bool = false):Void
Flashes an identified camera.
- camera - Can be "game", "hud", "other" or your created camera.
- color - Color hexadecimal string or color name.
- duration - How much time the shake lasts for (in seconds).
- forceReset - If false, won't flash if there's still a previous flash active.
- fadeOut (Optional) - Fade in/out toggle.
Examples:
- cameraFade('game', 'FFFFFF', 0.35, true) - Fade in to white in 0.35 seconds.
- cameraFade('game', 'FFFFFF', 0.35, true, true) - Fade out to white in 0.35 seconds.