Documentation
¶
Index ¶
- Constants
- Variables
- type BaseCartridge
- type Cartridge
- type Clearer
- type Color
- type Command
- type Config
- type Configger
- type Console
- type ConsoleState
- type ConsoleType
- type Drawer
- type Inputter
- type Mode
- type ModeType
- type Paletter
- type Persister
- type PicoGraphicsAPI
- type PicoInputAPI
- type PixelBuffer
- type Printer
- type Recorder
- type Runtime
- type Spriter
Constants ¶
View Source
const ( P1_BUTT_RIGHT = 0x4f P1_BUTT_LEFT = 0x50 P1_BUTT_DOWN = 0x51 P1_BUTT_UP = 0x52 //Z,X / C,V / N,M P1_BUTT_01 = 0x1d // Z P1_BUTT_02 = 0x1b // X P1_BUTT_03 = 0x6 // C P1_BUTT_04 = 0x19 // V P1_BUTT_05 = 0x11 // N P1_BUTT_06 = 0x10 // M )
View Source
const ( PICO8 = "pico8" TIC80 = "tic80" ZX_SPECTRUM = "zxspectrum" CBM64 = "cbm64" )
View Source
const TOTAL_COLORS = 256
Variables ¶
View Source
var ConsoleTypes = map[ConsoleType]string{ PICO8: "PICO8", TIC80: "TIC80", ZX_SPECTRUM: "ZX_SPECTRUM", CBM64: "CBM64", }
Functions ¶
This section is empty.
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
func (*BaseCartridge) IsRunning ¶
func (bc *BaseCartridge) IsRunning() bool
func (*BaseCartridge) Stop ¶
func (bc *BaseCartridge) Stop()
type Cartridge ¶
type Cartridge interface {
// BaseCartridge methods already implemented
Configger
IsRunning() bool
Stop()
PicoInputAPI
// User implemented methods below
Init()
Render()
Update()
// contains filtered or unexported methods
}
type Clearer ¶
type Clearer interface {
Cls() // Clear screen
ClsWithColor(colorID Color) // Clear screen with color
}
type Color ¶
type Color int
const ( PICO8_BLACK Color = 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 Color = 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 Command ¶
type Command interface {
Exec(pb PixelBuffer, statement string) error
}
func NewCDCommand ¶
func NewCDCommand() Command
func NewDirCommand ¶
func NewDirCommand() Command
func NewHelpCommand ¶
func NewHelpCommand() Command
func NewMkDirCommand ¶
func NewMkDirCommand() Command
func NewRunCommand ¶
func NewRunCommand() Command
type Config ¶
type Config struct {
BorderWidth int
ConsoleWidth int
ConsoleHeight int
WindowWidth int
WindowHeight int
FPS int
Verbose bool
ScreenshotScale int
GifScale int
GifLength int
BgColor Color
FgColor Color
BorderColor Color
// contains filtered or unexported fields
}
func NewConfig ¶
func NewConfig(consoleType ConsoleType) Config
type Console ¶
type Console interface {
LoadCart(cart Cartridge) error
Run() error
Destroy()
GetWindow() *sdl.Window
SetMode(newMode ModeType)
Inputter
}
func NewConsole ¶
func NewConsole(consoleType ConsoleType) (Console, error)
type ConsoleType ¶
type ConsoleType string
type Drawer ¶
type Drawer interface {
Color(colorID Color) // Set drawing color (colour!!!)
// drawing primatives
Circle(x, y, r int)
CircleWithColor(x, y, r int, colorID Color)
CircleFill(x, y, r int)
CircleFillWithColor(x, y, r int, colorID Color)
Line(x0, y0, x1, y1 int)
LineWithColor(x0, y0, x1, y1 int, colorID Color)
PGet(x, y int) Color
PSet(x, y int)
PSetWithColor(x, y int, colorID Color)
Rect(x0, y0, x1, y1 int)
RectWithColor(x0, y0, x1, y1 int, colorID Color)
RectFill(x0, y0, x1, y1 int)
RectFillWithColor(x0, y0, x1, y1 int, colorID Color)
}
type Inputter ¶
type Inputter interface {
PicoInputAPI
// contains filtered or unexported methods
}
func NewInputter ¶
func NewInputter() Inputter
type Persister ¶
type Persister interface {
SaveState(console Console) error
LoadState() (*ConsoleState, error)
}
func NewStateManager ¶
type PicoInputAPI ¶
type PixelBuffer ¶
type PixelBuffer interface {
Flip() error // Copy graphics buffer to screen
Destroy()
GetFrame() *sdl.Surface
PicoGraphicsAPI
// contains filtered or unexported methods
}
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) // Print a string of characters to the screen at position
PrintAtWithColor(str string, x, y int, colorID Color) // Print a string of characters to the screen at position with color
ScrollUpLine()
}
Click to show internal directories.
Click to hide internal directories.