diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-07-22 16:19:57 -0400 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:57:28 +0200 |
| commit | 2218b9e0029f662aaccf7c16dcab3ba1e91bf4cb (patch) | |
| tree | 86a832326cf63f96e94f2f4e59ce8f8e087f19c0 | |
| parent | 97c898ce6cab2194151db70f4af09258a9b02f7b (diff) | |
| download | muhqs-game-2218b9e0029f662aaccf7c16dcab3ba1e91bf4cb.tar.gz muhqs-game-2218b9e0029f662aaccf7c16dcab3ba1e91bf4cb.zip | |
add doc comment for NewRoundSimpleButton
| -rw-r--r-- | go/ui/button.go | 3 |
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) } |
