Documentation ¶
Index ¶
- Constants
- Variables
- func HideFPS()
- func Init(consoleType ConsoleType) error
- func Run(cart Cartridge) error
- func ShowFPS()
- type BaseCartridge
- type Cartridge
- type Clearer
- type ColorID
- type Config
- type Configger
- type ConsoleType
- type Drawer
- type Paletter
- type Peeker
- type PicoGraphicsAPI
- type PicoInputAPI
- type PixelBuffer
- type Printer
- type Runtime
- type Spriter
Constants ¶
View Source
const ( PICO8 = "pico8" TIC80 = "tic80" ZXSPECTRUM = "zxspectrum" CBM64 = "cbm64" )
View Source
const MaxCacheAge = 1 * time.Minute
View Source
const MaxSpriteCache = 1000
View Source
const TOTAL_COLORS = 16
Variables ¶
View Source
var ConsoleTypes = map[ConsoleType]string{ PICO8: "PICO8", TIC80: "TIC80", ZXSPECTRUM: "ZXSPECTRUM", CBM64: "CBM64", }
Functions ¶
func Init ¶
func Init(consoleType ConsoleType) error
Types ¶
type BaseCartridge ¶
type BaseCartridge struct { PixelBuffer // ref to console display PicoInputAPI // contains filtered or unexported fields }
func NewBaseCart ¶
func NewBaseCart() *BaseCartridge
NewBaseCart - initialise a struct implementing Cartridge interface
func (*BaseCartridge) Btn ¶
func (bc *BaseCartridge) Btn(id int) bool
func (*BaseCartridge) GetConfig ¶
func (bc *BaseCartridge) GetConfig() Config
GetConfig - return config need for Cart to run
type Cartridge ¶
type Cartridge interface { // BaseCartridge methods already implemented Configger PicoInputAPI // User implemented methods below Init() error Render() Update() // contains filtered or unexported methods }
type ColorID ¶
type ColorID uint8
const ( PICO8_BLACK ColorID = iota PICO8_DARK_BLUE PICO8_DARK_PURPLE PICO8_DARK_GREEN PICO8_BROWN PICO8_DARK_GRAY PICO8_LIGHT_GRAY PICO8_WHITE PICO8_RED PICO8_ORANGE PICO8_YELLOW PICO8_GREEN PICO8_BLUE PICO8_INDIGO PICO8_PINK PICO8_PEACH )
PICO8 - colors
const ( TIC80_BLACK ColorID = iota TIC80_DARK_RED TIC80_DARK_BLUE TIC80_DARK_GRAY TIC80_BROWN TIC80_DARK_GREEN TIC80_RED TIC80_LIGHT_GRAY TIC80_LIGHT_BLUE TIC80_ORANGE TIC80_BLUE_GRAY TIC80_LIGHT_GREEN TIC80_PEACH TIC80_CYAN TIC80_YELLOW TIC80_WHITE )
TIC80 - colors
type Config ¶
type Config struct { BorderWidth int ConsoleWidth int ConsoleHeight int ScreenshotScale int GifScale int GifLength int BgColor ColorID FgColor ColorID BorderColor ColorID // contains filtered or unexported fields }
func NewConfig ¶
func NewConfig(consoleType ConsoleType) Config
type ConsoleType ¶
type ConsoleType string
type Drawer ¶
type Drawer interface { SetColor(colorID ColorID) // Set drawing color (colour!!!) // drawing primitives Circle(x, y, r int, colorID ...ColorID) CircleFill(x, y, r int, colorID ...ColorID) Line(x0, y0, x1, y1 int, colorID ...ColorID) PGet(x, y int) ColorID PSet(x, y int, colorID ...ColorID) Rect(x0, y0, x1, y1 int, colorID ...ColorID) RectFill(x0, y0, x1, y1 int, colorID ...ColorID) }
type PicoGraphicsAPI ¶
type PicoInputAPI ¶
type PixelBuffer ¶
type Printer ¶
type Printer interface { // Text/Printing Cursor(x, y int) // Set text cursor GetCursor() pos Print(str string) // Print a string of characters to the screen at default pos PrintAt(str string, x, y int, colorID ...ColorID) // Print a string of characters to the screen at position with color ScrollUpLine() }
type Runtime ¶
type Runtime interface { PicoInputAPI LoadCart(cart Cartridge) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.