Grabbing the screen's pixels (BitmapData)

  • I want to grab what's currently on screen and make a FlxSprite out of it (thinking about making a nice transition effect with it later) and I've tried using FlxScreenGrab to get the bitmap data like so:

    var data = FlxScreenGrab.grab(new Rectangle(0, 0, FlxG.width, FlxG.height), false, true).bitmapData;
    add(new FlxSprite(0,0, data));

    but the only thing getting copied seems to be the openfl fps counter I'm using...
    Anyone else tried to do something similar who can share some knowledge?

  • administrators

    What target are you using? This is not easily possible on native targets, see

  • Cpp target is what I want to release on, but Neko (sometimes Web) target when I'm working on the game.
    That's a shame... I might have to think of something else then is seems.

Log in to reply