https://linen.dev logo
Join Discord
Powered by
# flixel
  • h

    hallowed-ocean-84954

    05/28/2023, 10:24 PM
    Anyone following my tribulations with capturing screen output on html5 might be interested in this. It turns out that the problem is indeed related to clearing the drawing buffer after rendering. It is probably the async nature of the browser interactions or something similar that makes it such a problem in html5. Now if I modify
    lime/_internal/backend/html5/HTML5Window.hx
    where the canvas context is first created to set this property true then you can capture the image properly with
    FlxG.stage.context3D.drawToBitmapData(bmp);
    .
    Copy code
    hx
                    var options =
                        {
                            ...
                                                    ...
                            preserveDrawingBuffer: true,
                                                    ...
                        };
    The problem is that the context cannot be modified once created. And while you can specify some attributes at creation you cannot specify this one. So .... hmmmm.... no nice solution yet but it's progress.
  • h

    hallowed-ocean-84954

    05/28/2023, 10:28 PM
    My current theory now is to create a filter that writes to a custom framebuffer and then read that back. But there is complexity in having to render twice and then read back. Not sure if there are better options
  • b

    bored-train-92318

    05/28/2023, 10:43 PM
    wait context3D works on html5?
  • h

    hallowed-ocean-84954

    05/28/2023, 10:55 PM
    Yep. The target stuff is further down the stack
  • r

    refined-flag-94330

    05/28/2023, 11:10 PM
    is there a way to get the bitmap data from FlxG.camera. I tried buffer and screen but they return null.
  • a

    able-printer-41379

    05/28/2023, 11:29 PM
    try drawing
    camera.canvas
    on a new bitmapdata
  • a

    able-printer-41379

    05/28/2023, 11:30 PM
    make sure that the camera is in FlxG.cameras.list (nvm FlxG.camera is already in cameras.list)
  • r

    refined-flag-94330

    05/28/2023, 11:45 PM
    It works! Thanks!
  • a

    able-printer-41379

    05/28/2023, 11:48 PM
    np!
  • t

    thousands-state-46635

    05/29/2023, 12:12 AM
    For some reason, sprites aren't appearing on my project, does anyone know why this could be the reason? code:
    Copy code
    hx
    lass InitLoadingState extends FlxState
    {
        public function new()
        {
            super();
            Parser.init("assets/engine/data/parser_rules.json");
            Drinks.init("assets/data/drinks/drink_files.txt");
    
            #if debug
            trace(Parser.parserRules);
            trace(Drinks.drinks);
            #end
        }
    
        override function create()
        {
            var sprite = new FlxSprite().makeGraphic(400, 200);
            add(sprite);
            // FlxG.switchState(new PlayState());
            super.create();
        }
    
        override function update(elapsed:Float)
        {
            super.update(elapsed);
        }
    }

    https://cdn.discordapp.com/attachments/165234904815239168/1112533957033086996/image.png▾

  • t

    thousands-state-46635

    05/29/2023, 12:14 AM
    lime, openfl & flixel are all up to date
  • d

    dazzling-ocean-80407

    05/29/2023, 12:14 AM
    the black square is probably the sprite
  • d

    dazzling-ocean-80407

    05/29/2023, 12:16 AM
    it'll just be easier to tell which one is the sprite if you comment the line out, run it, and see if something disappeared or not
  • t

    thousands-state-46635

    05/29/2023, 12:19 AM
    this is a 1920x1080 resolution project
  • t

    thousands-state-46635

    05/29/2023, 12:19 AM
    and flxsprite makegraphic() defaults to white
  • t

    thousands-state-46635

    05/29/2023, 12:20 AM
    even doing something like
    Copy code
    hx
    
            var sprite = new FlxSprite().makeGraphic(400, 200, FlxColor.BLUE);
    yields the same results
  • t

    thousands-state-46635

    05/29/2023, 12:25 AM
    created a new project... it worked fine until i changed the project resolutinon
  • t

    thousands-state-46635

    05/29/2023, 12:29 AM
    well now it works?
  • t

    thousands-state-46635

    05/29/2023, 12:29 AM
    an wtf
  • b

    bland-caravan-49046

    05/29/2023, 2:20 AM
    is there a way to turn off antialiasing on normal FlxText?
  • m

    most-eve-98431

    05/29/2023, 2:21 AM
    Setting it manually
  • m

    most-eve-98431

    05/29/2023, 2:21 AM
    text.antialiasing = false;
  • b

    bland-caravan-49046

    05/29/2023, 2:21 AM
    ohh alr
  • m

    most-eve-98431

    05/29/2023, 2:21 AM
    It should be off by default tho
  • b

    bland-caravan-49046

    05/29/2023, 2:21 AM
    i read that that doesn't work on google but i will try it
  • m

    most-eve-98431

    05/29/2023, 2:21 AM
    thats weird
  • b

    bland-caravan-49046

    05/29/2023, 2:21 AM
    i'm going for like
  • b

    bland-caravan-49046

    05/29/2023, 2:22 AM
    a raster text appearance
  • b

    bland-caravan-49046

    05/29/2023, 2:22 AM
    sharp edges
  • b

    bland-caravan-49046

    05/29/2023, 2:24 AM
    yeah no it didn't work, i want all the transparent pixels gone
1...98059806980798089809Latest