ui

package
v0.0.0-...-5c722c9 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button struct {
	Visible bool

	Pos  ge.Pos
	Text string

	PrevInput inputElement
	NextInput inputElement

	EventActivated gesignal.Event[*Button]
	// contains filtered or unexported fields
}

func (*Button) Activate

func (b *Button) Activate()

func (*Button) Dispose

func (b *Button) Dispose()

func (*Button) Init

func (b *Button) Init(scene *ge.Scene)

func (*Button) IsDisabled

func (b *Button) IsDisabled() bool

func (*Button) IsDisposed

func (b *Button) IsDisposed() bool

func (*Button) IsFocused

func (b *Button) IsFocused() bool

func (*Button) SetDisabled

func (b *Button) SetDisabled(disabled bool)

func (*Button) SetFocus

func (b *Button) SetFocus(focused bool)

func (*Button) Update

func (b *Button) Update(delta float64)

type ButtonStyle

type ButtonStyle struct {
	Width  float64
	Height float64

	BorderWidth float64

	Font resource.FontID

	BorderColor     ge.ColorScale
	BackgroundColor ge.ColorScale
	TextColor       ge.ColorScale

	FocusedBorderColor     ge.ColorScale
	FocusedBackgroundColor ge.ColorScale
	FocusedTextColor       ge.ColorScale

	DisabledBorderColor     ge.ColorScale
	DisabledBackgroundColor ge.ColorScale
	DisabledTextColor       ge.ColorScale
}

func DefaultButtonStyle

func DefaultButtonStyle() ButtonStyle

func (ButtonStyle) Resized

func (style ButtonStyle) Resized(w, h float64) ButtonStyle

type Image

type Image struct {
	Resource       resource.Image
	FlipHorizontal bool
	FlipVertical   bool
}

type ImageButton

type ImageButton struct {
	Visible bool

	Pos ge.Pos

	PrevInput inputElement
	NextInput inputElement

	EventActivated gesignal.Event[*ImageButton]
	// contains filtered or unexported fields
}

func (*ImageButton) Activate

func (b *ImageButton) Activate()

func (*ImageButton) Dispose

func (b *ImageButton) Dispose()

func (*ImageButton) Init

func (b *ImageButton) Init(scene *ge.Scene)

func (*ImageButton) IsDisabled

func (b *ImageButton) IsDisabled() bool

func (*ImageButton) IsDisposed

func (b *ImageButton) IsDisposed() bool

func (*ImageButton) IsFocused

func (b *ImageButton) IsFocused() bool

func (*ImageButton) SetFocus

func (b *ImageButton) SetFocus(focused bool)

func (*ImageButton) SetImage

func (b *ImageButton) SetImage(image Image)

func (*ImageButton) Update

func (b *ImageButton) Update(delta float64)

type ImageButtonStyle

type ImageButtonStyle struct {
	Width  float64
	Height float64

	BorderWidth float64

	BorderColor     ge.ColorScale
	BackgroundColor ge.ColorScale
	ImageColor      ge.ColorScale

	FocusedBorderColor     ge.ColorScale
	FocusedBackgroundColor ge.ColorScale
	FocusedImageColor      ge.ColorScale
}

func DefaultImageButtonStyle

func DefaultImageButtonStyle() ImageButtonStyle

func (ImageButtonStyle) Resized

func (style ImageButtonStyle) Resized(w, h float64) ImageButtonStyle

type Root

type Root struct {
	ActivationAction input.Action
	PrevInputAction  input.Action
	NextInputAction  input.Action
	// contains filtered or unexported fields
}

func NewRoot

func NewRoot(ctx *ge.Context, h *input.Handler) *Root

func (*Root) ConnectInputs

func (r *Root) ConnectInputs(from, to inputElement)

func (*Root) Dispose

func (r *Root) Dispose()

func (*Root) FocusInputAfter

func (r *Root) FocusInputAfter(e inputElement)

func (*Root) FocusInputBefore

func (r *Root) FocusInputBefore(e inputElement)

func (*Root) FocusNextInput

func (r *Root) FocusNextInput()

func (*Root) FocusPrevInput

func (r *Root) FocusPrevInput()

func (*Root) Init

func (r *Root) Init(scene *ge.Scene)

func (*Root) IsDisposed

func (r *Root) IsDisposed() bool

func (*Root) NewButton

func (r *Root) NewButton(style ButtonStyle) *Button

func (*Root) NewImageButton

func (r *Root) NewImageButton(style ImageButtonStyle) *ImageButton

func (*Root) Update

func (r *Root) Update(delta float64)

type ValueLabel

type ValueLabel[T comparable] struct {
	Visible bool

	Pos ge.Pos
	// contains filtered or unexported fields
}

func NewValueLabel

func NewValueLabel[T comparable](r *Root, style ValueLabelStyle) *ValueLabel[T]

func (*ValueLabel[T]) BindValue

func (l *ValueLabel[T]) BindValue(value *T)

func (*ValueLabel[T]) Dispose

func (l *ValueLabel[T]) Dispose()

func (*ValueLabel[T]) Init

func (l *ValueLabel[T]) Init(scene *ge.Scene)

func (*ValueLabel[T]) IsDisposed

func (l *ValueLabel[T]) IsDisposed() bool

func (*ValueLabel[T]) SetText

func (l *ValueLabel[T]) SetText(s string)

func (*ValueLabel[T]) Update

func (l *ValueLabel[T]) Update(delta float64)

type ValueLabelStyle

type ValueLabelStyle struct {
	Width  float64
	Height float64

	BorderWidth float64

	Font resource.FontID

	BorderColor     ge.ColorScale
	BackgroundColor ge.ColorScale
	TextColor       ge.ColorScale
}

func DefaultValueLabelStyle

func DefaultValueLabelStyle() ValueLabelStyle

Jump to

Keyboard shortcuts

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