DrawOffset
This commit is contained in:
@@ -112,6 +112,13 @@ func (w *Button) Draw(screen tcell.Screen) {
|
||||
h.DrawText(w.x, w.y+1, fmt.Sprintf("│%s│", h.Center(lbl, w.w-2)), dStyle, screen)
|
||||
h.DrawText(w.x, w.y+2, fmt.Sprintf("╰%s╯", strings.Repeat("─", w.w-2)), dStyle, screen)
|
||||
}
|
||||
|
||||
func (w *Button) DrawOffset(c Coord, screen tcell.Screen) {
|
||||
p := w.GetPos()
|
||||
w.SetPos(p.Add(c))
|
||||
w.Draw(screen)
|
||||
w.SetPos(p)
|
||||
}
|
||||
func (w *Button) Active() bool { return w.active }
|
||||
func (w *Button) SetActive(a bool) { w.active = a }
|
||||
func (w *Button) Visible() bool { return w.visible }
|
||||
|
||||
Reference in New Issue
Block a user