https://linen.dev logo
Join Discord
Powered by
# lime
  • p

    purple-toddler-22641

    01/11/2023, 5:09 PM
    I presume Flixel doesn't have anything like that built in
  • p

    purple-toddler-22641

    01/11/2023, 5:09 PM
    I know there's FlxCamera.screen but that's just for blit mode (which I think I don't use)
  • h

    hallowed-ocean-84954

    01/11/2023, 5:10 PM
    It didn't when I did it at least - I did it to capture screenshots for testing shaders
  • h

    hallowed-ocean-84954

    01/11/2023, 5:11 PM
    this is the capture code
  • h

    hallowed-ocean-84954

    01/11/2023, 5:12 PM
    this is the macro that installs it . I suspect this is version dependent - so you'll probably need to check the openfl version
  • a

    able-action-74275

    01/11/2023, 5:12 PM
    I think the window.readPixels should get with shaders aleady?
  • h

    hallowed-ocean-84954

    01/11/2023, 5:12 PM
    I cannot swear to it but I think I tried it
  • a

    able-action-74275

    01/11/2023, 5:12 PM
    it gets the pixels from gl.readPixels
  • h

    hallowed-ocean-84954

    01/11/2023, 5:12 PM
    certainly it's easier so try it first
  • h

    hallowed-ocean-84954

    01/11/2023, 5:13 PM
    the problem is when can you plug it in
  • h

    hallowed-ocean-84954

    01/11/2023, 5:13 PM
    you have to read at the right time - I think that was my biggest issue
  • h

    hallowed-ocean-84954

    01/11/2023, 5:13 PM
    I'm still baffled why game bar is getting old snaps
  • h

    hallowed-ocean-84954

    01/11/2023, 5:13 PM
    that's really wierd
  • p

    purple-toddler-22641

    01/11/2023, 5:16 PM
    Every app does that
  • p

    purple-toddler-22641

    01/11/2023, 5:16 PM
    Thanks for the code, will have to dig into that later
  • p

    purple-toddler-22641

    01/11/2023, 5:17 PM
    I also found FlxScreenGrab but that doesn't seem to work
  • a

    able-action-74275

    01/11/2023, 5:17 PM
    thats' a capture from lime
  • a

    able-action-74275

    01/11/2023, 5:17 PM
    HerokuShaders sample
  • h

    hallowed-ocean-84954

    01/11/2023, 5:17 PM
    yeah from there you have access at the right time
  • a

    able-action-74275

    01/11/2023, 5:17 PM
    I see
  • h

    hallowed-ocean-84954

    01/11/2023, 5:17 PM
    up in flixel it's harder to get access - at least I think that's the main issue
  • a

    able-action-74275

    01/11/2023, 5:17 PM
    flixel getting in the way
  • h

    hallowed-ocean-84954

    01/11/2023, 5:18 PM
    but I could get there going just into openfl - didn't need to go to lime thankfully
  • h

    hallowed-ocean-84954

    01/11/2023, 5:18 PM
    yeah FlxScreenGrab I think I tried and it didn't work for me either
  • a

    able-action-74275

    01/11/2023, 5:21 PM
    seems to work in flixel too
  • a

    able-action-74275

    01/11/2023, 5:21 PM
    Copy code
    hx
    FlxG.stage.window.onKeyDown.add((code, modifier) ->
    {
        if (code == A)
        {
            // get the data
            var image_pixels = FlxG.stage.window.readPixels(new Rectangle(0, 0, FlxG.stage.window.width, FlxG.stage.window.height));
            var image_bytes = image_pixels.encode();
    
            // write the data to disk
            var file = sys.io.File.write("test.png", true);
            file.writeBytes(image_bytes, 0, image_bytes.length);
            file.close();
        }
    });
  • h

    hallowed-ocean-84954

    01/11/2023, 5:21 PM
    what aare you grabbing with ?
  • h

    hallowed-ocean-84954

    01/11/2023, 5:21 PM
    wow! - ok cool
  • h

    hallowed-ocean-84954

    01/11/2023, 5:21 PM
    try that then
  • h

    hallowed-ocean-84954

    01/11/2023, 5:21 PM
    I'll have to revisit that - I could not get it to work when I tried
1...495051...138Latest