From 1bae69b2fdbcf35641d5d4a403cfb6261e34297d Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Wed, 9 Jul 2025 00:27:32 +0200 Subject: Spawn units --- draw.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'draw.go') diff --git a/draw.go b/draw.go index 9af35f5..90c1134 100644 --- a/draw.go +++ b/draw.go @@ -29,5 +29,15 @@ func (e *Entity) Draw(g *Game, screen *ebiten.Image) { Size: 40, }, op) } + if e.Spawn.IsEnabled { + spawnText := fmt.Sprintf("%d", len(e.Spawn.Value.Requests)) + op := &text.DrawOptions{} + op.GeoM.Translate(float64(e.Position.Value.X+5), float64(e.Position.Value.Y+70)) + op.ColorScale.ScaleWithColor(color.White) + text.Draw(screen, spawnText, &text.GoTextFace{ + Source: g.FaceSource, + Size: 40, + }, op) + } } } -- cgit v1.3