Hello, I'm new to XNA as well as DirectX and am experiencing some weird side effects when drawing a sprite that I can't account for. I have a 3D ship that I can fly around using the Xbox360 controller (completed the XNA tutorials 1-3) and decided to see if I could implement pausing.
Well, i got everything working how I want it and even made a 2d sprite that loads a texture asset and draws it to the screen when the player pauses (just a blue rectangle with the word "Paused..." written on it). That works great too, except by drawing the sprite to the screen my 3d model suddenly becomes semi-transparent! Even when the sprite is no longer being drawn the model remains semi-transparent until I restart the game.
I am developing in XNA Game Studio Express and deploying onto my Xbox360.
I am confused by this side-effect of drawing the sprite. The 3d model references a .tga for it's texture but it is completely separate from my .bmp texture (which has been added through the content pipeline).
Here's the code that causes the effect (by commenting it out I no longer see the Pause sprite but also no longer get semi-transparency on the model):
spriteBatch.Begin(
SpriteBlendMode.None);new Rectangle(graphics.GraphicsDevice.Viewport.Width/2 - pauseTexture.Width/2,spriteBatch.Draw(pauseTexture,
graphics.GraphicsDevice.Viewport.Height/2 - pauseTexture.Height/2,
pauseTexture.Width,
pauseTexture.Height),
Color.White);spriteBatch.End();
At first I didn't use a SpriteBlendMode but thought maybe by explicitly using SpriteBlendMode.None I would avoid any possible transparency confusion, but it has no effect.