Documentation ¶
Index ¶
- Constants
- func ClickAndDragWindow(window *Window, hitbox Hitbox, c controller.Controller)
- func LoadFont(fontData []byte) (*truetype.Font, error)
- func LoadFontFromFile(fontfile string) (*truetype.Font, error)
- func NewUiController(window *Window) controller.Controller
- func SetProgressBar(pb *Window, progress int)
- type Activatable
- type Children
- type Container
- func (c *Container) AddChildren(children ...Element)
- func (c *Container) ElementById(id string) Element
- func (c *Container) GetChildren() Children
- func (c *Container) GetId() string
- func (c *Container) GlobalOrthoOrder() int
- func (c *Container) ReRender()
- func (c *Container) RemoveAllChildren()
- func (c *Container) RemoveChildren(children ...Element)
- func (c *Container) Render(size, offset mgl32.Vec2) mgl32.Vec2
- func (c *Container) SetBackgroundColor(r, g, b, a uint8)
- func (c *Container) SetBackgroundImage(img image.Image)
- func (c *Container) SetHeight(height float32)
- func (c *Container) SetId(id string)
- func (c *Container) SetMargin(margin Margin)
- func (c *Container) SetMarginPercent(marginPercent MarginPercentages)
- func (c *Container) SetPadding(padding Margin)
- func (c *Container) SetPaddingPercent(paddingPercent MarginPercentages)
- func (c *Container) SetWidth(width float32)
- func (c *Container) Spatial() renderer.Spatial
- func (c *Container) TextElementById(id string) *TextElement
- func (c *Container) UsePercentHeight(usePercent bool)
- func (c *Container) UsePercentWidth(usePercent bool)
- type Dropdown
- func (dd *Dropdown) Activate()
- func (dd *Dropdown) Active() bool
- func (dd *Dropdown) AddOnBlur(handler func())
- func (dd *Dropdown) AddOnChange(handler func(string))
- func (dd *Dropdown) AddOnFocus(handler func())
- func (dd *Dropdown) AddOnKeyPress(handler func(key string, release bool))
- func (dd *Dropdown) CloseDropdown()
- func (dd *Dropdown) Deactivate()
- func (dd *Dropdown) GetChildren() Children
- func (dd *Dropdown) GetHiddenText() string
- func (dd *Dropdown) GetHitbox() Hitbox
- func (dd *Dropdown) GetId() string
- func (dd *Dropdown) GetText() string
- func (dd *Dropdown) GlobalOrthoOrder() int
- func (dd *Dropdown) OpenDropdown()
- func (dd *Dropdown) ReRender()
- func (dd *Dropdown) Render(size, offset mgl32.Vec2) mgl32.Vec2
- func (dd *Dropdown) SetBackgroundColor(r, g, b, a uint8)
- func (dd *Dropdown) SetBackgroundImage(img image.Image)
- func (dd *Dropdown) SetFont(textFont *truetype.Font) *Dropdown
- func (dd *Dropdown) SetHeight(height float32)
- func (dd *Dropdown) SetHidden(hidden bool) *Dropdown
- func (dd *Dropdown) SetId(id string)
- func (dd *Dropdown) SetMargin(margin Margin)
- func (dd *Dropdown) SetMarginPercent(marginPercent MarginPercentages)
- func (dd *Dropdown) SetPadding(padding Margin)
- func (dd *Dropdown) SetPaddingPercent(paddingPercent MarginPercentages)
- func (dd *Dropdown) SetPlaceholder(placeholder string) *Dropdown
- func (dd *Dropdown) SetText(text string) *Dropdown
- func (dd *Dropdown) SetTextColor(textColor color.Color) *Dropdown
- func (dd *Dropdown) SetTextSize(textSize float32) *Dropdown
- func (dd *Dropdown) SetWidth(width float32)
- func (dd *Dropdown) Spatial() renderer.Spatial
- func (dd *Dropdown) ToggleDropdown()
- func (dd *Dropdown) UsePercentHeight(usePercent bool)
- func (dd *Dropdown) UsePercentWidth(usePercent bool)
- type Element
- type Hitbox
- type HitboxImpl
- func (hb *HitboxImpl) AddOnClick(handler func(button int, release bool, position mgl32.Vec2))
- func (hb *HitboxImpl) AddOnHover(handler func())
- func (hb *HitboxImpl) AddOnMouseMove(handler func(position mgl32.Vec2))
- func (hb *HitboxImpl) AddOnUnHover(handler func())
- func (hb *HitboxImpl) MouseClick(button int, release bool, position mgl32.Vec2) bool
- func (hb *HitboxImpl) MouseMove(position mgl32.Vec2) bool
- func (hb *HitboxImpl) SetSize(size mgl32.Vec2)
- type HtmlAssets
- type ImageElement
- func (ie *ImageElement) GetChildren() Children
- func (ie *ImageElement) GetId() string
- func (ie *ImageElement) GlobalOrthoOrder() int
- func (ie *ImageElement) ReRender()
- func (ie *ImageElement) Render(size, offset mgl32.Vec2) mgl32.Vec2
- func (ie *ImageElement) SetHeight(height float32)
- func (ie *ImageElement) SetId(id string)
- func (ie *ImageElement) SetImage(img image.Image)
- func (ie *ImageElement) SetRotation(rotation float32)
- func (ie *ImageElement) SetWidth(width float32)
- func (ie *ImageElement) Spatial() renderer.Spatial
- func (ie *ImageElement) UsePercentHeight(usePercent bool)
- func (ie *ImageElement) UsePercentWidth(usePercent bool)
- type Margin
- type MarginPercentages
- type TextElement
- func (te *TextElement) AddOnKeyPress(handler func(key string, release bool))
- func (te *TextElement) GetChildren() Children
- func (te *TextElement) GetHiddenText() string
- func (te *TextElement) GetId() string
- func (te *TextElement) GetText() string
- func (te *TextElement) GlobalOrthoOrder() int
- func (te *TextElement) ReRender()
- func (te *TextElement) Render(size, offset mgl32.Vec2) mgl32.Vec2
- func (te *TextElement) SetAlign(align int)
- func (te *TextElement) SetFont(textFont *truetype.Font) *TextElement
- func (te *TextElement) SetHeight(height float32) *TextElement
- func (te *TextElement) SetHidden(hidden bool) *TextElement
- func (te *TextElement) SetId(id string)
- func (te *TextElement) SetPlaceholder(placeholder string) *TextElement
- func (te *TextElement) SetText(text string) *TextElement
- func (te *TextElement) SetTextColor(textColor color.Color) *TextElement
- func (te *TextElement) SetTextSize(textSize float32) *TextElement
- func (te *TextElement) SetWidth(width float32) *TextElement
- func (te *TextElement) Spatial() renderer.Spatial
- type TextField
- func (tf *TextField) Activate()
- func (tf *TextField) Active() bool
- func (tf *TextField) AddOnBlur(handler func())
- func (tf *TextField) AddOnChange(handler func(string))
- func (tf *TextField) AddOnFocus(handler func())
- func (tf *TextField) AddOnKeyPress(handler func(key string, release bool))
- func (tf *TextField) Deactivate()
- func (tf *TextField) GetChildren() Children
- func (tf *TextField) GetHiddenText() string
- func (tf *TextField) GetHitbox() Hitbox
- func (tf *TextField) GetId() string
- func (tf *TextField) GetText() string
- func (tf *TextField) GlobalOrthoOrder() int
- func (tf *TextField) ReRender()
- func (tf *TextField) Render(size, offset mgl32.Vec2) mgl32.Vec2
- func (tf *TextField) RenderCursor()
- func (tf *TextField) SetBackgroundColor(r, g, b, a uint8)
- func (tf *TextField) SetBackgroundImage(img image.Image)
- func (tf *TextField) SetFont(textFont *truetype.Font) *TextField
- func (tf *TextField) SetHeight(height float32)
- func (tf *TextField) SetHidden(hidden bool) *TextField
- func (tf *TextField) SetId(id string)
- func (tf *TextField) SetMargin(margin Margin)
- func (tf *TextField) SetMarginPercent(marginPercent MarginPercentages)
- func (tf *TextField) SetPadding(padding Margin)
- func (tf *TextField) SetPaddingPercent(paddingPercent MarginPercentages)
- func (tf *TextField) SetPlaceholder(placeholder string) *TextField
- func (tf *TextField) SetText(text string) *TextField
- func (tf *TextField) SetTextColor(textColor color.Color) *TextField
- func (tf *TextField) SetTextSize(textSize float32) *TextField
- func (tf *TextField) SetWidth(width float32)
- func (tf *TextField) Spatial() renderer.Spatial
- func (tf *TextField) UsePercentHeight(usePercent bool)
- func (tf *TextField) UsePercentWidth(usePercent bool)
- type Window
- func (w *Window) BoundingRadius() float32
- func (w *Window) Center() mgl32.Vec3
- func (w *Window) Destroy(renderer renderer.Renderer)
- func (w *Window) Draw(renderer renderer.Renderer, transform mgl32.Mat4)
- func (w *Window) ElementById(id string) Element
- func (w *Window) Optimize(geometry *renderer.Geometry, transform mgl32.Mat4)
- func (w *Window) OrthoOrder() int
- func (w *Window) Render()
- func (w *Window) SetBackgroundColor(r, g, b, a uint8)
- func (w *Window) SetElement(element Element)
- func (w *Window) SetOrientation(orientation mgl32.Quat)
- func (w *Window) SetParent(parent *renderer.Node)
- func (w *Window) SetScale(scale mgl32.Vec3)
- func (w *Window) SetTranslation(translation mgl32.Vec3)
- func (w *Window) TextElementById(id string) *TextElement
Constants ¶
View Source
const ( LEFT_ALIGN int = iota CENTER_ALIGN RIGHT_ALIGN )
Variables ¶
This section is empty.
Functions ¶
func ClickAndDragWindow ¶
func ClickAndDragWindow(window *Window, hitbox Hitbox, c controller.Controller)
func NewUiController ¶
func NewUiController(window *Window) controller.Controller
func SetProgressBar ¶
Types ¶
type Activatable ¶
type Activatable interface { Active() bool Activate() Deactivate() }
func LoadHTML ¶
func LoadHTML(container *Container, htmlInput, cssInput io.Reader, assets HtmlAssets) ([]Activatable, error)
LoadHTML - load the html/css code into the container
type Children ¶
type Children []Element
func (Children) GetChildById ¶
func (Children) TextElementById ¶
func (c Children) TextElementById(id string) *TextElement
type Container ¶
type Container struct { Hitbox Hitbox GlobalOrthoOrderValue int // contains filtered or unexported fields }
func NewContainer ¶
func NewContainer() *Container
func (*Container) AddChildren ¶
func (*Container) ElementById ¶
func (*Container) GetChildren ¶
func (*Container) GlobalOrthoOrder ¶
func (*Container) RemoveAllChildren ¶
func (c *Container) RemoveAllChildren()
func (*Container) RemoveChildren ¶
func (*Container) SetBackgroundColor ¶
func (*Container) SetBackgroundImage ¶
func (*Container) SetMarginPercent ¶
func (c *Container) SetMarginPercent(marginPercent MarginPercentages)
func (*Container) SetPadding ¶
func (*Container) SetPaddingPercent ¶
func (c *Container) SetPaddingPercent(paddingPercent MarginPercentages)
func (*Container) TextElementById ¶
func (c *Container) TextElementById(id string) *TextElement
func (*Container) UsePercentHeight ¶
func (*Container) UsePercentWidth ¶
type Dropdown ¶
type Dropdown struct { Parent Element // contains filtered or unexported fields }
func NewDropdown ¶
func (*Dropdown) AddOnChange ¶
func (*Dropdown) AddOnFocus ¶
func (dd *Dropdown) AddOnFocus(handler func())
func (*Dropdown) AddOnKeyPress ¶
func (*Dropdown) CloseDropdown ¶
func (dd *Dropdown) CloseDropdown()
func (*Dropdown) Deactivate ¶
func (dd *Dropdown) Deactivate()
func (*Dropdown) GetChildren ¶
func (*Dropdown) GetHiddenText ¶
func (*Dropdown) GlobalOrthoOrder ¶
func (*Dropdown) OpenDropdown ¶
func (dd *Dropdown) OpenDropdown()
func (*Dropdown) SetBackgroundColor ¶
func (*Dropdown) SetBackgroundImage ¶
func (*Dropdown) SetMarginPercent ¶
func (dd *Dropdown) SetMarginPercent(marginPercent MarginPercentages)
func (*Dropdown) SetPadding ¶
func (*Dropdown) SetPaddingPercent ¶
func (dd *Dropdown) SetPaddingPercent(paddingPercent MarginPercentages)
func (*Dropdown) SetPlaceholder ¶
func (*Dropdown) SetTextSize ¶
func (*Dropdown) ToggleDropdown ¶
func (dd *Dropdown) ToggleDropdown()
func (*Dropdown) UsePercentHeight ¶
func (*Dropdown) UsePercentWidth ¶
type Hitbox ¶
type Hitbox interface { AddOnClick(handler func(button int, release bool, position mgl32.Vec2)) AddOnHover(handler func()) AddOnUnHover(handler func()) AddOnMouseMove(handler func(position mgl32.Vec2)) MouseMove(position mgl32.Vec2) bool MouseClick(button int, release bool, position mgl32.Vec2) bool SetSize(size mgl32.Vec2) }
type HitboxImpl ¶
type HitboxImpl struct {
// contains filtered or unexported fields
}
func (*HitboxImpl) AddOnClick ¶
func (hb *HitboxImpl) AddOnClick(handler func(button int, release bool, position mgl32.Vec2))
func (*HitboxImpl) AddOnHover ¶
func (hb *HitboxImpl) AddOnHover(handler func())
func (*HitboxImpl) AddOnMouseMove ¶
func (hb *HitboxImpl) AddOnMouseMove(handler func(position mgl32.Vec2))
func (*HitboxImpl) AddOnUnHover ¶
func (hb *HitboxImpl) AddOnUnHover(handler func())
func (*HitboxImpl) MouseClick ¶
func (*HitboxImpl) SetSize ¶
func (hb *HitboxImpl) SetSize(size mgl32.Vec2)
type HtmlAssets ¶
type HtmlAssets struct {
// contains filtered or unexported fields
}
func NewHtmlAssets ¶
func NewHtmlAssets() HtmlAssets
func (HtmlAssets) AddCallback ¶
func (assets HtmlAssets) AddCallback(key string, callback func(element Element, args ...interface{}))
type ImageElement ¶
type ImageElement struct { Hitbox Hitbox // contains filtered or unexported fields }
func NewImageElement ¶
func NewImageElement(img image.Image) *ImageElement
func (*ImageElement) GetChildren ¶
func (ie *ImageElement) GetChildren() Children
func (*ImageElement) GetId ¶
func (ie *ImageElement) GetId() string
func (*ImageElement) GlobalOrthoOrder ¶
func (ie *ImageElement) GlobalOrthoOrder() int
func (*ImageElement) ReRender ¶
func (ie *ImageElement) ReRender()
func (*ImageElement) SetHeight ¶
func (ie *ImageElement) SetHeight(height float32)
func (*ImageElement) SetId ¶
func (ie *ImageElement) SetId(id string)
func (*ImageElement) SetImage ¶
func (ie *ImageElement) SetImage(img image.Image)
func (*ImageElement) SetRotation ¶
func (ie *ImageElement) SetRotation(rotation float32)
func (*ImageElement) SetWidth ¶
func (ie *ImageElement) SetWidth(width float32)
func (*ImageElement) Spatial ¶
func (ie *ImageElement) Spatial() renderer.Spatial
func (*ImageElement) UsePercentHeight ¶
func (ie *ImageElement) UsePercentHeight(usePercent bool)
func (*ImageElement) UsePercentWidth ¶
func (ie *ImageElement) UsePercentWidth(usePercent bool)
type MarginPercentages ¶
type MarginPercentages struct {
Top, Right, Bottom, Left bool
}
func NewMarginPercentages ¶
func NewMarginPercentages(percentage bool) MarginPercentages
type TextElement ¶
type TextElement struct {
// contains filtered or unexported fields
}
func NewTextElement ¶
func (*TextElement) AddOnKeyPress ¶
func (te *TextElement) AddOnKeyPress(handler func(key string, release bool))
func (*TextElement) GetChildren ¶
func (te *TextElement) GetChildren() Children
func (*TextElement) GetHiddenText ¶
func (te *TextElement) GetHiddenText() string
func (*TextElement) GetId ¶
func (te *TextElement) GetId() string
func (*TextElement) GetText ¶
func (te *TextElement) GetText() string
func (*TextElement) GlobalOrthoOrder ¶
func (te *TextElement) GlobalOrthoOrder() int
func (*TextElement) ReRender ¶
func (te *TextElement) ReRender()
func (*TextElement) SetAlign ¶
func (te *TextElement) SetAlign(align int)
func (*TextElement) SetFont ¶
func (te *TextElement) SetFont(textFont *truetype.Font) *TextElement
func (*TextElement) SetHeight ¶
func (te *TextElement) SetHeight(height float32) *TextElement
func (*TextElement) SetHidden ¶
func (te *TextElement) SetHidden(hidden bool) *TextElement
func (*TextElement) SetId ¶
func (te *TextElement) SetId(id string)
func (*TextElement) SetPlaceholder ¶
func (te *TextElement) SetPlaceholder(placeholder string) *TextElement
func (*TextElement) SetText ¶
func (te *TextElement) SetText(text string) *TextElement
func (*TextElement) SetTextColor ¶
func (te *TextElement) SetTextColor(textColor color.Color) *TextElement
func (*TextElement) SetTextSize ¶
func (te *TextElement) SetTextSize(textSize float32) *TextElement
func (*TextElement) SetWidth ¶
func (te *TextElement) SetWidth(width float32) *TextElement
func (*TextElement) Spatial ¶
func (te *TextElement) Spatial() renderer.Spatial
type TextField ¶
type TextField struct {
// contains filtered or unexported fields
}
func NewTextField ¶
func (*TextField) AddOnChange ¶
func (*TextField) AddOnFocus ¶
func (tf *TextField) AddOnFocus(handler func())
func (*TextField) AddOnKeyPress ¶
func (*TextField) Deactivate ¶
func (tf *TextField) Deactivate()
func (*TextField) GetChildren ¶
func (*TextField) GetHiddenText ¶
func (*TextField) GlobalOrthoOrder ¶
func (*TextField) RenderCursor ¶
func (tf *TextField) RenderCursor()
func (*TextField) SetBackgroundColor ¶
func (*TextField) SetBackgroundImage ¶
func (*TextField) SetMarginPercent ¶
func (tf *TextField) SetMarginPercent(marginPercent MarginPercentages)
func (*TextField) SetPadding ¶
func (*TextField) SetPaddingPercent ¶
func (tf *TextField) SetPaddingPercent(paddingPercent MarginPercentages)
func (*TextField) SetPlaceholder ¶
func (*TextField) SetTextColor ¶
func (*TextField) SetTextSize ¶
func (*TextField) UsePercentHeight ¶
func (*TextField) UsePercentWidth ¶
type Window ¶
type Window struct { Tabs []Activatable // contains filtered or unexported fields }
func NewProgressBar ¶
func (*Window) BoundingRadius ¶
func (*Window) ElementById ¶
func (*Window) OrthoOrder ¶
func (*Window) SetBackgroundColor ¶
func (*Window) SetElement ¶
func (*Window) SetOrientation ¶
func (*Window) SetTranslation ¶
func (*Window) TextElementById ¶
func (w *Window) TextElementById(id string) *TextElement
Click to show internal directories.
Click to hide internal directories.