Did a lot of work off-repo, basically init

This commit is contained in:
Luke I. Wilson
2021-03-11 13:27:35 -06:00
parent 2e9b2ad2b1
commit d0bb43cc8f
16 changed files with 1788 additions and 0 deletions

25
ui/label.go Normal file
View File

@ -0,0 +1,25 @@
package ui
// Align defines the text alignment of a label.
type Align uint8
const (
// AlignLeft is the normal text alignment where text is aligned to the left
// of its bounding box.
AlignLeft Align = iota
// AlignRight causes text to be aligned to the right of its bounding box.
AlignRight
// AlignJustify causes text to be left-aligned, but also spaced so that it
// fits the entire box where it is being rendered.
AlignJustify
)
// A Label is a component for rendering text. Text can be rendered easily
// without a Label, but this component forces the text to fit within its
// bounding box and allows for left-align, right-align, and justify.
type Label struct {
Text string
x, y int
width, height int
Alignment Align
}