Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Title/Menu Screen are blank after adding camera to SpriteBatch

$
0
0

@Kipik wrote:

In my Game.cs file, I have this:
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.Black);
/*spriteBatch.Begin();
ScreenManager.Instance.Draw(spriteBatch);
spriteBatch.End();*/

        spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, _camera.Transform);
        ScreenManager.Instance.Draw(spriteBatch);
        spriteBatch.End();

        base.Draw(gameTime);
    }

Which makes the camera follow the player in the game, but now the Title and Menu Screens are blank until I actually select New Game because there's no Player.

I tried drawing two different spriteBatches but it just draws things two times when in-game, which is not ideal.

What can I do?

Thanks.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles