Camera Functions
Functions to change camera points and apply effects.
setCameraScroll(x:Float, y:Float):Void
Set the Game Camera's current scroll position.
Examples:
- setCameraScroll(0.0, 0.0) - Camera Scroll position is set to X: 0 and Y: 0.
setCameraFollowPoint
setCameraFollowPoint(x:Float, y:Float):Void
Set the Game Camera's follow point position.
Examples:
- setCameraFollowPoint(-150.0, 150.0) - Camera Follow point is set to 150 units to the left and 150 units down.
addCameraScroll(?x:Float = 0, ?y:Float = 0):Void
Adds X/Y to the Game Camera's current scroll position.
All values are optional and defaults to zero.
Examples:
- addCameraScroll(200.0, -100.0) - Camera Scroll moves 200 units to the right and 100 units up.
addCameraFollowPoint
addCameraFollowPoint(?x:Float = 0, ?y:Float = 0):Void
Adds X/Y to the Game Camera's follow point position.
All values are optional and defaults to zero.
Examples:
- addCameraFollowPoint(-600.0, -200.0) - Camera Follow point moves 600 units to the left and 200 units up.
Usage: getCameraScrollX()
Returns Game Camera's current scroll X, float value.
Usage: getCameraScrollY()
Returns Game Camera's current scroll Y, float value.
getCameraFollowX
Usage: getCameraFollowX()
Returns Game Camera's follow point X, float value.
getCameraFollowY
Usage: getCameraFollowY()
Returns Game Camera's follow point Y, float value.
cameraSetTarget
cameraSetTarget(character:String):Void
Changes the Follow Point to target a character.
- character - Can be "bf", "gf", or "dad" ("opponent" alternatively).
Examples:
- cameraSetTarget('opponent') - Sets camera follow point to Opponent.
cameraShake
cameraShake(camera:String, intensity:Float, duration:Float):Void
Shakes an identified camera.
- camera - Can be "game", "hud" or "other".
- 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" or "other".
- 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" or "other".
- 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.