Reputation: 1
So I've been following this answer: Adding a custom cursor in XNA/C#?
... to get a custom mouse cursor working on XNA.
I've done everything like the solution, get no error, but still get no custom cursor (it still shows the windows default one).
I'm unsure on what to do really...
I created the getCursorPos method at the bottom of my Game1.cs file, included the following declarations at the begining of Game1 class:
private MouseState mouseState;
private int cursorX;
private int cursorY;
The code in LoadContent was giving me an error:
cursorTex = content.Load<Texture2D>("cursor.png");
so I replaced it with:
cursorTex = Content.Load<Texture2D>("cursor");
("cursor" is a png)
What am I doing wrong?... Like I said, no error :(
Upvotes: 0
Views: 1661
Reputation: 32448
I suspect you need to update the mouse's position, using mouseState = Mouse.GetState();
(put it in your game's update method, before you update the cursorPos
variable).
Upvotes: 2