Hi !
First of all, please excuse my broken english.
I test Haxe since years, in my free time, and I enjoyed the last released of Haxe / OpenFL when…
For manage a layer system, I want to draw on many sprites with “drawTiles”, then addchild those on a “root” container (not on displayList), and finally draw this container on a bitmap which is on stage.
Example :
var wrapper:Sprite = new Sprite();
var img:BitmapData = Assets.getBitmapData("img/spritesheet.png");
var t:Tilesheet = new Tilesheet(img);
t.addTileRect(new Rectangle(64, 64, 64, 64));
t.drawTiles(wrapper.graphics, [0, 0, 0], false);
var bmd:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, false, 0);
var canvas:Bitmap = new Bitmap(bmd);
addChild(canvas);
bmd.draw(wrapper);
It works on flash target, but not with cpp : the bitmap “canvas” show a portion of spritesheet, but from the origin of the spritesheet (not at 64, 64).
If I skip the bmd.draw and just addchild the wrapper on stage, the result is good.
var wrapper:Sprite = new Sprite();
var img:BitmapData = Assets.getBitmapData("img/spritesheet.png");
var t:Tilesheet = new Tilesheet(img);
t.addTileRect(new Rectangle(64, 64, 64, 64));
t.drawTiles(wrapper.graphics, [0, 0, 0], false);
addChild(wrapper);
I don’t understand
https://github.com/Grouuu/demoOpenFLbug
openfl 3.4.0
lime 2.7.0
hxcpp 3.2.193