Captures a screen grab of the game and stores it locally, optionally saving as a PNG.

@link http://www.photonstorm.com

Static variables

staticread onlyscreenshot:Bitmap

Static methods

staticclearCaptureRegion():Void

Clears a previously defined capture region

staticclearHotKeys():Void

Clears all previously defined hotkeys

staticdefineCaptureRegion(X:Int, Y:Int, Width:Int, Height:Int):Void

Defines the region of the screen that should be captured. If you need it to be a fixed location then use this. If you want to grab the whole SWF size, you don't need to set this as that is the default. Remember that if your game is running in a zoom mode > 1 you need to account for this here.

Parameters:

X

The x coordinate (in Flash display space, not Flixel game world)

Y

The y coordinate (in Flash display space, not Flixel game world)

Width

The width of the grab region

Height

The height of the grab region

@:value({ HideMouse : false, SaveToFile : false })staticdefineHotKeys(Keys:Array<FlxKey>, SaveToFile:Bool = false, HideMouse:Bool = false):Void

Specify which key will capture a screen shot. Use the String value of the key in the same way FlxG.keys does (so "F1" for example) Optionally save the image to a file immediately. This uses the file systems "Save as" dialog window and pauses your game during the process.

Parameters:

Keys

The key(s) you press to capture the screen (i.e. [F1, SPACE])

SaveToFile

If true it will immediately encodes the grab to a PNG and open a "Save As" dialog window when the hotkey is pressed

HideMouse

If true the mouse will be hidden before capture and displayed afterwards when the hotkey is pressed

@:value({ HideMouse : false, SaveToFile : false })staticgrab(?CaptureRegion:Null<Rectangle>, SaveToFile:Bool = false, HideMouse:Bool = false):Bitmap

Takes a screen grab immediately of the given region or a previously defined region

Parameters:

CaptureRegion

A Rectangle area to capture. This over-rides that set by "defineCaptureRegion". If neither are set the full SWF size is used.

SaveToFile

Boolean If set to true it will immediately encode the grab to a PNG and open a "Save As" dialog window

HideMouse

Boolean If set to true the mouse will be hidden before capture and displayed again afterwards

Returns:

The screen grab as a Flash Bitmap image

Constructor

new()

Methods

Inherited Variables

Defined by FlxBasic

@:value(idEnumerator++)ID:Int = idEnumerator++

A unique ID starting from 0 and increasing by 1 for each subsequent FlxBasic that is created.

@:value(true)active:Bool = true

Controls whether update() is automatically called by FlxState/FlxGroup.

@:value(true)alive:Bool = true

Useful state for many game objects - "dead" (!alive) vs alive. kill() and revive() both flip this switch (along with exists, but you can override that).

camera:FlxCamera

Gets or sets the first camera of this object.

cameras:Array<FlxCamera>

This determines on which FlxCameras this object will be drawn. If it is null / has not been set, it uses the list of default draw targets, which is controlled via FlxG.camera.setDefaultDrawTarget as well as the DefaultDrawTarget argument of FlxG.camera.add.

read onlycontainer:Null<FlxContainer>

The parent containing this basic, typically if you check this recursively you should reach the state

Available since

5.7.0

.

@:value(true)exists:Bool = true

Controls whether update() and draw() are automatically called by FlxState/FlxGroup.

@:value(true)visible:Bool = true

Controls whether draw() is automatically called by FlxState/FlxGroup.

Inherited Methods

Defined by FlxBasic

draw():Void

Override this function to control how the object is drawn. Doing so is rarely necessary, but can be very useful.

getCameras():Array<FlxCamera>

The cameras that will draw this. Use this.cameras to set specific cameras for this object, otherwise the container's cameras are used, or the container's container and so on. If there is no container, say, if this is inside FlxGroups rather than a FlxContainer then the default draw cameras are returned.

Available since

5.7.0

.

kill():Void

Handy function for "killing" game objects. Use reset() to revive them. Default behavior is to flag them as nonexistent AND dead. However, if you want the "corpse" to remain in the game, like to animate an effect or whatever, you should override this, setting only alive to false, and leaving exists true.

revive():Void

Handy function for bringing game objects "back to life". Just sets alive and exists back to true. In practice, this function is most often called by FlxObject#reset().