0

I want to smooth rotate my spirtes. I have 6 sprites and I want to rotate them on 360. This is my code:

unactiveTimerWaitingForPlayersTxtSprite
                .registerUpdateHandler(timerToUnactiveTimerWaitingTxt);
TimerHandler timerToUnactiveTimerWaitingTxt = new TimerHandler(0.1f, true,
        new ITimerCallback() {
            public void onTimePassed(TimerHandler pTimerHandler) {
                unactiveTimerWaitingForPlayersTxtSprite
                        .setRotation(unactiveTimerWaitingForPlayersTxtSprite
                                .getRotation() - ANGLE_WAITING_TXT);
            }
        });

This is code for one sprite. For all my sprites I do that in the same way. When I run application on Asus transformer 700 rotate of objects is not smooth. I add this code to engine:

 engineOptions.getRenderOptions().setDithering(true);
        engineOptions.getRenderOptions().setMultiSampling(true);

but still the same effect. There is any way to smooth rotate objects?

edi233
  • 3,511
  • 13
  • 56
  • 97

1 Answers1

0

Use Modifiers: In this case you are looking for the RotationModifier.

If you want to rotate the sprites using custom TimerHandlers then you have to multiply the angle change (ANGLE_WAITING_TXT) with the elapsed time in order to have a smooth animation.

sjkm
  • 3,887
  • 2
  • 25
  • 43