Package etk
Package etk provides an Ebitengine tool kit for creating graphical user interfaces.
Variables
var Style = &Attributes{
TextColor: color.RGBA{0, 0, 0, 255},
BorderColor: color.RGBA{0, 0, 0, 255},
ButtonBgColor: color.RGBA{255, 255, 255, 255},
ButtonBgColorDisabled: color.RGBA{110, 110, 110, 255},
}
func Draw(screen *ebiten.Image) error
func Layout(outsideWidth, outsideHeight int)
func SetRoot(w Widget)
func Update() error
type Attributes struct {
TextColor color.Color
BorderColor color.Color
ButtonTextColor color.Color
ButtonBgColor color.Color
ButtonBgColorDisabled color.Color
}
type Box struct {
sync.Mutex
}
func NewBox() *Box
func (b *Box) AddChild(w ...Widget)
func (b *Box) Children() []Widget
func (*Box) Rect
¶
func (b *Box) Rect() image.Rectangle
func (b *Box) SetRect(r image.Rectangle)
type Button struct {
*Box
}
func NewButton(label string, onSelected func()) *Button
func (b *Button) Draw(screen *ebiten.Image) error
func (b *Button) HandleKeyboard() (handled bool, err error)
func (b *Button) HandleMouse() (handled bool, err error)
func (b *Button) SetRect(r image.Rectangle)
type Flex struct {
*Box
}
func NewFlex() *Flex
func (*Flex) Draw
¶
func (f *Flex) Draw(screen *ebiten.Image) error
func (f *Flex) HandleKeyboard() (handled bool, err error)
func (f *Flex) HandleMouse() (handled bool, err error)
func (f *Flex) SetRect(r image.Rectangle)
func (f *Flex) SetVertical(v bool)
type Widget interface {
Rect() image.Rectangle
SetRect(r image.Rectangle)
HandleMouse() (handled bool, err error)
HandleKeyboard() (handled bool, err error)
Draw(screen *ebiten.Image) error
Children() []Widget
}
Subdirectories