aboutsummaryrefslogtreecommitdiff
path: root/draw.go
diff options
context:
space:
mode:
Diffstat (limited to 'draw.go')
-rw-r--r--draw.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/draw.go b/draw.go
index b89ffa1..970974f 100644
--- a/draw.go
+++ b/draw.go
@@ -1,11 +1,12 @@
package main
import (
- "age_of_empires/physics"
- "age_of_empires/selection"
"fmt"
"image/color"
+ "age_of_empires/physics"
+ "age_of_empires/selection"
+
"github.com/hajimehoshi/ebiten/v2"
"github.com/hajimehoshi/ebiten/v2/text/v2"
"github.com/hajimehoshi/ebiten/v2/vector"
@@ -94,8 +95,8 @@ func (g *Game) Draw(screen *ebiten.Image) {
for _, e := range g.Entities {
e.Draw(g, screen)
}
- if g.Selection.IsActive {
- vector.StrokeRect(screen, float32(g.Selection.Start.X), float32(g.Selection.Start.Y), float32(cursor.X-g.Selection.Start.X), float32(cursor.Y-g.Selection.Start.Y), 10.0, color.RGBA{256 * 3 / 16, 256 * 3 / 16, 256 * 3 / 16, 256 / 4}, true)
+ if g.Selection.IsActive(cursor) {
+ g.Selection.Draw(screen, cursor)
}
drawTopBanner(screen, g)