Documentation ¶
Index ¶
- Constants
- Variables
- func Build[T baseIniter[T]](v T) T
- func DebugCounter() int64
- func Find[T any](e Entity, fn func(v *T))
- type AutoHeightLayout
- type B
- func (b *B) Add(e Entity)
- func (b *B) Begin(e Entity)
- func (b *B) BeginButton() *WButton
- func (b *B) BeginContainer(l ...Layouter) *WContainer
- func (b *B) BeginFlex(sizes ...float32) *WFlex
- func (b *B) BeginGrid(cols, rows int) *WGrid
- func (b *B) BeginList(spacing float32) *WList
- func (b *B) BeginMask() *WMask
- func (b *B) BeginPane() *WPane
- func (b *B) BeginPanel() *WPanel
- func (b *B) Button() *WButton
- func (b *B) ClientArea()
- func (b *B) ColorPicker() *WColorPicker
- func (b *B) Container() *WContainer
- func (b *B) Do(fn BuildFunc)
- func (b *B) End()
- func (b *B) EndButton()
- func (b *B) EndContainer()
- func (b *B) EndFlex()
- func (b *B) EndGrid()
- func (b *B) EndList()
- func (b *B) EndMask()
- func (b *B) EndPane()
- func (b *B) EndPanel()
- func (b *B) Label(t string) *WLabel
- func (b *B) Pane() *WPane
- func (b *B) Root() Entity
- func (b *B) SetRoot(e Entity)
- func (b *B) Slider(min, max float32) *WSlider
- func (b *B) Spinner(lbl string) *WSpinner
- func (b *B) SpinnerVec3() *WSpinnerVec3
- func (b *B) TextButton(t string) *WTextButton
- func (b *B) Tree(n *TreeNode) *WTree
- type BuildFunc
- type Direction
- type Entity
- type EventClick
- type EventValueChanged
- type FlexLayout
- type GridLayout
- type LayoutFunc
- type Layouter
- type ListLayout
- type MultiLayout
- type Observer
- type Overflow
- type Path
- type TreeNode
- type WButton
- type WColorPicker
- type WContainer
- type WCustom
- type WFlex
- type WGrid
- type WLabel
- func (w *WLabel) Build(b *B)
- func (w *WLabel) SetAutoSize(b bool) *WLabel
- func (w *WLabel) SetColor(vs ...float32) *WLabel
- func (w *WLabel) SetFont(font *text.Font) *WLabel
- func (w *WLabel) SetFontScale(v float32) *WLabel
- func (w *WLabel) SetOverflow(o text.Overflow) *WLabel
- func (w *WLabel) SetText(text string) *WLabel
- func (w *WLabel) SetTextAlign(a ...text.Align) *WLabel
- func (w *WLabel) SetTextf(f string, args ...any) *WLabel
- type WList
- type WMask
- type WPane
- func (w *WPane) Build(b *B)
- func (w *WPane) SetBorderColor(vs ...float32) *WPane
- func (w *WPane) SetBorderRadius(r float32) *WPane
- func (w *WPane) SetColor(vs ...float32) *WPane
- func (w *WPane) SetLayout(l ...Layouter) *WPane
- func (w *WPane) SetMaterial(mat gorge.Materialer) *WPane
- func (w *WPane) SetTexture(tex gorge.Texturer) *WPane
- type WPanel
- type WQuad
- type WScroll
- type WScrollbar
- type WSlider
- func (w *WSlider) Build(b *B)
- func (w *WSlider) OnChange(f func(float32)) *WSlider
- func (w *WSlider) SetFontScale(v float32) *WSlider
- func (w *WSlider) SetFormat(f string) *WSlider
- func (w *WSlider) SetMax(v float32) *WSlider
- func (w *WSlider) SetMin(v float32) *WSlider
- func (w *WSlider) SetValue(v float32) *WSlider
- type WSpinner
- func (w *WSpinner) Build(b *B)
- func (w *WSpinner) OnChange(fn func(float32)) *WSpinner
- func (w *WSpinner) SetLabel(t string) *WSpinner
- func (w *WSpinner) SetLabelColor(c ...float32) *WSpinner
- func (w *WSpinner) SetLabelTextColor(c ...float32) *WSpinner
- func (w *WSpinner) SetTextColor(c ...float32) *WSpinner
- func (w *WSpinner) SetValue(v float32) *WSpinner
- type WSpinnerVec3
- type WTextButton
- func (w *WTextButton) Build(b *B)
- func (w *WTextButton) FadeFactor(f float32) *WTextButton
- func (w *WTextButton) OnClick(fn func()) *WTextButton
- func (w *WTextButton) SetColor(vs ...float32) *WTextButton
- func (w *WTextButton) SetFontScale(s float32) *WTextButton
- func (w *WTextButton) SetHighlightColor(vs ...float32) *WTextButton
- func (w *WTextButton) SetPressedColor(vs ...float32) *WTextButton
- func (w *WTextButton) SetText(t string) *WTextButton
- type WTree
- type Widget
- func (w *Widget[T]) Add(cs ...gorge.Entity) *T
- func (w *Widget[T]) Attached(e gorgeui.Entity)
- func (w *Widget[T]) CalcMax() gm.Vec2
- func (w *Widget[T]) FillParent() *T
- func (w *Widget[T]) Find(id string) Entity
- func (w *Widget[T]) GetClientArea() Entity
- func (w *Widget[T]) HandleEvent(evt event.Event)
- func (w *Widget[T]) ID() string
- func (w *Widget[T]) IntersectFromScreen(pos gm.Vec2) ray.Result
- func (w *Widget[T]) IsMasked() bool
- func (w *Widget[T]) Remove(cs ...gorge.Entity) *T
- func (w *Widget[T]) SetAnchor(vs ...float32) *T
- func (w *Widget[T]) SetBorder(vs ...float32) *T
- func (w *Widget[T]) SetClientArea(a Entity) *T
- func (w *Widget[T]) SetDisableRaycast(b bool) *T
- func (w *Widget[T]) SetDragEvents(b bool) *T
- func (w *Widget[T]) SetHeight(v float32) *T
- func (w *Widget[T]) SetID(id string)
- func (w *Widget[T]) SetMargin(vs ...float32) *T
- func (w *Widget[T]) SetName(name string) *T
- func (w *Widget[T]) SetPivot(vs ...float32) *T
- func (w *Widget[T]) SetPosition(x, y, z float32) *T
- func (w *Widget[T]) SetRect(vs ...float32) *T
- func (w *Widget[T]) SetSize(v ...float32) *T
- func (w *Widget[T]) SetWidth(v float32) *T
- func (w *Widget[T]) String() string
Constants ¶
const ( OverflowVisible = Overflow(iota) OverflowHidden OverflowScroll )
Variables ¶
var Debug = false
Debug prints reference debug
Functions ¶
func DebugCounter ¶
func DebugCounter() int64
DebugCounter returns the number of gorlets instantiated.
Types ¶
type AutoHeightLayout ¶
type AutoHeightLayout struct {
Spacing float32
}
func AutoHeight ¶
func AutoHeight(spacing float32) *AutoHeightLayout
AutoHeight be resize to content.
func (AutoHeightLayout) Layout ¶
func (l AutoHeightLayout) Layout(ent Entity)
type B ¶
type B struct {
// contains filtered or unexported fields
}
func (*B) BeginButton ¶
func (*B) BeginContainer ¶
func (b *B) BeginContainer(l ...Layouter) *WContainer
func (*B) BeginPanel ¶
func (*B) ClientArea ¶
func (b *B) ClientArea()
func (*B) ColorPicker ¶
func (b *B) ColorPicker() *WColorPicker
func (*B) Container ¶
func (b *B) Container() *WContainer
func (*B) EndContainer ¶
func (b *B) EndContainer()
func (*B) SpinnerVec3 ¶
func (b *B) SpinnerVec3() *WSpinnerVec3
func (*B) TextButton ¶
func (b *B) TextButton(t string) *WTextButton
type EventClick ¶
type EventClick struct{} // need more info
EventClick is trigger when an event is clicked.
type EventValueChanged ¶
type EventValueChanged struct{ Value any }
EventValueChanged triggered when an input value is changed.
type FlexLayout ¶
type FlexLayout struct { Spacing float32 Direction Direction // contains filtered or unexported fields }
FlexLayout will redimension children based on sizes.
func LayoutFlexHorizontal ¶
func LayoutFlexHorizontal(sizes ...float32) *FlexLayout
LayoutFlexHorizontal automatically layout children horizontally based on sizes.
func LayoutFlexVertical ¶
func LayoutFlexVertical(sizes ...float32) *FlexLayout
LayoutFlexVertical automatically layout children vertically based on sizes.
func (FlexLayout) Layout ¶
func (l FlexLayout) Layout(ent Entity)
Layout implements layouter interface.
func (*FlexLayout) SetDirection ¶
func (l *FlexLayout) SetDirection(d Direction)
func (*FlexLayout) SetSizes ¶
func (l *FlexLayout) SetSizes(sizes ...float32)
SetSizes sets new sizes and recalculates flex.
func (*FlexLayout) SetSpacing ¶
func (l *FlexLayout) SetSpacing(spacing float32)
func (*FlexLayout) String ¶
func (f *FlexLayout) String() string
type GridLayout ¶
GridLayout creates a grid layouter that organizes children in a grid
func LayoutGrid ¶
func LayoutGrid(cols, rows int, spacing float32) *GridLayout
LayoutGrid creates a grid probably only needs one dimension.
func (*GridLayout) Layout ¶
func (l *GridLayout) Layout(ent Entity)
Layout implements layouter interface.
func (*GridLayout) SetDimensions ¶
func (l *GridLayout) SetDimensions(cols, rows int)
func (*GridLayout) SetSpacing ¶
func (l *GridLayout) SetSpacing(spacing float32)
type LayoutFunc ¶
type LayoutFunc func(ent Entity)
LayoutFunc type of func to be attached in UI element to update layout.
func (LayoutFunc) Layout ¶
func (fn LayoutFunc) Layout(ent Entity)
Layout implements layouter interface.
type Layouter ¶
type Layouter interface {
Layout(Entity)
}
Layouter interface for layouting entities.
type ListLayout ¶
ListLayout layouter that will rearrange children vertically.
func LayoutList ¶
func LayoutList(spacing float32) *ListLayout
LayoutList returns a func that will automatically layout children vertically based on sizes.
func (*ListLayout) SetDirection ¶
func (l *ListLayout) SetDirection(v Direction)
func (*ListLayout) SetSpacing ¶
func (l *ListLayout) SetSpacing(v float32)
type MultiLayout ¶
type MultiLayout []Layouter
func LayoutMulti ¶
func LayoutMulti(ls ...Layouter) MultiLayout
func (MultiLayout) Layout ¶
func (l MultiLayout) Layout(ent Entity)
func (MultiLayout) String ¶
func (l MultiLayout) String() string
type WButton ¶
func (*WButton) FadeFactor ¶
type WColorPicker ¶
type WColorPicker struct { Widget[WColorPicker] // contains filtered or unexported fields }
func ColorPicker ¶
func ColorPicker() *WColorPicker
func (*WColorPicker) Build ¶
func (w *WColorPicker) Build(b *B)
func (*WColorPicker) OnChange ¶
func (w *WColorPicker) OnChange(fn func(gm.Vec4)) *WColorPicker
func (*WColorPicker) SetValue ¶
func (w *WColorPicker) SetValue(c gm.Vec4) *WColorPicker
type WContainer ¶
type WContainer struct { Widget[WContainer] // contains filtered or unexported fields }
func Container ¶
func Container(c ...gorge.Entity) *WContainer
func (*WContainer) Build ¶
func (w *WContainer) Build(b *B)
func (*WContainer) SetLayout ¶
func (w *WContainer) SetLayout(l ...Layouter) *WContainer
type WCustom ¶
func (*WCustom) ObserveType ¶
type WMask ¶
func (*WMask) SetBorderRadius ¶
type WPane ¶
func (*WPane) SetBorderColor ¶
func (*WPane) SetBorderRadius ¶
func (*WPane) SetMaterial ¶
func (w *WPane) SetMaterial(mat gorge.Materialer) *WPane
type WPanel ¶
func (*WPanel) SetBorderColor ¶
func (*WPanel) SetOverflow ¶
func (*WPanel) SetScrollSize ¶
type WScroll ¶
func (*WScroll) SetScrollSize ¶
type WScrollbar ¶
type WScrollbar struct { Widget[WScrollbar] // contains filtered or unexported fields }
func Scrollbar ¶
func Scrollbar(dir Direction) *WScrollbar
func (*WScrollbar) Build ¶
func (w *WScrollbar) Build(b *B)
func (*WScrollbar) OnChange ¶
func (w *WScrollbar) OnChange(fn func(v float32)) *WScrollbar
func (*WScrollbar) SetMax ¶
func (w *WScrollbar) SetMax(v float32) *WScrollbar
func (*WScrollbar) SetValue ¶
func (w *WScrollbar) SetValue(v float32) *WScrollbar
type WSlider ¶
func (*WSlider) SetFontScale ¶
type WSpinner ¶
func (*WSpinner) SetLabelColor ¶
func (*WSpinner) SetLabelTextColor ¶
func (*WSpinner) SetTextColor ¶
type WSpinnerVec3 ¶
type WSpinnerVec3 struct { Widget[WSpinnerVec3] // contains filtered or unexported fields }
func SpinnerVec3 ¶
func SpinnerVec3() *WSpinnerVec3
func (*WSpinnerVec3) Build ¶
func (w *WSpinnerVec3) Build(b *B)
func (*WSpinnerVec3) OnChange ¶
func (w *WSpinnerVec3) OnChange(fn func(v gm.Vec3)) *WSpinnerVec3
func (*WSpinnerVec3) SetValue ¶
func (w *WSpinnerVec3) SetValue(v gm.Vec3) *WSpinnerVec3
type WTextButton ¶
type WTextButton struct { Widget[WTextButton] // contains filtered or unexported fields }
func TextButton ¶
func TextButton(t string) *WTextButton
func (*WTextButton) Build ¶
func (w *WTextButton) Build(b *B)
func (*WTextButton) FadeFactor ¶
func (w *WTextButton) FadeFactor(f float32) *WTextButton
func (*WTextButton) OnClick ¶
func (w *WTextButton) OnClick(fn func()) *WTextButton
func (*WTextButton) SetColor ¶
func (w *WTextButton) SetColor(vs ...float32) *WTextButton
func (*WTextButton) SetFontScale ¶
func (w *WTextButton) SetFontScale(s float32) *WTextButton
func (*WTextButton) SetHighlightColor ¶
func (w *WTextButton) SetHighlightColor(vs ...float32) *WTextButton
func (*WTextButton) SetPressedColor ¶
func (w *WTextButton) SetPressedColor(vs ...float32) *WTextButton
func (*WTextButton) SetText ¶
func (w *WTextButton) SetText(t string) *WTextButton
type Widget ¶
type Widget[T any] struct { gorgeui.RectComponent gorgeui.ElementComponent gorge.Container // contains filtered or unexported fields }
func (*Widget[T]) CalcMax ¶
CalcMax calculates children bounds and positions and return min max Calc maximum of the children
func (*Widget[T]) FillParent ¶
func (w *Widget[T]) FillParent() *T
func (*Widget[T]) GetClientArea ¶
func (*Widget[T]) HandleEvent ¶
HandleEvent handles events.
func (*Widget[T]) IntersectFromScreen ¶
IntersectFromScreen intersects the entity rect from screen coordinates.
func (*Widget[T]) IsMasked ¶
IsMasked returns true if the widget is masked so it won't receive further events outside of its bounds.
func (*Widget[T]) SetClientArea ¶
func (*Widget[T]) SetDisableRaycast ¶
func (*Widget[T]) SetDragEvents ¶
func (*Widget[T]) SetPosition ¶
Source Files ¶
- builder.go
- container_flex.go
- container_grid.go
- container_list.go
- events.go
- gorlet.go
- gorlet_button.go
- gorlet_colors.go
- gorlet_container.go
- gorlet_custom.go
- gorlet_label.go
- gorlet_mask.go
- gorlet_pane.go
- gorlet_panel.go
- gorlet_quad.go
- gorlet_scroll.go
- gorlet_slider.go
- gorlet_spinner.go
- gorlet_spinnervec3.go
- gorlet_textbutton.go
- helpers.go
- layout.go
- layout_flex.go
- layout_grid.go
- layout_list.go
- primitive.go
- stencil.go
- x_tree.go