Documentation ¶
Index ¶
- func CreateBoundWindow(title string, vsync bool, clearColour uint32, e UIElement) (frenyard.Window, error)
- func InitUILayoutElementComponent(self UILayoutElement)
- func InitUILayoutProxy(proxy UIProxyHost, target UILayoutElement)
- func InitUIProxy(proxy UIProxyHost, target UIElement)
- type ButtonBehavior
- type EnterWindowEvent
- type FlexboxContainer
- type FlexboxSlot
- type FlexboxWrapMode
- type FocusEvent
- type Frame
- type FramePass
- type LayoutElementNoSubelementsComponent
- type NinePatch
- type NinePatchFrame
- type NinePatchFrameLayer
- type PanelFixedElement
- type ScrollbarTheme
- type ScrollbarValue
- type SlideTransition
- type UIButton
- type UIElement
- type UIElementComponent
- type UIEventDebugger
- type UIFlexboxContainer
- type UILabel
- func (cr *UILabel) Alignment() frenyard.Alignment2i
- func (cr *UILabel) Background() uint32
- func (cr *UILabel) Colour() uint32
- func (cr *UILabel) FyEDraw(target frenyard.Renderer, under bool)
- func (cr *UILabel) FyEMouseEvent(ev frenyard.MouseEvent)
- func (cr *UILabel) FyENormalEvent(ev frenyard.NormalEvent)
- func (cr *UILabel) FyEResize(s frenyard.Vec2i)
- func (cr *UILabel) FyETick(deltaTime float64)
- func (cr *UILabel) FyLSizeForLimits(limits frenyard.Vec2i) frenyard.Vec2i
- func (cr *UILabel) SetAlignment(align frenyard.Alignment2i)
- func (cr *UILabel) SetBackground(colour uint32)
- func (cr *UILabel) SetColour(colour uint32)
- func (cr *UILabel) SetText(text integration.TypeChunk)
- func (cr *UILabel) Text() integration.TypeChunk
- type UILayoutElement
- func ConvertElementToLayout(subelement UIElement) UILayoutElement
- func NewDebugWrapPtr(inner UILayoutElement) UILayoutElement
- func NewUIMarginContainerPtr(innards UILayoutElement, margin frenyard.Area2i) UILayoutElement
- func NewUIScrollboxPtr(theme ScrollbarTheme, content UILayoutElement, vertical bool) UILayoutElement
- type UILayoutElementComponent
- type UILayoutElementComponentDetails
- type UILayoutProxy
- type UIOverlayContainer
- func (ufc *UIOverlayContainer) FyEDraw(r frenyard.Renderer, under bool)
- func (ufc *UIOverlayContainer) FyEResize(size frenyard.Vec2i)
- func (ufc *UIOverlayContainer) FyETick(delta float64)
- func (ufc *UIOverlayContainer) FyLSizeForLimits(limits frenyard.Vec2i) frenyard.Vec2i
- func (ufc *UIOverlayContainer) FyLSubelementChanged()
- func (ufc *UIOverlayContainer) SetContent(npp Frame, setup []UILayoutElement)
- type UIPanel
- type UIPanelDetails
- type UIProxy
- func (px *UIProxy) FyEDraw(target frenyard.Renderer, under bool)
- func (px *UIProxy) FyEFindElement(target UIElement) frenyard.Area2i
- func (px *UIProxy) FyEMouseEvent(ev frenyard.MouseEvent)
- func (px *UIProxy) FyENormalEvent(ev frenyard.NormalEvent)
- func (px *UIProxy) FyEResize(v frenyard.Vec2i)
- func (px *UIProxy) FyESize() frenyard.Vec2i
- func (px *UIProxy) FyETick(f float64)
- type UIProxyHost
- type UIRect
- type UIScrollbar
- func (uis *UIScrollbar) FyEDraw(r frenyard.Renderer, under bool)
- func (uis *UIScrollbar) FyEMouseEvent(me frenyard.MouseEvent)
- func (uis *UIScrollbar) FyENormalEvent(me frenyard.NormalEvent)
- func (uis *UIScrollbar) FyETick(time float64)
- func (uis *UIScrollbar) FyLSizeForLimits(limits frenyard.Vec2i) frenyard.Vec2i
- type UIScrollbox
- func (usc *UIScrollbox) FyEMouseEvent(me frenyard.MouseEvent)
- func (usc *UIScrollbox) FyEResize(size frenyard.Vec2i)
- func (usc *UIScrollbox) FyLSizeForLimits(limits frenyard.Vec2i) frenyard.Vec2i
- func (usc *UIScrollbox) FyLSubelementChanged()
- func (usc *UIScrollbox) FySSetValue(v float64)
- func (usc *UIScrollbox) FySValue() float64
- type UISlideTransitionContainer
- func (ufc *UISlideTransitionContainer) FyEResize(size frenyard.Vec2i)
- func (ufc *UISlideTransitionContainer) FyETick(time float64)
- func (ufc *UISlideTransitionContainer) FyLSizeForLimits(limits frenyard.Vec2i) frenyard.Vec2i
- func (ufc *UISlideTransitionContainer) FyLSubelementChanged()
- func (ufc *UISlideTransitionContainer) TransitionTo(next SlideTransition)
- type UITextbox
- func (tb *UITextbox) FyEDraw(target frenyard.Renderer, under bool)
- func (tb *UITextbox) FyENormalEvent(ne frenyard.NormalEvent)
- func (tb *UITextbox) FyETick(delta float64)
- func (tb *UITextbox) FyTArea() frenyard.Area2i
- func (tb *UITextbox) FyTClose()
- func (tb *UITextbox) FyTEditing(text string, start int, length int)
- func (tb *UITextbox) FyTInput(text string)
- func (tb *UITextbox) FyTOpen()
- func (tb *UITextbox) SetText(text string)
- func (tb *UITextbox) Text() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBoundWindow ¶
func CreateBoundWindow(title string, vsync bool, clearColour uint32, e UIElement) (frenyard.Window, error)
CreateBoundWindow creates a window that is bound to an element.
func InitUILayoutElementComponent ¶
func InitUILayoutElementComponent(self UILayoutElement)
InitUILayoutElementComponent initializes a UILayoutElementComponent given the containing UILayoutElement. Do not call on UILayoutProxy or feed after midnight.
func InitUILayoutProxy ¶
func InitUILayoutProxy(proxy UIProxyHost, target UILayoutElement)
InitUILayoutProxy initializes a UILayoutProxy, setting the target.
func InitUIProxy ¶
func InitUIProxy(proxy UIProxyHost, target UIElement)
InitUIProxy initializes a UIProxy, setting the target.
Types ¶
type EnterWindowEvent ¶
EnterWindowEvent is an event type specific to the UI framework that represents the element being attached to a window.
func (EnterWindowEvent) FyVOffset ¶
func (fe EnterWindowEvent) FyVOffset(o frenyard.Vec2i) frenyard.NormalEvent
FyVOffset implements NormalEvent.FyVOffset
func (EnterWindowEvent) FyVRoute ¶
func (fe EnterWindowEvent) FyVRoute() frenyard.NormalEventRoute
FyVRoute implements NormalEvent.FyVRoute
type FlexboxContainer ¶
type FlexboxContainer struct { DirVertical bool WrapMode FlexboxWrapMode // Ignored when used by the line solver; it uses fyFlexboxSlotlike instead Slots []FlexboxSlot // This is NOT part of the public API. It is provided for debugging use only. // Do not even mention this field in releases. Debug bool }
FlexboxContainer describes a UIFlexboxContainer's contents.
type FlexboxSlot ¶
type FlexboxSlot struct { // Can be nil. Element UILayoutElement // If there is a surplus, these are used to distribute it. Grow int32 // If there is a deficit, these are used to distribute it (along with minimum sizes) // DEFAULTS TO 1 IN CSS Shrink int32 // If *non-zero*, then this specifies the "initial share size" of this element. // Useful when Element is nil. Basis int32 // Slightly non-standard extension (or is it?) for cases where Basis would be used to pad a problematic element MinBasis int32 // Used to order the flexboxes visually. The Z-Order remains the index order. Order int // If the container should respect the minimum size of this slot. // DEFAULTS TO TRUE IN CSS (settable to false by overriding min w/h), BUT THIS IS REALLY STUPID B/C IT IGNORES SIZE CONSTRAINTS, SO LET'S NOT DO THAT RespectMinimumSize bool }
FlexboxSlot describes an element within a Flexbox container.
type FlexboxWrapMode ¶
type FlexboxWrapMode uint8
FlexboxWrapMode describes a type of wrapping mode for Flexbox containers.
const FlexboxWrapModeNone FlexboxWrapMode = 0
FlexboxWrapModeNone disallows wrapping for items, they are all on one line.
const FlexboxWrapModeWrap FlexboxWrapMode = 1
FlexboxWrapModeWrap allows items to wrap between lines.
type FocusEvent ¶
type FocusEvent struct { // True if this was a focus, false if this was an unfocus. Focused bool }
FocusEvent is an event type specific to the UI framework that represents focusing/unfocusing the receiving element.
func (FocusEvent) FyVOffset ¶
func (fe FocusEvent) FyVOffset(o frenyard.Vec2i) frenyard.NormalEvent
FyVOffset implements NormalEvent.FyVOffset
func (FocusEvent) FyVRoute ¶
func (fe FocusEvent) FyVRoute() frenyard.NormalEventRoute
FyVRoute implements NormalEvent.FyVRoute
type Frame ¶
type Frame interface { // FyFTick ticks the frame. Unstateful frames should really just ignore this. FyFTick(delta float64) // FyFDraw draws a pass of the frame. FyFDraw(r frenyard.Renderer, size frenyard.Vec2i, pass FramePass) // FyFPadding returns the padding. This is expected to not change without a notification - given by either resetting the holding container's frame or by doing something else that causes that to occur. FyFPadding() frenyard.Area2i // FyFClipping returns the requested PanelClipping value for when using this framing. FyFClipping() bool }
Frame represents a frame around the stacked elements in a UIOverlayContainer. It is, in a way, a simplified version of a single-element-container suitable for writing theme-related code.
type FramePass ¶
type FramePass uint8
FramePass is a draw pass for a Frame.
const FramePassOverAfter FramePass = 3
FramePassOverAfter is Over, after the interior has been drawn.
const FramePassOverBefore FramePass = 2
FramePassOverBefore is Over, before the interior has been drawn.
const FramePassUnderAfter FramePass = 1
FramePassUnderAfter is Under, after the interior has been drawn.
const FramePassUnderBefore FramePass = 0
FramePassUnderBefore is Under, before the interior has been drawn.
type LayoutElementNoSubelementsComponent ¶
type LayoutElementNoSubelementsComponent struct { }
LayoutElementNoSubelementsComponent should be used when your element has no subelements.
func (*LayoutElementNoSubelementsComponent) FyLSubelementChanged ¶
func (px *LayoutElementNoSubelementsComponent) FyLSubelementChanged()
FyLSubelementChanged implements UILayoutElement.FyLSubelementChanged
type NinePatch ¶
type NinePatch struct { // If nil, this NinePatch is disabled. Tex frenyard.Texture // The area of the image containing the under nine-patch. Sprite frenyard.Area2i // The area within that area, absolute, where the container bounds sit. Bounds frenyard.Area2i // The area within that area, absolute, where the nine-patch centre bounds sit. Centre frenyard.Area2i }
A NinePatch is a resizable rectangular border and background to fit a given container.
type NinePatchFrame ¶
type NinePatchFrame struct { Layers []NinePatchFrameLayer Padding frenyard.Area2i Clipping bool }
A NinePatchFrame uses a set of NinePatches as a container.
func (NinePatchFrame) FyFClipping ¶
func (npcf NinePatchFrame) FyFClipping() bool
FyFClipping implements Frame.FyFClipping
func (NinePatchFrame) FyFPadding ¶
func (npcf NinePatchFrame) FyFPadding() frenyard.Area2i
FyFPadding implements Frame.FyFPadding
func (NinePatchFrame) FyFTick ¶
func (npcf NinePatchFrame) FyFTick(delta float64)
FyFTick implements Frame.FyFTick
type NinePatchFrameLayer ¶
type NinePatchFrameLayer struct { Pass FramePass NinePatch Scale float64 ColourMod uint32 Mode frenyard.DrawMode }
A NinePatchFrameLayer provides the visuals for a given layer of a NinePatchFrame.
type PanelFixedElement ¶
type PanelFixedElement struct { Pos frenyard.Vec2i // Setting this to false is useful if you want an element to still tick but want to remove the drawing overhead. Visible bool // Setting this to true 'locks' the element. The element still participates in hit-tests but fails to focus and events are NOT forwarded. Locked bool Element UIElement }
PanelFixedElement describes an element attached to a panel.
type ScrollbarTheme ¶
type ScrollbarTheme struct { // The Base covers the whole visible main axis. The bounds of this touches the cross-axis sides of the Movement. Base Frame // The Movement covers the part of the scrollbar that moves during scrolling. It is given only the padding as bounds. Movement Frame }
ScrollbarTheme represents the Frame pair that makes up a Scrollbar.
type ScrollbarValue ¶
type ScrollbarValue interface { FySValue() float64 // Sets the value. It is the responsibility of the target to clamp these values; this will show attempts at overscrolling for potential feedback. FySSetValue(v float64) }
ScrollbarValue represents the value a scrollbar alters.
type SlideTransition ¶
type SlideTransition struct { Element UILayoutElement Length float64 Reverse bool Vertical bool }
SlideTransition represents a specific transition queued for a UISlideTransitionContainer.
type UIButton ¶
type UIButton struct { UILayoutProxy // "State" values Focused bool Hover bool Down bool LastMousePos frenyard.Vec2i // contains filtered or unexported fields }
UIButton is a themable button. Essentially, it's like an HTML button after the defaults are stripped off; the visual content is similar to any other element, but the "button" itself is an interaction proxy.
func NewUIButtonPtr ¶
func NewUIButtonPtr(theme UILayoutElement, click ButtonBehavior) *UIButton
NewUIButtonPtr creates a new UIButton.
func (*UIButton) FyEMouseEvent ¶
func (btn *UIButton) FyEMouseEvent(me frenyard.MouseEvent)
FyEMouseEvent overrides UILayoutProxy.FyEMouseEvent
func (*UIButton) FyENormalEvent ¶
func (btn *UIButton) FyENormalEvent(me frenyard.NormalEvent)
FyENormalEvent overrides UILayoutProxy.FyENormalEvent
type UIElement ¶
type UIElement interface { FyENormalEvent(ev frenyard.NormalEvent) FyEMouseEvent(ev frenyard.MouseEvent) // Updates the element. FyETick(deltaTime float64) /* * Drawing occurs in two passes: The 'under' pass and the main pass. * If the element has a shadow, it draws that in the 'under' pass. * As such, if an element has a background, it draws the shadow for that (if any) in the 'under' pass, * and splits its main pass into, in order: background, sub-element 'under' pass, sub-element main pass. */ FyEDraw(target frenyard.Renderer, under bool) /* * Sets FyESize. * FyESize MUST NOT change without FyEResize being used. * FyEResize MUST ONLY be called if: * 1. the parent element/window to which this element is attached is doing it * 2. there is no parent element/window (setting default) * 3. the parameter is equal to FyESize() (relayout) * FyESize SHOULD default to a reasonable default size for the element. */ FyEResize(size frenyard.Vec2i) FyESize() frenyard.Vec2i // Attempts to find an element relative to Area2iOfSize(FyESize()). Does not check for itself. Returns an empty area for 'not found'. FyEFindElement(target UIElement) frenyard.Area2i }
UIElement is the core UI element type (no layout capabilities). An implementation must contain UIElementComponent or UIProxy.
type UIElementComponent ¶
type UIElementComponent struct {
// contains filtered or unexported fields
}
UIElementComponent implements the resizing logic for UIElement and default method implementations.
func NewUIElementComponent ¶
func NewUIElementComponent(size frenyard.Vec2i) UIElementComponent
NewUIElementComponent creates a new UIElementComponent.
func (*UIElementComponent) FyEFindElement ¶
func (es *UIElementComponent) FyEFindElement(target UIElement) frenyard.Area2i
FyEFindElement implements UIElement.FyEFindElement
func (*UIElementComponent) FyEResize ¶
func (es *UIElementComponent) FyEResize(size frenyard.Vec2i)
FyEResize implements UIElement.FyEResize
func (*UIElementComponent) FyESize ¶
func (es *UIElementComponent) FyESize() frenyard.Vec2i
FyESize implements UIElement.FyESize
type UIEventDebugger ¶
type UIEventDebugger struct { UIElementComponent // contains filtered or unexported fields }
UIEventDebugger is a simple test element to debug events.
func NewUIEventDebuggerPtr ¶
func NewUIEventDebuggerPtr(size frenyard.Vec2i) *UIEventDebugger
NewUIEventDebuggerPtr creates a UIEventDebugger
func (*UIEventDebugger) FyEDraw ¶
func (cr *UIEventDebugger) FyEDraw(target frenyard.Renderer, under bool)
FyEDraw implements UIElement.FyEDraw
func (*UIEventDebugger) FyEMouseEvent ¶
func (cr *UIEventDebugger) FyEMouseEvent(ev frenyard.MouseEvent)
FyEMouseEvent implements UIElement.FyEMouseEvent
func (*UIEventDebugger) FyENormalEvent ¶
func (cr *UIEventDebugger) FyENormalEvent(ev frenyard.NormalEvent)
FyENormalEvent implements UIElement.FyENormalEvent
func (*UIEventDebugger) FyETick ¶
func (cr *UIEventDebugger) FyETick(deltaTime float64)
FyETick implements UIElement.FyETick
type UIFlexboxContainer ¶
type UIFlexboxContainer struct { UIPanel UILayoutElementComponent // contains filtered or unexported fields }
UIFlexboxContainer lays out UILayoutElements using a partial implementation of Flexbox.
func NewUIFlexboxContainerPtr ¶
func NewUIFlexboxContainerPtr(setup FlexboxContainer) *UIFlexboxContainer
NewUIFlexboxContainerPtr creates a UIFlexboxContainer from the FlexboxContainer details
func (*UIFlexboxContainer) FyEResize ¶
func (ufc *UIFlexboxContainer) FyEResize(size frenyard.Vec2i)
FyEResize overrides UIPanel.FyEResize
func (*UIFlexboxContainer) FyLSizeForLimits ¶
func (ufc *UIFlexboxContainer) FyLSizeForLimits(limits frenyard.Vec2i) frenyard.Vec2i
FyLSizeForLimits implements UILayoutElement.FyLSizeForLimits
func (*UIFlexboxContainer) FyLSubelementChanged ¶
func (ufc *UIFlexboxContainer) FyLSubelementChanged()
FyLSubelementChanged implements UILayoutElement.FyLSubelementChanged
func (*UIFlexboxContainer) SetContent ¶
func (ufc *UIFlexboxContainer) SetContent(setup FlexboxContainer)
SetContent changes the contents of the UIFlexboxContainer.
type UILabel ¶
type UILabel struct { UIElementComponent UILayoutElementComponent LayoutElementNoSubelementsComponent // contains filtered or unexported fields }
UILabel displays text.
func NewUILabelPtr ¶
func NewUILabelPtr(text integration.TypeChunk, colour uint32, back uint32, align frenyard.Alignment2i) *UILabel
NewUILabelPtr creates a new UILabel from the various visual details about it.
func (*UILabel) Alignment ¶
func (cr *UILabel) Alignment() frenyard.Alignment2i
Alignment gets the alignment.
func (*UILabel) Background ¶
Background gets the background colour
func (*UILabel) FyEMouseEvent ¶
func (cr *UILabel) FyEMouseEvent(ev frenyard.MouseEvent)
FyEMouseEvent implements UIElement.FyEMouseEvent
func (*UILabel) FyENormalEvent ¶
func (cr *UILabel) FyENormalEvent(ev frenyard.NormalEvent)
FyENormalEvent implements UIElement.FyENormalEvent
func (*UILabel) FyLSizeForLimits ¶
FyLSizeForLimits implements UILayoutElement.FyLSizeForLimits
func (*UILabel) SetAlignment ¶
func (cr *UILabel) SetAlignment(align frenyard.Alignment2i)
SetAlignment sets the alignment.
func (*UILabel) SetBackground ¶
SetBackground sets the background colour.
func (*UILabel) SetText ¶
func (cr *UILabel) SetText(text integration.TypeChunk)
SetText sets the document.
type UILayoutElement ¶
type UILayoutElement interface { UIElement /* * Propagation of subelement limits change. */ FyLSubelementChanged() /* * Gets the optimum size given limitations. * The limitations use SIZE_UNLIMITED where unlimited. * The result may exceed the limitations given. * Note that this MUST NOT CHANGE given the same content. */ FyLSizeForLimits(limits frenyard.Vec2i) frenyard.Vec2i // contains filtered or unexported methods }
UILayoutElement is the base type for all UIElements that support layout. All implementations must use UILayoutElementComponent or UILayoutProxy.
func ConvertElementToLayout ¶
func ConvertElementToLayout(subelement UIElement) UILayoutElement
ConvertElementToLayout converts a UIElement to a UILayoutElement.
func NewDebugWrapPtr ¶
func NewDebugWrapPtr(inner UILayoutElement) UILayoutElement
NewDebugWrapPtr wraps in an interior layout.
func NewUIMarginContainerPtr ¶
func NewUIMarginContainerPtr(innards UILayoutElement, margin frenyard.Area2i) UILayoutElement
NewUIMarginContainerPtr is a wrapper around NewUIOverlayContainerPtr which creates a margin without any other details around a given element.
func NewUIScrollboxPtr ¶
func NewUIScrollboxPtr(theme ScrollbarTheme, content UILayoutElement, vertical bool) UILayoutElement
NewUIScrollboxPtr creates a scrollbox.
type UILayoutElementComponent ¶
type UILayoutElementComponent struct { // "This", not "Private". Only access from the component holder. ThisUILayoutElementComponentDetails UILayoutElementComponentDetails }
UILayoutElementComponent implements layout notification sending and receiving.
type UILayoutElementComponentDetails ¶
type UILayoutElementComponentDetails struct {
// contains filtered or unexported fields
}
UILayoutElementComponentDetails is a holder for methods meant to be accessed by the owner struct of UILayoutElementComponent.
func (*UILayoutElementComponentDetails) Attach ¶
func (details *UILayoutElementComponentDetails) Attach(subelement UILayoutElement) UILayoutElement
Attach attaches an element, so that if it changes, the parent will be notified.
func (*UILayoutElementComponentDetails) ContentChanged ¶
func (details *UILayoutElementComponentDetails) ContentChanged()
ContentChanged alerts the UI layouter that the limits of this component changed.
func (*UILayoutElementComponentDetails) Detach ¶
func (details *UILayoutElementComponentDetails) Detach(subelement UILayoutElement)
Detach detaches a previously attached element.
type UILayoutProxy ¶
type UILayoutProxy struct { UIProxy LayoutElementNoSubelementsComponent }
UILayoutProxy is UIProxy with layout support.
func (*UILayoutProxy) FyLSizeForLimits ¶
func (px *UILayoutProxy) FyLSizeForLimits(limits frenyard.Vec2i) frenyard.Vec2i
FyLSizeForLimits implements UILayoutElement.FyLSizeForLimits
type UIOverlayContainer ¶
type UIOverlayContainer struct { UIPanel UILayoutElementComponent // contains filtered or unexported fields }
UIOverlayContainer overlays elements on top of each other, and this itself on top of a potentially padded NinePatchPackage.
func NewUIOverlayContainerPtr ¶
func NewUIOverlayContainerPtr(npp Frame, setup []UILayoutElement) *UIOverlayContainer
NewUIOverlayContainerPtr creates a UIOverlayContainer
func (*UIOverlayContainer) FyEDraw ¶
func (ufc *UIOverlayContainer) FyEDraw(r frenyard.Renderer, under bool)
FyEDraw overrides UIPanel.FyEDraw
func (*UIOverlayContainer) FyEResize ¶
func (ufc *UIOverlayContainer) FyEResize(size frenyard.Vec2i)
FyEResize overrides UIPanel.FyEResize
func (*UIOverlayContainer) FyETick ¶
func (ufc *UIOverlayContainer) FyETick(delta float64)
FyETick overrides UIPanel.FyETick
func (*UIOverlayContainer) FyLSizeForLimits ¶
func (ufc *UIOverlayContainer) FyLSizeForLimits(limits frenyard.Vec2i) frenyard.Vec2i
FyLSizeForLimits implements UILayoutElement.FyLSizeForLimits
func (*UIOverlayContainer) FyLSubelementChanged ¶
func (ufc *UIOverlayContainer) FyLSubelementChanged()
FyLSubelementChanged implements UILayoutElement.FyLSubelementChanged
func (*UIOverlayContainer) SetContent ¶
func (ufc *UIOverlayContainer) SetContent(npp Frame, setup []UILayoutElement)
SetContent changes the content of the UIOverlayContainer.
type UIPanel ¶
type UIPanel struct { UIElementComponent ThisUIPanelDetails UIPanelDetails }
UIPanel is a "set it and forget it" stateful panel for placing multiple elements into.
func (*UIPanel) FyEFindElement ¶
FyEFindElement implements UIElement.FyEFindElement
func (*UIPanel) FyEMouseEvent ¶
func (pan *UIPanel) FyEMouseEvent(ev frenyard.MouseEvent)
FyEMouseEvent implements UIElement.FyEMouseEvent
func (*UIPanel) FyENormalEvent ¶
func (pan *UIPanel) FyENormalEvent(ev frenyard.NormalEvent)
FyENormalEvent implements UIElement.FyENormalEvent
type UIPanelDetails ¶
type UIPanelDetails struct { // Enables/disables clipping Clipping bool // contains filtered or unexported fields }
UIPanelDetails contains the details of a UIPanel otherwise accessible only by it's owner.
func (*UIPanelDetails) SetContent ¶
func (pan *UIPanelDetails) SetContent(content []PanelFixedElement)
SetContent sets the contents of the panel.
type UIProxy ¶
type UIProxy struct {
// contains filtered or unexported fields
}
UIProxy is a "proxy" element. Useful to use another element as a base class without including it via inheritance.
func (*UIProxy) FyEFindElement ¶
FyEFindElement implements UIElement.FyEFindElement
func (*UIProxy) FyEMouseEvent ¶
func (px *UIProxy) FyEMouseEvent(ev frenyard.MouseEvent)
FyEMouseEvent implements UIElement.FyEMouseEvent
func (*UIProxy) FyENormalEvent ¶
func (px *UIProxy) FyENormalEvent(ev frenyard.NormalEvent)
FyENormalEvent implements UIElement.FyENormalEvent
type UIProxyHost ¶
type UIProxyHost interface {
// contains filtered or unexported methods
}
UIProxyHost is used to 'drill down' to the UIProxy within an element.
type UIRect ¶
type UIRect struct { UIElementComponent // May be nil. Tex frenyard.Texture // If Texture is nil, this is ignored. Sprite frenyard.Area2i // Colour (either modulates Texture if present, or is filled as-is) Colour uint32 // Alignment Alignment frenyard.Alignment2i }
UIRect is a 'filler' background element.
func NewColouredRectPtr ¶
NewColouredRectPtr creates a UIRect given a colour and size.
func NewTextureRectPtr ¶
func NewTextureRectPtr(colour uint32, tex frenyard.Texture, sprite frenyard.Area2i, size frenyard.Vec2i, alignment frenyard.Alignment2i) *UIRect
NewTextureRectPtr creates a UIRect given a colour, texture, sprite area, and size.
func (*UIRect) FyEMouseEvent ¶
func (cr *UIRect) FyEMouseEvent(ev frenyard.MouseEvent)
FyEMouseEvent implements UIElement.FyEMouseEvent
func (*UIRect) FyENormalEvent ¶
func (cr *UIRect) FyENormalEvent(ev frenyard.NormalEvent)
FyENormalEvent implements UIElement.FyENormalEvent
type UIScrollbar ¶
type UIScrollbar struct { UIElementComponent UILayoutElementComponent LayoutElementNoSubelementsComponent Value ScrollbarValue MouseNotch float64 // contains filtered or unexported fields }
UIScrollbar is an implementation of a scrollbar.
func NewUIScrollbarPtr ¶
func NewUIScrollbarPtr(theme ScrollbarTheme, vertical bool, value ScrollbarValue) *UIScrollbar
NewUIScrollbarPtr creates a new scrollbar with the given theme and direction.
func (*UIScrollbar) FyEDraw ¶
func (uis *UIScrollbar) FyEDraw(r frenyard.Renderer, under bool)
FyEDraw implements UIElement.FyEDraw
func (*UIScrollbar) FyEMouseEvent ¶
func (uis *UIScrollbar) FyEMouseEvent(me frenyard.MouseEvent)
FyEMouseEvent implements UIElement.FyEMouseEvent
func (*UIScrollbar) FyENormalEvent ¶
func (uis *UIScrollbar) FyENormalEvent(me frenyard.NormalEvent)
FyENormalEvent implements UIElement.FyENormalEvent
func (*UIScrollbar) FyETick ¶
func (uis *UIScrollbar) FyETick(time float64)
FyETick implements UIElement.FyETick
func (*UIScrollbar) FyLSizeForLimits ¶
func (uis *UIScrollbar) FyLSizeForLimits(limits frenyard.Vec2i) frenyard.Vec2i
FyLSizeForLimits implements UILayoutElement.FyLSizeForLimits
type UIScrollbox ¶
type UIScrollbox struct { UIPanel UILayoutElementComponent // contains filtered or unexported fields }
UIScrollbox allows scrolling around the contained element.
func (*UIScrollbox) FyEMouseEvent ¶
func (usc *UIScrollbox) FyEMouseEvent(me frenyard.MouseEvent)
FyEMouseEvent overrides UIPanel.FyEMouseEvent
func (*UIScrollbox) FyEResize ¶
func (usc *UIScrollbox) FyEResize(size frenyard.Vec2i)
FyEResize overrides UIPanel.FyEResize
func (*UIScrollbox) FyLSizeForLimits ¶
func (usc *UIScrollbox) FyLSizeForLimits(limits frenyard.Vec2i) frenyard.Vec2i
FyLSizeForLimits implements UILayoutElement.FyLSizeForLimits
func (*UIScrollbox) FyLSubelementChanged ¶
func (usc *UIScrollbox) FyLSubelementChanged()
FyLSubelementChanged implements UILayoutElement.FyLSubelementChanged
func (*UIScrollbox) FySSetValue ¶
func (usc *UIScrollbox) FySSetValue(v float64)
FySSetValue implements ScrollbarValue.FySSetValue
func (*UIScrollbox) FySValue ¶
func (usc *UIScrollbox) FySValue() float64
FySValue implements ScrollbarValue.FySValue
type UISlideTransitionContainer ¶
type UISlideTransitionContainer struct { UIPanel UILayoutElementComponent // contains filtered or unexported fields }
UISlideTransitionContainer creates a 'slide transition' box.
func NewUISlideTransitionContainerPtr ¶
func NewUISlideTransitionContainerPtr(initContent UILayoutElement) *UISlideTransitionContainer
NewUISlideTransitionContainerPtr creates a 'slide transition' box.
func (*UISlideTransitionContainer) FyEResize ¶
func (ufc *UISlideTransitionContainer) FyEResize(size frenyard.Vec2i)
FyEResize overrides UIPanel.FyEResize
func (*UISlideTransitionContainer) FyETick ¶
func (ufc *UISlideTransitionContainer) FyETick(time float64)
FyETick overrides UIPanel.FyETick
func (*UISlideTransitionContainer) FyLSizeForLimits ¶
func (ufc *UISlideTransitionContainer) FyLSizeForLimits(limits frenyard.Vec2i) frenyard.Vec2i
FyLSizeForLimits implements UILayoutElement.FyLSizeForLimits
func (*UISlideTransitionContainer) FyLSubelementChanged ¶
func (ufc *UISlideTransitionContainer) FyLSubelementChanged()
FyLSubelementChanged implements UILayoutElement.FyLSubelementChanged
func (*UISlideTransitionContainer) TransitionTo ¶
func (ufc *UISlideTransitionContainer) TransitionTo(next SlideTransition)
TransitionTo transitions to a new slide.
type UITextbox ¶
type UITextbox struct { UILayoutProxy // Called on rebuild (this includes, though isn't strictly limited to, changes) OnRebuild func() // Called after some time without anything happening OnStall func() // Called on enter OnConfirm func() // contains filtered or unexported fields }
UITextbox is a textbox.
func NewUITextboxPtr ¶
func NewUITextboxPtr(text string, hint string, face font.Face, primaryColour uint32, suggestionColour uint32, hintColour uint32, backgroundColour uint32, align frenyard.Alignment2i) *UITextbox
NewUITextboxPtr creates a UITextbox.
func (*UITextbox) FyENormalEvent ¶
func (tb *UITextbox) FyENormalEvent(ne frenyard.NormalEvent)
FyENormalEvent overrides UILayoutProxy.FyENormalEvent
func (*UITextbox) FyTEditing ¶
FyTEditing implements TextInput.FyTEditing