Making a sprite always point to another sprite in XNA
Posted
by Whitey
on Stack Overflow
See other posts from Stack Overflow
or by Whitey
Published on 2010-05-09T23:48:25Z
Indexed on
2010/05/09
23:58 UTC
Read the original article
Hit count: 436
I have a player sprite (playerTexture
) and a crosshair sprite (crossTexture
) in my game. I need to make the player sprite always face towards the crosshair.
Does anyone know how to do this? I have tried doing it myself but the math involved boggles my mind. I know there's a rotation parameter in the spriteBatch.Draw()
method but I'm unsure how to use it.
Thanks!
© Stack Overflow or respective owner