Documentation ¶
Index ¶
- Constants
- Variables
- type Button
- type ButtonManager
- type ChangeKeyMenu
- func (menu *ChangeKeyMenu) Input(input MenuInput) SubMenu
- func (menu *ChangeKeyMenu) IsChoosing() bool
- func (menu *ChangeKeyMenu) MakeRenderer(maxWidth int, maxHeight int, buttonManager *ButtonManager, ...) gfx.RenderFunction
- func (menu *ChangeKeyMenu) PlayBeep()
- func (menu *ChangeKeyMenu) RawInput(event sdl.Event)
- func (menu *ChangeKeyMenu) SetChoosing(v bool, key string, button *StaticFixedWidthButton)
- func (menu *ChangeKeyMenu) UpdateWindowSize(x int, y int)
- type ChooseButton
- func (choose *ChooseButton) Disable()
- func (choose *ChooseButton) Enable()
- func (choose *ChooseButton) Interact(menu SubMenu) SubMenu
- func (choose *ChooseButton) IsEnabled() bool
- func (choose *ChooseButton) Next()
- func (choose *ChooseButton) Previous()
- func (choose *ChooseButton) Render(font *ttf.Font, renderer *sdl.Renderer, buttonManager *ButtonManager, ...) (int, int, error)
- func (choose *ChooseButton) SetEnabled(v bool)
- func (choose *ChooseButton) Text() string
- func (choose *ChooseButton) Toggle() bool
- type JoystickAxisType
- type JoystickButtonMapping
- func (mapping *JoystickButtonMapping) AddAxisMapping(name string, axis JoystickAxisType)
- func (mapping *JoystickButtonMapping) AddButtonMapping(name string, code int)
- func (mapping *JoystickButtonMapping) ButtonList() []string
- func (mapping *JoystickButtonMapping) ExtraButtonList() []string
- func (mapping *JoystickButtonMapping) GetConfigureButton(button int) string
- func (mapping *JoystickButtonMapping) GetRawCode(name string) int
- func (mapping *JoystickButtonMapping) GetRawExtraInput(name string) JoystickInputType
- func (mapping *JoystickButtonMapping) GetRawInput(name string) JoystickInputType
- func (mapping *JoystickButtonMapping) HandleAxis(event *sdl.JoyAxisEvent)
- func (mapping *JoystickButtonMapping) IsPressed(name string) bool
- func (mapping *JoystickButtonMapping) Press(rawButton int)
- func (mapping *JoystickButtonMapping) Release(rawButton int)
- func (mapping *JoystickButtonMapping) TotalButtons() int
- func (mapping *JoystickButtonMapping) Unmap(name string)
- func (mapping *JoystickButtonMapping) UpdateJoystick(manager *common.JoystickManager)
- type JoystickButtonType
- type JoystickInputType
- type JoystickMenu
- func (menu *JoystickMenu) FinishConfigure()
- func (menu *JoystickMenu) GetTexture(textureManager *TextureManager, text string) TextureId
- func (menu *JoystickMenu) Input(input MenuInput) SubMenu
- func (menu *JoystickMenu) MakeRenderer(maxWidth int, maxHeight int, buttonManager *ButtonManager, ...) gfx.RenderFunction
- func (menu *JoystickMenu) PlayBeep()
- func (menu *JoystickMenu) RawInput(event sdl.Event)
- func (menu *JoystickMenu) UpdateWindowSize(x int, y int)
- type JoystickState
- type JoystickStateAdd
- type JoystickStateRemove
- type LoadRomInfoMenu
- func (loader *LoadRomInfoMenu) GetSelectionColor(use int) sdl.Color
- func (loader *LoadRomInfoMenu) Input(input MenuInput) SubMenu
- func (loader *LoadRomInfoMenu) MakeRenderer(maxWidth int, maxHeight int, buttonManager *ButtonManager, ...) gfx.RenderFunction
- func (loader *LoadRomInfoMenu) PlayBeep()
- func (loader *LoadRomInfoMenu) RawInput(event sdl.Event)
- func (loader *LoadRomInfoMenu) UpdateWindowSize(x int, y int)
- type LoadRomMenu
- func (loadRomMenu *LoadRomMenu) Input(input MenuInput) SubMenu
- func (loadRomMenu *LoadRomMenu) MakeRenderer(maxWidth int, maxHeight int, buttonManager *ButtonManager, ...) gfx.RenderFunction
- func (loadRomMenu *LoadRomMenu) PlayBeep()
- func (loadRomMenu *LoadRomMenu) RawInput(event sdl.Event)
- func (loadRomMenu *LoadRomMenu) UpdateWindowSize(x int, y int)
- type Menu
- type MenuAction
- type MenuButtons
- func (buttons *MenuButtons) Add(item MenuItem)
- func (buttons *MenuButtons) Interact(input MenuInput, menu SubMenu) SubMenu
- func (buttons *MenuButtons) Next()
- func (buttons *MenuButtons) Previous()
- func (buttons *MenuButtons) Render(startX int, startY int, maxWidth int, maxHeight int, ...) (int, int, error)
- func (buttons *MenuButtons) Select(item MenuItem)
- type MenuInput
- type MenuItem
- type MenuLabel
- type MenuNextLine
- type MenuQuitFunc
- type MenuRenderLayer
- type MenuSpace
- type MenuState
- type NullInput
- type PossibleRom
- type RomId
- type RomIdAndPath
- type RomLoaderAdd
- type RomLoaderFrame
- type RomLoaderInfo
- type RomLoaderState
- func (loader *RomLoaderState) AddNewRom(rom RomLoaderAdd)
- func (loader *RomLoaderState) AddRomFrame(frame RomLoaderFrame)
- func (loader *RomLoaderState) AdvanceFrames()
- func (loader *RomLoaderState) FindRomIdByPath(path string) RomId
- func (loader *RomLoaderState) FindSortedIdIndex(roms []*RomIdAndPath, path string) int
- func (loader *RomLoaderState) GetFilteredRoms() []*RomIdAndPath
- func (loader *RomLoaderState) GetSelectedRom() (string, bool)
- func (loader *RomLoaderState) GetSelectedRomInfo() (*RomLoaderInfo, bool)
- func (loader *RomLoaderState) MaximumTiles() int
- func (loader *RomLoaderState) NextDownSelection()
- func (loader *RomLoaderState) NextSelection()
- func (loader *RomLoaderState) PreviousSelection()
- func (loader *RomLoaderState) PreviousUpSelection()
- func (loader *RomLoaderState) Render(maxWidth int, maxHeight int, font *ttf.Font, smallFont *ttf.Font, ...) error
- func (loader *RomLoaderState) SearchAdd(letter string)
- func (loader *RomLoaderState) SearchBackspace()
- func (loader *RomLoaderState) TileLayout() *TileLayout
- func (loader *RomLoaderState) TileRows(maxHeight int) int
- func (loader *RomLoaderState) TilesPerRow(maxWidth int) int
- func (loader *RomLoaderState) UpdateWindowSize(width int, height int)
- func (loader *RomLoaderState) ZoomIn()
- func (loader *RomLoaderState) ZoomOut()
- type Snow
- type SortRomIds
- type StaticButton
- type StaticButtonFunc
- type StaticFixedButtonFunc
- type StaticFixedWidthButton
- func (button *StaticFixedWidthButton) Interact(menu SubMenu) SubMenu
- func (button *StaticFixedWidthButton) Render(font *ttf.Font, renderer *sdl.Renderer, buttonManager *ButtonManager, ...) (int, int, error)
- func (button *StaticFixedWidthButton) Text() string
- func (button *StaticFixedWidthButton) Update(parts ...string)
- type StaticMenu
- func (menu *StaticMenu) Input(input MenuInput) SubMenu
- func (menu *StaticMenu) MakeRenderer(maxWidth int, maxHeight int, buttonManager *ButtonManager, ...) gfx.RenderFunction
- func (menu *StaticMenu) PlayBeep()
- func (menu *StaticMenu) RawInput(event sdl.Event)
- func (menu *StaticMenu) UpdateWindowSize(x int, y int)
- type SubMenu
- type SubMenuButton
- type SubMenuFunc
- type TextureId
- type TextureInfo
- type TextureMaker
- type TextureManager
- func (manager *TextureManager) Destroy()
- func (manager *TextureManager) GetCachedTexture(id TextureId, makeTexture TextureMaker) (TextureInfo, error)
- func (manager *TextureManager) NextId() TextureId
- func (manager *TextureManager) RenderText(font *ttf.Font, renderer *sdl.Renderer, text string, color sdl.Color, ...) (TextureInfo, error)
- type TileLayout
- type ToggleButton
- type ToggleButtonFunc
Constants ¶
const ( MenuToggle = iota MenuNext MenuPrevious MenuUp MenuDown MenuSelect MenuQuit // usually when ESC is input )
const ( MenuActionQuit = iota MenuActionLoadRom MenuActionSound MenuActionJoystick )
const ( MenuStateTop = iota MenuStateLoadRom )
const ( LoadRomInfoSelect = iota LoadRomInfoBack )
const JoystickMaxPartialCounter = 20
Variables ¶
var TextureManagerDestroyed = fmt.Errorf("texture manager has been destroyed")
Functions ¶
This section is empty.
Types ¶
type ButtonManager ¶
Maps a hash of a string and the 32-bit representation of a color to a texture id
func MakeButtonManager ¶
func MakeButtonManager() ButtonManager
func (*ButtonManager) GetButtonTextureId ¶
func (manager *ButtonManager) GetButtonTextureId(textureManager *TextureManager, message string, color sdl.Color) TextureId
type ChangeKeyMenu ¶
type ChangeKeyMenu struct { MenuQuit context.Context Quit MenuQuitFunc Buttons MenuButtons ExtraInfo string Beep *mix.Music Chooser *ChooseButton Choosing bool ChoosingKey string ChoosingButton *StaticFixedWidthButton Current uint64 /* show a warning if the user is choosing a key that is already in use */ Warning string ChooseDone context.Context ChooseCancel context.CancelFunc TempChoice sdl.Keycode Keys *common.EmulatorKeys Lock sync.Mutex }
func (*ChangeKeyMenu) Input ¶
func (menu *ChangeKeyMenu) Input(input MenuInput) SubMenu
func (*ChangeKeyMenu) IsChoosing ¶
func (menu *ChangeKeyMenu) IsChoosing() bool
func (*ChangeKeyMenu) MakeRenderer ¶
func (menu *ChangeKeyMenu) MakeRenderer(maxWidth int, maxHeight int, buttonManager *ButtonManager, textureManager *TextureManager, font *ttf.Font, smallFont *ttf.Font, clock uint64) gfx.RenderFunction
func (*ChangeKeyMenu) PlayBeep ¶
func (menu *ChangeKeyMenu) PlayBeep()
func (*ChangeKeyMenu) RawInput ¶
func (menu *ChangeKeyMenu) RawInput(event sdl.Event)
func (*ChangeKeyMenu) SetChoosing ¶
func (menu *ChangeKeyMenu) SetChoosing(v bool, key string, button *StaticFixedWidthButton)
func (*ChangeKeyMenu) UpdateWindowSize ¶
func (menu *ChangeKeyMenu) UpdateWindowSize(x int, y int)
type ChooseButton ¶
func (*ChooseButton) Disable ¶
func (choose *ChooseButton) Disable()
func (*ChooseButton) Enable ¶
func (choose *ChooseButton) Enable()
func (*ChooseButton) Interact ¶
func (choose *ChooseButton) Interact(menu SubMenu) SubMenu
func (*ChooseButton) IsEnabled ¶
func (choose *ChooseButton) IsEnabled() bool
func (*ChooseButton) Next ¶
func (choose *ChooseButton) Next()
func (*ChooseButton) Previous ¶
func (choose *ChooseButton) Previous()
func (*ChooseButton) Render ¶
func (choose *ChooseButton) Render(font *ttf.Font, renderer *sdl.Renderer, buttonManager *ButtonManager, textureManager *TextureManager, x int, y int, selected bool, clock uint64) (int, int, error)
func (*ChooseButton) SetEnabled ¶
func (choose *ChooseButton) SetEnabled(v bool)
func (*ChooseButton) Text ¶
func (choose *ChooseButton) Text() string
func (*ChooseButton) Toggle ¶
func (choose *ChooseButton) Toggle() bool
type JoystickAxisType ¶
func (*JoystickAxisType) IsPressed ¶
func (axis *JoystickAxisType) IsPressed() bool
func (*JoystickAxisType) ToString ¶
func (axis *JoystickAxisType) ToString() string
type JoystickButtonMapping ¶
type JoystickButtonMapping struct { Inputs map[string]JoystickInputType ExtraInputs map[string]JoystickInputType }
Probably this isn't needed, and the JoystickManager can take care of the mapping
func (*JoystickButtonMapping) AddAxisMapping ¶
func (mapping *JoystickButtonMapping) AddAxisMapping(name string, axis JoystickAxisType)
func (*JoystickButtonMapping) AddButtonMapping ¶
func (mapping *JoystickButtonMapping) AddButtonMapping(name string, code int)
func (*JoystickButtonMapping) ButtonList ¶
func (mapping *JoystickButtonMapping) ButtonList() []string
func (*JoystickButtonMapping) ExtraButtonList ¶
func (mapping *JoystickButtonMapping) ExtraButtonList() []string
func (*JoystickButtonMapping) GetConfigureButton ¶
func (mapping *JoystickButtonMapping) GetConfigureButton(button int) string
func (*JoystickButtonMapping) GetRawCode ¶
func (mapping *JoystickButtonMapping) GetRawCode(name string) int
returns the sdl joystick button mapped to the given name, or -1 * if no such mapping exists
func (*JoystickButtonMapping) GetRawExtraInput ¶
func (mapping *JoystickButtonMapping) GetRawExtraInput(name string) JoystickInputType
func (*JoystickButtonMapping) GetRawInput ¶
func (mapping *JoystickButtonMapping) GetRawInput(name string) JoystickInputType
func (*JoystickButtonMapping) HandleAxis ¶
func (mapping *JoystickButtonMapping) HandleAxis(event *sdl.JoyAxisEvent)
func (*JoystickButtonMapping) IsPressed ¶
func (mapping *JoystickButtonMapping) IsPressed(name string) bool
func (*JoystickButtonMapping) Press ¶
func (mapping *JoystickButtonMapping) Press(rawButton int)
func (*JoystickButtonMapping) Release ¶
func (mapping *JoystickButtonMapping) Release(rawButton int)
func (*JoystickButtonMapping) TotalButtons ¶
func (mapping *JoystickButtonMapping) TotalButtons() int
func (*JoystickButtonMapping) Unmap ¶
func (mapping *JoystickButtonMapping) Unmap(name string)
func (*JoystickButtonMapping) UpdateJoystick ¶
func (mapping *JoystickButtonMapping) UpdateJoystick(manager *common.JoystickManager)
type JoystickButtonType ¶
func (*JoystickButtonType) IsPressed ¶
func (button *JoystickButtonType) IsPressed() bool
func (*JoystickButtonType) ToString ¶
func (button *JoystickButtonType) ToString() string
type JoystickInputType ¶
type JoystickMenu ¶
type JoystickMenu struct { Buttons MenuButtons Quit MenuQuitFunc // JoystickName string // JoystickIndex int Textures map[string]TextureId Lock sync.Mutex Configuring bool Mapping JoystickButtonMapping // the button currently being configured, which is an index into the ButtonList() PartialButton JoystickInputType PartialCounter int ConfigureButton int ConfigureButtonEnd int Released chan int ConfigurePrevious context.CancelFunc JoystickManager *common.JoystickManager }
func (*JoystickMenu) FinishConfigure ¶
func (menu *JoystickMenu) FinishConfigure()
func (*JoystickMenu) GetTexture ¶
func (menu *JoystickMenu) GetTexture(textureManager *TextureManager, text string) TextureId
func (*JoystickMenu) Input ¶
func (menu *JoystickMenu) Input(input MenuInput) SubMenu
func (*JoystickMenu) MakeRenderer ¶
func (menu *JoystickMenu) MakeRenderer(maxWidth int, maxHeight int, buttonManager *ButtonManager, textureManager *TextureManager, font *ttf.Font, smallFont *ttf.Font, clock uint64) gfx.RenderFunction
func (*JoystickMenu) PlayBeep ¶
func (menu *JoystickMenu) PlayBeep()
func (*JoystickMenu) RawInput ¶
func (menu *JoystickMenu) RawInput(event sdl.Event)
func (*JoystickMenu) UpdateWindowSize ¶
func (menu *JoystickMenu) UpdateWindowSize(x int, y int)
type JoystickState ¶
type JoystickState interface { }
type JoystickStateAdd ¶
type JoystickStateAdd struct { Index int InstanceId sdl.JoystickID Name string }
type JoystickStateRemove ¶
type JoystickStateRemove struct { Index int InstanceId sdl.JoystickID }
type LoadRomInfoMenu ¶
type LoadRomInfoMenu struct { RomLoader *LoadRomMenu // the previous load rom menu Selection int Filesize int64 Mapper int Info *RomLoaderInfo }
displays info about a specific rom in the rom loader and gives the user a choice to actually load the rom or not
func (*LoadRomInfoMenu) GetSelectionColor ¶
func (loader *LoadRomInfoMenu) GetSelectionColor(use int) sdl.Color
func (*LoadRomInfoMenu) Input ¶
func (loader *LoadRomInfoMenu) Input(input MenuInput) SubMenu
func (*LoadRomInfoMenu) MakeRenderer ¶
func (loader *LoadRomInfoMenu) MakeRenderer(maxWidth int, maxHeight int, buttonManager *ButtonManager, textureManager *TextureManager, font *ttf.Font, smallFont *ttf.Font, clock uint64) gfx.RenderFunction
func (*LoadRomInfoMenu) PlayBeep ¶
func (loader *LoadRomInfoMenu) PlayBeep()
func (*LoadRomInfoMenu) RawInput ¶
func (loader *LoadRomInfoMenu) RawInput(event sdl.Event)
func (*LoadRomInfoMenu) UpdateWindowSize ¶
func (loader *LoadRomInfoMenu) UpdateWindowSize(x int, y int)
type LoadRomMenu ¶
type LoadRomMenu struct { Quit context.Context LoaderCancel context.CancelFunc MenuCancel context.CancelFunc Back MenuQuitFunc SelectRom func() LoaderState *RomLoaderState Beep *mix.Music }
func (*LoadRomMenu) Input ¶
func (loadRomMenu *LoadRomMenu) Input(input MenuInput) SubMenu
func (*LoadRomMenu) MakeRenderer ¶
func (loadRomMenu *LoadRomMenu) MakeRenderer(maxWidth int, maxHeight int, buttonManager *ButtonManager, textureManager *TextureManager, font *ttf.Font, smallFont *ttf.Font, clock uint64) gfx.RenderFunction
func (*LoadRomMenu) PlayBeep ¶
func (loadRomMenu *LoadRomMenu) PlayBeep()
func (*LoadRomMenu) RawInput ¶
func (loadRomMenu *LoadRomMenu) RawInput(event sdl.Event)
func (*LoadRomMenu) UpdateWindowSize ¶
func (loadRomMenu *LoadRomMenu) UpdateWindowSize(x int, y int)
type Menu ¶
type Menu struct { Input chan MenuInput Lock sync.Mutex Beep *mix.Music // contains filtered or unexported fields }
func (*Menu) Run ¶
func (menu *Menu) Run(window *sdl.Window, mainCancel context.CancelFunc, font *ttf.Font, smallFont *ttf.Font, programActions chan<- common.ProgramActions, renderNow chan bool, renderManager *gfx.RenderManager, joystickManager *common.JoystickManager, emulatorKeys *common.EmulatorKeys)
func (*Menu) ToggleActive ¶
func (menu *Menu) ToggleActive()
type MenuAction ¶
type MenuAction int
type MenuButtons ¶
func MakeMenuButtons ¶
func MakeMenuButtons() MenuButtons
func (*MenuButtons) Add ¶
func (buttons *MenuButtons) Add(item MenuItem)
func (*MenuButtons) Interact ¶
func (buttons *MenuButtons) Interact(input MenuInput, menu SubMenu) SubMenu
func (*MenuButtons) Next ¶
func (buttons *MenuButtons) Next()
func (*MenuButtons) Previous ¶
func (buttons *MenuButtons) Previous()
func (*MenuButtons) Render ¶
func (buttons *MenuButtons) Render(startX int, startY int, maxWidth int, maxHeight int, buttonManager *ButtonManager, textureManager *TextureManager, font *ttf.Font, renderer *sdl.Renderer, clock uint64) (int, int, error)
func (*MenuButtons) Select ¶
func (buttons *MenuButtons) Select(item MenuItem)
type MenuNextLine ¶
type MenuNextLine struct { }
func (*MenuNextLine) Render ¶
func (line *MenuNextLine) Render(font *ttf.Font, renderer *sdl.Renderer, buttonManager *ButtonManager, textureManager *TextureManager, x int, y int, selected bool, clock uint64) (int, int, error)
func (*MenuNextLine) Text ¶
func (line *MenuNextLine) Text() string
type MenuQuitFunc ¶
callback that is invoked when MenuQuit is input
type MenuRenderLayer ¶
func (*MenuRenderLayer) Render ¶
func (layer *MenuRenderLayer) Render(info gfx.RenderInfo) error
func (*MenuRenderLayer) ZIndex ¶
func (layer *MenuRenderLayer) ZIndex() int
type NullInput ¶
type NullInput struct { }
func (*NullInput) Get ¶
func (buttons *NullInput) Get() nes.ButtonMapping
type PossibleRom ¶
type RomIdAndPath ¶
func (*RomIdAndPath) Contains ¶
func (info *RomIdAndPath) Contains(filter string) bool
func (*RomIdAndPath) Less ¶
func (info *RomIdAndPath) Less(other *RomIdAndPath) bool
func (*RomIdAndPath) SortKey ¶
func (info *RomIdAndPath) SortKey() string
type RomLoaderAdd ¶
type RomLoaderFrame ¶
type RomLoaderFrame struct { Id RomId Frame nes.VirtualScreen }
type RomLoaderInfo ¶
type RomLoaderInfo struct { Path string Frames []nes.VirtualScreen ShowFrame int }
func (*RomLoaderInfo) GetFrame ¶
func (info *RomLoaderInfo) GetFrame() (nes.VirtualScreen, bool)
func (*RomLoaderInfo) NextFrame ¶
func (info *RomLoaderInfo) NextFrame()
type RomLoaderState ¶
type RomLoaderState struct { Roms map[RomId]*RomLoaderInfo NewRom chan RomLoaderAdd AddFrame chan RomLoaderFrame Lock sync.Mutex Arrow imagelib.Image ArrowId TextureId /* Keep track of which tile to start with when rendering the rows * in the loading screen, and the last tile to render. * min <= indexof(selectedrom) <= max * * These values will change as new roms get added, and as * the user moves around the tiles using up/down/left/right */ MinRenderIndex int WindowSizeWidth int WindowSizeHeight int RomIdsAndPaths filterlist.List[*RomIdAndPath] SelectedRomKey string Layout TileLayout }
func MakeRomLoaderState ¶
func (*RomLoaderState) AddNewRom ¶
func (loader *RomLoaderState) AddNewRom(rom RomLoaderAdd)
func (*RomLoaderState) AddRomFrame ¶
func (loader *RomLoaderState) AddRomFrame(frame RomLoaderFrame)
func (*RomLoaderState) AdvanceFrames ¶
func (loader *RomLoaderState) AdvanceFrames()
func (*RomLoaderState) FindRomIdByPath ¶
func (loader *RomLoaderState) FindRomIdByPath(path string) RomId
func (*RomLoaderState) FindSortedIdIndex ¶
func (loader *RomLoaderState) FindSortedIdIndex(roms []*RomIdAndPath, path string) int
func (*RomLoaderState) GetFilteredRoms ¶
func (loader *RomLoaderState) GetFilteredRoms() []*RomIdAndPath
func (*RomLoaderState) GetSelectedRom ¶
func (loader *RomLoaderState) GetSelectedRom() (string, bool)
func (*RomLoaderState) GetSelectedRomInfo ¶
func (loader *RomLoaderState) GetSelectedRomInfo() (*RomLoaderInfo, bool)
func (*RomLoaderState) MaximumTiles ¶
func (loader *RomLoaderState) MaximumTiles() int
Must hold the lock before calling this
func (*RomLoaderState) NextDownSelection ¶
func (loader *RomLoaderState) NextDownSelection()
func (*RomLoaderState) NextSelection ¶
func (loader *RomLoaderState) NextSelection()
func (*RomLoaderState) PreviousSelection ¶
func (loader *RomLoaderState) PreviousSelection()
func (*RomLoaderState) PreviousUpSelection ¶
func (loader *RomLoaderState) PreviousUpSelection()
func (*RomLoaderState) SearchAdd ¶
func (loader *RomLoaderState) SearchAdd(letter string)
func (*RomLoaderState) SearchBackspace ¶
func (loader *RomLoaderState) SearchBackspace()
func (*RomLoaderState) TileLayout ¶
func (loader *RomLoaderState) TileLayout() *TileLayout
func (*RomLoaderState) TileRows ¶
func (loader *RomLoaderState) TileRows(maxHeight int) int
func (*RomLoaderState) TilesPerRow ¶
func (loader *RomLoaderState) TilesPerRow(maxWidth int) int
func (*RomLoaderState) UpdateWindowSize ¶
func (loader *RomLoaderState) UpdateWindowSize(width int, height int)
func (*RomLoaderState) ZoomIn ¶
func (loader *RomLoaderState) ZoomIn()
func (*RomLoaderState) ZoomOut ¶
func (loader *RomLoaderState) ZoomOut()
type SortRomIds ¶
type SortRomIds []RomIdAndPath
func (SortRomIds) Len ¶
func (data SortRomIds) Len() int
func (SortRomIds) Less ¶
func (data SortRomIds) Less(left, right int) bool
func (SortRomIds) Swap ¶
func (data SortRomIds) Swap(left, right int)
type StaticButton ¶
type StaticButton struct { Name string Func StaticButtonFunc Lock sync.Mutex }
A button that does not change state
func (*StaticButton) Interact ¶
func (button *StaticButton) Interact(menu SubMenu) SubMenu
func (*StaticButton) Render ¶
func (button *StaticButton) Render(font *ttf.Font, renderer *sdl.Renderer, buttonManager *ButtonManager, textureManager *TextureManager, x int, y int, selected bool, clock uint64) (int, int, error)
func (*StaticButton) Text ¶
func (button *StaticButton) Text() string
func (*StaticButton) Update ¶
func (button *StaticButton) Update(text string)
type StaticButtonFunc ¶
type StaticButtonFunc func(button *StaticButton)
type StaticFixedButtonFunc ¶
type StaticFixedButtonFunc func(*StaticFixedWidthButton)
type StaticFixedWidthButton ¶
type StaticFixedWidthButton struct { Width int Parts []string Func StaticFixedButtonFunc Lock sync.Mutex }
A button that renders its components in a fixed width
func (*StaticFixedWidthButton) Interact ¶
func (button *StaticFixedWidthButton) Interact(menu SubMenu) SubMenu
func (*StaticFixedWidthButton) Render ¶
func (button *StaticFixedWidthButton) Render(font *ttf.Font, renderer *sdl.Renderer, buttonManager *ButtonManager, textureManager *TextureManager, x int, y int, selected bool, clock uint64) (int, int, error)
func (*StaticFixedWidthButton) Text ¶
func (button *StaticFixedWidthButton) Text() string
func (*StaticFixedWidthButton) Update ¶
func (button *StaticFixedWidthButton) Update(parts ...string)
type StaticMenu ¶
type StaticMenu struct { Buttons MenuButtons Quit MenuQuitFunc ExtraInfo string Beep *mix.Music }
func (*StaticMenu) Input ¶
func (menu *StaticMenu) Input(input MenuInput) SubMenu
func (*StaticMenu) MakeRenderer ¶
func (menu *StaticMenu) MakeRenderer(maxWidth int, maxHeight int, buttonManager *ButtonManager, textureManager *TextureManager, font *ttf.Font, smallFont *ttf.Font, clock uint64) gfx.RenderFunction
func (*StaticMenu) PlayBeep ¶
func (menu *StaticMenu) PlayBeep()
func (*StaticMenu) RawInput ¶
func (menu *StaticMenu) RawInput(event sdl.Event)
func (*StaticMenu) UpdateWindowSize ¶
func (menu *StaticMenu) UpdateWindowSize(x int, y int)
type SubMenu ¶
type SubMenu interface { /* Returns the new menu based on what button was pressed */ Input(input MenuInput) SubMenu MakeRenderer(maxWidth int, maxHeight int, buttonManager *ButtonManager, textureManager *TextureManager, font *ttf.Font, smallFont *ttf.Font, clock uint64) gfx.RenderFunction UpdateWindowSize(int, int) RawInput(sdl.Event) PlayBeep() }
func MakeJoystickMenu ¶
func MakeJoystickMenu(parent SubMenu, joystickStateChanges <-chan JoystickState, joystickManager *common.JoystickManager) SubMenu
func MakeKeysMenu ¶
func MakeKeysMenu(menu *Menu, parentMenu SubMenu, update func(common.EmulatorKeys), keys *common.EmulatorKeys) SubMenu
func MakeMainMenu ¶
func MakeMainMenu(menu *Menu, mainCancel context.CancelFunc, programActions chan<- common.ProgramActions, joystickStateChanges <-chan JoystickState, joystickManager *common.JoystickManager, textureManager *TextureManager, keys *common.EmulatorKeys) SubMenu
type SubMenuButton ¶
type SubMenuButton struct { Name string Func SubMenuFunc }
func (*SubMenuButton) Interact ¶
func (button *SubMenuButton) Interact(menu SubMenu) SubMenu
func (*SubMenuButton) Render ¶
func (button *SubMenuButton) Render(font *ttf.Font, renderer *sdl.Renderer, buttonManager *ButtonManager, textureManager *TextureManager, x int, y int, selected bool, clock uint64) (int, int, error)
func (*SubMenuButton) Text ¶
func (button *SubMenuButton) Text() string
type SubMenuFunc ¶
type SubMenuFunc func() SubMenu
type TextureInfo ¶
We could juse use sdl.Texture.Query() to get the width/height. The downsides * of doing that are that it involves an extra cgo call.
type TextureMaker ¶
type TextureMaker func() (TextureInfo, error)
type TextureManager ¶
type TextureManager struct { Textures map[TextureId]TextureInfo Lock sync.Mutex // contains filtered or unexported fields }
func MakeTextureManager ¶
func MakeTextureManager() *TextureManager
func (*TextureManager) Destroy ¶
func (manager *TextureManager) Destroy()
func (*TextureManager) GetCachedTexture ¶
func (manager *TextureManager) GetCachedTexture(id TextureId, makeTexture TextureMaker) (TextureInfo, error)
func (*TextureManager) NextId ¶
func (manager *TextureManager) NextId() TextureId
func (*TextureManager) RenderText ¶
type TileLayout ¶
type ToggleButton ¶
type ToggleButton struct { State1 string State2 string Func ToggleButtonFunc // contains filtered or unexported fields }
func (*ToggleButton) Interact ¶
func (toggle *ToggleButton) Interact(menu SubMenu) SubMenu
func (*ToggleButton) Render ¶
func (button *ToggleButton) Render(font *ttf.Font, renderer *sdl.Renderer, buttonManager *ButtonManager, textureManager *TextureManager, x int, y int, selected bool, clock uint64) (int, int, error)
func (*ToggleButton) Text ¶
func (toggle *ToggleButton) Text() string
type ToggleButtonFunc ¶
type ToggleButtonFunc func(bool)