https://linen.dev logo
Join DiscordCommunities
Powered by
# openfl
  • h

    hallowed-ocean-84954

    04/22/2023, 10:41 PM
    you can use Context3D.drawToBitmapData()
  • e

    enough-lawyer-1858

    04/22/2023, 10:45 PM
    I suppose that
    Copy code
    haxe
    @:privateAccess
    new Shader().__context.drawToBitmapData();
    right?
  • h

    hallowed-ocean-84954

    04/22/2023, 10:45 PM
    er hang on - let me check my code
  • h

    hallowed-ocean-84954

    04/22/2023, 10:46 PM
    I used a macro to install a reader func
  • e

    enough-lawyer-1858

    04/22/2023, 10:46 PM
    cos iirc that function was for like public ones, not public static ones
  • h

    hallowed-ocean-84954

    04/22/2023, 10:46 PM
    oh that no
  • h

    hallowed-ocean-84954

    04/22/2023, 10:46 PM
    go via the stage
  • h

    hallowed-ocean-84954

    04/22/2023, 10:47 PM
    are you doing this from openfl or flixel
  • e

    enough-lawyer-1858

    04/22/2023, 10:47 PM
    openfl
  • e

    enough-lawyer-1858

    04/22/2023, 10:47 PM
    altho i dont see the diff what im trying to do with openfl that with flixel
  • e

    enough-lawyer-1858

    04/22/2023, 10:48 PM
    I suppose shortcuts like
    FlxG.stage
    ?
  • h

    hallowed-ocean-84954

    04/22/2023, 10:48 PM
    only how you would get to the context
  • h

    hallowed-ocean-84954

    04/22/2023, 10:48 PM
    right
  • h

    hallowed-ocean-84954

    04/22/2023, 10:48 PM
    but to get the shader output I had to make sure it runs before present() is called
  • h

    hallowed-ocean-84954

    04/22/2023, 10:49 PM
    I think the doc notes that
  • h

    hallowed-ocean-84954

    04/22/2023, 10:49 PM
    yeah
  • h

    hallowed-ocean-84954

    04/22/2023, 10:50 PM
    so I did this from flixel - but this should be easier from openfl though I don't know how much easier. But I did it to capture shader output and save it to a file
  • e

    enough-lawyer-1858

    04/22/2023, 10:56 PM
    I basically need it to do that to do some wacky stuff, but yea I'm gonna try that out, Thx!
  • e

    enough-lawyer-1858

    04/22/2023, 10:58 PM
    do I need to add another function to stop the presentation or something like
    beginFill()
    and
    endFill()
    in
    openfl.display.Graphics
    ?
  • e

    enough-lawyer-1858

    04/22/2023, 10:58 PM
    @hallowed-ocean-84954
  • a

    able-action-74275

    04/22/2023, 11:14 PM
    I think you can use lime window readPixels to grab it, but you need to make sure it ia done before context.clear is run
  • a

    able-action-74275

    04/22/2023, 11:15 PM
    possibly by overriding draw on the FlxState and grabbing the pixels before calling super.draw
  • a

    able-action-74275

    04/22/2023, 11:16 PM
    I've done it on open fl so probably can be done flixel too
  • a

    able-action-74275

    04/22/2023, 11:17 PM
    unless you don't want to read the whole window
  • a

    able-action-74275

    04/22/2023, 11:19 PM
    drawToBitmap looks great
  • h

    hallowed-ocean-84954

    04/22/2023, 11:28 PM
    try the lime approach too. To get this to work right I had to install a function callout in Context3D before present() with a build macro. It was fun to do but I've been meaning to revisit the impl because I think there are simpler ways. If you want to see the impl I did it's in .
  • d

    damp-artist-60225

    04/23/2023, 11:00 AM
    It seems that the .build file stopped being created once I started using git version control, since it now uses the git version instead. Is there a way around this so I can continue to have the .build file as before, without rebuilding lime tools?
  • a

    able-action-74275

    04/23/2023, 1:19 PM
    are you comitting the built files (export directory) to source control?
  • d

    damp-artist-60225

    04/23/2023, 1:22 PM
    I'm not, I have export/ in the .gitignore file
  • a

    able-action-74275

    04/23/2023, 1:28 PM
    oh so .build is not created simply by way of having a git* repository?
1...505152...57Latest