tulib

package module
v0.0.0-...-b257bdd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2014 License: MIT Imports: 3 Imported by: 0

README

Experimental termbox utilities library..

The API will change, I do not recommend using it at all.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLabelParams = LabelParams{
	termbox.ColorDefault,
	termbox.ColorDefault,
	AlignLeft,
	'…',
	false,
}

Functions

func KeyToString

func KeyToString(key termbox.Key, ch rune, mod termbox.Modifier) string

Types

type Alignment

type Alignment int
const (
	AlignLeft Alignment = iota
	AlignCenter
	AlignRight
)

type Buffer

type Buffer struct {
	Cells []termbox.Cell
	Rect
}

func NewBuffer

func NewBuffer(w, h int) Buffer

func TermboxBuffer

func TermboxBuffer() Buffer

func (*Buffer) Blit

func (this *Buffer) Blit(dstr Rect, srcx, srcy int, src *Buffer)

func (*Buffer) DrawLabel

func (this *Buffer) DrawLabel(dest Rect, params *LabelParams, text []byte)

func (*Buffer) Fill

func (this *Buffer) Fill(dst Rect, proto termbox.Cell)

Fills an area which is an intersection between buffer and 'dest' with 'proto'.

func (*Buffer) Get

func (this *Buffer) Get(x, y int) *termbox.Cell

Gets a pointer to the cell at specified position or nil if it's out

of range.

func (*Buffer) Resize

func (this *Buffer) Resize(nw, nh int)

Resizes the Buffer, buffer contents are invalid after the resize.

func (*Buffer) Set

func (this *Buffer) Set(x, y int, proto termbox.Cell)

Sets a cell at specified position

type LabelParams

type LabelParams struct {
	Fg             termbox.Attribute
	Bg             termbox.Attribute
	Align          Alignment
	Ellipsis       rune
	CenterEllipsis bool
}

type Rect

type Rect struct {
	X      int
	Y      int
	Width  int
	Height int
}

func (Rect) FitsIn

func (a Rect) FitsIn(b Rect) bool

func (Rect) Intersection

func (a Rect) Intersection(b Rect) Rect

func (Rect) IsEmpty

func (r Rect) IsEmpty() bool

func (Rect) IsValid

func (r Rect) IsValid() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL