Flixel Power Tools FlxScreenGrab
Back to the Flixel Power Tools
This class allows you to take screen grabs of your game as it’s running. And then save that grab as a PNG locally. The screen grab process can be bound to a Hot Key, or called directly. You can control if the mouse pointer is hidden before capture or not, and you have full control over which part of the screen is captured. It defaults to the whole screen, but any rectangle region is valid (and can even be passed in real-time, see the Camera Test Suite example!)
Screen Shot
Code Example
1 2 3 4 5 6 |
// Define our hotkey (F1) the parameters simply say "save it right away" and "hide the mouse first" FlxScreenGrab.defineHotKey("F1", true, true); // That's it! The tools do the rest until you either unload the plugin or clear the hot key |
Recent Flixel Power Tool Posts
- Flixel Power Tools v1.9 Released
- Flixel Power Tools v1.8 Released - Let's get clicky
- Flixel Power Tools v1.7 - Kaboom!
- Flixel Power Tools v1.6 released including FlxControl
- Flixel Power Tools v1.5 - A monster of an update!
- FlxScreenGrab and FlxScrollZone added to Flixel Power Tools
- Flixel Power Tools v1.3 - Now Flixel 2.5 compatible!
- FlxHealthBar added to Flixel Power Tools
4 Responses
Leave a commentMake yourself heard
FPT Classes
Hire Us
All about Photon Storm and our
HTML5 game development services
Recent Posts
OurGames
Filter our Content
- ActionScript3
- Art
- Cool Links
- Demoscene
- Flash Game Dev Tips
- Game Development
- Gaming
- Geek Shopping
- HTML5
- In the Media
- Phaser
- Phaser 3
- Projects
Brain Food
This seems to run afoul of Error 2176 in FP10: “Certain actions, such as those that display a pop-up window, may only be invoked upon user interaction, for example by a mouse click or button press.”
Not sure why hitting F1 doesn’t count as a button press.
Sure it’s for using locally to grab from your game while running it. I’ll do an example at some point where it’s fired from a mouse event (that is why the sandbox security thing hits it)
Hi rich,
I tried the sample above but it doesn’t seem to be doing anything.
We tried implementing it to our own flixel game and although it works on a flash viewer, it doesn’t work when it is online.
Is it because the browser is preventing the pop-up box from opening?
Thanks!
Hi Karlo – Nope it’s a Flash sandbox permissions error. The event that triggers the screen capture has to be fired from either a MouseEvent or KeyboardEvent function, that’s why it only works locally. It shouldn’t be that hard to modify to make it work from a real event if you need.