I have this code (XNA 4):
int col = 0;
int row = 0;
foreach (Tile tile in TileList)
{
if (col > NumTiles.X) {
row++;
}
tile.Position = new Vector2(TileDimensions.X / 2, TileDimensions.Y / 2) + new Vector2(col * TileDimensions.X, row * TileDimensions.Y) + Margins + Position;
col++;
}
My problem is that it draws the tiles blurry.
If I use this code instead (I delete the first Vector2 from the position):
int col = 0;
int row = 0;
foreach (Tile tile in TileList)
{
if (col > NumTiles.X) {
row++;
}
tile.Position = new Vector2(col * TileDimensions.X, row * TileDimensions.Y) + Margins + Position;
col++;
}
It draws them fine.
Images:


EDIT: I just found that I need to cast the numbers as integers, or the spritebatch does some funky inbetween pixel stuff which happens to blur my image
I just found that I need to cast the numbers as integers, or the spritebatch does some funky inbetween pixel stuff which happens to blur my image