Detecting pixels in a rotated Texture2D in XNA?
Posted
by
PugWrath
on Game Development
See other posts from Game Development
or by PugWrath
Published on 2012-11-09T21:11:07Z
Indexed on
2012/11/09
23:26 UTC
Read the original article
Hit count: 228
I know things similar to this have been posted, but I'm still trying to find a good solution... I'm drawing Texture2D objects on the ground in my game, and for Mouse-Over or targeting methods, I'm detecting whether or not the pixel in that Texture at the mouse position is Color.Transparent. This works perfectly when I do not rotate the texture, but I'd like to be able to rotate textures to add realism/variety. However, I either need to create a new Texture2D that is rotated at the correct angle so that I can detect its pixels, or I need to find some other method of detection... Any thoughts?
© Game Development or respective owner