package ui
Constants
EventTypeInvalid
EventType(iota)
EventTypeEnter
EventTypeMove
EventTypeExit
EventTypeClick
EventTypeRightClick
EventTypeDoubleClick
EventTypeDown
EventTypeUp
EventTypeMiss
EventTypeDragStart
EventTypeDrop
EventTypeDropEnter
EventTypeDropExit
EventTypeDragEnd
EventTypeRebuild
EventTypeDestroy
EventTypeSubmit
EventTypeChange
EventTypeRender
EventTypeKeyDown
EventTypeKeyUp
EventTypeEnd
iota
InputTypeText
PositioningStatic
Positioning(iota)
PositioningAbsolute
PositioningFixed
PositioningRelative
PositioningSticky
0x00
0x01
0x02
0x03
BorderStyleNone
iota
BorderStyleHidden
BorderStyleDotted
BorderStyleDashed
BorderStyleSolid
BorderStyleDouble
BorderStyleGroove
BorderStyleRidge
BorderStyleInset
BorderStyleOutset
ContentFitNone
iota
ContentFitWidth
ContentFitHeight
ContentFitBoth
iota
OverflowVisible
OverflowHidden
DirtyTypeNone
iota
DirtyTypeLayout
DirtyTypeResize
DirtyTypeGenerated
DirtyTypeColorChange
DirtyTypeScissor
DirtyTypeParent
DirtyTypeParentLayout
DirtyTypeParentResize
DirtyTypeParentGenerated
DirtyTypeParentReGenerated
DirtyTypeParentColorChange
DirtyTypeParentScissor
ElementTypeLabel
ElementType(iota)
ElementTypePanel
ElementTypeCheckbox
ElementTypeImage
ElementTypeProgressBar
ElementTypeSelect
ElementTypeSlider
EntityDataName
"ui"
LabelFontSize
14.0
Types
BasicStylizer
struct
type BasicStylizer struct {
Parent *UI
}
BorderStyle
int32
Panel
func (b *Button) Base() *UI
func (b *Button) ButtonData() *buttonData
func (b *Button) Init(texture *rendering.Texture, text string)
func (b *Button) Label() *Label
func (b *Button) SetColor(color matrix.Color)
Checkbox
Panel
Checkbox.Base
func (cb *Checkbox) Base() *UI
Checkbox.CheckboxData
func (cb *Checkbox) CheckboxData() *checkboxData
Checkbox.Init
func (cb *Checkbox) Init()
Checkbox.IsChecked
func (cb Checkbox) IsChecked() bool
Checkbox.SetChecked
func (cb *Checkbox) SetChecked(isChecked bool)
ContentFit
int32
DirtyType
int
ElementType
uint8
EventType
int
Group
struct
type Group struct {
// Has unexported fields.
}
Group.Attach
func (group *Group) Attach(host *engine.Host)
Group.Detach
func (group *Group) Detach(host *engine.Host)
Group.HasRequests
func (group *Group) HasRequests() bool
func (group *Group) IsFocusedOnInput() bool
Group.SetThreaded
func (g *Group) SetThreaded()
Image
Panel
Image.Base
func (s *Image) Base() *UI
Image.Frame
func (img *Image) Frame() int
Image.ImageData
func (s *Image) ImageData() *imageData
Image.Init
func (s *Image) Init(texture *rendering.Texture)
Image.InitFlipbook
func (s *Image) InitFlipbook(framesPerSecond float32, textures []*rendering.Texture)
Image.InitSpriteSheet
func (s *Image) InitSpriteSheet(framesPerSecond float32, texture *rendering.Texture, jsonStr string)
Image.PlayAnimation
func (img *Image) PlayAnimation()
Image.SetFlipBookAnimation
func (img *Image) SetFlipBookAnimation(framesPerSecond float32, textures ...*rendering.Texture)
Image.SetFrame
func (img *Image) SetFrame(index int)
Image.SetFrameRate
func (img *Image) SetFrameRate(framesPerSecond float32)
Image.SetSpriteSheet
func (img *Image) SetSpriteSheet(framesPerSecond float32, texture *rendering.Texture, jsonStr string)
Image.SetTexture
func (img *Image) SetTexture(texture *rendering.Texture)
Image.StopAnimation
func (img *Image) StopAnimation()
Panel
func (input *Input) Base() *UI
func (input *Input) Focus()
func (input *Input) Init(placeholderText string)
func (input *Input) InputData() *inputData
Input.InsertText
func (input *Input) InsertText(text string)
func (input *Input) IsFocused() bool
func (input *Input) RemoveFocus()
func (input *Input) SelectAll()
func (input *Input) SetBGColor(newColor matrix.Color)
func (input *Input) SetCursorColor(newColor matrix.Color)
func (input *Input) SetCursorOffset(offset int)
func (input *Input) SetDescription(text string)
func (input *Input) SetFGColor(newColor matrix.Color)
func (input *Input) SetFontSize(fontSize float32)
func (input *Input) SetNextFocusedInput(next *Input)
func (input *Input) SetPlaceholder(text string)
func (input *Input) SetSelectColor(newColor matrix.Color)
Input.SetText
func (input *Input) SetText(text string)
Input.SetTextWithoutEvent
func (input *Input) SetTextWithoutEvent(text string)
func (input *Input) SetTitle(text string)
func (input *Input) SetType(inputType InputType)
Input.Text
func (input *Input) Text() string
int32
Label
UI
Label.Base
func (l *Label) Base() *UI
Label.BoldRange
func (label *Label) BoldRange(start, end int)
Label.CalculateMaxWidth
func (label *Label) CalculateMaxWidth() float32
Label.Clone
func (label *Label) Clone(to *Label)
Label.ColorRange
func (label *Label) ColorRange(start, end int, newColor, bgColor matrix.Color)
Label.EnforceBGColor
func (label *Label) EnforceBGColor(color matrix.Color)
Label.EnforceFGColor
func (label *Label) EnforceFGColor(color matrix.Color)
Label.FontFace
func (label *Label) FontFace() rendering.FontFace
Label.FontSize
func (label *Label) FontSize() float32
Label.Hide
func (label *Label) Hide()
Label.Init
func (label *Label) Init(text string)
Label.LabelData
func (l *Label) LabelData() *labelData
Label.LineHeight
func (label *Label) LineHeight() float32
Label.MaxWidth
func (label *Label) MaxWidth() float32
Label.Measure
func (label *Label) Measure() matrix.Vec2
Label.SetBGColor
func (label *Label) SetBGColor(newColor matrix.Color)
Label.SetBaseline
func (label *Label) SetBaseline(baseline rendering.FontBaseline)
Label.SetColor
func (label *Label) SetColor(newColor matrix.Color)
Label.SetFontSize
func (label *Label) SetFontSize(size float32)
Label.SetFontStyle
func (label *Label) SetFontStyle(style string)
Label.SetFontWeight
func (label *Label) SetFontWeight(weight string)
Label.SetJustify
func (label *Label) SetJustify(justify rendering.FontJustify)
Label.SetLineHeight
func (label *Label) SetLineHeight(height float32)
Label.SetMaxWidth
func (label *Label) SetMaxWidth(maxWidth float32)
Label.SetText
func (label *Label) SetText(text string)
Label.SetWidthAutoHeight
func (label *Label) SetWidthAutoHeight(width float32)
Label.SetWrap
func (label *Label) SetWrap(wrapText bool)
Label.Show
func (label *Label) Show()
Label.Text
func (label *Label) Text() string
Label.UnEnforceBGColor
func (label *Label) UnEnforceBGColor()
Label.UnEnforceFGColor
func (label *Label) UnEnforceFGColor()
Layout
struct
type Layout struct {
Stylizer LayoutStylizer
// Has unexported fields.
}
Layout.Border
func (l *Layout) Border() matrix.Vec4
Layout.CalcOffset
func (l *Layout) CalcOffset() matrix.Vec2
Layout.CledarStyles
func (l *Layout) CledarStyles()
Layout.ContentSize
func (l *Layout) ContentSize() matrix.Vec2
Layout.InnerOffset
func (l *Layout) InnerOffset() matrix.Vec4
Layout.LocalInnerOffset
func (l *Layout) LocalInnerOffset() matrix.Vec4
Layout.Margin
func (l *Layout) Margin() matrix.Vec4
Layout.Offset
func (l *Layout) Offset() matrix.Vec2
Layout.Padding
func (l *Layout) Padding() matrix.Vec4
Layout.PixelSize
func (l *Layout) PixelSize() matrix.Vec2
Layout.Positioning
func (l *Layout) Positioning() Positioning
Layout.Scale
func (l *Layout) Scale(width, height float32) bool
Layout.ScaleHeight
func (l *Layout) ScaleHeight(height float32) bool
Layout.ScaleWidth
func (l *Layout) ScaleWidth(width float32) bool
Layout.SetBorder
func (l *Layout) SetBorder(left, top, right, bottom float32)
Layout.SetInnerOffset
func (l *Layout) SetInnerOffset(left, top, right, bottom float32)
Layout.SetInnerOffsetBottom
func (l *Layout) SetInnerOffsetBottom(offset float32)
Layout.SetInnerOffsetLeft
func (l *Layout) SetInnerOffsetLeft(offset float32)
Layout.SetInnerOffsetRight
func (l *Layout) SetInnerOffsetRight(offset float32)
Layout.SetInnerOffsetTop
func (l *Layout) SetInnerOffsetTop(offset float32)
Layout.SetLocalInnerOffset
func (l *Layout) SetLocalInnerOffset(left, top, right, bottom float32)
Layout.SetMargin
func (l *Layout) SetMargin(left, top, right, bottom float32)
Layout.SetOffset
func (l *Layout) SetOffset(x, y float32)
Layout.SetOffsetX
func (l *Layout) SetOffsetX(x float32)
Layout.SetOffsetY
func (l *Layout) SetOffsetY(y float32)
Layout.SetPadding
func (l *Layout) SetPadding(left, top, right, bottom float32)
Layout.SetPositioning
func (l *Layout) SetPositioning(pos Positioning)
Layout.SetRowLayoutOffset
func (l *Layout) SetRowLayoutOffset(offset matrix.Vec2)
Layout.SetZ
func (l *Layout) SetZ(z float32)
Layout.Ui
func (l *Layout) Ui() *UI
Layout.Z
func (l *Layout) Z() float32
LayoutStylizer
interface
type LayoutStylizer interface {
ProcessStyle(layout *Layout) []error
}
LeftStylizer
struct
type LeftStylizer struct{ BasicStylizer }
LeftStylizer.ProcessStyle
func (s LeftStylizer) ProcessStyle(layout *Layout) []error
Manager
struct
type Manager struct {
Host *engine.Host
Group Group
// Has unexported fields.
}
Manager.Add
func (man *Manager) Add() *UI
Manager.Clear
func (man *Manager) Clear()
Manager.DisableUpdate
func (man *Manager) DisableUpdate()
Manager.EnableUpdate
func (man *Manager) EnableUpdate()
Manager.Hovered
func (man *Manager) Hovered() []*UI
Manager.Init
func (man *Manager) Init(host *engine.Host)
Manager.IsUpdateDisabled
func (man *Manager) IsUpdateDisabled() bool
Manager.Remove
func (man *Manager) Remove(ui *UI)
Manager.Reserve
func (man *Manager) Reserve(additionalElements int)
Overflow
int
Panel
UI
FirstPanelOnEntity
func FirstPanelOnEntity(entity *engine.Entity) *Panel
Panel.AddChild
func (p *Panel) AddChild(target *UI)
Panel.Background
func (p *Panel) Background() *rendering.Texture
Panel.Base
func (p *Panel) Base() *UI
Panel.BorderColor
func (p *Panel) BorderColor() [4]matrix.Color
Panel.BorderSize
func (p *Panel) BorderSize() matrix.Vec4
Panel.BorderStyle
func (p *Panel) BorderStyle() [4]BorderStyle
Panel.Child
func (p *Panel) Child(index int) *UI
Panel.Color
func (p *Panel) Color() matrix.Color
func (p *Panel) DisableDragScroll()
Panel.DontFitContent
func (p *Panel) DontFitContent()
Panel.DontFitContentHeight
func (p *Panel) DontFitContentHeight()
Panel.DontFitContentWidth
func (p *Panel) DontFitContentWidth()
func (p *Panel) EnableDragScroll()
Panel.EnforceColor
func (p *Panel) EnforceColor(color matrix.Color)
Panel.FitContent
func (p *Panel) FitContent()
Panel.FitContentHeight
func (p *Panel) FitContentHeight()
Panel.FitContentWidth
func (p *Panel) FitContentWidth()
Panel.FittingContent
func (p *Panel) FittingContent() bool
Panel.FittingContentHeight
func (p *Panel) FittingContentHeight() bool
Panel.FittingContentWidth
func (p *Panel) FittingContentWidth() bool
Panel.Freeze
Panel.HasBackground
func (p *Panel) HasBackground() bool
Panel.HasEnforcedColor
func (p *Panel) HasEnforcedColor() bool
Panel.Init
func (panel *Panel) Init(texture *rendering.Texture, elmType ElementType)
Panel.InsertChild
func (p *Panel) InsertChild(target *UI, idx int)
Panel.IsFrozen
func (p *Panel) IsFrozen() bool
func (p *Panel) IsScrolling() bool
func (p *Panel) MaxScroll() matrix.Vec2
Panel.Overflow
func (p *Panel) Overflow() Overflow
Panel.PanelData
func (p *Panel) PanelData() *panelData
Panel.RemoveBackground
func (p *Panel) RemoveBackground()
Panel.RemoveChild
func (p *Panel) RemoveChild(target *UI)
func (p *Panel) ResetScroll()
func (p *Panel) ScrollDirection() PanelScrollDirection
func (p *Panel) ScrollToChild(child *UI)
func (p *Panel) ScrollX() float32
func (p *Panel) ScrollY() float32
Panel.SetBackground
func (p *Panel) SetBackground(tex *rendering.Texture)
Panel.SetBorderColor
func (p *Panel) SetBorderColor(left, top, right, bottom matrix.Color)
Panel.SetBorderRadius
func (p *Panel) SetBorderRadius(topLeft, topRight, bottomRight, bottomLeft float32)
Panel.SetBorderSize
func (p *Panel) SetBorderSize(left, top, right, bottom float32)
Panel.SetBorderStyle
func (p *Panel) SetBorderStyle(left, top, right, bottom BorderStyle)
Panel.SetColor
func (p *Panel) SetColor(bgColor matrix.Color)
Panel.SetOverflow
func (p *Panel) SetOverflow(overflow Overflow)
func (p *Panel) SetScrollDirection(direction PanelScrollDirection)
func (p *Panel) SetScrollX(value float32)
func (p *Panel) SetScrollY(value float32)
Panel.SetSpeed
func (p *Panel) SetSpeed(speed float32)
Panel.SetUseBlending
func (p *Panel) SetUseBlending(useBlending bool)
Panel.UnEnforceColor
func (p *Panel) UnEnforceColor()
Panel.UnFreeze
func (p *Panel) UnFreeze()
int32
type PanelScrollDirection = int32
Positioning
int
ProgressBar
Panel
ProgressBar.Base
func (p *ProgressBar) Base() *UI
ProgressBar.Init
func (p *ProgressBar) Init(fgTexture, bgTexture *rendering.Texture)
ProgressBar.SetBGColor
func (b *ProgressBar) SetBGColor(bgColor matrix.Color)
ProgressBar.SetFGColor
func (b *ProgressBar) SetFGColor(fgColor matrix.Color)
ProgressBar.SetValue
func (b *ProgressBar) SetValue(value float32)
ProgressBar.Value
func (b ProgressBar) Value() float32
RightStylizer
struct
type RightStylizer struct{ BasicStylizer }
RightStylizer.ProcessStyle
func (s RightStylizer) ProcessStyle(layout *Layout) []error
Select
Panel
Select.AddOption
func (s *Select) AddOption(name, value string)
Select.Base
func (s *Select) Base() *UI
Select.Init
func (s *Select) Init(text string, options []SelectOption)
Select.Name
func (s *Select) Name() string
Select.PickOption
func (s *Select) PickOption(index int)
Select.PickOptionByLabel
func (s *Select) PickOptionByLabel(label string)
Select.SelectData
func (s *Select) SelectData() *selectData
Select.SetColor
func (s *Select) SetColor(newColor matrix.Color)
Select.SetOptionsColor
func (s *Select) SetOptionsColor(newColor matrix.Color)
Select.Value
func (s *Select) Value() string
SelectOption
struct
type SelectOption struct {
Name string
Value string
}
ShaderData
struct
type ShaderData struct {
rendering.ShaderDataBase
UVs matrix.Vec4
FgColor matrix.Color
BgColor matrix.Color
Scissor matrix.Vec4
Size2D matrix.Vec4
BorderRadius matrix.Vec4
BorderSize matrix.Vec4
BorderColor [4]matrix.Color
BorderLen matrix.Vec2
}
ShaderData.Size
func (s ShaderData) Size() int
Slider
Panel
Slider.Base
func (s *Slider) Base() *UI
Slider.Delta
func (slider Slider) Delta() float32
Slider.Init
Slider.SetBGColor
func (slider *Slider) SetBGColor(bgColor matrix.Color)
Slider.SetFGColor
func (slider *Slider) SetFGColor(fgColor matrix.Color)
Slider.SetValue
func (slider *Slider) SetValue(value float32)
Slider.SliderData
func (s *Slider) SliderData() *sliderData
Slider.Value
func (slider Slider) Value() float32
StretchCenterStylizer
struct
type StretchCenterStylizer struct{ BasicStylizer }
StretchCenterStylizer.ProcessStyle
func (s StretchCenterStylizer) ProcessStyle(layout *Layout) []error
StretchHeightStylizer
struct
type StretchHeightStylizer struct{ BasicStylizer }
StretchHeightStylizer.ProcessStyle
func (s StretchHeightStylizer) ProcessStyle(layout *Layout) []error
StretchWidthStylizer
struct
type StretchWidthStylizer struct{ BasicStylizer }
StretchWidthStylizer.ProcessStyle
func (s StretchWidthStylizer) ProcessStyle(layout *Layout) []error
UI
struct
type UI struct {
// Has unexported fields.
}
AllOnEntity
func AllOnEntity(entity *engine.Entity) []*UI
FirstOnEntity
func FirstOnEntity(entity *engine.Entity) *UI
UI.AddEvent
func (ui *UI) AddEvent(evtType EventType, evt func()) events.Id
UI.Clean
UI.Clone
func (ui *UI) Clone(parent *engine.Entity) *UI
UI.Entity
func (ui *UI) Entity() *engine.Entity
UI.Event
func (ui *UI) Event(evtType EventType) *events.Event
UI.ExecuteEvent
func (ui *UI) ExecuteEvent(evtType EventType) bool
UI.FindByName
func (ui *UI) FindByName(name string) *UI
UI.GenerateScissor
func (ui *UI) GenerateScissor()
UI.Hide
UI.Host
func (ui *UI) Host() *engine.Host
UI.IsDown
func (ui *UI) IsDown() bool
UI.IsInFrontOf
func (ui *UI) IsInFrontOf(other *UI) bool
UI.IsType
func (ui *UI) IsType(elmType ElementType) bool
UI.Layout
func (ui *UI) Layout() *Layout
UI.RemoveEvent
func (ui *UI) RemoveEvent(evtType EventType, evtId events.Id)
UI.SetDirty
func (ui *UI) SetDirty(dirtyType DirtyType)
UI.SetDontClean
func (ui *UI) SetDontClean(val bool)
UI.ShaderData
func (ui *UI) ShaderData() *ShaderData
UI.Show
func (u *UI) ToButton() *Button
UI.ToCheckbox
func (u *UI) ToCheckbox() *Checkbox
UI.ToImage
func (u *UI) ToImage() *Image
func (u *UI) ToInput() *Input
UI.ToLabel
func (u *UI) ToLabel() *Label
UI.ToPanel
func (u *UI) ToPanel() *Panel
UI.ToProgressBar
func (u *UI) ToProgressBar() *ProgressBar
UI.ToSelect
func (u *UI) ToSelect() *Select
UI.ToSlider
func (u *UI) ToSlider() *Slider
UI.Type
func (ui *UI) Type() ElementType
UI.Update
func (ui *UI) Update(deltaTime float64)
UIElementData
interface
type UIElementData interface {
// Has unexported methods.
}