ui

package
v0.0.0-...-ed10b4e Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button struct {
	Region image.Rectangle
	Text   string

	OnClick func(b *Button)
	// contains filtered or unexported fields
}

func (*Button) Draw

func (b *Button) Draw(screen *ebiten.Image, region image.Rectangle)

func (*Button) HandleInput

func (b *Button) HandleInput(region image.Rectangle) Widget

func (*Button) Update

func (b *Button) Update(focused Widget) error

type HSplitter

type HSplitter struct {
	Children []Widget
	Widths   []int
}

func (*HSplitter) Draw

func (h *HSplitter) Draw(screen *ebiten.Image, region image.Rectangle)

func (*HSplitter) HandleInput

func (h *HSplitter) HandleInput(region image.Rectangle) Widget

func (*HSplitter) Update

func (h *HSplitter) Update(focused Widget) error

type HorizontalAlign

type HorizontalAlign int
const (
	Left HorizontalAlign = iota
	Center
	Right
)

type Label

type Label struct {
	Region          image.Rectangle
	Text            string
	HorizontalAlign HorizontalAlign
	VerticalAlign   VerticalAlign
}

func (*Label) Draw

func (l *Label) Draw(screen *ebiten.Image, region image.Rectangle)

func (*Label) HandleInput

func (l *Label) HandleInput(region image.Rectangle) Widget

func (*Label) Update

func (l *Label) Update(focused Widget) error

type Panel

type Panel struct {
	Children        []Widget
	BackgroundColor color.Color
}

func (*Panel) Draw

func (p *Panel) Draw(screen *ebiten.Image, region image.Rectangle)

func (*Panel) HandleInput

func (p *Panel) HandleInput(region image.Rectangle) Widget

func (*Panel) Update

func (p *Panel) Update(focused Widget) error

type TextBox

type TextBox struct {
	Region image.Rectangle
	Value  string
	// contains filtered or unexported fields
}

func (*TextBox) Draw

func (t *TextBox) Draw(screen *ebiten.Image, region image.Rectangle)

func (*TextBox) HandleInput

func (t *TextBox) HandleInput(region image.Rectangle) Widget

func (*TextBox) Update

func (t *TextBox) Update(focused Widget) error

type UI

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

func New

func New(panel *Panel) *UI

func (*UI) Main

func (u *UI) Main() error

func (*UI) SetTitle

func (u *UI) SetTitle(title string)

func (*UI) SetWindowSize

func (u *UI) SetWindowSize(width, height int)

type VSplitter

type VSplitter struct {
	Children []Widget
	Heights  []int
}

func (*VSplitter) Draw

func (v *VSplitter) Draw(screen *ebiten.Image, region image.Rectangle)

func (*VSplitter) HandleInput

func (v *VSplitter) HandleInput(region image.Rectangle) Widget

func (*VSplitter) Update

func (v *VSplitter) Update(focused Widget) error

type VerticalAlign

type VerticalAlign int
const (
	Middle VerticalAlign = iota
	Top
	Bottom
)

type Widget

type Widget interface {
	HandleInput(region image.Rectangle) Widget
	Update(focused Widget) error
	Draw(screen *ebiten.Image, region image.Rectangle)
}

Jump to

Keyboard shortcuts

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