package ui
import "kaijuengine.com/engine/ui"
Constants
EventTypeInvalid
EventType(iota)
EventTypeEnter
EventTypeMove
EventTypeExit
EventTypeClick
EventTypeRightClick
EventTypeDoubleClick
EventTypeDown
EventTypeUp
EventTypeRightDown
EventTypeRightUp
EventTypeMiss
EventTypeDragStart
EventTypeDrop
EventTypeDropEnter
EventTypeDropExit
EventTypeDragEnd
EventTypeRebuild
EventTypeDestroy
EventTypeFocus
EventTypeBlur
EventTypeSubmit
EventTypeChange
EventTypeRender
EventTypeKeyDown
EventTypeKeyUp
EventTypeEnd
iota
InputTypeText
PositioningStatic
Positioning(iota)
PositioningAbsolute
PositioningFixed
PositioningRelative
PositioningSticky
FlexAlignAuto
FlexAlign(iota)
FlexAlignStart
FlexAlignEnd
FlexAlignCenter
FlexAlignStretch
0x00
0x01
0x02
0x03
BorderStyleNone
iota
BorderStyleHidden
BorderStyleDotted
BorderStyleDashed
BorderStyleSolid
BorderStyleDouble
BorderStyleGroove
BorderStyleRidge
BorderStyleInset
BorderStyleOutset
ContentFitNone
iota
ContentFitWidth
ContentFitHeight
ContentFitBoth
iota
OverflowVisible
OverflowHidden
LayoutModeFlow
LayoutMode(iota)
LayoutModeGrid
LayoutModeFlex
FlexDirectionRow
FlexDirection(iota)
FlexDirectionRowReverse
FlexDirectionColumn
FlexDirectionColumnReverse
FlexWrapNoWrap
FlexWrap(iota)
FlexWrapWrap
FlexWrapWrapReverse
FlexJustifyStart
FlexJustify(iota)
FlexJustifyEnd
FlexJustifyCenter
FlexJustifySpaceBetween
FlexJustifySpaceAround
FlexJustifySpaceEvenly
FlexAlignContentStart
FlexAlignContent(iota)
FlexAlignContentEnd
FlexAlignContentCenter
FlexAlignContentStretch
FlexAlignContentSpaceBetween
FlexAlignContentSpaceAround
FlexAlignContentSpaceEvenly
DirtyTypeNone
iota
DirtyTypeLayout
DirtyTypeResize
DirtyTypeGenerated
DirtyTypeColorChange
DirtyTypeScissor
DirtyTypeParent
DirtyTypeParentLayout
DirtyTypeParentResize
DirtyTypeParentGenerated
DirtyTypeParentReGenerated
DirtyTypeParentColorChange
DirtyTypeParentScissor
ElementTypeLabel
ElementType(iota)
ElementTypePanel
ElementTypeCheckbox
ElementTypeImage
ElementTypeProgressBar
ElementTypeSelect
ElementTypeSlider
ElementTypeTextArea
EntityDataName
"ui"
LabelFontSize
14.0
Variables
Types
BasicStylizer
struct
type BasicStylizer struct {
Parent weak.Pointer[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) IsDisabled() bool
func (b *Button) Label() *Label
func (b *Button) SetColor(color matrix.Color)
func (b *Button) SetDisabled(disabled bool)
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.IsDisabled
func (cb *Checkbox) IsDisabled() bool
Checkbox.SetChecked
func (cb *Checkbox) SetChecked(isChecked bool)
Checkbox.SetCheckedWithoutEvent
func (cb *Checkbox) SetCheckedWithoutEvent(isChecked bool)
Checkbox.SetDisabled
func (cb *Checkbox) SetDisabled(disabled bool)
ContentFit
int32
DirtyType
int
ElementType
uint8
EventType
int
FlexAlign
int
FlexAlignContent
int
type FlexAlignContent = int
FlexDirection
int
FlexJustify
int
FlexWrap
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) FontFace() rendering.FontFace
func (input *Input) FontSize() float32
func (input *Input) Init(placeholderText string)
func (input *Input) InputData() *inputData
Input.InsertText
func (input *Input) InsertText(text string)
func (input *Input) IsDisabled() bool
func (input *Input) IsFocused() bool
func (input *Input) IsRequired() bool
func (input *Input) IsValid() 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) SetDisabled(disabled bool)
func (input *Input) SetFGColor(newColor matrix.Color)
func (input *Input) SetFontFace(face rendering.FontFace)
func (input *Input) SetFontSize(fontSize float32)
func (input *Input) SetFontStyle(style string)
func (input *Input) SetFontWeight(weight string)
func (input *Input) SetLineHeight(lineHeight float32)
func (input *Input) SetNextFocusedElement(next *UI)
func (input *Input) SetNextFocusedInput(next *Input)
func (input *Input) SetPlaceholder(text string)
func (input *Input) SetRequired(required bool)
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)
func (input *Input) SetWrap(wrap bool)
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.ClearColorRanges
func (label *Label) ClearColorRanges()
ClearColorRanges drops every persisted color range overlay on this label
and re-runs the base color pass. Use this when a consumer wants to wipe all
overlays without changing the underlying text.
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.Justify
func (label *Label) Justify() rendering.FontJustify
Label.LabelData
func (l *Label) LabelData() *labelData
Label.LetterSpacing
func (label *Label) LetterSpacing() float32
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.SetFontFace
func (label *Label) SetFontFace(face rendering.FontFace)
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.SetLetterSpacing
func (label *Label) SetLetterSpacing(spacing float32)
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.AlignSelf
func (l *Layout) AlignSelf() FlexAlign
Layout.Border
func (l *Layout) Border() matrix.Vec4
Layout.CalcOffset
func (l *Layout) CalcOffset() matrix.Vec2
Layout.ClearStyles
func (l *Layout) ClearStyles()
Layout.ContentSize
func (l *Layout) ContentSize() matrix.Vec2
Layout.FlexBasis
func (l *Layout) FlexBasis() float32
Layout.FlexBasisAuto
func (l *Layout) FlexBasisAuto() bool
Layout.FlexBasisPercent
func (l *Layout) FlexBasisPercent() bool
Layout.FlexGrow
func (l *Layout) FlexGrow() float32
Layout.FlexOrder
func (l *Layout) FlexOrder() int
Layout.FlexShrink
func (l *Layout) FlexShrink() float32
Layout.GridColumnEnd
func (l *Layout) GridColumnEnd() int
Layout.GridColumnStart
func (l *Layout) GridColumnStart() int
Layout.GridRowEnd
func (l *Layout) GridRowEnd() int
Layout.GridRowStart
func (l *Layout) GridRowStart() int
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.SetAlignSelf
func (l *Layout) SetAlignSelf(align FlexAlign)
Layout.SetBorder
func (l *Layout) SetBorder(left, top, right, bottom float32)
Layout.SetFlexBasis
func (l *Layout) SetFlexBasis(basis float32, percent bool)
Layout.SetFlexBasisAuto
func (l *Layout) SetFlexBasisAuto()
Layout.SetFlexGrow
func (l *Layout) SetFlexGrow(grow float32)
Layout.SetFlexOrder
func (l *Layout) SetFlexOrder(order int)
Layout.SetFlexShrink
func (l *Layout) SetFlexShrink(shrink float32)
Layout.SetGridColumn
func (l *Layout) SetGridColumn(start, end int)
Layout.SetGridRow
func (l *Layout) SetGridRow(start, end int)
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
LayoutMode
int
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)
Manager.RootBackgroundColor
func (man *Manager) RootBackgroundColor() matrix.Color
RootBackgroundColor is the opaque backdrop that the top of the UI tree
composites against when computing calculated ("used") colors for halo-free
font rendering. It is the color a root-level transparent element resolves
to. Defaults to opaque black; a zero (fully transparent) value is treated as
opaque black so the calculated-color chain is always grounded on an opaque
backdrop.
Manager.SetRootBackgroundColor
func (man *Manager) SetRootBackgroundColor(c matrix.Color)
SetRootBackgroundColor overrides the backdrop used for calculated colors and
re-renders the root elements so the new value propagates down the tree.
Manager.Shutdown
func (man *Manager) Shutdown()
Shutdown synchronously detaches the Manager from its host: removes its
update from UIUpdater, detaches its Group from UILateUpdater, and removes
its window-resize handler. It also clears any UI elements still owned by the
Manager so the next Init starts clean.
This is safe to call when Manager hasn't been Init'd yet (no-op). It is also
idempotent — calling it twice in a row tears down nothing the second time.
After Shutdown the Manager can be Init'd again on the same or a different
host.
Without this, calling Init twice on the same Manager (which happens when a
workspace is disabled then re-enabled in the editor) leaves the previous
update callback registered, so two goroutines race on the same Manager's
iteration slices and panic with index-out-of-range.
Overflow
int
Panel
UI
FirstPanelOnEntity
func FirstPanelOnEntity(entity *engine.Entity) *Panel
Panel.AddChild
func (p *Panel) AddChild(target *UI)
Panel.AllowClickThrough
func (p *Panel) AllowClickThrough()
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.CalculatedBGColor
func (p *Panel) CalculatedBGColor() matrix.Color
CalculatedBGColor returns this panel's opaque "used" background color:
its own fill (which may be partially or fully transparent) alpha-composited
over its parent's calculated background, recursively up to the manager's
opaque root backdrop. This is the actual color a child element or its
text visually sits on. The font renderer uses it as the glyph-edge blend
target so anti-aliasing produces no halo, regardless of how transparent the
intervening panels are.
It is computed live by walking ancestors (cheap: tree depth is small
and this only runs while the UI is dirty/cleaning). The result is opaque
whenever the root backdrop is opaque (the default), which is why text
composited onto it can be rendered fully opaque and halo-free.
Panel.Child
func (p *Panel) Child(index int) *UI
Panel.ClearLayoutStyles
func (p *Panel) ClearLayoutStyles()
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.GetAspectRatio
func (p *Panel) GetAspectRatio() float32
Panel.GetMaxSize
func (p *Panel) GetMaxSize() matrix.Vec2
Panel.GetMinSize
func (p *Panel) GetMinSize() matrix.Vec2
Panel.GetUsesBorderBox
func (p *Panel) GetUsesBorderBox() bool
Panel.GridCellWidth
func (p *Panel) GridCellWidth() float32
GridCellWidth returns the computed width of a single grid column (based
on current panel dimensions, column count, and gap). Used by CSS width %
processing so children (e.g. div{width:100%}) fit their grid cell instead of
full parent.
Panel.GridColumns
func (p *Panel) GridColumns() int
Panel.GridGap
func (p *Panel) GridGap() matrix.Vec2
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.IsFlex
func (p *Panel) IsFlex() bool
Panel.IsFrozen
func (p *Panel) IsFrozen() bool
Panel.IsGrid
func (p *Panel) IsGrid() bool
func (p *Panel) IsScrolling() bool
func (p *Panel) MaxScroll() matrix.Vec2
Panel.OutlineColor
func (p *Panel) OutlineColor() matrix.Color
Panel.OutlineOffset
func (p *Panel) OutlineOffset() float32
Panel.OutlineOutset
func (p *Panel) OutlineOutset() float32
Panel.OutlineWidth
func (p *Panel) OutlineWidth() float32
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.SetAspectRatio
func (p *Panel) SetAspectRatio(r 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.SetBorderRadiusBottomLeft
func (p *Panel) SetBorderRadiusBottomLeft(r float32)
Panel.SetBorderRadiusBottomRight
func (p *Panel) SetBorderRadiusBottomRight(r float32)
Panel.SetBorderRadiusTopLeft
func (p *Panel) SetBorderRadiusTopLeft(r float32)
Panel.SetBorderRadiusTopRight
func (p *Panel) SetBorderRadiusTopRight(r 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.SetFlex
func (p *Panel) SetFlex()
Panel.SetFlexAlignContent
func (p *Panel) SetFlexAlignContent(align FlexAlignContent)
Panel.SetFlexAlignItems
func (p *Panel) SetFlexAlignItems(align FlexAlign)
Panel.SetFlexDirection
func (p *Panel) SetFlexDirection(direction FlexDirection)
Panel.SetFlexJustify
func (p *Panel) SetFlexJustify(justify FlexJustify)
Panel.SetFlexWrap
func (p *Panel) SetFlexWrap(wrap FlexWrap)
Panel.SetFlowLayout
func (p *Panel) SetFlowLayout()
Panel.SetGrid
func (p *Panel) SetGrid(columns int)
SetGrid enables CSS Grid-like layout with the given number of columns.
Children will be placed in row-major order into the grid cells. Column
widths are computed by dividing available width by columns (accounting for
gaps). Use SetGridGap to control spacing between items. This works with the
existing fit content and scrolling systems.
Panel.SetGridAutoColumns
func (p *Panel) SetGridAutoColumns(width float32)
Panel.SetGridAutoRows
func (p *Panel) SetGridAutoRows(height float32)
Panel.SetGridGap
func (p *Panel) SetGridGap(x, y float32)
Panel.SetGridTemplateColumns
func (p *Panel) SetGridTemplateColumns(columns []float32)
SetGridTemplateColumns configures explicit grid column widths. Positive
values are fixed pixels, negative values are fr units.
Panel.SetMaterial
func (p *Panel) SetMaterial(mat *rendering.Material)
Panel.SetMaxHeight
func (p *Panel) SetMaxHeight(h float32)
Panel.SetMaxWidth
func (p *Panel) SetMaxWidth(w float32)
Panel.SetMinHeight
func (p *Panel) SetMinHeight(h float32)
Panel.SetMinWidth
func (p *Panel) SetMinWidth(w float32)
Panel.SetOutline
func (p *Panel) SetOutline(width, offset float32, color 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.SetUseBlending
func (p *Panel) SetUseBlending(useBlending bool)
Panel.SetUsesBorderBox
func (p *Panel) SetUsesBorderBox(v 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.ClearOptions
func (s *Select) ClearOptions()
Select.Init
func (s *Select) Init(text string, options []SelectOption)
Select.IsDisabled
func (s *Select) IsDisabled() bool
Select.Name
func (s *Select) Name() string
Select.PickOption
func (s *Select) PickOption(index int)
Select.PickOptionByLabel
func (s *Select) PickOptionByLabel(label string)
Select.PickOptionByLabelWithoutEvent
func (s *Select) PickOptionByLabelWithoutEvent(label string)
Select.PickOptionWithoutEvent
func (s *Select) PickOptionWithoutEvent(index int) bool
Select.SelectData
func (s *Select) SelectData() *selectData
Select.SetColor
func (s *Select) SetColor(newColor matrix.Color)
Select.SetDisabled
func (s *Select) SetDisabled(disabled bool)
Select.SetOptionsColor
func (s *Select) SetOptionsColor(newColor matrix.Color)
Select.SetTextColor
func (s *Select) SetTextColor(newColor matrix.Color)
Select.Value
func (s *Select) Value() string
SelectOption
struct
type SelectOption struct {
Name string
Value string
// Has unexported fields.
}
SelectOptionCheckStylizer
struct
type SelectOptionCheckStylizer struct{ BasicStylizer }
SelectOptionCheckStylizer.ProcessStyle
func (s SelectOptionCheckStylizer) ProcessStyle(layout *Layout) []error
SelectOptionStylizer
struct
type SelectOptionStylizer struct{ BasicStylizer }
SelectOptionStylizer.ProcessStyle
func (s SelectOptionStylizer) ProcessStyle(layout *Layout) []error
SelectOptionTextStylizer
struct
type SelectOptionTextStylizer struct{ BasicStylizer }
SelectOptionTextStylizer.ProcessStyle
func (s SelectOptionTextStylizer) ProcessStyle(layout *Layout) []error
SelectTextStylizer
struct
type SelectTextStylizer struct{ BasicStylizer }
SelectTextStylizer.ProcessStyle
func (s SelectTextStylizer) ProcessStyle(layout *Layout) []error
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
OutlineColor matrix.Color
OutlineSize 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.IsDisabled
func (slider *Slider) IsDisabled() bool
Slider.SetBGColor
func (slider *Slider) SetBGColor(bgColor matrix.Color)
Slider.SetDisabled
func (slider *Slider) SetDisabled(disabled bool)
Slider.SetFGColor
func (slider *Slider) SetFGColor(fgColor matrix.Color)
Slider.SetValue
func (slider *Slider) SetValue(value float32)
Slider.SetValueWithoutEvent
func (slider *Slider) SetValueWithoutEvent(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
TextArea
Panel
TextArea.ApplyColorRange
func (textarea *TextArea) ApplyColorRange(start, end int, fg, bg matrix.Color)
ApplyColorRange colors a [start,end) rune range of the text area's content
in place (no glyph re-mesh), the same mechanism Label uses. SetText clears
color ranges, so re-apply after the text changes.
TextArea.Base
func (textarea *TextArea) Base() *UI
TextArea.ClearColorRanges
func (textarea *TextArea) ClearColorRanges()
ClearColorRanges removes all applied color ranges.
TextArea.Data
func (textarea *TextArea) Data() *textareaData
TextArea.Focus
func (textarea *TextArea) Focus()
TextArea.FontFace
func (textarea *TextArea) FontFace() rendering.FontFace
TextArea.FontSize
func (textarea *TextArea) FontSize() float32
TextArea.Init
func (textarea *TextArea) Init(placeholderText string)
TextArea.InsertText
func (textarea *TextArea) InsertText(text string)
TextArea.IsDisabled
func (textarea *TextArea) IsDisabled() bool
TextArea.IsFocused
func (textarea *TextArea) IsFocused() bool
TextArea.IsRequired
func (textarea *TextArea) IsRequired() bool
TextArea.IsValid
func (textarea *TextArea) IsValid() bool
TextArea.RemoveFocus
func (textarea *TextArea) RemoveFocus()
TextArea.SelectAll
func (textarea *TextArea) SelectAll()
TextArea.SetBGColor
func (textarea *TextArea) SetBGColor(newColor matrix.Color)
TextArea.SetCursorColor
func (textarea *TextArea) SetCursorColor(newColor matrix.Color)
TextArea.SetCursorOffset
func (textarea *TextArea) SetCursorOffset(offset int)
TextArea.SetDisabled
func (textarea *TextArea) SetDisabled(disabled bool)
TextArea.SetFGColor
func (textarea *TextArea) SetFGColor(newColor matrix.Color)
TextArea.SetFontFace
func (textarea *TextArea) SetFontFace(face rendering.FontFace)
TextArea.SetFontSize
func (textarea *TextArea) SetFontSize(fontSize float32)
TextArea.SetFontStyle
func (textarea *TextArea) SetFontStyle(style string)
TextArea.SetFontWeight
func (textarea *TextArea) SetFontWeight(weight string)
TextArea.SetLineHeight
func (textarea *TextArea) SetLineHeight(lineHeight float32)
TextArea.SetNextFocusedElement
func (textarea *TextArea) SetNextFocusedElement(next *UI)
TextArea.SetPlaceholder
func (textarea *TextArea) SetPlaceholder(text string)
TextArea.SetRequired
func (textarea *TextArea) SetRequired(required bool)
TextArea.SetSelectColor
func (textarea *TextArea) SetSelectColor(newColor matrix.Color)
TextArea.SetText
func (textarea *TextArea) SetText(text string)
TextArea.SetTextWithoutEvent
func (textarea *TextArea) SetTextWithoutEvent(text string)
TextArea.SetWrap
func (textarea *TextArea) SetWrap(wrap bool)
TextArea.Text
func (textarea *TextArea) Text() string
TextArea.TextAreaData
func (textarea *TextArea) TextAreaData() *textareaData
TriangleStylizer
struct
type TriangleStylizer struct{ BasicStylizer }
TriangleStylizer.ProcessStyle
func (t TriangleStylizer) 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.IsActive
func (ui *UI) IsActive() bool
UI.IsDisabled
func (ui *UI) IsDisabled() bool
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.IsValid
func (ui *UI) IsValid() 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.SetDisabled
func (ui *UI) SetDisabled(disabled bool)
UI.SetDontClean
func (ui *UI) SetDontClean(val bool)
UI.SetVisibility
func (ui *UI) SetVisibility(visible 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.ToTextArea
func (u *UI) ToTextArea() *TextArea
UI.Type
func (ui *UI) Type() ElementType
UI.Update
func (ui *UI) Update(deltaTime float64)
UIElementData
interface
type UIElementData interface {
// Has unexported methods.
}