ebitenui

package module
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 6 Imported by: 31

README

GitHub release (latest by date including pre-releases) GitHub GoDoc GoDoc

Discord Subreddit subscribers

Ebiten UI

A user interface engine and widget library for Ebitengine

>> Note: This library is separate from Ebitengine. Please reach out to the linked Discord server for questions or suggestions

Ebiten UI is an extension to Ebitengine that provides the ability to render a complete user interface, with widgets such as buttons, lists, combo boxes, and so on. It uses the [retained mode] model. All graphics used by Ebiten UI can be fully customized, so you can really make your UI your own.

Documentation on how to use and extend Ebiten UI is available at ebitenui.github.io.

Screenshots

Quick Start

Ebiten UI is written in Go 1.19 which is available at https://go.dev/.

There are Ebiten UI examples that can be found in the _examples/ folder.

They can be run from the root directory of the project with the following commands:

  • Ebiten UI complete demo: go run github.com/ebitenui/ebitenui/_examples/demo
  • Ebiten UI widget: go run github.com/ebitenui/ebitenui/_examples/widget_demos/<folder_name>

The examples can also be tested as WASM by running the following commands and opening your browser to http://localhost:6262:

  • Ebiten UI complete demo: go run github.com/hajimehoshi/wasmserve@latest -http=:6262 ./_examples/demo
  • Ebiten UI widget: go run github.com/hajimehoshi/wasmserve@latest -http=:6262 ./_examples/widget_demos/<folder_name>

Used By

Social Media

License

Ebiten UI is licensed under the MIT license.

Maintainers

Contributing

Want to help develop Ebiten UI? Check out our current issues. Want to know the steps on how to start contributing, take a look at the open source guide.

Documentation

Overview

Package ebitenui contains the main UI type that renders a complete user interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FocusDirection added in v0.3.3

type FocusDirection int
const (
	FOCUS_NEXT FocusDirection = iota
	FOCUS_PREVIOUS
)

type UI

type UI struct {
	// Container is the root container of the UI hierarchy.
	Container *widget.Container

	//If true the default tab/shift-tab to focus will be disabled
	DisableDefaultFocus bool
	// contains filtered or unexported fields
}

UI encapsulates a complete user interface that can be rendered onto the screen. There should only be exactly one UI per application.

func (*UI) AddWindow

func (u *UI) AddWindow(w *widget.Window) widget.RemoveWindowFunc

AddWindow adds window w to ui for rendering. It returns a function to remove w from ui.

func (*UI) ChangeFocus added in v0.3.3

func (u *UI) ChangeFocus(direction FocusDirection)

func (*UI) ClearFocus added in v0.3.0

func (u *UI) ClearFocus()

func (*UI) Draw

func (u *UI) Draw(screen *ebiten.Image)

Draw renders u onto screen. This function should be called in the Ebiten Draw function.

func (*UI) GetFocusedWidget added in v0.4.3

func (u *UI) GetFocusedWidget() widget.Focuser

func (*UI) HasFocus

func (u *UI) HasFocus() bool

func (*UI) IsWindowOpen added in v0.3.3

func (u *UI) IsWindowOpen(w *widget.Window) bool

func (*UI) Update

func (u *UI) Update()

Update updates u. This method should be called in the Ebiten Update function.

Directories

Path Synopsis
_examples
Package event contains types to deal with firing and handling events.
Package event contains types to deal with firing and handling events.
Package image contains types to deal with nine-slice images, buffered (cached) images, as well as drawing using masks.
Package image contains types to deal with nine-slice images, buffered (cached) images, as well as drawing using masks.
Package input deals with user input such as mouse button clicks, scroll wheel movement etc.
Package input deals with user input such as mouse button clicks, scroll wheel movement etc.
utilities
Package widget contains various widget implementations such as buttons, checkboxes, combo boxes, lists etc.
Package widget contains various widget implementations such as buttons, checkboxes, combo boxes, lists etc.

Jump to

Keyboard shortcuts

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