diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-04-03 17:33:12 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:53 +0100 |
| commit | e2acea9d73cc717786b083008cb44441ef487299 (patch) | |
| tree | 21c06c1116f0a75dff726148c444be89f30ae4ce /go/ui/button.go | |
| parent | 011b95e8db31f1306eafb575ed12bed4e2fc1ca3 (diff) | |
| download | muhqs-game-e2acea9d73cc717786b083008cb44441ef487299.tar.gz muhqs-game-e2acea9d73cc717786b083008cb44441ef487299.zip | |
bump ebiten version to 2.5.1 and new APIs
Diffstat (limited to 'go/ui/button.go')
| -rw-r--r-- | go/ui/button.go | 4 |
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) |
