view

package
v0.0.0-...-14468cb Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CellEmpty = Cell{
	Rune:  ' ',
	Style: style.StyleClear,
}

Functions

func NewStyle

func NewStyle(fg style.Color, args ...interface{}) style.Style

func Render

func Render(objects ...Drawable)

Types

type Buffer

type Buffer struct {
	image.Rectangle
	CellMap map[image.Point]Cell
}

func NewBuffer

func NewBuffer(r image.Rectangle) *Buffer

func (*Buffer) Fill

func (self *Buffer) Fill(c Cell, r image.Rectangle)

func (*Buffer) GetCell

func (self *Buffer) GetCell(p image.Point) Cell

func (*Buffer) SetCell

func (self *Buffer) SetCell(c Cell, p image.Point)

func (*Buffer) SetString

func (self *Buffer) SetString(s string, style style.Style, p image.Point)

type Canvas

type Canvas struct {
	modules.Module
	Objects []*CanvasObject
}

func NewCanvas

func NewCanvas() *Canvas

func (*Canvas) Draw

func (self *Canvas) Draw(buf *Buffer)

func (*Canvas) Set

func (self *Canvas) Set(module ...interface{})

type CanvasObject

type CanvasObject struct {
	XRatio      float64
	YRatio      float64
	WidthRatio  float64
	HeightRatio float64

	Entry  interface{}
	IsLeaf bool
	Cell   [][]Cell
	// contains filtered or unexported fields
}

func NewCol

func NewCol(ratio float64, i ...interface{}) CanvasObject

func NewRow

func NewRow(ratio float64, i ...interface{}) CanvasObject

type Cell

type Cell struct {
	Rune  rune
	Style style.Style
}

func NewCell

func NewCell(rune rune, args ...interface{}) Cell

type Drawable

type Drawable interface {
	GetRect() image.Rectangle
	SetRect(int, int, int, int)
	Draw(*Buffer)
	sync.Locker
}

type View

type View struct {
	Width  int
	Height int
	// contains filtered or unexported fields
}

func GetViewInstance

func GetViewInstance() *View

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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