aboutsummaryrefslogtreecommitdiff
path: root/go/ui/button.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/ui/button.go')
-rw-r--r--go/ui/button.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/go/ui/button.go b/go/ui/button.go
index e882d39c..afd37a31 100644
--- a/go/ui/button.go
+++ b/go/ui/button.go
@@ -4,8 +4,8 @@ import (
"image/color"
"github.com/hajimehoshi/ebiten/v2"
- "github.com/hajimehoshi/ebiten/v2/ebitenutil"
"github.com/hajimehoshi/ebiten/v2/text"
+ "github.com/hajimehoshi/ebiten/v2/vector"
"muhq.space/muhqs-game/go/font"
)
@@ -32,7 +32,7 @@ func NewSimpleButton(x, y, w, h int, label string, onClick func(b *SimpleButton)
func (b *SimpleButton) render() *ebiten.Image {
img := ebiten.NewImage(b.Width, b.Height)
- ebitenutil.DrawRect(img, float64(0), float64(0), float64(b.Width), float64(b.Height), b.Bg)
+ vector.DrawFilledRect(img, float32(0), float32(0), float32(b.Width), float32(b.Height), b.Bg, false)
bounds := text.BoundString(font.Font24, b.label)
x := b.Width/2 - centerTextXOffset(bounds)