ui

package
v0.0.0-...-bdb03cc Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PlayImg, _    = gfx.NewImage("images/play.png")
	PauseImg, _   = gfx.NewImage("images/pause.png")
	StopImg, _    = gfx.NewImage("images/stop.png")
	ForwardImg, _ = gfx.NewImage("images/forward.png")
	RewindImg, _  = gfx.NewImage("images/rewind.png")
	NextImg, _    = gfx.NewImage("images/next.png")
	BackImg, _    = gfx.NewImage("images/back.png")

	Black = gfx.NewColor(0, 0, 0, 255)
	Clear = gfx.NewColor(0, 0, 0, 0)
)

Functions

This section is empty.

Types

type Button

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

Button is a clickable rectangle

func NewButton

func NewButton(x, y, w, h float32, image *gfx.Image, color *gfx.Color, onClick func(*Button)) *Button

NewButton builds and returns a new button

func (*Button) Draw

func (button *Button) Draw()

Draw draws the button

func (*Button) SetImage

func (button *Button) SetImage(image *gfx.Image)

SetImage sets the image for the button

func (*Button) Update

func (button *Button) Update(dt float32)

Update checks for clicks

type Element

type Element interface {
	Update(float32)
	Draw()
}

Element is the general interface for all elements to be used

Jump to

Keyboard shortcuts

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