menu

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: GPL-3.0 Imports: 33 Imported by: 2

Documentation

Overview

Package menu is the graphical interface allowing to browse games, launch games, configure settings, and display a contextual menu to interract with the running game.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Menu struct {
	*video.Video // we embbed video here to have direct access to drawing functions
	// contains filtered or unexported fields
}

Menu is a type holding the menu state, the stack of scenes, tweens, etc

func Init

func Init(v *video.Video) *Menu

Init initializes the menu. If a game is already running, it will warp the user to the quick menu. If not, it will display the menu tabs.

func (m *Menu) ContextReset()

ContextReset uploads the UI images to the GPU. It should be called after each time the window is recreated.

func (m *Menu) ProcessHotkeys()

ProcessHotkeys checks if certain keys are pressed and perform corresponding actions

func (m *Menu) Push(s Scene)

Push will navigate to a new scene. It usually happen when the user presses OK on a menu entry.

func (m *Menu) Render(dt float32)

Render takes care of rendering the menu

func (m *Menu) RenderNotifications()

RenderNotifications draws the list of notification messages on the viewport

func (m *Menu) Update(dt float32)

Update takes care of calling the update method of the current scene. Each scene has it's own input logic to allow a variety of navigation systems.

func (m *Menu) UpdatePalette()

UpdatePalette updates the color palette to honor the dark theme

func (m *Menu) WarpToQuickMenu()

WarpToQuickMenu loads the contextual menu for games that are launched from the command line interface or from 'Load Game'.

type Prettifier added in v0.14.12

type Prettifier func(string) string

Prettifier processes a file name

type Scene

type Scene interface {
	Entry() *entry
	// contains filtered or unexported methods
}

Scene represents a page of the UI A scene is typically an entry displaying its own children A segue is a smooth transition between two scenes.

type Tweens added in v0.6.2

type Tweens map[*float32]*gween.Tween

Tweens are the current animations of the menu components

func (Tweens) FastForward added in v0.6.2

func (ts Tweens) FastForward()

FastForward finishes all the current animations in the queue.

func (Tweens) Update added in v0.6.2

func (ts Tweens) Update(dt float32)

Update loops over the animation queue and updade them so we can see progress

Jump to

Keyboard shortcuts

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