aboutsummaryrefslogtreecommitdiff
path: root/go/ui/clickable.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/ui/clickable.go')
-rw-r--r--go/ui/clickable.go40
1 files changed, 0 insertions, 40 deletions
diff --git a/go/ui/clickable.go b/go/ui/clickable.go
deleted file mode 100644
index 761b7534..00000000
--- a/go/ui/clickable.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package ui
-
-import (
- "github.com/hajimehoshi/ebiten/v2"
-)
-
-type Clickable interface {
- Click(x, y int)
-}
-
-type ClickWrapper struct {
- w Widget
- onClick func(x, y int)
-}
-
-func NewClickWrapper(w Widget, onClick func(x, y int)) *ClickWrapper {
- return &ClickWrapper{w, onClick}
-}
-
-func (w *ClickWrapper) Draw(screen *ebiten.Image) {
- w.w.Draw(screen)
-}
-
-func (w *ClickWrapper) FindObjectAt(x, y int) interface{} {
- return w.w.FindObjectAt(x, y)
-}
-
-func (w *ClickWrapper) Contains(x, y int) bool {
- return w.w.Contains(x, y)
-}
-
-func (w *ClickWrapper) Click(x, y int) {
- w.onClick(x, y)
-}
-
-func (w *ClickWrapper) Scroll(x, y int) {
- if w, ok := w.w.(Scrollable); ok {
- w.Scroll(x, y)
- }
-}