textscenes

package
v0.0.0-...-9adee62 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Bold_Red    = "\x1b[1;31m"
	Bold_Green  = "\x1b[1;32m"
	Bold_Yellow = "\x1b[1;33m"
	Red         = "\x1b[31m"
	Reset       = "\x1b[0m"
)

copied from ansi package

View Source
const MenuItemsPlaceholder = "MENU_ITEMS"

Variables

View Source
var (
	MenuKeyRows    = strings.Split(menuKeys, "\n")
	ConfirmKeyRows = strings.Split(confirmOnly, "\n")
)
View Source
var Controls = ColorizeFrame(controls, "⿴", Bold_Green, Bold_Red)
View Source
var GameOver = Colorize(ColorizeBetween(gameover, "⿴  ", "  ⿴", Bold_Yellow), "⿴", Red)
View Source
var OptionScreen = NewMenuScreen(ColorizeFrame(options, "⿴", Bold_Green, Bold_Red))
View Source
var WelcomeScreen = NewMenuScreen(ColorizeFrame(welcome, "⿴", Bold_Green, Bold_Red))

Functions

func Colorize

func Colorize(text, pattern, color string) string

func ColorizeBetween

func ColorizeBetween(text, startPattern, endPattern, color string) string

func ColorizeFrame

func ColorizeFrame(text, verticalFramePattern, contentColor, frameColor string) string

func Screen

func Screen(screen string) string

Types

type MenuScreen struct {
	RowsTop []string
	RowsBot []string
	PadLeft string
}

func NewMenuScreen

func NewMenuScreen(source string) MenuScreen
func (screen MenuScreen) Menu(names, descriptions []string, current string) string

Jump to

Keyboard shortcuts

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