To use a custom mouse you are drawing a sprite in the mouse location.
First in your Game class, declare your MouseTexture variable.
In your LoadContent method import your sprite:
And finally your draw method:
There are other ways to do this, including calculating offset but this is the simplest method to do it.
First in your Game class, declare your MouseTexture variable.
PHP:
public class Game : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
Texture2D MouseTexture;
In your LoadContent method import your sprite:
PHP:
protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);
base.LoadContent();
MouseTexture = Content.Load<Texture2D>("bug-icon");
}
And finally your draw method:
PHP:
protected override void Draw(GameTime gameTime)
{
spriteBatch.Begin();
GraphicsDevice.Clear(Color.CornflowerBlue);
base.Draw(gameTime);
spriteBatch.Draw(MouseTexture, new Vector2(Mouse.GetState().X, Mouse.GetState().Y), Color.White);
spriteBatch.End();
}
There are other ways to do this, including calculating offset but this is the simplest method to do it.