Documentation ¶
Index ¶
- Constants
- type Selection
- type UI
- func (ui *UI) AddDelay(time uint64, f func())
- func (ui *UI) AddElement(element *UIElement)
- func (ui *UI) AddElements(elements []*UIElement)
- func (ui *UI) Disable()
- func (ui *UI) Enable()
- func (ui *UI) GetHighestLayer() []*UIElement
- func (ui *UI) GetHighestLayerValue() UILayer
- func (ui *UI) IsDisabled() bool
- func (ui *UI) IterateElementsByLayer(f func(*UIElement))
- func (ui *UI) MakeFadeIn(time uint64) util.AlphaFadeFunc
- func (ui *UI) MakeFadeOut(time uint64) util.AlphaFadeFunc
- func (ui *UI) RemoveElement(toRemove *UIElement)
- func (ui *UI) RemoveElements(toRemove []*UIElement)
- func (ui *UI) SetElementsFromArray(elements []*UIElement)
- func (ui *UI) StandardUpdate()
- type UIClickElementFunc
- type UIDelay
- type UIDrawFunc
- type UIElement
- func MakeConfirmDialog(ui *UI, cache *lbx.LbxCache, imageCache *util.ImageCache, message string, ...) []*UIElement
- func MakeConfirmDialogWithLayer(ui *UI, cache *lbx.LbxCache, imageCache *util.ImageCache, layer UILayer, ...) []*UIElement
- func MakeErrorElement(ui *UI, cache *lbx.LbxCache, imageCache *util.ImageCache, message string, ...) *UIElement
- func MakeHelpElement(ui *UI, cache *lbx.LbxCache, imageCache *util.ImageCache, help lbx.HelpEntry, ...) *UIElement
- func MakeHelpElementWithLayer(ui *UI, cache *lbx.LbxCache, imageCache *util.ImageCache, layer UILayer, ...) *UIElement
- func MakeLairConfirmDialog(ui *UI, cache *lbx.LbxCache, imageCache *util.ImageCache, ...) []*UIElement
- func MakeLairConfirmDialogWithLayer(ui *UI, cache *lbx.LbxCache, imageCache *util.ImageCache, ...) []*UIElement
- func MakeSelectionUI(ui *UI, lbxCache *lbx.LbxCache, imageCache *util.ImageCache, cornerX int, ...) []*UIElement
- type UIGainFocusFunc
- type UIInsideElementFunc
- type UIKeyFunc
- type UILayer
- type UILoseFocusFunc
- type UINotInsideElementFunc
- type UITextEntry
Constants ¶
View Source
const DoubleClickThreshold = 20
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UI ¶
type UI struct { // track the layer number of the elements Elements map[UILayer][]*UIElement Draw func(*UI, *ebiten.Image) HandleKeys UIKeyFunc Counter uint64 LeftClickedElements []*UIElement Delays []UIDelay // disabled so that the zero value is enabled Disabled bool // contains filtered or unexported fields }
func (*UI) AddElement ¶
func (*UI) AddElements ¶
func (*UI) GetHighestLayer ¶
func (*UI) GetHighestLayerValue ¶
func (*UI) IsDisabled ¶
func (*UI) IterateElementsByLayer ¶
func (*UI) MakeFadeIn ¶
func (ui *UI) MakeFadeIn(time uint64) util.AlphaFadeFunc
func (*UI) MakeFadeOut ¶
func (ui *UI) MakeFadeOut(time uint64) util.AlphaFadeFunc
func (*UI) RemoveElement ¶
func (*UI) RemoveElements ¶
func (*UI) SetElementsFromArray ¶
func (*UI) StandardUpdate ¶
func (ui *UI) StandardUpdate()
type UIClickElementFunc ¶
type UIClickElementFunc func(element *UIElement)
type UIDrawFunc ¶
type UIDrawFunc func(element *UIElement, window *ebiten.Image)
type UIElement ¶
type UIElement struct { Rect image.Rectangle // fires if the mouse is not inside this element NotInside UINotInsideElementFunc // fires if the mouse is inside this element Inside UIInsideElementFunc // fires if a left click occurred but no other element was clicked on NotLeftClicked UIClickElementFunc // fires when a left click occurs on this element LeftClick UIClickElementFunc // fires when the left click button is released on this element LeftClickRelease UIClickElementFunc // fires when this element is double clicked DoubleLeftClick UIClickElementFunc // fires when this element is right clicked RightClick UIClickElementFunc // fires when this element is left clicked GainFocus UIGainFocusFunc // fires when some other element is left clicked LoseFocus UILoseFocusFunc // fires when the user types some keys and this element is focused TextEntry UITextEntry // fires when a key is pressed and this element is focused HandleKeys UIKeyFunc Draw UIDrawFunc Layer UILayer }
func MakeConfirmDialog ¶
func MakeErrorElement ¶
func MakeHelpElement ¶
func MakeLairConfirmDialog ¶
type UIGainFocusFunc ¶
type UIGainFocusFunc func(*UIElement)
type UIInsideElementFunc ¶
type UILoseFocusFunc ¶
type UILoseFocusFunc func(*UIElement)
type UINotInsideElementFunc ¶
type UINotInsideElementFunc func(element *UIElement)
type UITextEntry ¶
Click to show internal directories.
Click to hide internal directories.