Hi,
I'm having a problem developing a menu for a XNA project. I'm relatively new to C#.
The error that I'm getting is:
'Microsoft.Xna. Framework.Graph ics.GraphicsDev ice' is a 'type' but is used like a 'variable'
My class that has this error looks like this:
public override void LoadContent()
{
if (content1 == null)
content1 = new ContentManager( ScreenManager.G ame.Services, "Content");
spriteBatch = new SpriteBatch(GraphicsDevice); -->This is where I get the error
myModel = content.Load<Mo del>("Models\\p 1_wedge");
aspectRatio = (float)graphics .GraphicsDevice .Viewport.Width /
(float)graphics .GraphicsDevice .Viewport.Heigh t;
//gameFont = content.Load<Sp riteFont>("game font");
// A real game would probably have more content than this sample, so
// it would take longer to load. We simulate that by delaying for a
// while, giving you a chance to admire the beautiful loading screen.
//Thread.Sleep(10 00);
// once the load has finished, we use ResetElapsedTim e to tell the game's
// timing mechanism that we have just finished a very long frame, and that
// it should not try to catch up.
//ScreenManager.G ame.ResetElapse dTime();
}
Please help
I'm having a problem developing a menu for a XNA project. I'm relatively new to C#.
The error that I'm getting is:
'Microsoft.Xna. Framework.Graph ics.GraphicsDev ice' is a 'type' but is used like a 'variable'
My class that has this error looks like this:
public override void LoadContent()
{
if (content1 == null)
content1 = new ContentManager( ScreenManager.G ame.Services, "Content");
spriteBatch = new SpriteBatch(GraphicsDevice); -->This is where I get the error
myModel = content.Load<Mo del>("Models\\p 1_wedge");
aspectRatio = (float)graphics .GraphicsDevice .Viewport.Width /
(float)graphics .GraphicsDevice .Viewport.Heigh t;
//gameFont = content.Load<Sp riteFont>("game font");
// A real game would probably have more content than this sample, so
// it would take longer to load. We simulate that by delaying for a
// while, giving you a chance to admire the beautiful loading screen.
//Thread.Sleep(10 00);
// once the load has finished, we use ResetElapsedTim e to tell the game's
// timing mechanism that we have just finished a very long frame, and that
// it should not try to catch up.
//ScreenManager.G ame.ResetElapse dTime();
}
Please help
Comment