Documentation ¶
Index ¶
- Constants
- Variables
- type Align
- type BorderDefinitions
- type Frame
- func (f *Frame) BgColor() tl.Attr
- func (f *Frame) Draw(s *tl.Screen)
- func (f *Frame) FgColor() tl.Attr
- func (f *Frame) LevelFollow(level *tl.BaseLevel)
- func (f *Frame) Position() (int, int)
- func (f *Frame) SetBgColor(color tl.Attr)
- func (f *Frame) SetFgColor(color tl.Attr)
- func (f *Frame) SetPosition(x, y int)
- func (f *Frame) SetSize(w, h int)
- func (f *Frame) SetTitle(text string, align Align)
- func (f *Frame) Size() (int, int)
- func (f *Frame) Tick(ev tl.Event)
- type HLine
- func (l *HLine) BgColor() tl.Attr
- func (l *HLine) Draw(s *tl.Screen)
- func (l *HLine) FgColor() tl.Attr
- func (f *HLine) LevelFollow(level *tl.BaseLevel)
- func (l *HLine) Position() (int, int)
- func (l *HLine) SetBGColor(color tl.Attr)
- func (l *HLine) SetFGColor(color tl.Attr)
- func (l *HLine) SetPosition(x, y int)
- func (l *HLine) SetSize(w, h int)
- func (l *HLine) Size() int
- func (l *HLine) Tick(ev tl.Event)
- type LineType
- type TextArea
- func (t *TextArea) Color() (tl.Attr, tl.Attr)
- func (t *TextArea) Draw(s *tl.Screen)
- func (f *TextArea) LevelFollow(level *tl.BaseLevel)
- func (t *TextArea) Position() (int, int)
- func (t *TextArea) SetAlign(align Align)
- func (t *TextArea) SetColor(bg, fg tl.Attr)
- func (t *TextArea) SetPosition(x, y int)
- func (t *TextArea) SetText(text string, align Align)
- func (t *TextArea) SetTypewriterDuration(typewriterduration int64)
- func (t *TextArea) Size() (int, int)
- func (t *TextArea) Tick(ev tl.Event)
- type VLine
- func (l *VLine) BgColor() tl.Attr
- func (l *VLine) Draw(s *tl.Screen)
- func (l *VLine) FgColor() tl.Attr
- func (f *VLine) LevelFollow(level *tl.BaseLevel)
- func (l *VLine) Position() (int, int)
- func (l *VLine) SetBGColor(color tl.Attr)
- func (l *VLine) SetFGColor(color tl.Attr)
- func (l *VLine) SetPosition(x, y int)
- func (l *VLine) SetWidth(w, h int)
- func (l *VLine) Size() int
- func (l *VLine) Tick(ev tl.Event)
Constants ¶
const ( LineEmpty LineType = 0 LineSingleBorder = 1 << iota LineDoubleBorder )
Variables ¶
var BorderTheme = map[uint]*BorderDefinitions{ uint(LineEmpty): &BorderDefinitions{hc: ' ', vc: ' ', luc: ' ', ruc: ' ', lbc: ' ', rbc: ' '}, uint(LineSingleBorder): &BorderDefinitions{hc: '─', vc: '│', luc: '┌', ruc: '┐', lbc: '└', rbc: '┘'}, uint(LineDoubleBorder): &BorderDefinitions{hc: '═', vc: '║', luc: '╔', ruc: '╗', lbc: '╚', rbc: '╝'}, }
Functions ¶
This section is empty.
Types ¶
type Align ¶
type Align uint
const ( AlignNone Align = 0 AlignLeft Align = 1 << iota AlignRight AlignHCenter AlignTop AlignBottom AlignVCenter AlignCenter = AlignHCenter | AlignVCenter )
type BorderDefinitions ¶
type BorderDefinitions struct {
// contains filtered or unexported fields
}
type Frame ¶
type Frame struct { *tl.Rectangle *BorderDefinitions *TextArea // contains filtered or unexported fields }
A type representing a 2D rectangle, with position, size and colof.
func NewFrame ¶
func NewFrame(x, y, w, h int, bgcolor tl.Attr, fgcolor tl.Attr, frametype LineType, signmode bool) *Frame
NewFrame creates a new Rectangle at position (x, y), with size (width, height) and color colof. Returns a pointer to the new NewFrame.
func (*Frame) SetBgColor ¶
SetColor sets the color of the Rectangle.
func (*Frame) SetFgColor ¶
func (*Frame) SetPosition ¶
SetPosition sets the coordinates of the Rectangle to be x and y.
type HLine ¶
type HLine struct { *BorderDefinitions // contains filtered or unexported fields }
A type representing a 2D horizontal Line
func (*HLine) SetBGColor ¶
SetBGColor set the background color of the horizontal line .
func (*HLine) SetFGColor ¶
SetFGColor set the background color of the horizontal line .
func (*HLine) SetPosition ¶
SetPosition sets the coordinates of the horizontal line to be x and y.
type TextArea ¶
type TextArea struct {
// contains filtered or unexported fields
}
A type representing a Text with Area dimension
func NewTextArea ¶
NewTextArea creates a new TextArea
func (*TextArea) SetPosition ¶
SetPosition sets the coordinates of the TextArea to be x and y.
func (*TextArea) SetTypewriterDuration ¶
Set typewriter speed
type VLine ¶
type VLine struct { *BorderDefinitions // contains filtered or unexported fields }
func (*VLine) SetBGColor ¶
SetBGColor set the background color of the horizontal line .
func (*VLine) SetFGColor ¶
SetFGColor set the background color of the horizontal line .
func (*VLine) SetPosition ¶
SetPosition sets the coordinates of the horizontal line to be x and y.