Hello,
When I render without any text it renders like it should be:
but when I draw text it looks pretty different:
I’m also not able to switch to the wireframe mode when rendering text, I don’t know why.
Here’s my code for the text:
private void DrawText()
{
spriteBatch.Begin();
spriteBatch.DrawString(font, "X: " + camera.Position.X, new Vector2(0, 0), Color.White);
spriteBatch.DrawString(font, "Y: " + camera.Position.Y, new Vector2(0, 20), Color.White);
spriteBatch.DrawString(font, "Z: " + camera.Position.Z, new Vector2(0, 40), Color.White);
spriteBatch.End();
}
And the code for rendering:
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
DrawText();
if (world != null)
{
for (int a = 0; a < world.chunks.GetLength(0); a++)
{
for (int b = 0; b < world.chunks.GetLength(1); b++)
{
if (world.chunks[a, b] != null)
{
world.chunks[a, b].draw(gameTime, camera, basicEffect);
}
}
}
}
base.Draw(gameTime);
}
What am I doing wrong there?