class flixel.system.frontEnds.CameraFrontEnd
Available on all platforms
Instance Fields
An array listing FlxCamera objects that are used to draw stuff. * By default flixel creates one camera the size of the screen.
var useBufferLocking:Bool
Allows you to possibly slightly optimize the rendering process IF * you are not doing any pre-processing in your game state's draw() call.
function add<T>(NewCamera:T):T
Add a new camera object to the game. * Handy for PiP, split-screen, etc. * *
NewCamera | The camera you want to add. * |
returns | This FlxCamera instance. |
function fade(?Color:Int = -16777216, ?Duration:Float = 1, ?FadeIn:Bool = false, ?OnComplete:Void ->Void = null, ?Force:Bool = false):Void
The screen is gradually filled with this color. * *
Color | The color you want to use. * |
Duration | How long it takes for the fade to finish. * |
FadeIn | True fades from a color, false fades to it. * |
OnComplete | A function you want to run when the fade finishes. * |
Force | Force the effect to reset. |
function flash(?Color:Int = -1, ?Duration:Float = 1, ?OnComplete:Void ->Void = null, ?Force:Bool = false):Void
All screens are filled with this color and gradually return to normal. * *
Color | The color you want to use. * |
Duration | How long it takes for the flash to fade. * |
OnComplete | A function you want to run when the flash finishes. * |
Force | Force the effect to reset. |
function remove(Camera:FlxCamera, ?Destroy:Bool = true):Void
Remove a camera from the game. * *
Camera | The camera you want to remove. * |
Destroy | Whether to call destroy() on the camera, default value is true. |
function reset(?NewCamera:FlxCamera = null):Void
Dumps all the current cameras and resets to just one camera. * Handy for doing split-screen especially. * *
NewCamera | Optional; specify a specific camera object to be the new main camera. |
function shake(?Intensity:Float = 0.05f, ?Duration:Float = 0.5f, ?OnComplete:Void ->Void = null, ?Force:Bool = true, ?Direction:Int = 0):Void
A simple screen-shake effect. * *
Intensity | Percentage of screen size representing the maximum distance that the screen can move while shaking. * |
Duration | The length in seconds that the shaking effect should last. * |
OnComplete | A function you want to run when the shake effect finishes. * |
Force | Force the effect to reset (default = true, unlike flash() and fade()!). * |
Direction | Whether to shake on both axes, just up and down, or just side to side (use class constants SHAKEBOTHAXES, SHAKEVERTICALONLY, or SHAKEHORIZONTALONLY). Default value is SHAKEBOTHAXES (0). |