Add a slider UI widget

I'm not too happy with how I have to configure the step for each one
separately, but it's the best I can do at the moment.
This commit is contained in:
2020-03-24 22:33:26 +00:00
parent 69971b2825
commit 20ad9ae6f8
5 changed files with 266 additions and 9 deletions

View File

@@ -109,6 +109,19 @@ func (h *hoverImpl) setHoverState(hovering bool) {
h.hovering = hovering
}
// Mouseables are told where on the (original) screen the mouse cursor is
type mouseable interface {
registerMousePosition(image.Point)
}
type mouseImpl struct {
pos image.Point
}
func (m *mouseImpl) registerMousePosition(pt image.Point) {
m.pos = pt
}
// Paintable encapsulates one or more regions to be painted to the screen
type paintable interface {
regions(tick int) []region