screen

package
v0.0.0-...-52c1314 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Line

type Line struct {
	// contains filtered or unexported fields
}

Line is a representation of a line on the Screen. `keep` is to indicate if the line should survive calls to clear the screen `name` is to give the line a name so to be able to clear it directly

func NewLine

func NewLine(content string, keep bool, name string) *Line

NewLine is a constructor for Line

type Screen

type Screen struct {
	// contains filtered or unexported fields
}

Screen is the global primitive that keeps track of lines on the screen and allow to operate o them to do things like animations or rendering

func NewScreen

func NewScreen(showColors *bool) *Screen

NewScreen is a constructor for Screen

func (*Screen) Bleu

func (s *Screen) Bleu(text string) string

Bleu renders text in green

func (*Screen) CarvePrint

func (s *Screen) CarvePrint(content string)

CarvePrint is a shortcut to an unnamed permanent line

func (*Screen) CleanLines

func (s *Screen) CleanLines()

CleanLines is to remove lines that are not marked as keep = true

func (*Screen) Clear

func (s *Screen) Clear()

Clear clears the actual screen so it can be repinted

func (*Screen) ClearNamedLayers

func (s *Screen) ClearNamedLayers(layerName string)

ClearNamedLayers clears the layers with the specified name

func (*Screen) Critical

func (s *Screen) Critical(text string) string

Critical renders text in red

func (*Screen) Display

func (s *Screen) Display(content string, preserveContent bool, lineName string)

Display is the basic call to print a line to the screen. it allows to set the `keep` flag for the line and to name line successive calls to display will clear lines who have `keep` set to false

func (*Screen) Emphasis

func (s *Screen) Emphasis(text string) string

Emphasis emboldens the text

func (*Screen) InsertLine

func (s *Screen) InsertLine(content string, name string)

InsertLine adds a line to the screen without rendering or clearing the screen

func (*Screen) Invert

func (s *Screen) Invert(text string) string

Invert inverts the color of the text practical for when the background color is changed

func (*Screen) Normal

func (s *Screen) Normal(text string) string

Normal renders text as normal is a noop

func (*Screen) NumLines

func (s *Screen) NumLines() int

NumLines returns the number of lines that are known by screen

func (*Screen) Ok

func (s *Screen) Ok(text string) string

Ok renders text in green

func (*Screen) Purple

func (s *Screen) Purple(text string) string

Purple renders text in purple

func (*Screen) RemoveBlankLines

func (s *Screen) RemoveBlankLines()

RemoveBlankLines is a shortcut to remove lines that are blank

func (*Screen) Render

func (s *Screen) Render()

Render renders all lines to the screen

func (*Screen) ShowPrint

func (s *Screen) ShowPrint(content string)

ShowPrint is a shortcut to an unnamed temporary line

func (*Screen) Teal

func (s *Screen) Teal(text string) string

Teal renders text in teal color

func (*Screen) Warning

func (s *Screen) Warning(text string) string

Warning renders text in yellow

Jump to

Keyboard shortcuts

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