Versions in this module Expand all Collapse all v0 v0.0.2 Oct 11, 2019 Changes in this version + func InitWidget(parent Widget, w Widget) + func LoadTTF(path string, size float64) (font.Face, error) + func PrintWidgets(w Widget, indent string) + type Align int + const AlignBottom + const AlignBottomLeft + const AlignBottomRight + const AlignCenter + const AlignDefault + const AlignLeft + const AlignRight + const AlignTop + const AlignTopLeft + const AlignTopRight type Base + Disabled bool + Image string + ImageAlign Align + TextAlign Align + Theme *Theme + type Charset struct + type ImageSheetConfig struct + Atlas image.Image + File string + Sheets []SheetConfig + func LoadImages(configFileName string) (ImageSheetConfig, error) type Panel + Children []Widget + Parent Widget + PointerInside bool + Virt Widget + func (p *Panel) DrawImageAndText(textColor color.Color) + func (p *Panel) Equals(w Widget) bool + func (p *Panel) MyTheme() *Theme + func (p *Panel) Paint() + func (p *Panel) WidgetUnder(pos Vec) Widget + type PlainRect struct + BackColor color.Color + BorderColor color.Color + BorderInset float64 + BorderSize float64 + func (pr PlainRect) Draw(s Surface, rect Rect) type PushButton + Pressed bool + func (pb *PushButton) Paint() type Rect + func (r Rect) AlignToPoint(dst Vec, al Align) Vec + func (r Rect) AlignToRect(dst Rect, al Align) Vec + func (r Rect) Center() Vec + func (r Rect) Extended(left, bottom, right, top float64) Rect + func (r Rect) H() float64 + func (r Rect) W() float64 + type SheetConfig struct + H float64 + Names []string + W float64 + XOffset float64 + YOffset float64 type Surface + DrawImage func(name string, pos Vec, col color.Color) + DrawImageAligned func(name string, rect Rect, al Align, col color.Color) + DrawImageStretched func(name string, rect Rect, col color.Color) + GetImageSize func(name string) (Vec, error) + GetTextRect func(msg, font string) Rect + GetTheme func() *Theme + InitImageSheets func(config ImageSheetConfig) error + InitImages func(configFileName string) error + InitTTF func(fontName, fileName string, size float64, charset Charset) error + IsPopUp func(w Widget) bool + IsPopUpMode func() bool + PopDownTo func(w Widget) + PopUp func(w Widget) + PopUpUnder func(pos Vec) Widget + SetTheme func(theme Theme) type SurfaceConfig + BackColor color.Color + FPS int + IconFile string + Title string + WindowGeometry Rect + type TexturedPanel struct + Color color.Color + ImagePrefix string + TileHorizontal bool + TileVertical bool + func (tp TexturedPanel) Draw(s Surface, rect Rect) + type Theme struct + DisabledTextColor color.Color + Drawers map[ThemeDrawerKey]ThemeDrawer + Pad float64 + TextColor color.Color + TitleFont string + TooltipColor color.Color + TooltipFont string + type ThemeDrawer interface + Draw func(s Surface, rect Rect) + type ThemeDrawerKey string + const ThemeButton + const ThemeButtonActive + const ThemeButtonDisabled + const ThemeButtonHL + const ThemePanel + const ThemePanelDisabled + const ThemeTooltip type Vec + func (v Vec) Half() Vec + func (v Vec) Sub(u Vec) Vec + func (v Vec) ZR() Rect type Widget + Close func() + Equals func(w Widget) bool + Foster func(ch Widget) + Paint func() + Place func(rel Vec) + WidgetUnder func(pos Vec) Widget v0.0.1 Aug 18, 2019 Changes in this version + const Key0 + const Key1 + const Key2 + const Key3 + const Key4 + const Key5 + const Key6 + const Key7 + const Key8 + const Key9 + const KeyA + const KeyApostrophe + const KeyB + const KeyBackslash + const KeyBackspace + const KeyC + const KeyCapsLock + const KeyComma + const KeyD + const KeyDelete + const KeyDown + const KeyE + const KeyEnd + const KeyEnter + const KeyEqual + const KeyEscape + const KeyF + const KeyF1 + const KeyF10 + const KeyF11 + const KeyF12 + const KeyF13 + const KeyF14 + const KeyF15 + const KeyF16 + const KeyF17 + const KeyF18 + const KeyF19 + const KeyF2 + const KeyF20 + const KeyF21 + const KeyF22 + const KeyF23 + const KeyF24 + const KeyF25 + const KeyF3 + const KeyF4 + const KeyF5 + const KeyF6 + const KeyF7 + const KeyF8 + const KeyF9 + const KeyG + const KeyGraveAccent + const KeyH + const KeyHome + const KeyI + const KeyInsert + const KeyJ + const KeyK + const KeyKP0 + const KeyKP1 + const KeyKP2 + const KeyKP3 + const KeyKP4 + const KeyKP5 + const KeyKP6 + const KeyKP7 + const KeyKP8 + const KeyKP9 + const KeyKPAdd + const KeyKPDecimal + const KeyKPDivide + const KeyKPEnter + const KeyKPEqual + const KeyKPMultiply + const KeyKPSubtract + const KeyL + const KeyLast + const KeyLeft + const KeyLeftAlt + const KeyLeftBracket + const KeyLeftControl + const KeyLeftShift + const KeyLeftSuper + const KeyM + const KeyMenu + const KeyMinus + const KeyN + const KeyNumLock + const KeyO + const KeyP + const KeyPageDown + const KeyPageUp + const KeyPause + const KeyPeriod + const KeyPrintScreen + const KeyQ + const KeyR + const KeyRight + const KeyRightAlt + const KeyRightBracket + const KeyRightControl + const KeyRightShift + const KeyRightSuper + const KeyS + const KeyScrollLock + const KeySemicolon + const KeySlash + const KeySpace + const KeyT + const KeyTab + const KeyU + const KeyUnknown + const KeyUp + const KeyV + const KeyW + const KeyWorld1 + const KeyWorld2 + const KeyX + const KeyY + const KeyZ + const MouseButton1 + const MouseButton2 + const MouseButton3 + const MouseButton4 + const MouseButton5 + const MouseButton6 + const MouseButton7 + const MouseButton8 + const MouseButtonLast + const MouseButtonLeft + const MouseButtonMiddle + const MouseButtonRight + var DefaultPanel = Base + var DefaultPushButton = Base + func RGB(r, g, b float64) color.Color + func RGBA(r, g, b, a float64) color.Color + type Base struct + BackColor color.Color + Border float64 + BorderColor color.Color + BorderInset float64 + ForeColor color.Color + ImageScale float64 + Phantom bool + Rect Rect + Text string + Tooltip string + type Button int + type Interactive struct + OnKeys func() bool + OnMouseClick func(button Button) + OnMouseDown func(button Button) + OnMouseIn func() + OnMouseMove func() + OnMouseOut func() + OnMouseUp func(button Button) + OnMouseWheel func() + type Node interface + Close func() + Foster func(ch Node) + SubNodes func() []Node + type Panel struct + OnDraw func() + Surface Surface + func NewPanel(parent Node, b Base) *Panel + func (n Panel) SubNodes() []Node + func (w *Panel) Close() + func (w *Panel) Foster(ch Node) + func (w *Panel) GetPanel() *Panel + func (w *Panel) GlobalRect() (r Rect) + func (w *Panel) Place(rel Vec) + func (w *Panel) ProcessKeys() + func (w *Panel) ProcessMouse() + func (w *Panel) Render() + func (w *Panel) SubWidgets() []Widget + type PushButton struct + OnPress func() + func NewPushButton(parent Node, b Base) *PushButton + func (n PushButton) SubNodes() []Node + type Rect struct + Max Vec + Min Vec + func R(x1, y1, x2, y2 float64) Rect + func R0(w, h float64) Rect + func (r Rect) Contains(u Vec) bool + func (r Rect) Expanded(d float64) Rect + func (r Rect) Moved(delta Vec) Rect + func (r Rect) Size() Vec + type Surface interface + ClickMousePos func() Vec + DrawFillRect func(r Rect, col color.Color) + DrawRect func(r Rect, col color.Color, thick float64) + DrawText func(r Rect, col color.Color, font, msg string, alh, alv int) + JustPressed func(button Button) bool + JustReleased func(button Button) bool + MousePos func() Vec + MouseScroll func() Vec + PrevMousePos func() Vec + Root func() Widget + Run func() + SetEvents func(handler func()) + SetToolTip func(tooltip string) + type SurfaceConfig struct + PixelSize float64 + type Vec struct + X float64 + Y float64 + func V(x, y float64) Vec + func (v Vec) Add(u Vec) Vec + func (v Vec) Len() float64 + type Widget interface + GetPanel func() *Panel + GlobalRect func() Rect + ProcessKeys func() + ProcessMouse func() + Render func() + SubWidgets func() []Widget + type WindowConfig struct + FPS int + IconFile string + Title string + WindowGeometry Rect