Applying a transform to a DisplayObjectContainer without triggering a redraw for all Graphics contained

I’ve tried using cacheAsBitmap=true & setting cacheAsBitmapMatrix to an identity matrix for each of the children.
This however results in some unexpected offsetting of the children whenever the container is scaled.

I’ve also tried setting the ‘openfl_disable_graphics_upscaling’ flag. This works when scaling upwards, but not downwards (less than 1.0). There’s also a considerable performance hit compared to the first approach.

I’m simply trying to implement a camera zoom effect in a non-Flash target without redrawing every Graphic when the scale or rotation changes.
How can this be done?

Have you tried doing your own “cache as bitmap” thing ? I mean drawing the sprite to a bitmap, use the bitmap during the zoom animation and then switching back to the sprite when it’s done.

I did consider that… but for some reason I thought it wouldn’t work.
On further consideration, I don’t see why it wouldn’t.
Thanks :slight_smile:

1 Like