0
\$\begingroup\$

I have a probably dumb question.

I'm trying to create a LoadingCircle so I just picked one image (you can see in the attachment) and made some sequences to rotate it:

 Tween.to(loadingCircle, SpriteAccessor.ANGLE, 1f).targetRelative(25).repeatYoyo(Tween.INFINITY,0).start(tweenManager);

And SpriteAccessor:

case ANGLE:
   returnValues[0] = target.getRotation();

case ANGLE:
    target.setRotation(newValues[0]);

It rotates of course, but 'to()' method gets the 'time' parameter. Now, the animation rotates the image, but slows down and stops rotating after the given time and starts from the beginning - speeds up and again - slows down.

Is it possible somehow to set the rotation to be continous, that it won't slow down and repeat the action? It's caused by the interpolation I think.

If you could point me the way I would be grateful!

enter image description here

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

How about changing your approach to the simpler solution? You could just manually rotate the sprite in your update-method with something like the following: sprite.setRotation((sprite.getRotation() + rotationSpeed) % 360);. That way the sprite will smoothly spin around forever, and your code stays clean and straight-forward.

\$\endgroup\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .