debugui

package module
v0.0.0-...-7eae500 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: Apache-2.0 Imports: 19 Imported by: 1

README

DebugUI for Ebitengine

The project is currently under development. The API is subject to frequent changes. Please do not use it in production.

DebugUI is a UI toolkit especially for debugging. This is based on Microui. The original Microui was developed by @rxi. The original Go port was developed by @zeozeozeo and @Zyko0.

License

DebugUI for Ebitengine is licensed under Apache license version 2.0. See LICENSE file.

Microui

https://github.com/rxi/microui

Copyright (c) 2024 rxi

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Documentation

Index

Constants

View Source
const (
	ColorText = iota
	ColorBorder
	ColorWindowBG
	ColorTitleBG
	ColorTitleText
	ColorPanelBG
	ColorButton
	ColorButtonHover
	ColorButtonFocus
	ColorBase
	ColorBaseHover
	ColorBaseFocus
	ColorScrollBase
	ColorScrollThumb
	ColorMax = ColorScrollThumb
)

Variables

This section is empty.

Functions

func DrawText

func DrawText(dst *ebiten.Image, str string, op *text.DrawOptions)

Types

type Context

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

func (*Context) Button

func (c *Context) Button(label string) Response

func (*Context) Checkbox

func (c *Context) Checkbox(label string, state *bool) Response

func (*Context) Container

func (c *Context) Container(name string) *container

func (*Context) Control

func (c *Context) Control(idStr string, f func(r image.Rectangle) Response) Response

func (*Context) DrawControl

func (c *Context) DrawControl(f func(screen *ebiten.Image))

func (*Context) Header

func (c *Context) Header(label string, expanded bool) Response

func (*Context) Label

func (c *Context) Label(text string)

func (*Context) LayoutColumn

func (c *Context) LayoutColumn(f func())

func (*Context) Number

func (c *Context) Number(value *float64, step float64, digits int) Response

func (*Context) OpenPopup

func (c *Context) OpenPopup(name string)

func (*Context) Panel

func (c *Context) Panel(name string, f func(layout Layout))

func (*Context) Popup

func (c *Context) Popup(name string, f func(res Response, layout Layout))

func (*Context) SetFocus

func (c *Context) SetFocus()

func (*Context) SetLayoutRow

func (c *Context) SetLayoutRow(widths []int, height int)

func (*Context) SetScroll

func (c *Context) SetScroll(scroll image.Point)

func (*Context) Slider

func (c *Context) Slider(value *float64, lo, hi float64, step float64, digits int) Response

func (*Context) Text

func (c *Context) Text(text string)

func (*Context) TextBox

func (c *Context) TextBox(buf *string) Response

func (*Context) TreeNode

func (c *Context) TreeNode(label string, f func(res Response))

func (*Context) Window

func (c *Context) Window(title string, rect image.Rectangle, f func(res Response, layout Layout))

type DebugUI

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

func New

func New() *DebugUI

func (*DebugUI) Draw

func (d *DebugUI) Draw(screen *ebiten.Image)

func (*DebugUI) Update

func (d *DebugUI) Update(f func(ctx *Context))

type Layout

type Layout struct {
	Rect        image.Rectangle
	Body        image.Rectangle
	ContentSize image.Point
	Scroll      image.Point
}

type Response

type Response int
const (
	ResponseActive Response = (1 << 0)
	ResponseSubmit Response = (1 << 1)
	ResponseChange Response = (1 << 2)
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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