1
\$\begingroup\$

Is there any way to make a SpriteBatch flip when its clicked, something like Android Animation?

I know that spriteBatch.Draw() have SpriteEffects, but it literally flip it and I want to flip it like an animation.

\$\endgroup\$
1
\$\begingroup\$

In XNA, you won't find any direct analog to the Android method you linked. You are also correct that SpriteEffects is not the answer to your problem (it's a very short enumeration).

If you want to display an animation, you will have to manually display different sprites sequentially, which is commonly accomplished with a sprite sheet that contains the frames. You must implement some form of a counter that updates each frame, and use that counter to select the correct frame of your animation. For example, if the animation frames are arranged into a grid, you could progress through that grid's rows and columns using a pair of simple loops (again, based on your counter).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.