minigui

package
v0.0.0-...-1449d46 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawSliderShape

func DrawSliderShape[T float32 | float64 | int](s *slider[T], image *ebiten.Image, whiteImage *ebiten.Image, left, top, width, height, scale float32)

func UpdateSlider

func UpdateSlider[T float32 | float64 | int](s *slider[T], x, y, width, height, scale float32)

Types

type Component

type Component interface {
	Label() string
	Update(x, y, width, height, scale float32)
	Draw(image *ebiten.Image, whiteImage *ebiten.Image, top, left, width, height, scale float32)
}

type GUI

type GUI struct {
	X               float32
	Y               float32
	Width           float32
	ComponentHeight float32
	Scale           float32

	HorizontalAlign HorizontalAlign
	// contains filtered or unexported fields
}

func NewGUI

func NewGUI() *GUI

func (*GUI) AddButton

func (g *GUI) AddButton(label string, value bool, callback func(v bool))

func (*GUI) AddSliderFloat32

func (g *GUI) AddSliderFloat32(label string, value, min, max float32, callback func(v float32))

func (*GUI) AddSliderFloat64

func (g *GUI) AddSliderFloat64(label string, value, min, max float64, callback func(v float64))

func (*GUI) AddSliderInt

func (g *GUI) AddSliderInt(label string, value, min, max int, callback func(v int))

func (*GUI) Draw

func (g *GUI) Draw(image *ebiten.Image)

func (*GUI) SetTitle

func (g *GUI) SetTitle(t string)

func (*GUI) Update

func (g *GUI) Update()

type HorizontalAlign

type HorizontalAlign int
const (
	HorizontalAlignLeft HorizontalAlign = iota
	HorizontalAlignRight
)

type RangeInterpolator

type RangeInterpolator[T float32 | float64 | int] struct {
	Min   T
	Max   T
	Value T
}

func (*RangeInterpolator[T]) Ratio

func (r *RangeInterpolator[T]) Ratio() float64

func (*RangeInterpolator[T]) SetRatio

func (r *RangeInterpolator[T]) SetRatio(ratio float64)

func (*RangeInterpolator[T]) String

func (r *RangeInterpolator[T]) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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