ui

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

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

Go to latest
Published: Mar 9, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENTER = iota
	UP
	DOWN
	LEFT
	RIGHT
	ESC
)
View Source
const OffSet = 1

OffSet defines how much buffer space should be left between the top left corner of the screen and the top left corner of the game map display

Variables

This section is empty.

Functions

func Clear

func Clear()

func DrawRune

func DrawRune(x, y int, r rune)

DrawRune is the display function to be used when representing objects on the screen. It is not to be used when displaying text.

func GameToScreen

func GameToScreen(x, y int) (int, int)

Converts Game coordinates to Screen Coordinates, adjusted for offset and aspect

func Print

func Print(x, y int, chars string)

Print displays the given string at the given position on the screen

func PrintSlice

func PrintSlice(x, y int, items []string)

PrintSlice displays a given slice of strings in series, beginning at position

func PrintSliceAtBottom

func PrintSliceAtBottom(items []string)

PrintSliceAtBottom displays a given slice of strings, snapped to the bottom of the screen

func ScreenToGame

func ScreenToGame(x, y int) (int, int)

Converts Screen coordinates to Game Coordinates, useful for turning mouse click coordinates to the cell in that position on the game map

func SetCell

func SetCell(x, y int, r rune)

func Uninit

func Uninit()

Uninitializes Termbox

func Update

func Update()

Types

type Event

type Event struct {
	Key rune
}

func GetEvent

func GetEvent() Event

Jump to

Keyboard shortcuts

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