Documentation ¶
Index ¶
- Constants
- Variables
- type Container
- type ContainerBase
- type Label
- type PanelBase
- func (pb *PanelBase) CancelDrag()
- func (pb *PanelBase) DragBy(dx, dy int)
- func (pb *PanelBase) Hide()
- func (pb *PanelBase) Layout(outsideWidth, outsideHeight int) (int, int)
- func (pb *PanelBase) LayoutWidgets()
- func (pb *PanelBase) Show()
- func (pb *PanelBase) StartDrag()
- func (pb *PanelBase) StopDrag()
- func (pb *PanelBase) Tapped()
- func (pb *PanelBase) Update()
- func (pb *PanelBase) Visible() bool
- type StatusPanel
- type UI
- type Widget
- type WidgetBase
- func (wb *WidgetBase) Activate()
- func (wb *WidgetBase) Align() gg.Align
- func (wb *WidgetBase) Deactivate()
- func (wb *WidgetBase) Disabled() bool
- func (wb *WidgetBase) Draw(screen *ebiten.Image)
- func (wb *WidgetBase) ID() string
- func (wb *WidgetBase) OffsetRect() (int, int, int, int)
- func (wb *WidgetBase) Parent() Container
- func (wb *WidgetBase) Position() (int, int)
- func (wb *WidgetBase) Rect() (int, int, int, int)
- func (wb *WidgetBase) SetPosition(x, y int)
- func (wb *WidgetBase) Size() (int, int)
- func (wb *WidgetBase) Tapped()
- func (wb *WidgetBase) Update()
Constants ¶
View Source
const PADDING_SIZE = 24
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container interface { Position() (int, int) Size() (int, int) Rect() (int, int, int, int) Widgets() []Widget FindWidgetAt(int, int) Widget LayoutWidgets() StartDrag() DragBy(int, int) StopDrag() CancelDrag() Tapped() Visible() bool Show() Hide() Layout(int, int) (int, int) Update() Draw(*ebiten.Image) }
Container is an interface for a UI widget
type ContainerBase ¶
type ContainerBase struct {
// contains filtered or unexported fields
}
func (*ContainerBase) Draw ¶
func (cb *ContainerBase) Draw(screen *ebiten.Image)
func (*ContainerBase) FindWidgetAt ¶
func (cb *ContainerBase) FindWidgetAt(x, y int) Widget
func (*ContainerBase) Position ¶
func (cb *ContainerBase) Position() (int, int)
func (*ContainerBase) Size ¶
func (cb *ContainerBase) Size() (int, int)
func (*ContainerBase) Widgets ¶
func (cb *ContainerBase) Widgets() []Widget
type Label ¶
type Label struct { WidgetBase // contains filtered or unexported fields }
Label is a button that display some text
func (*Label) Deactivate ¶
func (l *Label) Deactivate()
func (*Label) UpdateText ¶
type PanelBase ¶
type PanelBase struct {
ContainerBase
}
func (*PanelBase) CancelDrag ¶
func (pb *PanelBase) CancelDrag()
func (*PanelBase) LayoutWidgets ¶
func (pb *PanelBase) LayoutWidgets()
Layout widgets that belong to this container by setting the x,y of each relative to their parent
type StatusPanel ¶
func NewStatusPanel ¶
func NewStatusPanel() *StatusPanel
type UI ¶
type UI struct { StatusPanel *StatusPanel // contains filtered or unexported fields }
type Widget ¶
type Widget interface { Parent() Container ID() string Size() (int, int) Position() (int, int) Rect() (int, int, int, int) OffsetRect() (int, int, int, int) SetPosition(int, int) Align() gg.Align Disabled() bool Activate() Deactivate() Tapped() Update() Draw(*ebiten.Image) }
IWidget is an interface for widget
type WidgetBase ¶
type WidgetBase struct {
// contains filtered or unexported fields
}
Widget base is a button that display a single icon
func (*WidgetBase) Activate ¶
func (wb *WidgetBase) Activate()
func (*WidgetBase) Align ¶
func (wb *WidgetBase) Align() gg.Align
func (*WidgetBase) Deactivate ¶
func (wb *WidgetBase) Deactivate()
func (*WidgetBase) Disabled ¶
func (wb *WidgetBase) Disabled() bool
func (*WidgetBase) Draw ¶
func (wb *WidgetBase) Draw(screen *ebiten.Image)
func (*WidgetBase) ID ¶
func (wb *WidgetBase) ID() string
func (*WidgetBase) OffsetRect ¶
func (wb *WidgetBase) OffsetRect() (int, int, int, int)
func (*WidgetBase) Parent ¶
func (wb *WidgetBase) Parent() Container
func (*WidgetBase) Position ¶
func (wb *WidgetBase) Position() (int, int)
func (*WidgetBase) SetPosition ¶
func (wb *WidgetBase) SetPosition(x, y int)
func (*WidgetBase) Size ¶
func (wb *WidgetBase) Size() (int, int)
func (*WidgetBase) Tapped ¶
func (wb *WidgetBase) Tapped()
func (*WidgetBase) Update ¶
func (wb *WidgetBase) Update()
Click to show internal directories.
Click to hide internal directories.