Documentation ¶
Index ¶
- func ClearScreen()
- type Canvas
- func (cnv Canvas) ClearInner()
- func (cnv Canvas) DrawBoxWithTitle(title string) error
- func (cnv Canvas) DrawColoredBoxWithTitle(title string, boxColor Color, textColor Color) error
- func (cnv Canvas) DrawColoredText(text string, point Point, color Color)
- func (cnv Canvas) DrawPath(sym string, points []Point)
- func (cnv Canvas) DrawSource(pp PointProvider)
- func (cnv Canvas) DrawText(text string, point Point)
- func (cnv Canvas) EndDraw()
- func (cnv Canvas) SetColor(c Color)
- func (cnv Canvas) SetDefaultColor()
- func (cnv Canvas) Size() Point
- type Color
- type Point
- type PointProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearScreen ¶ added in v1.1.0
func ClearScreen()
ClearScreen clear all terminal screen. Need invoke this method before draw.
Types ¶
type Canvas ¶
type Canvas struct {
// contains filtered or unexported fields
}
Canvas is the canvas for drawing
func (Canvas) DrawBoxWithTitle ¶
DrawBoxWithTitle draw box around canvas with some title
func (Canvas) DrawColoredBoxWithTitle ¶
DrawColoredBoxWithTitle draw box with spicified color around canvas with some colored title
func (Canvas) DrawColoredText ¶
DrawColoredText print colored text on specified position
func (Canvas) DrawSource ¶ added in v1.1.0
func (cnv Canvas) DrawSource(pp PointProvider)
DrawSource draw symbol on position provided by PointProvider
func (Canvas) EndDraw ¶ added in v1.1.0
func (cnv Canvas) EndDraw()
EndDraw invoke when the drawing is end and need to put cursor pos to the bottom of screen
func (Canvas) SetDefaultColor ¶ added in v1.1.0
func (cnv Canvas) SetDefaultColor()
SetDefaultColor reset color to default
type PointProvider ¶ added in v1.1.0
PointProvider interface for provide point and symbol for draw
Click to show internal directories.
Click to hide internal directories.