seGUI

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

README

seGUI

A simple UI library for golang and Ebitenengine.

WIP! Development just begining.

Screenshot of some basic code and a basic window

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultWinSettings = WindowData{
	HasTitleBar: true, Closable: true, Movable: true,
	TitleColor:       color.RGBA{R: 255, G: 255, B: 255, A: 255},
	TitleBGColor:     color.RGBA{R: 32, G: 32, B: 32, A: 255},
	TitleButtonColor: color.RGBA{R: 255, G: 255, B: 255, A: 255},
	BGColor:          color.RGBA{R: 16, G: 16, B: 16, A: 255},
}

Functions

func AddWindow

func AddWindow(windowID string, window WindowData) error

Add a window. Returns true if added

func CloseWindow

func CloseWindow(windowID string) error

func DeleteWindow

func DeleteWindow(windowID string) error

Delete a window. Returns true if deleted

func DrawWindows

func DrawWindows(screen *ebiten.Image)

Run this in ebiten draw(), pass "screen"

func OpenWindow

func OpenWindow(windowID string) error

func UpdateWindow

func UpdateWindow(windowID string, window WindowData) error

Update a window. Returns true if updated

func UpdateWindowItems

func UpdateWindowItems(windowID string, windowItems []WindowItemData) error

Update window items. Returns true if updated

Types

type V2i

type V2i struct {
	X, Y int
}

type WindowData

type WindowData struct {
	Title string

	StartPosition,
	StartSize V2i

	Closable, Focused, AutoCentered,
	Borderless, Movable, CachePersist,
	Resizable, KeepPosition, HasTitleBar bool

	TitleColor,
	TitleBGColor,
	TitleButtonColor,
	BGColor,
	BorderColor color.Color
}

type WindowItemData

type WindowItemData struct {
	Text     string
	Size     V2i
	Position V2i

	Color, HoverColor, ActionColor color.Color

	Action func()
}

Jump to

Keyboard shortcuts

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