Added TermboxScreen.ClearLine().
authorIain Patterson <me@iain.cx>
Thu, 5 Mar 2015 16:49:17 +0000 (16:49 +0000)
committerIain Patterson <me@iain.cx>
Thu, 5 Mar 2015 16:49:17 +0000 (16:49 +0000)
Clear from given column to end of line.

screen/screen.go

index 251ca87..4d40793 100644 (file)
@@ -98,6 +98,14 @@ func (s *TermboxScreen) PrintAt(x int, y int, text string) {
        s.Flush()
 }
 
+// Clear EOL
+func (s *TermboxScreen) ClearLine(x int, y int) {
+       for i := x; i < s.width; i++ {
+               termbox.SetCell(i, y, ' ', termbox.ColorDefault, termbox.ColorDefault)
+       }
+       s.Flush()
+}
+
 // set the screen size
 func (s *TermboxScreen) SetSize(width, height int) {
        // if we get bigger then clear out the bottom line