I wrote a Camera
class that contains Matrix
(for zooming and moving around). When I zoomed it with any zoom scale other than 1, some isometric grids becomes visible on each of my isometric tile.
//Camera.cs
//Producing the matrix from previously set Zoom and Location
public static void Update()
{
Transform = Matrix.CreateTranslation(Location.X, Location.Y, 0) *
Matrix.CreateScale(Zoom,Zoom,1);
InverseTransform = Matrix.Invert(Transform);
}
//Game.cs
spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, null, null, null, null, Camera.InverseTransform);
/* Some Drawing */
spriteBatch.End();
PS: Actually, I really want these grids to be visible for zoom scale of 1.0f too. Having these grids make my game looks more like a tile-based game.
Before Zoom (Scale = 1.0f):
After Zoom (Zooming in):
After Zoom (Zooming out):
Zooming very close (Grid line appears to be more than one pixels):