added grid comment to theme.go, since I always forget how grindlines work

This commit is contained in:
2024-06-09 18:41:27 +02:00
parent 1af3e9fc42
commit b8496d0ae2

View File

@@ -138,7 +138,20 @@ func (manager *ThemeManager) SetCurrentTheme(theme string) {
} }
} }
// fill a cell with the given color // Fill a cell with the given color.
//
// We do not draw the cell at 0,0 of it's position but at 1,1. This
// creates a top and lef transparent. By using a different background
// for the whole grid we can then decide wether to show grid lines or
// not.
//
// If no gridlines are selected the background will just be filled
// with the DEAD color. However, IF we are to show the gridlines, we
// fill it with a lighter color. The transparent edges of all tiles
// then create the grid.
//
// So we don't draw a grid, we just left a grid behind, which saves us
// from a lot of drawing operations.
func FillCell(tile *ebiten.Image, cellsize int, col color.RGBA) { func FillCell(tile *ebiten.Image, cellsize int, col color.RGBA) {
vector.DrawFilledRect( vector.DrawFilledRect(
tile, tile,