visual

package
v0.0.0-...-d88343e Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlignGroup

func AlignGroup(group CellGroup, align Alignment, boundingBox rect.Rect)

func NewBorder

func NewBorder(pos position.Position, size size.Size, style BorderStyle) *border

Types

type Alignment

type Alignment int
const (
	AlignNone Alignment = iota

	AlignLeft
	AlignRight

	AlignTop
	AlignBottom

	AlignHorizontalMiddle
	AlignVerticalMiddle
	AlignMiddle
)

type Animation

type Animation interface {
	Frames() []CellGroup
	SetFrames([]CellGroup)

	FrameDuration() time.Duration
	SetFrameDuration(time.Duration)

	Draw(tcell.Screen)
}

func NewAnimation

func NewAnimation(frames []CellGroup, duration time.Duration) Animation

type Border

type Border interface {
	CellGroup() CellGroup

	BorderStyle() BorderStyle
	SetBorderStyle(BorderStyle)

	Resize(size.Size)
	Draw(tcell.Screen)
}

type BorderStyle

type BorderStyle struct {
	Horizontal BorderTickStyle
	Vertical   BorderTickStyle
	Corner     BorderTickStyle

	Fill BorderTickStyle
}

func DefaultBorderStyle

func DefaultBorderStyle(style tcell.Style, fillStyle tcell.Style) BorderStyle

type BorderTickStyle

type BorderTickStyle struct {
	Style     tcell.Style
	Character rune
}

type Cell

type Cell interface {
	Character() rune
	SetCharacter(rune)

	Position() position.Position
	SetPosition(position.Position)

	Style() tcell.Style
	SetStyle(tcell.Style)

	Draw(tcell.Screen)
}

func NewCell

func NewCell(character rune, pos position.Position, style tcell.Style) Cell

type CellGroup

type CellGroup interface {
	Cells() []Cell
	Draw(tcell.Screen)

	Position() position.Position
	SetPosition(position.Position)

	Size() size.Size
}

func NewCellGroup

func NewCellGroup(cells []Cell, pos position.Position, size size.Size) CellGroup

func NewCellGroupFromLine

func NewCellGroupFromLine(line string, startPosition position.Position, style tcell.Style) CellGroup

type Counter

type Counter interface {
	Count() int
	Tick()
}

func NewCounter

func NewCounter(start, max int, duration time.Duration) Counter

type Cursor

type Cursor interface {
	Draw(tcell.Screen)
	Position() position.MutablePosition
}

func NewCursor

func NewCursor(active Pel, duration time.Duration, pos position.MutablePosition) Cursor

type CursorBuilder

type CursorBuilder interface {
	Char(rune) CursorBuilder
	Style(tcell.Style) CursorBuilder
	Foreground(tcell.Color) CursorBuilder
	Background(tcell.Color) CursorBuilder

	ActiveChar(rune) CursorBuilder

	ActiveStyle(tcell.Style) CursorBuilder

	Position(position.MutablePosition) CursorBuilder
	Duration(time.Duration) CursorBuilder

	Build() Cursor
}

func NewCursorBuilder

func NewCursorBuilder() CursorBuilder

type Drawable

type Drawable interface {
	Draw(tcell.Screen)
}

func NewDrawableGroup

func NewDrawableGroup(drawables []Drawable) Drawable

type MutablePel

type MutablePel interface {
	Pel
	SetChar(rune)
	SetStyle(tcell.Style)
}

func NewMutablePel

func NewMutablePel(char rune, style tcell.Style) MutablePel

type Pel

type Pel interface {
	Char() rune
	Style() tcell.Style
}

func NewPel

func NewPel(char rune, style tcell.Style) Pel

type Text

type Text interface {
	Value() string
	SetValue(string)

	Position() position.Position
	SetPosition(position.Position)

	Style() tcell.Style
	SetStyle(tcell.Style)

	Draw(tcell.Screen)
}

func NewText

func NewText(value string, pos position.Position, style tcell.Style) Text

Jump to

Keyboard shortcuts

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