aboutsummaryrefslogtreecommitdiff
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-07-24 12:22:10 -0400
commit7affd79b884d87c93c53e87056a1d5b74f669497 (patch)
tree7214f7df5d58ec6898f34479239d736fb40574e1
parent71b060a6b79ebee5cd4c7c29b598543d2b32dc93 (diff)
downloadmuhqs-game-7affd79b884d87c93c53e87056a1d5b74f669497.tar.gz
muhqs-game-7affd79b884d87c93c53e87056a1d5b74f669497.zip
add doc comment for NewRoundSimpleButton
-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) }