Documentation ¶
Index ¶
- Constants
- type Action
- type UI
- func (u *UI) Hide()
- func (u *UI) Home(eventType uint32)
- func (u *UI) Message(text string, seconds time.Duration)
- func (u *UI) ProcessEvents()
- func (u *UI) Quit(eventType uint32)
- func (u *UI) Repaint()
- func (u *UI) ScreenBuffer() (buffer []byte)
- func (u *UI) SetControls(keymap options.Keymap) (err error)
- func (u *UI) Show()
- func (u *UI) Text(text string)
Constants ¶
const (
// Margin is the space in pixels between screen border and UI text.
Margin = 2
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action func(eventType uint32)
Action type for user interactions. TODO: see if we can use a single one for gameboy/ui.
type UI ¶
type UI struct { Enabled bool Controls map[options.KeyStroke]Action // Send true to this channel to quit the program. QuitChan chan bool // contains filtered or unexported fields }
UI structure to manage user commands and overlay.
func (*UI) Message ¶
Message shows a temporary message that will be cleared after the given duration (in seconds). This message stacks with permanent text set with Text().
func (*UI) ProcessEvents ¶
func (u *UI) ProcessEvents()
func (*UI) ScreenBuffer ¶
ScreenBuffer creates a new SDL texture suitable to use for the emulator's screen, and a pixel buffer that it returns, which the PPU should write into. This lets us do funny stuff with the GameBoy display's pixels in the UI that we couldn't easily do if we only had access to a texture.
func (*UI) SetControls ¶
SetControls validates and sets the given control map for the emulator's UI.