tbutils

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2014 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package tbutils provides a small number of helper functions for displaying text in a termbox

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateXCenterCoord

func CalculateXCenterCoord(text string) int

CalculateXCenterCoord calculates the x coordinate to write a string to so it is centred in the termbox. If the text is longer than the width of the termbox then this function returns 0

func DrawLine

func DrawLine(x, y int, text string)

DrawLine adds a single line of text to the termbox's back buffer. If the line is too long to fit in the termbox, it will be split across multiple lines. This function is the equivalent of calling DrawRichLine(x,y,text,termbox.ColorDefault,termbox.ColorDefault)

func DrawRichLine added in v0.3.1

func DrawRichLine(x, y int, text string, fg, bg termbox.Attribute)

DrawRichLine adds a single line of text to the termbox's back buffer. If the line is too long to fit in the termbox, it will be split across multiple lines.

func DrawRichText added in v0.3.1

func DrawRichText(x, y int, text string, fg, bg termbox.Attribute)

DrawRichText takes a string and adds it to the termbox's back buffer. If the string contains any newline characters, it'll be split across multiple rows. If the string is too long to find in the termbox, it'll be split across multiple lines to fit.

func DrawText

func DrawText(x, y int, text string)

DrawText take a string and adds it to the termbox's back buffer. If the string contains any newline characters, the string will be split across multiple rows. If the string is too long to fit in the termbox, it'll be split across multiple lines to fit. This function is the equivalent of calling DrawRichText(x,y,text,termbox.ColorDefault,termbox.ColorDefault)

Types

This section is empty.

Jump to

Keyboard shortcuts

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