commit 70bd0b02f34e8e746d3b3936054421390b83f9aa Author: Zack Guo Date: Tue Feb 3 09:07:31 2015 -0500 Renderer interface diff --git a/box.go b/box.go new file mode 100644 index 0000000..a9274b8 --- /dev/null +++ b/box.go @@ -0,0 +1,98 @@ +package termui + +import tm "github.com/nsf/termbox-go" + +const TOP_RIGHT = '┐' +const VERTICAL_LINE = '│' +const HORIZONTAL_LINE = '─' +const TOP_LEFT = '┌' +const BOTTOM_RIGHT = '┘' +const BOTTOM_LEFT = '└' + +type Box struct { + X int + Y int + Width int + Height int + Border bool + FgColor tm.Attribute + BgColor tm.Attribute +} + +type HLine struct { + X int + Y int + Length int + FgColor tm.Attribute + BgColor tm.Attribute +} + +type VLine struct { + X int + Y int + Length int + FgColor tm.Attribute + BgColor tm.Attribute +} + +func (l HLine) Buffer() []Point{ + pts := make([]Point,l.Length) + for i:=0;i