I’m using openfl 2.1.7 for a simple arrow shoot html5 game. I build the game with “openfl build html5 -Ddom”. When I rotate the game scene sprite by “sceneSprite.rotation = 90”. All display objects goes to (0,0) with rotation = 0.
This only happens under Safari (both desktop and mobile). Chrome doesn’t has this issue.
I found a work around for this. After reset the scene’s rotation, force reset all displayObjects’ rotation.
Hope it helps guys met the similar issue.
Thanks.
...
sceneSprite.rotation = 90;
refreshDisplayObjects(stage);
...
private static function refreshDisplayObjects(container:DisplayObjectContainer):Void
{
for(i in 0...container.numChildren)
{
var child = container.getChildAt(i);
if (Std.is(child, DisplayObjectContainer))
{
refreshDisplayObjects(cast child);
}
child.rotation += 0.0001;
}
}