Display overlay text in the UI

We still have fonts to do, so this is very ugly, but it at least shows
*something* on the screen now.
This commit is contained in:
2020-03-26 22:09:26 +00:00
parent a0fd653c24
commit e4ce932324
7 changed files with 107 additions and 34 deletions

View File

@@ -291,7 +291,7 @@ func (d *Driver) Draw(screen *ebiten.Image) error {
}
func (d *Driver) addRecord(record *menus.Record) error {
log.Printf("Adding record: %#+v", record)
//log.Printf("Adding record: %#+v", record)
handler, ok := widgetBuilders[record.Type]
if !ok {
@@ -316,28 +316,28 @@ func (d *Driver) addRecord(record *menus.Record) error {
func (d *Driver) hoverStartEvent(h hoverable, inBounds bool) {
if inBounds && !h.hoverState() {
log.Printf("hoverable false -> true")
//log.Printf("hoverable false -> true")
h.setHoverState(true)
}
}
func (d *Driver) hoverEndEvent(h hoverable, inBounds bool) {
if !inBounds && h.hoverState() {
log.Printf("hoverable true -> false")
//log.Printf("hoverable true -> false")
h.setHoverState(false)
}
}
func (d *Driver) mouseDownEvent(c clickable, inBounds, wasDown, isDown bool) {
if inBounds && !wasDown && isDown {
log.Printf("mouse down false -> true")
//log.Printf("mouse down false -> true")
c.setMouseDownState(true)
}
}
func (d *Driver) mouseClickEvent(c clickable, inBounds, wasDown, isDown bool) {
if inBounds && wasDown && !isDown {
log.Printf("mouse click")
//log.Printf("mouse click")
c.registerMouseClick()
}
}
@@ -345,12 +345,12 @@ func (d *Driver) mouseClickEvent(c clickable, inBounds, wasDown, isDown bool) {
func (d *Driver) mouseUpEvent(c clickable, inBounds, wasDown, isDown bool) {
if inBounds {
if wasDown && !isDown {
log.Printf("mouse down true -> false")
//log.Printf("mouse down true -> false")
c.setMouseDownState(false)
}
} else {
if wasDown {
log.Printf("mouse down true -> false")
//log.Printf("mouse down true -> false")
c.setMouseDownState(false)
}
}