How to make my simple round sprite look right in XNA
- by Joshua Perina
Ok, I'm very new to graphics programming (but not new to coding). I'm trying to load a simple image in XNA which I can do fine. It is a simple round circle which I made in photoshop. The problem is the edges show up rough when I draw it on the screen even with the exact size. The anti-aliasing is missing. I'm sure I'm missing something very simple:
GraphicsDevice.Clear(Color.Black);
// TODO: Add your drawing code here
spriteBatch.Begin();
spriteBatch.Draw(circle, new Rectangle(10, 10, 10, 10), Color.White);
spriteBatch.End();
Couldn't post picture because I'm a first time poster. But my smooth png circle has rough edges. So I found that if I added:
spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.NonPremultiplied);
I can get a smooth image when the image is the same size as the original png. But if I want to scale that image up or down then the rough edges return. How do I get XNA to smoothly resize my simple round image to a smaller size without getting the rough edges?