menu

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioOption

type AudioOption struct {
	BaseLabel string
	GetLevel  func() float32 // in [0, 1] range
	SetLevel  func(ctx *context.Context, value float32) error
	OnClick   func(*context.Context)
	// contains filtered or unexported fields
}

func (*AudioOption) Confirm

func (self *AudioOption) Confirm(ctx *context.Context) (Key, *scene.Change, error)

func (*AudioOption) HoverUpdate

func (self *AudioOption) HoverUpdate(ctx *context.Context)

func (*AudioOption) MaxName

func (self *AudioOption) MaxName() string

func (*AudioOption) Name

func (self *AudioOption) Name() string

func (*AudioOption) SoftHighlight

func (self *AudioOption) SoftHighlight(ctx *context.Context) bool

type BasicOption

type BasicOption struct {
	Label string
	Func  func(*context.Context) Key
}

func (*BasicOption) Confirm

func (self *BasicOption) Confirm(ctx *context.Context) (Key, *scene.Change, error)

func (*BasicOption) HoverUpdate

func (self *BasicOption) HoverUpdate(ctx *context.Context)

func (*BasicOption) Name

func (self *BasicOption) Name() string

func (*BasicOption) SoftHighlight

func (self *BasicOption) SoftHighlight(ctx *context.Context) bool

type EffectOption

type EffectOption struct {
	Label     string
	OnConfirm func(*context.Context) error
}

func (*EffectOption) Confirm

func (self *EffectOption) Confirm(ctx *context.Context) (Key, *scene.Change, error)

func (*EffectOption) HoverUpdate

func (self *EffectOption) HoverUpdate(ctx *context.Context)

func (*EffectOption) Name

func (self *EffectOption) Name() string

func (*EffectOption) SoftHighlight

func (self *EffectOption) SoftHighlight(ctx *context.Context) bool

type EffectOptionWithHighlight

type EffectOptionWithHighlight struct {
	Label         string
	OnConfirm     func(*context.Context) error
	HighlightFunc func(*context.Context) bool
}

func (*EffectOptionWithHighlight) Confirm

func (self *EffectOptionWithHighlight) Confirm(ctx *context.Context) (Key, *scene.Change, error)

func (*EffectOptionWithHighlight) HoverUpdate

func (self *EffectOptionWithHighlight) HoverUpdate(ctx *context.Context)

func (*EffectOptionWithHighlight) Name

func (self *EffectOptionWithHighlight) Name() string

func (*EffectOptionWithHighlight) SoftHighlight

func (self *EffectOptionWithHighlight) SoftHighlight(ctx *context.Context) bool

type Key

type Key uint8
const (
	NoChange Key = iota
	NoConfirm
	Back
	Options
	OptsAudio
	OptsWindow
	OptsScaling
	FirstKey
)
type Menu struct {
	Title string
	// contains filtered or unexported fields
}
func (self *Menu) DrawLogical(canvas *ebiten.Image, ctx *context.Context)
func (self *Menu) JumpTo(key Key)
func (self *Menu) Key() Key
func (self *Menu) NewGameOptionsOptionList(ctx *context.Context)
func (self *Menu) NewOptionList(key Key) *OptionList
func (self *Menu) Update(ctx *context.Context) (*scene.Change, error)
type NavOption struct {
	Label string
	To    Key
}
func (self *NavOption) Confirm(ctx *context.Context) (Key, *scene.Change, error)
func (self *NavOption) HoverUpdate(ctx *context.Context)
func (self *NavOption) Name() string
func (self *NavOption) SoftHighlight(ctx *context.Context) bool

type Option

type Option interface {
	Name() string
	HoverUpdate(*context.Context) // for extra stuff on hover
	Confirm(*context.Context) (Key, *scene.Change, error)
	SoftHighlight(*context.Context) bool
}

type OptionList

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

func (*OptionList) Add

func (self *OptionList) Add(opt Option)

func (*OptionList) AddBackOption

func (self *OptionList) AddBackOption(opt Option)

func (*OptionList) Draw

func (self *OptionList) Draw(canvas *ebiten.Image, ctx *context.Context)

func (*OptionList) Update

func (self *OptionList) Update(ctx *context.Context) (Key, *scene.Change, error)

type OptionWithMaxName

type OptionWithMaxName interface {
	Option
	MaxName() string
}

type PercentOption

type PercentOption struct {
	BaseLabel     string
	NotifyPercent func(uint8)
	Percent       uint8
}

func (*PercentOption) Confirm

func (self *PercentOption) Confirm(ctx *context.Context) (Key, *scene.Change, error)

func (*PercentOption) HoverUpdate

func (self *PercentOption) HoverUpdate(ctx *context.Context)

func (*PercentOption) MaxName

func (self *PercentOption) MaxName() string

func (*PercentOption) Name

func (self *PercentOption) Name() string

func (*PercentOption) SoftHighlight

func (self *PercentOption) SoftHighlight(ctx *context.Context) bool

type SceneChangeEffectOption

type SceneChangeEffectOption struct {
	Label     string
	Change    scene.Change
	OnConfirm func(*context.Context) error
}

func (*SceneChangeEffectOption) Confirm

func (self *SceneChangeEffectOption) Confirm(ctx *context.Context) (Key, *scene.Change, error)

func (*SceneChangeEffectOption) HoverUpdate

func (self *SceneChangeEffectOption) HoverUpdate(ctx *context.Context)

func (*SceneChangeEffectOption) Name

func (self *SceneChangeEffectOption) Name() string

func (*SceneChangeEffectOption) SoftHighlight

func (self *SceneChangeEffectOption) SoftHighlight(ctx *context.Context) bool

type SceneChangeOption

type SceneChangeOption struct {
	Label  string
	Change scene.Change
}

func (*SceneChangeOption) Confirm

func (self *SceneChangeOption) Confirm(ctx *context.Context) (Key, *scene.Change, error)

func (*SceneChangeOption) HoverUpdate

func (self *SceneChangeOption) HoverUpdate(ctx *context.Context)

func (*SceneChangeOption) Name

func (self *SceneChangeOption) Name() string

func (*SceneChangeOption) SoftHighlight

func (self *SceneChangeOption) SoftHighlight(ctx *context.Context) bool

Jump to

Keyboard shortcuts

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