display

package module
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 9 Imported by: 0

README

display

Console display

Interfaces

TODO - cartesian
Tile

A displayable element with a size

Renderable

Object that can be rendered into a tile (delayed rendering)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBorder

func NewBorder(content tile.Renderable, above *rune, below *rune, left *rune, right *rune) tile.Renderable

func NewHorizontalLine

func NewHorizontalLine(char rune, len int) tile.Renderable

func NewPanel

func NewPanel(content ...PositionedRenderable) tile.Renderable

Constructors

func NewVerticalLine

func NewVerticalLine(char rune, len int) tile.Renderable

Types

type BorderBuilder

type BorderBuilder interface {
	WithContent(content tile.Renderable) BorderBuilder
	WithAbove(character rune) BorderBuilder
	WithBelow(character rune) BorderBuilder
	WithHorizontal(character rune) BorderBuilder
	WithLeft(character rune) BorderBuilder
	WithRight(character rune) BorderBuilder
	WithVertical(character rune) BorderBuilder
	Build() tile.Renderable
}

func NewBorderBuilder

func NewBorderBuilder() BorderBuilder

type Canvas

type Canvas interface {
	core.StringerMl
	// Modify
	WriteAt(position xy.Position, content any) Canvas
	OverwriteAt(position xy.Position, content any) Canvas
	// Cells
	GetCell(position xy.Position) (cell cells.Cell, ok bool)
	SetCell(position xy.Position, cell cells.Cell)
	// Renderable
	Render(rules ...tile.RenderRule) tile.Tile
}

Mutable display type

func NewCanvas

func NewCanvas() Canvas

type IntersectionRuleBuilder

type IntersectionRuleBuilder interface {
	AddIntersection(above, below, left, right *rune, intersection rune) IntersectionRuleBuilder
	Build() tile.RenderRule
}

func NewIntersectionRuleBuilder

func NewIntersectionRuleBuilder() IntersectionRuleBuilder

type PositionedRenderable

type PositionedRenderable struct {
	Position xy.Position
	tile.Renderable
}

type Span

type Span struct {
	Content any
	Span    int
}

Content that spans columns span = no of colums - TODO -1 for all?

type TableBuilder

type TableBuilder interface {
	// Config
	WithHorizontalSeparator(separator rune) TableBuilder
	WithVerticalSeparator(separator rune) TableBuilder
	SetCell(x, y int, content any) TableBuilder
	SetCellByPosition(pos xy.Position, content any) TableBuilder
	AppendRow(content ...any) TableBuilder
	// tile.Renderable
	Build() tile.Renderable
}

func NewTableBuilder

func NewTableBuilder() TableBuilder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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