I created a basic SpriteFont (Arial, Size: 12) that I’m playing around with.
It looks fine when drawn with spriteBatch.Begin()
(no parameters passed).
However, when I draw with Nearest Neighbor filtering, it’s showing up with some black areas (there’s even a black pixel underneath the comma). Increasing the font size didn’t help either:
Below is my Draw
function:
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin(blendState: BlendState.Opaque, samplerState: SamplerState.PointClamp);
spriteBatch.DrawString(gameFont, "Hello, World!", new Vector2(WINDOW_WIDTH / 2, WINDOW_HEIGHT / 2), Color.White);
spriteBatch.End();
base.Draw(gameTime);
}
Is there a proper way to draw SpriteFonts on the screen with Nearest Neighbor?
Am I even doing this Nearest Neighbor filtering correctly?
I intend to draw everything with Nearest Neighbor because I plan to make a simple, retro-style pixel Pong clone as my first project to familiarize myself with MonoGame.