ui

package
v0.0.0-...-251eadb Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package ui provides some simple user interface objects

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button struct {
	Clicked *rx.Bool
	// contains filtered or unexported fields
}

A Button is a grahical item that can be clicked

func NewButton

func NewButton(r *sdl.Rect, sheet *gfx2.Sheet, textureID int) *Button

NewButton creates a new button

func (*Button) Render

func (b *Button) Render(r *sdl.Renderer)

Render draws the button on the screen

func (*Button) Run

func (b *Button) Run(ctx context.Context, m *gamekit.Mouse)

Run the event processes

type ToggleButton

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

A ToggleButton is a named button that is part of a toggle group

func NewToggleButton

func NewToggleButton(name string, r *sdl.Rect, checkboxOffset *sdl.Rect, sheet *gfx2.Sheet, textureID int, checkboxID int) *ToggleButton

NewToggleButton creates a new toggle button

func (*ToggleButton) Render

func (tb *ToggleButton) Render(r *sdl.Renderer)

Render draws the toggle button to the renderer

func (*ToggleButton) Run

func (tb *ToggleButton) Run(ctx context.Context, m *gamekit.Mouse, selected *rx.String)

Run runs the toggle button event processes

type ToggleGroup

type ToggleGroup struct {
	Selected *rx.String
	// contains filtered or unexported fields
}

ToggleGroup is a group of buttons, only one of which may be selected

func NewToggleGroup

func NewToggleGroup(defaultSelected string) *ToggleGroup

NewToggleGroup create a new toggle group, marking the the given one as the default selected

func (*ToggleGroup) Add

func (tg *ToggleGroup) Add(tb *ToggleButton)

Add a new toggle button, must be done before Run is called

func (*ToggleGroup) Render

func (tg *ToggleGroup) Render(r *sdl.Renderer)

Render the toggle group buttons

func (*ToggleGroup) Run

func (tg *ToggleGroup) Run(ctx context.Context, m *gamekit.Mouse)

Run the backend event processes

Jump to

Keyboard shortcuts

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