ebitenui

package module
v0.0.0-...-4426e49 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ImgUncheckedBox *ebiten.Image
	ImgCheckedBox   *ebiten.Image
)
View Source
var (
	MplusNormalFont font.Face
	MplusBigFont    font.Face
)

Functions

func AttachH

func AttachH(imgs ...*ebiten.Image) *ebiten.Image

AttachH attaches input images horizontally. AttachH supposes all input images have proper height.

func AttachV

func AttachV(imgs ...*ebiten.Image) *ebiten.Image

AttachV attaches input images vertically. AttachV supposes all input images have proper width.

func LoadFontFromFile

func LoadFontFromFile(path string, op *truetype.Options) font.Face

func RenderBox

func RenderBox(size image.Point, clr color.Color) *ebiten.Image

func RenderText

func RenderText(s string, font font.Face, clr color.Color) *ebiten.Image

todo: it fails to render string when it is multiple-lines todo: numbers and normal words are not coherently rendered

func RenderTextBox

func RenderTextBox(t *ebiten.Image, clr color.Color) *ebiten.Image

Types

type Button

type Button struct {
	MinPt image.Point
	Image *ebiten.Image
	// contains filtered or unexported fields
}

func (*Button) Draw

func (b *Button) Draw(screen *ebiten.Image)

func (*Button) SetOnPressed

func (b *Button) SetOnPressed(f func(b *Button))

func (*Button) Update

func (b *Button) Update()

type Checkbox

type Checkbox struct {
	MinPt image.Point
	Text  *ebiten.Image
	// contains filtered or unexported fields
}

Checkbox is a struct for implementing a checkbox. Checkbox consists of padded checkbox image and text image. The font of Text is fixed, including text size.

func NewCheckbox

func NewCheckbox(s string, p image.Point) *Checkbox

func (*Checkbox) Checked

func (c *Checkbox) Checked() bool

func (*Checkbox) Draw

func (c *Checkbox) Draw(screen *ebiten.Image)

func (*Checkbox) SetOnChanged

func (c *Checkbox) SetOnChanged(f func(c *Checkbox))

func (*Checkbox) Update

func (c *Checkbox) Update()

todo: could it be abstracted as button?

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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