painter

package
v0.0.0-...-d640f43 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawBox

func DrawBox(layer *canvas.Layer, startX, startY, endX, endY int, style tcell.Style)

DrawBox will draw a box on the layer

func DrawHLine

func DrawHLine(layer *canvas.Layer, x, y, len int, style tcell.Style)

DrawHLine draws a horizontal line on the screen.

func DrawText

func DrawText(layer *canvas.Layer, x, y int, text string, style tcell.Style)

DrawText draws text to the x y coords, automatically allocating enough space for double width chars.

func DrawVLine

func DrawVLine(layer *canvas.Layer, x, y, len int, style tcell.Style)

DrawVLine draws a vertical line on the screen.

func DrawWrappedText

func DrawWrappedText(layer *canvas.Layer, minX, minY, maxX, maxY int, text string, style tcell.Style)

DrawWrappedText will print text to the screen, wrapping where possible to stay inside the bounds supplied in the paramters, and without overstepping the bounds of the screen.

func Fill

func Fill(layer *canvas.Layer, char rune, style tcell.Style)

Fill covers the entire layer with the specified rune.

Because runes can be either 1 or 2 spaces wide when painted on the screen, the method first checks to see how many cells should be advanced in the x axis each call to SetContent before it starts painting. If it turns out that it's impossible to paint the requested rune in the remaining area, a blank space is painted instead.

func Paint

func Paint(layer *canvas.Layer, startX, startY, endX, endY int, char rune, style tcell.Style)

Paint covers the rectangle region specified by the two coord pairs with the supplied rune.

Because runes can be either 1 or 2 spaces wide when painted on the screen, the method first checks to see how many cells should be advanced in the x axis each call to SetContent before it starts painting. If it turns out that it's impossible to paint the requested rune in the remaining area, a blank space is painted instead.

Types

This section is empty.

Jump to

Keyboard shortcuts

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