diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-04-03 17:33:12 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:57:07 +0200 |
| commit | 90e93c708cf045b3f70ebd04c17ed8f0a303ab37 (patch) | |
| tree | c80e95bfd24f385938e0cd98e09e71fc5c1aacb8 /go/ui/button.go | |
| parent | e536684a420d2e905b23afab22b8ef453714f865 (diff) | |
| download | muhqs-game-90e93c708cf045b3f70ebd04c17ed8f0a303ab37.tar.gz muhqs-game-90e93c708cf045b3f70ebd04c17ed8f0a303ab37.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) |
