Add a meaningful exception message for SpriteBatch

I just started writing a little bit of MonoGame code and I was very confused why my project did not compile. I had written this code:


public GameScreen()
{
	graphics = new GraphicsDeviceManager(this);
	spritebatch = new SpriteBatch(GraphicsDevice);
}

And I got this exception message:

System.ArgumentException has been thrown
graphicsDevice

Then after lots of searching about the problem I looked at the Platformer2D sample and I realized that spritebatch must be initiated in LoadContent() method and not in the constructor method.

My suggestion is that the message could be more informative so new users won’t face this mind boggling problem. :slight_smile: