From b8496d0ae2b060513844251b5804444da73b76e4 Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Sun, 9 Jun 2024 18:41:27 +0200 Subject: [PATCH] added grid comment to theme.go, since I always forget how grindlines work --- src/theme.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/theme.go b/src/theme.go index 6d81497..7da7715 100644 --- a/src/theme.go +++ b/src/theme.go @@ -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) { vector.DrawFilledRect( tile,