ui

package
v0.0.0-...-35c5657 Latest Latest
Warning

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

Go to latest
Published: May 8, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Choices

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

Choices is a wheel that prints available choices

func NewChoices

func NewChoices(x, y, cols int, bg color.Color) (cs *Choices)

NewChoices creates a new empty Choices of a specific color

func (*Choices) Draw

func (cs *Choices) Draw(grid *Grid)

Draw renders Choices to a screen

type Grid

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

Grid is a 2D matrix of text, rendered to an Image

func NewGrid

func NewGrid(cols, rows int, glyphs *font.Font) (g *Grid)

NewGrid creates an empty Grid of max size

func (*Grid) Draw

func (g *Grid) Draw(screen *ebiten.Image)

Draw renders Game to a screen

func (*Grid) Paint

func (g *Grid) Paint(x, y, cols, rows int, bg color.Color)

Paint replaces a rectangular region of the screen with the specified color

func (*Grid) Size

func (g *Grid) Size() (width, height int)

Size gets the dimensions of the Grid when rendered

func (*Grid) Text

func (g *Grid) Text(x, y, cols, rows int, data []rune, fg color.Color, inverted bool)

Text replaces a rectangular region of the screen with the specified runes

type Player

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

Player presents player stats to the player

func NewPlayer

func NewPlayer(x, y int, label color.Color) *Player

NewPlayer creates a new filled Player

func (*Player) AddStat

func (p *Player) AddStat(name string, max int)

AddStat registers a stat for the Player to render

func (*Player) Draw

func (p *Player) Draw(grid *Grid)

Draw renders a Player

type Statbar

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

Statbar is a labelled progressbar that represents some Player stat quantity

func NewStatbar

func NewStatbar(x, y int, stat string, max int, label color.Color) (sb *Statbar)

NewStatbar creates a new filled Statbar

func (*Statbar) Draw

func (sb *Statbar) Draw(grid *Grid)

Draw renders Statbar to a screen

type Textbox

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

Textbox is a bordered Box which prints text messages to the player

func NewTextbox

func NewTextbox(x, y, cols, rows int, bg color.Color) (tb *Textbox)

NewTextbox creates a new empty textbox of a specific color

func (*Textbox) Draw

func (tb *Textbox) Draw(grid *Grid)

Draw renders Textbox to a screen

type Titlebar

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

Titlebar is a topbar which prints both a Title and Location

func NewTitlebar

func NewTitlebar(x, y, cols int, bg color.Color) (tb *Titlebar)

NewTitlebar creates a new empty titlebar of a specific color

func (*Titlebar) Draw

func (tb *Titlebar) Draw(grid *Grid)

Draw renders Titlebar to a screen

type Window

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

Window presents the entire game area to the player

func NewWindow

func NewWindow(cols, rows int, glyphs *font.Font) *Window

NewWindow creates a fully populated game screen

func (*Window) DisplayStat

func (w *Window) DisplayStat(name string, max int)

DisplayStat adds a Player Stat to the Window

func (*Window) Draw

func (w *Window) Draw(screen *ebiten.Image)

Draw renders the Window to the screen

func (*Window) Size

func (w *Window) Size() (width, height int)

Size gets the dimensions of the Window when rendered

Jump to

Keyboard shortcuts

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