aboutsummaryrefslogtreecommitdiff
path: root/go/ui
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-07-22 16:19:57 -0400
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:57:28 +0200
commit2218b9e0029f662aaccf7c16dcab3ba1e91bf4cb (patch)
tree86a832326cf63f96e94f2f4e59ce8f8e087f19c0 /go/ui
parent97c898ce6cab2194151db70f4af09258a9b02f7b (diff)
downloadmuhqs-game-2218b9e0029f662aaccf7c16dcab3ba1e91bf4cb.tar.gz
muhqs-game-2218b9e0029f662aaccf7c16dcab3ba1e91bf4cb.zip
add doc comment for NewRoundSimpleButton
Diffstat (limited to 'go/ui')
-rw-r--r--go/ui/button.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/go/ui/button.go b/go/ui/button.go
index b6cec672..9afa8c05 100644
--- a/go/ui/button.go
+++ b/go/ui/button.go
@@ -35,6 +35,9 @@ func NewSimpleButton(x, y, w, h int, label string, onClick func(b *SimpleButton)
return sb
}
+// NewRoundSimpleButton creates a circular SimpleButton.
+// The shape used for click detection is still a square.
+// x and y define the left upper corner of the square (x, y) rect (x+r, y+r).
func NewRoundSimpleButton(x, y, r int, label string, onClick func(b *SimpleButton)) *SimpleButton {
sb := &SimpleButton{NewWidgetBase(x, y, r, r), label, Gray, color.White, font.Font24, 1.5}
sb.EventHandlersMap["click"] = func(int, int) { onClick(sb) }