menu

package
v0.0.0-...-f6f1029 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MenuToggle = iota
	MenuNext
	MenuPrevious
	MenuUp
	MenuDown
	MenuSelect
	MenuQuit // usually when ESC is input
)
View Source
const (
	MenuActionQuit = iota
	MenuActionLoadRom
	MenuActionSound
	MenuActionJoystick
)
View Source
const (
	MenuStateTop = iota
	MenuStateLoadRom
)
View Source
const (
	LoadRomInfoSelect = iota
	LoadRomInfoBack
)
View Source
const JoystickMaxPartialCounter = 20

Variables

View Source
var TextureManagerDestroyed = fmt.Errorf("texture manager has been destroyed")

Functions

This section is empty.

Types

type Button

type Button interface {
	MenuItem
	/* invoked when the user presses enter while selecting this button */
	Interact(SubMenu) SubMenu
}

type ButtonManager

type ButtonManager struct {
	Ids  map[uint64]map[uint32]TextureId
	Lock sync.Mutex
}

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

type ChooseButton struct {
	Enabled bool
	Lock    sync.Mutex
	Items   []string
	Choice  int
}

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

type JoystickAxisType struct {
	Axis    int
	Value   int
	Name    string
	Pressed bool
}

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

type JoystickButtonType struct {
	Button  int
	Name    string
	Pressed bool
}

func (*JoystickButtonType) IsPressed

func (button *JoystickButtonType) IsPressed() bool

func (*JoystickButtonType) ToString

func (button *JoystickButtonType) ToString() string

type JoystickInputType

type JoystickInputType interface {
	IsPressed() bool
	ToString() string
}

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 struct {
	Input chan MenuInput
	Lock  sync.Mutex
	Beep  *mix.Music
	// contains filtered or unexported fields
}

func MakeMenu

func MakeMenu(mainQuit context.Context, font *ttf.Font) Menu
func (menu *Menu) Close()
func (menu *Menu) IsActive() bool
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 *Menu) ToggleActive()
type MenuAction int
type MenuButtons struct {
	Items    []MenuItem
	Selected int
	Lock     sync.Mutex
}

func MakeMenuButtons

func MakeMenuButtons() 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, buttonManager *ButtonManager, textureManager *TextureManager, font *ttf.Font, renderer *sdl.Renderer, clock uint64) (int, int, error)
func (buttons *MenuButtons) Select(item MenuItem)
type MenuInput int
type MenuItem interface {
	Text() string
	/* returns next x,y coordinate where rendering can occur, and a possible error */
	Render(*ttf.Font, *sdl.Renderer, *ButtonManager, *TextureManager, int, int, bool, uint64) (int, int, error)
}
type MenuLabel struct {
	Label string
	Color sdl.Color
}
func (label *MenuLabel) Render(font *ttf.Font, renderer *sdl.Renderer, buttonManager *ButtonManager, textureManager *TextureManager, x int, y int, selected bool, clock uint64) (int, int, error)
func (label *MenuLabel) Text() string
type MenuNextLine struct {
}
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 (line *MenuNextLine) Text() string
type MenuQuitFunc func(SubMenu) SubMenu

callback that is invoked when MenuQuit is input

type MenuRenderLayer struct {
	Renderer func(renderer *sdl.Renderer) error
	Index    int
}
func (layer *MenuRenderLayer) Render(info gfx.RenderInfo) error
func (layer *MenuRenderLayer) ZIndex() int
type MenuSpace struct {
	Space int
}
func (space *MenuSpace) Render(font *ttf.Font, renderer *sdl.Renderer, buttonManager *ButtonManager, textureManager *TextureManager, x int, y int, selected bool, clock uint64) (int, int, error)
func (space *MenuSpace) Text() string
type MenuState int

type NullInput

type NullInput struct {
}

func (*NullInput) Get

func (buttons *NullInput) Get() nes.ButtonMapping

type PossibleRom

type PossibleRom struct {
	Path  string
	RomId RomId
}

type RomId

type RomId uint64

type RomIdAndPath

type RomIdAndPath struct {
	Id   RomId
	Path string
}

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 RomLoaderAdd struct {
	Id   RomId
	Path string
}

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 MakeRomLoaderState(quit context.Context, windowWidth int, windowHeight int, arrowId TextureId) *RomLoaderState

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) Render

func (loader *RomLoaderState) Render(maxWidth int, maxHeight int, font *ttf.Font, smallFont *ttf.Font, renderer *sdl.Renderer, textureManager *TextureManager) error

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 Snow

type Snow struct {
	// contains filtered or unexported fields
}

func MakeSnow

func MakeSnow(screenWidth int) Snow

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 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 struct {
	Name string
	Func SubMenuFunc
}
func (button *SubMenuButton) Interact(menu SubMenu) SubMenu
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 (button *SubMenuButton) Text() string
type SubMenuFunc func() SubMenu

type TextureId

type TextureId uint64

type TextureInfo

type TextureInfo struct {
	Texture *sdl.Texture
	Width   int
	Height  int
}

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

func (manager *TextureManager) RenderText(font *ttf.Font, renderer *sdl.Renderer, text string, color sdl.Color, id TextureId) (TextureInfo, error)

type TileLayout

type TileLayout struct {
	/* Where the first tile starts */
	XStart int
	YStart int
	/* How much to increase x/y by for each tile */
	XSpace int
	YSpace int
	/* amount to divide the nes screen by to make a thumbnail */
	Thumbnail float32
}

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL