Don’t know if this topic was discussed before. I can’t find something similar.
Problem is when I am drawing a circle and rotating it , it looks horrible, I have tried to compile in flash and it looks just fine but html5 is causing the problem,
sun = new Sprite();
sun.graphics.lineStyle(0,0xFF6600);
sun.graphics.beginFill(0xFF3300);
sun.graphics.drawCircle(0,0,40);
sun.graphics.endFill();
addEventListener(Event.ENTER_FRAME, orbit);
private function orbit(e):Void
{
sun.rotation++;
}
Notice that orange and blue both circle are kinda cut off , and when they rotate they are kinda shaky.
I ran into the same problem as Galib a while back: http://community.openfl.org/t/jerky-rotation-on-html5/8850
Unfortunately no one ever replied. I just looked at CanvasRenderer.hx
and GLRenderer.hx and you know what? With OpenFL 4.9.1 renderSession.roundPixels
seems to be false by default. This ain’t giving me smooth rotations though.
Could you do me a favor and check the code snippet in the post I’ve linked
and tell me if it’s looking smooth?
I just did some testing and found out that renderSession.roundPixels actually affects the smoothness of
a rotation. The object to be rotated needs to be a Bitmap though and furthermore it’s smoothing property
should be set to true. If it’s a simple shape as in my example above the rotation will be stuttering no
matter what you do.