# HG changeset patch # User Alys Brooks # Date 2022-05-02 08:35:15 # Node ID 67531e2872bbafd4c2bc8a083d005036199b0512 # Parent d14eca6d24139306d9b840d1f8adb112ca8c97ce Add translucent effect. diff --git a/isometric-park-fna/FNAGame.cs b/isometric-park-fna/FNAGame.cs --- a/isometric-park-fna/FNAGame.cs +++ b/isometric-park-fna/FNAGame.cs @@ -550,13 +550,17 @@ } //Convenience method I'm not super sure about anymore. - protected void drawTileAt(int x, int y, int tileIndex, int height) + protected void drawTileAt(int x, int y, int tileIndex, int height, Color color) { float maxdepth = ((this.squaresAcross + 1) + ((this.squaresDown + 1) * Tile.TileWidth)) * 10; float depthOffset = 0.7f - ((x + (y * Tile.TileWidth)) / maxdepth); - Tile.drawTileAt(this.tileBatch, x, y, tileIndex, height, depthOffset); + Tile.drawTileAt(this.tileBatch, x, y, tileIndex, height, depthOffset, color); + } + + protected void drawTileAt(int x, int y, int tileIndex, int height) { + drawTileAt(x, y, tileIndex, height, Color.White); } @@ -709,33 +713,33 @@ } */ tileBatch.Begin(SpriteSortMode.BackToFront, - BlendState.AlphaBlend, - null, - null, - null, - null, - camera.get_transformation(GraphicsDevice)); + BlendState.AlphaBlend, + null, + null, + null, + null, + camera.get_transformation(GraphicsDevice)); +#if DEBUG -#if DEBUG - drawTileAt(4, 4, 140, 3); - drawTileAt(6, 4, 141, 3); - drawTileAt(8, 4, 142, 2); - drawTileAt(10, 4, 142, 3); + var translucent = new Color(1.0f, 1.0f, 1.0f, 0.25f); + drawTileAt(4, 4, 140, 3, translucent); + drawTileAt(6, 4, 141, 3, translucent); + drawTileAt(8, 4, 142, 2, translucent); + drawTileAt(10, 4, 142, 3, translucent); for (int i = 10; i < 199; i++) { - drawTileAt(10, i, 281, 1); + drawTileAt(10, i, 281, 1, translucent); } - drawTileAt(10, 199, 284, 1); - drawTileAt(11, 199, 280, 1); - drawTileAt(12, 199, 280, 1); - drawTileAt(13, 199, 283, 1); - drawTileAt(13, 198, 281, 1); - drawTileAt(13, 197, 282, 1); - drawTileAt(12, 197, 285, 1); - drawTileAt(12, 25, 300, 2); + drawTileAt(10, 199, 284, 1, translucent); + drawTileAt(11, 199, 280, 1, translucent); + drawTileAt(12, 199, 280, 1, translucent); + drawTileAt(13, 199, 283, 1, translucent); + drawTileAt(13, 198, 281, 1, translucent); + drawTileAt(13, 197, 282, 1, translucent); + drawTileAt(12, 197, 285, 1, translucent); + drawTileAt(12, 25, 300, 2, translucent); #endif - #if DEBUG Tile.OutlineSquare(tileBatch, 1, 1, Color.Red, 2); Tile.OutlineSquare(tileBatch, 3, 1, Color.Blue, 2);