class flixel.addons.plugin.screengrab.FlxScreenGrab extends FlxPlugin
Available on all platforms
Captures a screen grab of the game and stores it locally, optionally saving as a PNG. * * @link http://www.photonstorm.com * @author Richard Davey / Photon Storm
Class Fields
static function defineCaptureRegion(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. * *
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 |
static function defineHotKeys(Keys:Array<String>, ?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. * *
Key | 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 |
static function grab(?CaptureRegion:Rectangle = null, ?SaveToFile:Bool = false, ?HideMouse:Bool = false):Bitmap
Takes a screen grab immediately of the given region or a previously defined region * *
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 | Bitmap The screen grab as a Flash Bitmap image |