Documentation
¶
Index ¶
- func BoolError(message string, want, got bool) string
- func IntError(message string, want, got int) string
- func PositionError(message string, want, got image.Point) string
- func SizeError(message string, want, got Size) string
- func StringError(message, want, got string) string
- type BlockLayout
- type Component
- type ComponentEngine
- type Core
- func (core *Core) AddChild(factory Factory) Component
- func (core *Core) ApplyColorProperty(name string, color color.RGBA)
- func (core *Core) ApplyPixelProperty(name string, px int)
- func (core *Core) ApplyProperty(prop theme.Property)
- func (core *Core) ApplyPropertyValue(name string, value string)
- func (core *Core) ApplyStyle(name string)
- func (core *Core) CausesFrameRedraw() bool
- func (core *Core) Children() []*Component
- func (core *Core) DisplayType() LayoutOptions
- func (core *Core) Events() *event.Queue
- func (core *Core) ForceFrameRedraw()
- func (core *Core) GetColorProperty(name string, fallbackColor color.RGBA) color.RGBA
- func (core *Core) GetPixelProperty(name string) int
- func (core *Core) GetSize() Size
- func (core *Core) GetZ() int
- func (core *Core) IsVisible() bool
- func (core *Core) Move(point image.Point)
- func (core *Core) MoveXY(x int, y int)
- func (core *Core) OnRender(renderer func(bounds image.Rectangle, screen *ebiten.Image))
- func (core *Core) OnStyleChange(listener StyleListener)
- func (core *Core) Position() image.Point
- func (core *Core) RemoveChild(child *Component)
- func (core *Core) Render(bounds image.Rectangle, screen *ebiten.Image)
- func (core *Core) ResolveFrameRedraw()
- func (core *Core) SetDisplayType(op LayoutOptions)
- func (core *Core) SetPosition(point image.Point)
- func (core *Core) SetPositionXY(x int, y int)
- func (core *Core) SetSize(size Size)
- func (core *Core) SetVisible(visible bool)
- func (core *Core) SetZ(z int)
- func (core *Core) Style() *map[string]theme.Property
- type Factory
- type FlexDirection
- type FlexLayout
- type FlexPosition
- type GridLayout
- type LayoutOptions
- type Size
- type State
- type StyleListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StringError ¶
Types ¶
type BlockLayout ¶
type BlockLayout struct{}
BlockLayout This layout does not manipulate any positions or sizes and just forwards the next child components for the layout phase
func (BlockLayout) ProcessLayout ¶
func (l BlockLayout) ProcessLayout(comp Component) []*Component
type ComponentEngine ¶
type ComponentEngine struct{}
func (ComponentEngine) RecalculatePositions ¶
func (e ComponentEngine) RecalculatePositions(rootComponent Component)
func (ComponentEngine) UpdateComponentTree ¶
func (e ComponentEngine) UpdateComponentTree(rootComponent Component)
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
func (*Core) ApplyColorProperty ¶
func (*Core) ApplyPixelProperty ¶
func (*Core) ApplyProperty ¶
func (*Core) ApplyPropertyValue ¶
func (*Core) ApplyStyle ¶
func (*Core) CausesFrameRedraw ¶
func (*Core) DisplayType ¶
func (core *Core) DisplayType() LayoutOptions
func (*Core) ForceFrameRedraw ¶
func (core *Core) ForceFrameRedraw()
func (*Core) GetColorProperty ¶
func (*Core) GetPixelProperty ¶
func (*Core) OnStyleChange ¶
func (core *Core) OnStyleChange(listener StyleListener)
func (*Core) RemoveChild ¶
func (*Core) ResolveFrameRedraw ¶
func (core *Core) ResolveFrameRedraw()
func (*Core) SetDisplayType ¶
func (core *Core) SetDisplayType(op LayoutOptions)
func (*Core) SetPosition ¶
func (*Core) SetPositionXY ¶
func (*Core) SetVisible ¶
type FlexDirection ¶
type FlexDirection string
const ( FlexRow FlexDirection = "row" FlexColumn FlexDirection = "column" )
type FlexLayout ¶
type FlexLayout struct { JustifyContent FlexPosition AlignItems FlexPosition Direction FlexDirection Gap int }
FlexLayout This layout can position based on horizontal and vertical layout
func Flex ¶
func Flex() FlexLayout
func FlexCentered ¶
func FlexCentered() FlexLayout
func (FlexLayout) Align ¶
func (l FlexLayout) Align(pos FlexPosition) FlexLayout
func (FlexLayout) Justify ¶
func (l FlexLayout) Justify(pos FlexPosition) FlexLayout
func (FlexLayout) ProcessLayout ¶
func (l FlexLayout) ProcessLayout(comp Component) []*Component
func (FlexLayout) UseDirection ¶
func (l FlexLayout) UseDirection(dir FlexDirection) FlexLayout
func (FlexLayout) UseGap ¶
func (l FlexLayout) UseGap(gap int) FlexLayout
type FlexPosition ¶
type FlexPosition string
const ( FlexStart FlexPosition = "flex-start" FlexCenter FlexPosition = "center" FlexEnd FlexPosition = "flex-end" )
type GridLayout ¶
func (GridLayout) ProcessLayout ¶
func (g GridLayout) ProcessLayout(comp Component) []*Component
func (GridLayout) UseColumns ¶
func (g GridLayout) UseColumns(cols int) GridLayout
func (GridLayout) UseGap ¶
func (g GridLayout) UseGap(gap int) GridLayout
type LayoutOptions ¶
func NewBlockLayout ¶
func NewBlockLayout() LayoutOptions
func NewGridLayout ¶
func NewGridLayout() LayoutOptions
type Size ¶
func SizeFromBounds ¶
type State ¶
type State[T any] struct { Initial T // contains filtered or unexported fields }
func (*State[T]) OnChange ¶
func (state *State[T]) OnChange(listener func(new T))
OnChange allows to listen to state changes of the current state object
type StyleListener ¶
Click to show internal directories.
Click to hide internal directories.