DrawOffset

This commit is contained in:
2025-08-06 20:55:44 -05:00
parent 81c7ec8324
commit 7c96fbb187
20 changed files with 168 additions and 29 deletions

View File

@@ -108,12 +108,20 @@ func (w *MenuItem) Draw(screen tcell.Screen) {
}
x += 1
for i := range w.items {
// TODO: Use DrawOffset
w.items[i].SetPos(Coord{X: x, Y: y})
w.items[i].Draw(screen)
y++
}
}
}
func (w *MenuItem) DrawOffset(c Coord, screen tcell.Screen) {
p := w.GetPos()
w.SetPos(p.Add(c))
w.Draw(screen)
w.SetPos(p)
}
func (w *MenuItem) Active() bool { return w.active }
func (w *MenuItem) SetActive(a bool) {
w.active = a