Documentation
¶
Index ¶
- func AlignUINode(uinode UINode, bounds pixel.Rect, valignment nodes.VerticalAlignment, ...)
- type Button
- func (b *Button) Enabled() bool
- func (b *Button) GetButtonStyles(state ButtonState) *nodes.Styles
- func (b *Button) GetOrigSize() pixel.Vec
- func (b *Button) OnClick(fn func())
- func (b *Button) SetButtonStyles(state ButtonState, styles *nodes.Styles)
- func (b *Button) SetEnabled(enabled bool)
- func (b *Button) SetHAlignment(h nodes.HorizontalAlignment)
- func (b *Button) SetSize(size pixel.Vec)
- func (b *Button) SetStyles(styles *nodes.Styles)
- func (b *Button) SetText(text string)
- func (b *Button) SetVAlignment(v nodes.VerticalAlignment)
- func (b *Button) Update(dt float64)
- func (b *Button) UpdateFromTheme(theme *nodes.Theme)
- type ButtonGroup
- type ButtonState
- type CheckBox
- type DropDown
- func (d *DropDown) AddValue(text, value string)
- func (d *DropDown) ChangeValue(value, text string)
- func (d *DropDown) Clear()
- func (d *DropDown) HDropDown() float64
- func (d *DropDown) Init()
- func (d *DropDown) IterateEntries(fn func(value, text string))
- func (d *DropDown) Mount()
- func (d *DropDown) OnChange(fn func(string, string))
- func (d *DropDown) RemoveValue(value string)
- func (d *DropDown) SetHDropDown(h float64)
- func (d *DropDown) SetSize(size pixel.Vec)
- func (d *DropDown) SetValue(value string)
- func (d *DropDown) Unmount()
- func (d *DropDown) Update(dt float64)
- func (d *DropDown) Value() string
- type FloatInputBox
- type Grid
- type HBox
- type InputBox
- func (i *InputBox) Focus()
- func (i *InputBox) Init()
- func (i *InputBox) OnChange(onchange func(string))
- func (i *InputBox) OnEnter(onenter func(string))
- func (i *InputBox) SetSize(size pixel.Vec)
- func (i *InputBox) SetStyles(styles *nodes.Styles)
- func (i *InputBox) SetValue(value string)
- func (i *InputBox) Update(dt float64)
- func (i *InputBox) UpdateFromTheme(theme *nodes.Theme)
- func (i *InputBox) Value() string
- type IntInputBox
- type Menu
- type MenuBar
- type MenuItem
- type SelectList
- func (s *SelectList) AddEntry(text string, value string, content interface{})
- func (s *SelectList) ChangeEntry(oldvalue string, text string, value string, content interface{})
- func (s *SelectList) Clear()
- func (s *SelectList) Count() int
- func (s *SelectList) Init()
- func (s *SelectList) IterateEntries(fn func(value string, content interface{}))
- func (s *SelectList) MultiSelect() bool
- func (s *SelectList) OnSelect(onselect func(v string, content interface{}))
- func (s *SelectList) OnUnselect(onunselect func(v string, content interface{}))
- func (s *SelectList) RemoveEntry(value string)
- func (s *SelectList) Selected() []SelectListSelection
- func (s *SelectList) SetMultiSelect(ms bool)
- func (s *SelectList) SetSize(size pixel.Vec)
- func (s *SelectList) SetStyles(styles *nodes.Styles)
- func (s *SelectList) UnselectAll()
- type SelectListSelection
- type Slider
- func (s *Slider) Draw(win pixel.Target, mat pixel.Matrix)
- func (s *Slider) Init()
- func (s *Slider) Mounted()
- func (s *Slider) OnChange(fn func(v float32))
- func (s *Slider) SetStyles(styles *nodes.Styles)
- func (s *Slider) SetValue(v float32)
- func (s *Slider) Unmounted()
- func (s *Slider) Update(dt float64)
- func (s *Slider) Value() float32
- type Text
- type UIBase
- func (ui *UIBase) Alignment() nodes.Alignment
- func (ui *UIBase) Contains(point pixel.Vec) bool
- func (ui *UIBase) GetOrigPos() pixel.Vec
- func (ui *UIBase) HAlignment() nodes.HorizontalAlignment
- func (ui *UIBase) IsStylesOverridden() bool
- func (ui *UIBase) KeepOnScreen()
- func (ui *UIBase) OverrideStyles(styles *nodes.Styles)
- func (ui *UIBase) SetAlignment(a nodes.Alignment)
- func (ui *UIBase) SetHAlignment(h nodes.HorizontalAlignment)
- func (ui *UIBase) SetOrigin(origin pixel.Vec)
- func (ui *UIBase) SetPos(pos pixel.Vec)
- func (ui *UIBase) SetSize(size pixel.Vec)
- func (ui *UIBase) SetStyles(styles *nodes.Styles)
- func (ui *UIBase) SetStylesOverridden(overridden bool)
- func (ui *UIBase) SetVAlignment(v nodes.VerticalAlignment)
- func (ui *UIBase) Size() pixel.Vec
- func (ui *UIBase) VAlignment() nodes.VerticalAlignment
- type UINode
- type VBox
- type VScroll
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlignUINode ¶
func AlignUINode(uinode UINode, bounds pixel.Rect, valignment nodes.VerticalAlignment, halignment nodes.HorizontalAlignment)
Types ¶
type Button ¶
type Button struct { UIBase // contains filtered or unexported fields }
func (*Button) GetButtonStyles ¶
func (b *Button) GetButtonStyles(state ButtonState) *nodes.Styles
func (*Button) GetOrigSize ¶
func (*Button) SetButtonStyles ¶
func (b *Button) SetButtonStyles(state ButtonState, styles *nodes.Styles)
func (*Button) SetEnabled ¶
func (*Button) SetHAlignment ¶
func (b *Button) SetHAlignment(h nodes.HorizontalAlignment)
func (*Button) SetVAlignment ¶
func (b *Button) SetVAlignment(v nodes.VerticalAlignment)
func (*Button) UpdateFromTheme ¶
type ButtonGroup ¶
type ButtonGroup struct { UIBase // contains filtered or unexported fields }
func NewButtonGroup ¶
func NewButtonGroup(name string, h float64) *ButtonGroup
func (*ButtonGroup) AddButton ¶
func (g *ButtonGroup) AddButton(caption, value string, w float64)
func (*ButtonGroup) OnChange ¶
func (g *ButtonGroup) OnChange(fn func(v string))
func (*ButtonGroup) SetAlignment ¶
func (g *ButtonGroup) SetAlignment(a nodes.Alignment)
func (*ButtonGroup) SetStyles ¶
func (g *ButtonGroup) SetStyles(styles *nodes.Styles)
type ButtonState ¶
type ButtonState int
const ( ButtonInit ButtonState = iota ButtonEnabled ButtonDisabled ButtonHover ButtonPressed )
type DropDown ¶
type DropDown struct { UIBase // contains filtered or unexported fields }
func NewDropDown ¶
TODO: theme support
func (*DropDown) ChangeValue ¶
func (*DropDown) IterateEntries ¶
func (*DropDown) RemoveValue ¶
func (*DropDown) SetHDropDown ¶
type FloatInputBox ¶
type FloatInputBox struct {
InputBox
}
func NewFloatInputBox ¶
func NewFloatInputBox(name string, w, h float64) *FloatInputBox
func (*FloatInputBox) FloatValue ¶
func (f *FloatInputBox) FloatValue() (float64, error)
func (*FloatInputBox) SetFloatValue ¶
func (f *FloatInputBox) SetFloatValue(v float64)
func (*FloatInputBox) Update ¶
func (f *FloatInputBox) Update(dt float64)
type Grid ¶
type Grid struct { UIBase // contains filtered or unexported fields }
func (*Grid) ChildChanged ¶
func (g *Grid) ChildChanged()
func (*Grid) RemoveChild ¶
func (*Grid) RemoveChildren ¶
func (g *Grid) RemoveChildren()
type HBox ¶
type HBox struct { UIBase // contains filtered or unexported fields }
func (*HBox) ChildChanged ¶
func (h *HBox) ChildChanged()
func (*HBox) RemoveChild ¶
func (*HBox) RemoveChildren ¶
func (h *HBox) RemoveChildren()
func (*HBox) SetFixedSize ¶
type InputBox ¶
type InputBox struct { UIBase // contains filtered or unexported fields }
func NewInputBox ¶
func (*InputBox) UpdateFromTheme ¶
type IntInputBox ¶
type IntInputBox struct {
InputBox
}
func NewIntInputBox ¶
func NewIntInputBox(name string, w, h float64) *IntInputBox
func (*IntInputBox) IntValue ¶
func (i *IntInputBox) IntValue() (int64, error)
func (*IntInputBox) SetIntValue ¶
func (i *IntInputBox) SetIntValue(v int64)
func (*IntInputBox) Update ¶
func (i *IntInputBox) Update(dt float64)
type MenuBar ¶
type MenuBar struct { HBox // contains filtered or unexported fields }
func NewMenuBar ¶
func (*MenuBar) SetMenuItemEnabled ¶
type SelectList ¶
type SelectList struct { UIBase // contains filtered or unexported fields }
func NewSelectList ¶
func NewSelectList(name string, w, h float64, multiselect bool) *SelectList
func (*SelectList) AddEntry ¶
func (s *SelectList) AddEntry(text string, value string, content interface{})
func (*SelectList) ChangeEntry ¶
func (s *SelectList) ChangeEntry(oldvalue string, text string, value string, content interface{})
func (*SelectList) Clear ¶
func (s *SelectList) Clear()
func (*SelectList) Count ¶
func (s *SelectList) Count() int
func (*SelectList) Init ¶
func (s *SelectList) Init()
func (*SelectList) IterateEntries ¶
func (s *SelectList) IterateEntries(fn func(value string, content interface{}))
func (*SelectList) MultiSelect ¶
func (s *SelectList) MultiSelect() bool
func (*SelectList) OnSelect ¶
func (s *SelectList) OnSelect(onselect func(v string, content interface{}))
func (*SelectList) OnUnselect ¶
func (s *SelectList) OnUnselect(onunselect func(v string, content interface{}))
func (*SelectList) RemoveEntry ¶
func (s *SelectList) RemoveEntry(value string)
func (*SelectList) Selected ¶
func (s *SelectList) Selected() []SelectListSelection
func (*SelectList) SetMultiSelect ¶
func (s *SelectList) SetMultiSelect(ms bool)
func (*SelectList) SetSize ¶
func (s *SelectList) SetSize(size pixel.Vec)
func (*SelectList) SetStyles ¶
func (s *SelectList) SetStyles(styles *nodes.Styles)
func (*SelectList) UnselectAll ¶
func (s *SelectList) UnselectAll()
type SelectListSelection ¶
type SelectListSelection struct { Value string Content interface{} }
type Text ¶
type Text struct { UIBase // contains filtered or unexported fields }
func (*Text) GetContent ¶
func (*Text) UpdateFromTheme ¶
type UIBase ¶
func (*UIBase) Contains ¶
Contains returns whether the given point (in local coordinates) lies within the boundaries of this UI element
func (*UIBase) GetOrigPos ¶
func (*UIBase) HAlignment ¶
func (ui *UIBase) HAlignment() nodes.HorizontalAlignment
func (*UIBase) IsStylesOverridden ¶
func (*UIBase) KeepOnScreen ¶
func (ui *UIBase) KeepOnScreen()
func (*UIBase) OverrideStyles ¶
func (*UIBase) SetAlignment ¶
func (*UIBase) SetHAlignment ¶
func (ui *UIBase) SetHAlignment(h nodes.HorizontalAlignment)
func (*UIBase) SetStylesOverridden ¶
func (*UIBase) SetVAlignment ¶
func (ui *UIBase) SetVAlignment(v nodes.VerticalAlignment)
func (*UIBase) VAlignment ¶
func (ui *UIBase) VAlignment() nodes.VerticalAlignment
type UINode ¶
type UINode interface { nodes.Node GetOrigPos() pixel.Vec Size() pixel.Vec Alignment() nodes.Alignment SetAlignment(a nodes.Alignment) OverrideStyles(styles *nodes.Styles) HAlignment() nodes.HorizontalAlignment SetHAlignment(h nodes.HorizontalAlignment) VAlignment() nodes.VerticalAlignment SetVAlignment(v nodes.VerticalAlignment) IsStylesOverridden() bool SetStylesOverridden(overridden bool) }
type VBox ¶
type VBox struct { UIBase // contains filtered or unexported fields }
func (*VBox) ChildChanged ¶
func (v *VBox) ChildChanged()
func (*VBox) RemoveChild ¶
func (*VBox) RemoveChildren ¶
func (v *VBox) RemoveChildren()
func (*VBox) SetHAlignment ¶
func (v *VBox) SetHAlignment(val nodes.HorizontalAlignment)
type VScroll ¶
type VScroll struct { UIBase // contains filtered or unexported fields }
func NewVScroll ¶
Click to show internal directories.
Click to hide internal directories.