Documentation ¶
Index ¶
- Constants
- Variables
- func HSplitRect(r image.Rectangle, n int) []image.Rectangle
- func HSplitRectBySizeHints(r image.Rectangle, sty BoxLayoutStyles, sizeHints []SizeHint) []image.Rectangle
- func VSplitRect(r image.Rectangle, n int) []image.Rectangle
- func VSplitRectBySizeHints(r image.Rectangle, sty BoxLayoutStyles, sizeHints []SizeHint) []image.Rectangle
- type BoxLayoutStyles
- type Button
- type ButtonState
- type DrawContext
- type EventHandler
- func (h *EventHandler) OnKeyDown(cb KeyCallback)
- func (h *EventHandler) OnKeyUp(cb KeyCallback)
- func (h *EventHandler) OnMouseLeftClicked(cb MouseCallback)
- func (h *EventHandler) OnMouseMove(cb MouseCallback)
- func (h *EventHandler) OnMouseRightClicked(cb MouseCallback)
- func (h *EventHandler) Update()
- type Form
- type HBoxLayout
- type ImageButton
- type KeyCallback
- type KeyCallbacks
- type MouseCallback
- type MouseCallbacks
- type ResizeContext
- type SizeHint
- type TextBox
- type VBoxLayout
- type Widget
Constants ¶
View Source
const ( ButtonStateNormal = iota ButtonStateHover )
Variables ¶
View Source
var (
ButtonColorNormal = color.RGBA{160, 160, 160, 255}
)
Functions ¶
func HSplitRectBySizeHints ¶
func VSplitRectBySizeHints ¶
Types ¶
type BoxLayoutStyles ¶
type Button ¶
type Button struct {
// contains filtered or unexported fields
}
func NewButton ¶
func NewButton(text string, evts *EventHandler) *Button
func (*Button) ChangeText ¶
func (*Button) Draw ¶
func (c *Button) Draw(ctx *DrawContext)
func (*Button) Resize ¶
func (c *Button) Resize(ctx *ResizeContext)
type ButtonState ¶
type ButtonState byte
type DrawContext ¶
type EventHandler ¶
type EventHandler struct {
// contains filtered or unexported fields
}
func (*EventHandler) OnKeyDown ¶
func (h *EventHandler) OnKeyDown(cb KeyCallback)
func (*EventHandler) OnKeyUp ¶
func (h *EventHandler) OnKeyUp(cb KeyCallback)
func (*EventHandler) OnMouseLeftClicked ¶
func (h *EventHandler) OnMouseLeftClicked(cb MouseCallback)
func (*EventHandler) OnMouseMove ¶
func (h *EventHandler) OnMouseMove(cb MouseCallback)
func (*EventHandler) OnMouseRightClicked ¶
func (h *EventHandler) OnMouseRightClicked(cb MouseCallback)
func (*EventHandler) Update ¶
func (h *EventHandler) Update()
type HBoxLayout ¶
type HBoxLayout struct {
// contains filtered or unexported fields
}
func (*HBoxLayout) Draw ¶
func (c *HBoxLayout) Draw(ctx *DrawContext)
func (*HBoxLayout) Resize ¶
func (c *HBoxLayout) Resize(ctx *ResizeContext)
func (*HBoxLayout) SizeHint ¶
func (c *HBoxLayout) SizeHint() SizeHint
type ImageButton ¶
type ImageButton struct {
// contains filtered or unexported fields
}
func NewImageButton ¶
func NewImageButton(img *ebiten.Image, dx, dy int, evts *EventHandler) *ImageButton
func (*ImageButton) Draw ¶
func (c *ImageButton) Draw(ctx *DrawContext)
func (*ImageButton) OnClick ¶
func (b *ImageButton) OnClick(fn func())
func (*ImageButton) Resize ¶
func (c *ImageButton) Resize(ctx *ResizeContext)
func (*ImageButton) SizeHint ¶
func (c *ImageButton) SizeHint() SizeHint
type KeyCallbacks ¶
type KeyCallbacks []KeyCallback
Events
func (KeyCallbacks) Call ¶
func (cbs KeyCallbacks) Call(k ebiten.Key)
type MouseCallbacks ¶
type MouseCallbacks []MouseCallback
Events
func (MouseCallbacks) Call ¶
func (cbs MouseCallbacks) Call(p image.Point)
type ResizeContext ¶
type TextBox ¶
type TextBox struct {
// contains filtered or unexported fields
}
func NewTextBox ¶
func NewTextBox(evts *EventHandler) *TextBox
func (*TextBox) ChangeTextFunc ¶
func (*TextBox) Draw ¶
func (c *TextBox) Draw(ctx *DrawContext)
func (*TextBox) Resize ¶
func (c *TextBox) Resize(ctx *ResizeContext)
type VBoxLayout ¶
type VBoxLayout struct {
// contains filtered or unexported fields
}
func NewVBoxLayout ¶
func NewVBoxLayout(styles BoxLayoutStyles, ws ...Widget) *VBoxLayout
func (*VBoxLayout) Draw ¶
func (c *VBoxLayout) Draw(ctx *DrawContext)
func (*VBoxLayout) Resize ¶
func (c *VBoxLayout) Resize(ctx *ResizeContext)
func (*VBoxLayout) SizeHint ¶
func (c *VBoxLayout) SizeHint() SizeHint
type Widget ¶
type Widget interface { Draw(ctx *DrawContext) // Draw hast to take its absolute position into account Resize(ctx *ResizeContext) // Resizes to absolute screen position SizeHint() SizeHint }
Click to show internal directories.
Click to hide internal directories.