ScreenShotPlugin.enabled:Bool; // Enable/disable the plugin at any time
ScreenShotPlugin.screenshtotKeys:Array<FlxKey>; // Keys to press to do a screenshot
ScreenShotPlugin.saveFormat:FileFormatOption; // The save file type (FileFormatOption.PNG/ FileFormatOption.JPEG)
ScreenShotPlugin.screenshotPath:String; // The path where to save the screenshots
ScreenShotPlugin.flashColor:Int; // The color of the flash that appears when taking a screenshot (0xAARRGGBB)
ScreenShotPlugin.outlineColor:Int; // The shot display outline's color that appears when taking a screenshot (0xAARRGGBB)
ScreenShotPlugin.screenshotFadeTime:Float; // The flash fade-in duration
ScreenShotPlugin.jpegQuality:Int; // If `saveFormat` is set to JPEG, this defines the quality of the JPEG files (0-100)
ScreenShotPlugin.sound:FlxSoundAsset; // Custom sound asset to play when the screenshot is taken (if null, no sound is played)
Some original code from flixel-addons.
Make sure you have flixel
and openfl
installed.
In your Project.xml
make sure this is there:
<haxelib name="flixel-screenshot-plugin" />
In your project's Main.hx
file, after the FlxGame
is initialized, add this line:
flixel.FlxG.plugins.add(new flixel.addons.plugin.ScreenShotPlugin());
And you're done!