Documentation ¶
Overview ¶
Package gui provides a text/graphical rendering system for tile-based games.
Index ¶
Constants ¶
View Source
const ( ColorBlack = Color(termbox.ColorBlack) ColorBlue = Color(termbox.ColorBlue) ColorCyan = Color(termbox.ColorCyan) ColorGreen = Color(termbox.ColorGreen) ColorMagenta = Color(termbox.ColorMagenta) ColorRed = Color(termbox.ColorRed) ColorWhite = Color(termbox.ColorWhite) ColorYellow = Color(termbox.ColorYellow) ColorBrightBlack = Color(termbox.ColorBlack | termbox.AttrBold) ColorBrightBlue = Color(termbox.ColorBlue | termbox.AttrBold) ColorBrightCyan = Color(termbox.ColorCyan | termbox.AttrBold) ColorBrightGreen = Color(termbox.ColorGreen | termbox.AttrBold) ColorBrightMagenta = Color(termbox.ColorMagenta | termbox.AttrBold) ColorBrightRed = Color(termbox.ColorRed | termbox.AttrBold) ColorBrightWhite = Color(termbox.ColorWhite | termbox.AttrBold) ColorBrightYellow = Color(termbox.ColorYellow | termbox.AttrBold) )
Variables ¶
This section is empty.
Functions ¶
func Exit ¶
func Exit()
Exit tells the program to exit, then returns immediately. Main will return at some point in the future. Calling Exit twice panics.
Types ¶
type Interface ¶
type Interface interface { // SpriteSize returns the width and height of each tile. SpriteSize() (w, h int) // PreRender is called with the width and height in tiles of the screen before // SpriteAt is called during a frame. PreRender(w, h int) // SpriteAt returns the Sprite at (x, y) on the screen. SpriteAt(x, y, w, h int) *Sprite // Mouse is called when the user left clicks on the screen. Mouse(x, y, w, h int) // Rune is called when a character is entered on the keyboard. Return false if // the OS should handle the key event instead. Rune(r rune) (handled bool) // Key is called when a special key is pressed on the keyboard. Return false if // the OS should handle the key event instead. The default action for Escape is // to exit the program. Key(k Key) (handled bool) // Closing is called before the user exits the program. Return false to cancel. Closing() (allow bool) }
Interface is the set of methods that are called by gui.
Methods with x, y, w, h parameters fulful x ∈ [0, w) ∧ y ∈ [0, h).
Click to show internal directories.
Click to hide internal directories.