ui

package
v0.0.0-...-4427e8c Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2017 License: MIT Imports: 22 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGenericThumbnail

func CreateGenericThumbnail(text string) image.Image

func DrawCenteredText

func DrawCenteredText(dst draw.Image, text string, dx, dy int, c color.Color)

func DrawCharacter

func DrawCharacter(dst draw.Image, x, y int, ch byte, c color.Color)

func DrawText

func DrawText(dst draw.Image, x, y int, text string, c color.Color)

func Run

func Run(paths []string)

func WordWrap

func WordWrap(text string, maxLength int) []string

Types

type Audio

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

func NewAudio

func NewAudio() *Audio

func (*Audio) Callback

func (a *Audio) Callback(out []float32)

func (*Audio) Start

func (a *Audio) Start() error

func (*Audio) Stop

func (a *Audio) Stop() error

type BasicControllerAdapter

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

func (*BasicControllerAdapter) Buttons

func (bca *BasicControllerAdapter) Buttons() [8]bool

func (*BasicControllerAdapter) SetWindow

func (bca *BasicControllerAdapter) SetWindow(window *glfw.Window)

func (*BasicControllerAdapter) Trigger

func (bca *BasicControllerAdapter) Trigger(button int, newState bool)

type ControllerAdapter

type ControllerAdapter interface {
	Buttons() [8]bool

	SetWindow(*glfw.Window)

	Trigger(int, bool)
}

type Director

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

func NewDirector

func NewDirector(window *glfw.Window, audio *Audio, ca1, ca2 ControllerAdapter) *Director

func (*Director) Console

func (d *Director) Console() *nes.Console

func (*Director) PlayGame

func (d *Director) PlayGame(path string)

func (*Director) Run

func (d *Director) Run()

func (*Director) SetTitle

func (d *Director) SetTitle(title string)

func (*Director) SetView

func (d *Director) SetView(view View)

func (*Director) ShowMenu

func (d *Director) ShowMenu()

func (*Director) Start

func (d *Director) Start(paths []string)

func (*Director) Step

func (d *Director) Step()

func (*Director) Window

func (d *Director) Window() *glfw.Window

type DummyControllerAdapter

type DummyControllerAdapter struct{}

func NewDummyControllerAdapter

func NewDummyControllerAdapter() *DummyControllerAdapter

func (*DummyControllerAdapter) Buttons

func (*DummyControllerAdapter) Buttons() [8]bool

func (*DummyControllerAdapter) SetWindow

func (*DummyControllerAdapter) SetWindow(_ *glfw.Window)

func (*DummyControllerAdapter) Trigger

func (*DummyControllerAdapter) Trigger(_ int, _ bool)

type GameView

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

func (*GameView) Console

func (view *GameView) Console() *nes.Console

func (*GameView) Enter

func (view *GameView) Enter()

func (*GameView) Exit

func (view *GameView) Exit()

func (*GameView) Update

func (view *GameView) Update(t, dt float64)

type KeyboardControllerAdapter

type KeyboardControllerAdapter struct {
	*BasicControllerAdapter
}

func NewKeyboardControllerAdapter

func NewKeyboardControllerAdapter() *KeyboardControllerAdapter

func NewKeyboardControllerAdapterWithWindow

func NewKeyboardControllerAdapterWithWindow(window *glfw.Window) *KeyboardControllerAdapter

func (*KeyboardControllerAdapter) Buttons

func (kba *KeyboardControllerAdapter) Buttons() [8]bool

func (*KeyboardControllerAdapter) SetWindow

func (kba *KeyboardControllerAdapter) SetWindow(window *glfw.Window)

func (*KeyboardControllerAdapter) Trigger

func (kba *KeyboardControllerAdapter) Trigger(button int, newState bool)
type MenuView struct {
	// contains filtered or unexported fields
}
func (view *MenuView) Console() *nes.Console
func (view *MenuView) Enter()
func (view *MenuView) Exit()
func (view *MenuView) Update(t, dt float64)

type Texture

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

func NewTexture

func NewTexture() *Texture

func (*Texture) Bind

func (t *Texture) Bind()

func (*Texture) Lookup

func (t *Texture) Lookup(path string) (x, y, dx, dy float32)

func (*Texture) Purge

func (t *Texture) Purge()

func (*Texture) Unbind

func (t *Texture) Unbind()

type View

type View interface {
	Enter()
	Exit()
	Update(t, dt float64)

	Console() *nes.Console
}

func NewGameView

func NewGameView(director *Director, console *nes.Console, title, hash string) View

func NewMenuView

func NewMenuView(director *Director, paths []string) View

Jump to

Keyboard shortcuts

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