drawToBitmapData on iOS
Hi guys,
I just installed the latest version of Air hoping there was some changes on this, but I still have a problem so let me try to ask your help...
I have to render the stage3d on a bitmap, like a screenshot, and to do this I’m using the drawToBitmapData function, like the example on the API documentation.
This works fine on desktop but not on mobile, for example on my iPad3, where nothing is shown.
I noticed, reading around, that if put a call to the render function every frame, then also on ipad I see correctly the render result moved on a bitmap and pasted over the stage. But not using a single call, that is what I need.
So, with a function like this:
private function render(event:Event):void {
stage3d.context3D.clear(0, 0, 0, 1);
stage3d.context3D.drawTriangles(quadIndices);
stage3d.context3D.drawToBitmapData(bd);
stage3d.context3D.present();
var bitmap:Bitmap = new Bitmap(bd);
addChild(bitmap);
}
on mobile I have a working result only adding a ’addEventListener(Event.ENTER_FRAME, render)’
what do you think?
thanks!
