-1

I am working on a game (c# and xna game studio 4.0) which is familiar to Mario. I want to make object change color when the mouse us on the object.

Will something like

If(Mouse.Intersects.(object)) {}

work

1 Answers1

0

Stolen from another question on SO:

MouseState current_mouse = Mouse.GetState();
Vector2 pos = new Vector2(current_mouse.X, current_mouse.Y);

Allows you to detect your mouse position. You'll then need to figure out what that means in world coordinates, which'll depend on the way you've implemented your camera.

Community
  • 1
  • 1
sokkyoku
  • 2,161
  • 1
  • 20
  • 22