[FIXED] Rotating animations problem in LibGDX

Hello, JGO.

I’m trying to make a top down shooter with libgdx. As you already know, in a top down (Bird’s eye) game, you don’t need to make every side of a sprite because you just have to rotate the sprite and there is where my problem lies.

When you ARE NOT using animations you can just set the texture of the sprite

sprite.setTexture(texture)

and then call the method

sprite.setRotation(angleInRadians)

BUT I AM using animations so how can I get the texture when I’m calling

animation.getKeyFrame(...)

.

Calling animation.getKeyFrame(…).getTexture() does not work as it returns the whole texture pack

Pleaaaase I need to fix this for this weekend’s ludum dare

I’m pretty sure if somebody knows how to do it, they would just tell you.

you can either create a sprite form the keyframe and setRotation there, which is probably not recommended or you can set the rotation when you batch.draw() the textureRegion, which is probably better. There is a param for this. :slight_smile:

How could I be so dumb?!

Thank you :smiley: