hallowed-ocean-84954
05/28/2023, 10:24 PMlime/_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);
.
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.hallowed-ocean-84954
05/28/2023, 10:28 PMbored-train-92318
05/28/2023, 10:43 PMhallowed-ocean-84954
05/28/2023, 10:55 PMrefined-flag-94330
05/28/2023, 11:10 PMable-printer-41379
05/28/2023, 11:29 PMcamera.canvas
on a new bitmapdataable-printer-41379
05/28/2023, 11:30 PMrefined-flag-94330
05/28/2023, 11:45 PMable-printer-41379
05/28/2023, 11:48 PMthousands-state-46635
05/29/2023, 12:12 AMhx
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▾
thousands-state-46635
05/29/2023, 12:14 AMdazzling-ocean-80407
05/29/2023, 12:14 AMdazzling-ocean-80407
05/29/2023, 12:16 AMthousands-state-46635
05/29/2023, 12:19 AMthousands-state-46635
05/29/2023, 12:19 AMthousands-state-46635
05/29/2023, 12:20 AMhx
var sprite = new FlxSprite().makeGraphic(400, 200, FlxColor.BLUE);
yields the same resultsthousands-state-46635
05/29/2023, 12:25 AMthousands-state-46635
05/29/2023, 12:29 AMthousands-state-46635
05/29/2023, 12:29 AMbland-caravan-49046
05/29/2023, 2:20 AMmost-eve-98431
05/29/2023, 2:21 AMmost-eve-98431
05/29/2023, 2:21 AMtext.antialiasing = false;
bland-caravan-49046
05/29/2023, 2:21 AMmost-eve-98431
05/29/2023, 2:21 AMbland-caravan-49046
05/29/2023, 2:21 AMmost-eve-98431
05/29/2023, 2:21 AMbland-caravan-49046
05/29/2023, 2:21 AMbland-caravan-49046
05/29/2023, 2:22 AMbland-caravan-49046
05/29/2023, 2:22 AMbland-caravan-49046
05/29/2023, 2:24 AM