components

package
v0.0.0-...-8789af9 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 4 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 {
	Node
	// contains filtered or unexported fields
}

func NewButton

func NewButton(x, y, width, height int, cornerRadius int, label string, onClick func()) *Button

func (*Button) Render

func (b *Button) Render(ctx gui.DrawContext)

func (*Button) Update

func (b *Button) Update()

type Component

type Component interface {
	Update()
	Render(ctx gui.DrawContext)
}

type Node

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

func (*Node) AppendChild

func (n *Node) AppendChild(child Component)

func (*Node) GetOffset

func (n *Node) GetOffset() (int, int)

func (*Node) Render

func (n *Node) Render(ctx gui.DrawContext)

func (*Node) SetOffset

func (n *Node) SetOffset(x int, y int)

func (*Node) Update

func (n *Node) Update()

type Slider

type Slider struct {
	Node
	// contains filtered or unexported fields
}

func NewSlider

func NewSlider(x, y, width, height int, minValue, maxValue float32, onChange func(float32)) *Slider

func (*Slider) GetValue

func (s *Slider) GetValue() float32

func (*Slider) Render

func (s *Slider) Render(ctx gui.DrawContext)

func (*Slider) Update

func (s *Slider) Update()

type Toggle

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

func NewToggle

func NewToggle(x, y, width, height int, initialState bool, onChange func(bool)) *Toggle

func (*Toggle) IsOn

func (t *Toggle) IsOn() bool

func (*Toggle) Render

func (t *Toggle) Render(ctx gui.DrawContext)

func (*Toggle) Update

func (t *Toggle) Update()

Jump to

Keyboard shortcuts

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