Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClampUint16 ¶
func LoosenContext ¶
func LoosenContext(ctx vxfw.DrawContext) vxfw.DrawContext
LoosenContext takes a vxfw.DrawContext and returns a context with no minimum sizes.
func TightenContext ¶
func TightenContext(ctx vxfw.DrawContext, size vxfw.Size) vxfw.DrawContext
TightenContext returns a vxfw.DrawContext whose min and max along each dimension is as close to size as possible while still staying in-bounds. If either dimension of size is 0, it's ignored.
Types ¶
type EventHandlerFunc ¶
EventHandlerFunc is a convenience function to make stateless widgets. EventHandlerFunc(fn) is a vxfw.EventHandler that calls fn during the event handling phase.
func (EventHandlerFunc) Draw ¶
func (_ EventHandlerFunc) Draw(_ vxfw.DrawContext) (vxfw.Surface, error)
Draw implements vxfw.Widget
func (EventHandlerFunc) HandleEvent ¶
func (fn EventHandlerFunc) HandleEvent(event vaxis.Event, phase vxfw.EventPhase) (vxfw.Command, error)
type WidgetFunc ¶
type WidgetFunc func(vxfw.DrawContext) (vxfw.Surface, error)
WidgetFunc is convenience adapter to turn an ordinary function into a vxfw.Widget WidgetFunc(fn) is a vxfw.Widget that calls fn during the Draw phase.
func (WidgetFunc) Draw ¶
func (fn WidgetFunc) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error)
Click to show internal directories.
Click to hide internal directories.