pages

package
v0.0.0-...-46214c3 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadImage

func LoadImage(filename string) image.Image

Types

type BasePage

type BasePage struct {
	DirtyChan *chan bool
	// contains filtered or unexported fields
}

func NewBasePage

func NewBasePage() (page BasePage)

func (*BasePage) AddButton

func (page *BasePage) AddButton(img image.Image, x, y int, action func()) *elems.Button

func (*BasePage) AddMenuButton

func (page *BasePage) AddMenuButton(img image.Image, x, y int, newPage string) *elems.Button

func (BasePage) BaseDraw

func (page BasePage) BaseDraw(target *draw.Image)

func (BasePage) BaseProcess

func (page BasePage) BaseProcess() bool

func (BasePage) Buttons

func (page BasePage) Buttons() []*elems.Button

func (BasePage) Draw

func (page BasePage) Draw(target *draw.Image)

func (BasePage) Process

func (page BasePage) Process() bool

func (*BasePage) SetBackground

func (page *BasePage) SetBackground(img image.Image)

func (*BasePage) SetDirtyChan

func (page *BasePage) SetDirtyChan(dirtyChan *chan bool)

type ClearPage

type ClearPage struct {
	BasePage
}

func (*ClearPage) Process

func (p *ClearPage) Process() bool

type GasPage

type GasPage struct {
	BasePage

	Counter int32
	// contains filtered or unexported fields
}

func (*GasPage) Draw

func (p *GasPage) Draw(target *draw.Image)

func (GasPage) DrawDigit

func (p GasPage) DrawDigit(target draw.Image, src image.Image, digit uint8, pos image.Point)

func (*GasPage) Process

func (p *GasPage) Process() bool

type MainPage

type MainPage struct {
	BasePage
	ButtonGas *elems.Button
	ButtonElc *elems.Button
	ButtonWat *elems.Button
	ButtonSys *elems.Button
}

type Page

type Page interface {
	Draw(*draw.Image)
	Process() bool
	Buttons() []*elems.Button
	SetDirtyChan(*chan bool)
}

func NewClearPage

func NewClearPage() Page

func NewGasPage

func NewGasPage() Page

func NewMainPage

func NewMainPage() Page

Jump to

Keyboard shortcuts

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