Description:
Add translucent effect.
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r575:67531e2872bb -

@@ -550,13 +550,17
550 550 }
551 551
552 552 //Convenience method I'm not super sure about anymore.
553 protected void drawTileAt(int x, int y, int tileIndex, int height)
553 protected void drawTileAt(int x, int y, int tileIndex, int height, Color color)
554 554 {
555 555 float maxdepth = ((this.squaresAcross + 1) + ((this.squaresDown + 1) * Tile.TileWidth)) * 10;
556 556
557 557 float depthOffset = 0.7f - ((x + (y * Tile.TileWidth)) / maxdepth);
558 558
559 Tile.drawTileAt(this.tileBatch, x, y, tileIndex, height, depthOffset);
559 Tile.drawTileAt(this.tileBatch, x, y, tileIndex, height, depthOffset, color);
560 }
561
562 protected void drawTileAt(int x, int y, int tileIndex, int height) {
563 drawTileAt(x, y, tileIndex, height, Color.White);
560 564 }
561 565
562 566
@@ -709,33 +713,33
709 713 }
710 714 */
711 715 tileBatch.Begin(SpriteSortMode.BackToFront,
712 BlendState.AlphaBlend,
713 null,
714 null,
715 null,
716 null,
717 camera.get_transformation(GraphicsDevice));
716 BlendState.AlphaBlend,
717 null,
718 null,
719 null,
720 null,
721 camera.get_transformation(GraphicsDevice));
722 #if DEBUG
718 723
719 #if DEBUG
720 drawTileAt(4, 4, 140, 3);
721 drawTileAt(6, 4, 141, 3);
722 drawTileAt(8, 4, 142, 2);
723 drawTileAt(10, 4, 142, 3);
724 var translucent = new Color(1.0f, 1.0f, 1.0f, 0.25f);
725 drawTileAt(4, 4, 140, 3, translucent);
726 drawTileAt(6, 4, 141, 3, translucent);
727 drawTileAt(8, 4, 142, 2, translucent);
728 drawTileAt(10, 4, 142, 3, translucent);
724 729
725 730 for (int i = 10; i < 199; i++) {
726 drawTileAt(10, i, 281, 1);
731 drawTileAt(10, i, 281, 1, translucent);
727 732 }
728 drawTileAt(10, 199, 284, 1);
729 drawTileAt(11, 199, 280, 1);
730 drawTileAt(12, 199, 280, 1);
731 drawTileAt(13, 199, 283, 1);
732 drawTileAt(13, 198, 281, 1);
733 drawTileAt(13, 197, 282, 1);
734 drawTileAt(12, 197, 285, 1);
735 drawTileAt(12, 25, 300, 2);
733 drawTileAt(10, 199, 284, 1, translucent);
734 drawTileAt(11, 199, 280, 1, translucent);
735 drawTileAt(12, 199, 280, 1, translucent);
736 drawTileAt(13, 199, 283, 1, translucent);
737 drawTileAt(13, 198, 281, 1, translucent);
738 drawTileAt(13, 197, 282, 1, translucent);
739 drawTileAt(12, 197, 285, 1, translucent);
740 drawTileAt(12, 25, 300, 2, translucent);
736 741 #endif
737 742
738
739 743 #if DEBUG
740 744 Tile.OutlineSquare(tileBatch, 1, 1, Color.Red, 2);
741 745 Tile.OutlineSquare(tileBatch, 3, 1, Color.Blue, 2);
You need to be logged in to leave comments. Login now