guigui

package module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

README

Guigui (ぐいぐい)

An experimental GUI framework for Go with Ebitengine.

This project is an alpha version, and everything may change in the future.

Except for minor changes like typo fixes, we have not yet established a development policy for accepting changes. For new widgets, please make your proposal in Discussion.

  • Supports Hi-DPI for clear visuals on modern displays.
  • Built-in internationalization (I18N) support for multiple languages.
  • Efficient rendering with optimized draw calls for better performance.
Light Mode Dark Mode
Light Mode Dark Mode
git clone https://github.com/xackery/guigui.git
cd guigui
go run ./example/gallery

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blur

func Blur(widget Widget)

func Bounds

func Bounds(widget Widget) image.Rectangle

func Disable

func Disable(widget Widget)

func Enable

func Enable(widget Widget)

func Focus

func Focus(widget Widget)

func HasFocusedChildWidget

func HasFocusedChildWidget(widget Widget) bool

func Hide

func Hide(widget Widget)

func IsEnabled

func IsEnabled(widget Widget) bool

func IsFocused

func IsFocused(widget Widget) bool

func IsVisible

func IsVisible(widget Widget) bool

func Opacity

func Opacity(widget Widget) float64

func Position

func Position(widget Widget) image.Point

func RequestRedraw

func RequestRedraw(widget Widget)

func Run

func Run(root Widget, options *RunOptions) error

func SetOpacity

func SetOpacity(widget Widget, opacity float64)

func SetPosition

func SetPosition(widget Widget, position image.Point)

func Show

func Show(widget Widget)

func VisibleBounds

func VisibleBounds(widget Widget) image.Rectangle

Types

type ChildWidgetAppender

type ChildWidgetAppender struct {
	// contains filtered or unexported fields
}

func (*ChildWidgetAppender) AppendChildWidget

func (c *ChildWidgetAppender) AppendChildWidget(widget Widget)

type ColorMode

type ColorMode int
const (
	ColorModeLight ColorMode = iota
	ColorModeDark
)

type Context

type Context struct {
	// contains filtered or unexported fields
}

func (*Context) AppScale

func (c *Context) AppScale() float64

func (*Context) AppSize

func (c *Context) AppSize() (int, int)

func (*Context) AppendAppLocales

func (c *Context) AppendAppLocales(locales []language.Tag) []language.Tag

func (*Context) AppendLocales

func (c *Context) AppendLocales(locales []language.Tag) []language.Tag

func (*Context) ColorMode

func (c *Context) ColorMode() ColorMode

func (*Context) DeviceScale

func (c *Context) DeviceScale() float64

func (*Context) ResetColorMode

func (c *Context) ResetColorMode()

func (*Context) Scale

func (c *Context) Scale() float64

func (*Context) SetAppLocales

func (c *Context) SetAppLocales(locales []language.Tag)

func (*Context) SetAppScale

func (c *Context) SetAppScale(scale float64)

func (*Context) SetColorMode

func (c *Context) SetColorMode(mode ColorMode)

type DefaultWidget

type DefaultWidget struct {
	// contains filtered or unexported fields
}

func (*DefaultWidget) CursorShape

func (*DefaultWidget) CursorShape(context *Context) (ebiten.CursorShapeType, bool)

func (*DefaultWidget) Draw

func (*DefaultWidget) Draw(context *Context, dst *ebiten.Image)

func (*DefaultWidget) HandleInput

func (*DefaultWidget) HandleInput(context *Context) HandleInputResult

func (*DefaultWidget) IsPopup

func (*DefaultWidget) IsPopup() bool

func (*DefaultWidget) Layout

func (*DefaultWidget) Layout(context *Context, appender *ChildWidgetAppender)

func (*DefaultWidget) Size

func (d *DefaultWidget) Size(context *Context) (int, int)

func (*DefaultWidget) Update

func (*DefaultWidget) Update(context *Context) error

type HandleInputResult

type HandleInputResult struct {
	// contains filtered or unexported fields
}

func AbortHandlingInput

func AbortHandlingInput() HandleInputResult

func HandleInputByWidget

func HandleInputByWidget(widget Widget) HandleInputResult

func (*HandleInputResult) ShouldRaise

func (r *HandleInputResult) ShouldRaise() bool

type MouseOverlay

type MouseOverlay struct {
	DefaultWidget
	// contains filtered or unexported fields
}

func (*MouseOverlay) HandleInput

func (m *MouseOverlay) HandleInput(context *Context) HandleInputResult

func (*MouseOverlay) IsHovering

func (m *MouseOverlay) IsHovering() bool

func (*MouseOverlay) IsPressing

func (m *MouseOverlay) IsPressing() bool

func (*MouseOverlay) SetOnDown

func (m *MouseOverlay) SetOnDown(f func(mouseButton ebiten.MouseButton, cursorPosition image.Point))

func (*MouseOverlay) SetOnUp

func (m *MouseOverlay) SetOnUp(f func(mouseButton ebiten.MouseButton, cursorPosition image.Point))

func (*MouseOverlay) Update

func (m *MouseOverlay) Update(context *Context) error

type RootWidget

type RootWidget struct {
	DefaultWidget
}

func (*RootWidget) Size

func (*RootWidget) Size(context *Context) (int, int)

type RunOptions

type RunOptions struct {
	Title             string
	WindowMinWidth    int
	WindowMinHeight   int
	WindowMaxWidth    int
	WindowMaxHeight   int
	AppScale          float64
	ScreenTransparent bool
}

type Widget

type Widget interface {
	Layout(context *Context, appender *ChildWidgetAppender)
	HandleInput(context *Context) HandleInputResult
	Update(context *Context) error
	CursorShape(context *Context) (ebiten.CursorShapeType, bool)
	Draw(context *Context, dst *ebiten.Image)
	IsPopup() bool
	Size(context *Context) (int, int)
	// contains filtered or unexported methods
}

func Parent

func Parent(widget Widget) Widget

Directories

Path Synopsis
example
counter command
gallery command
todo command
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL