last_light/game/ui/ui.go

32 lines
497 B
Go
Raw Normal View History

2024-04-21 03:48:58 +03:00
package ui
import (
2024-05-06 20:43:35 +03:00
"mvvasilev/last_light/engine"
2024-05-06 21:19:08 +03:00
engine1 "mvvasilev/last_light/engine"
2024-04-21 03:48:58 +03:00
2024-04-24 17:11:33 +03:00
"github.com/gdamore/tcell/v2"
2024-04-21 03:48:58 +03:00
)
type UIElement interface {
MoveTo(x, y int)
2024-05-06 21:19:08 +03:00
Position() engine1.Position
Size() engine1.Size
2024-04-24 17:11:33 +03:00
Input(e *tcell.EventKey)
2024-05-06 20:43:35 +03:00
engine.Drawable
2024-04-24 17:11:33 +03:00
}
type UIHighlightableElement interface {
IsHighlighted() bool
Highlight()
Unhighlight()
SetHighlighted(highlighted bool)
UIElement
}
type UISelectableElement interface {
Select()
OnSelect(func())
UIHighlightableElement
2024-04-21 03:48:58 +03:00
}