components

package
v0.0.0-...-5202d7a Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 6 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) IsPressed

func (b *Button) IsPressed() bool

func (*Button) Render

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

func (*Button) SetText

func (b *Button) SetText(text string)

type Component

type Component interface {
	Update()
	Render(ctx gui.DrawContext)
	SetParent(parent *Node)
	GetParent() *Node
	GetGlobalOffset() (int, int)
	GetDimensions() (int, int)
}

type Dockable

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

func NewDockable

func NewDockable(width, height int, onDock func(x, y int), screenWidth, screenHeight int) *Dockable

func (*Dockable) Dock

func (d *Dockable) Dock(x, y int)

func (*Dockable) Undock

func (d *Dockable) Undock()

func (*Dockable) Update

func (d *Dockable) Update(globalX, globalY int)

type Draggable

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

func NewDraggable

func NewDraggable(width, height int, onDrag func(x, y int), onDragStart func(mouseX, mouseY int), onDragEnd func()) *Draggable

func (*Draggable) SetDimensions

func (d *Draggable) SetDimensions(width, height int)

func (*Draggable) Update

func (d *Draggable) Update(globalX, globalY int)

type Label

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

func NewLabel

func NewLabel(x, y int, text string) *Label

func (*Label) Render

func (l *Label) Render(ctx gui.DrawContext)

func (*Label) SetColor

func (l *Label) SetColor(color color.Color)

func (*Label) SetPtSize

func (l *Label) SetPtSize(ptSize int)

func (*Label) SetText

func (l *Label) SetText(text string)

type Node

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

func (*Node) AppendChild

func (n *Node) AppendChild(child Component)

func (*Node) GetDimensions

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

func (*Node) GetGlobalOffset

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

func (*Node) GetGlobalOffsetX

func (n *Node) GetGlobalOffsetX() int

func (*Node) GetGlobalOffsetY

func (n *Node) GetGlobalOffsetY() int

func (*Node) GetOffset

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

func (*Node) GetParent

func (n *Node) GetParent() *Node

func (*Node) IsWithinBounds

func (n *Node) IsWithinBounds(mouseX, mouseY int) bool

func (*Node) Render

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

func (*Node) SetOffset

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

func (*Node) SetParent

func (n *Node) SetParent(parent *Node)

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) SetValue

func (s *Slider) SetValue(actualValue float32)

type Surface

type Surface struct {
	Node

	IsLocked bool
	// contains filtered or unexported fields
}

func NewSurface

func NewSurface(x, y, width, height int) *Surface

func (*Surface) Dock

func (s *Surface) Dock(x, y int)

func (*Surface) DockBottom

func (s *Surface) DockBottom()

func (*Surface) DockLeft

func (s *Surface) DockLeft()

func (*Surface) DockRight

func (s *Surface) DockRight()

func (*Surface) DockTop

func (s *Surface) DockTop()

func (*Surface) OnDragEnd

func (s *Surface) OnDragEnd()

func (*Surface) OnDragStart

func (s *Surface) OnDragStart(mouseX, mouseY int)

func (*Surface) OnWindowResize

func (s *Surface) OnWindowResize(newWindowWidth, newWindowHeight int)

func (*Surface) PrepareRender

func (s *Surface) PrepareRender(ctx gui.DrawContext)

func (*Surface) Render

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

func (*Surface) Reposition

func (s *Surface) Reposition()

func (*Surface) Resize

func (s *Surface) Resize(width, height int)

func (*Surface) ResizeBottom

func (s *Surface) ResizeBottom(x, y int)

func (*Surface) ResizeLeft

func (s *Surface) ResizeLeft(x, y int)

func (*Surface) ResizeRight

func (s *Surface) ResizeRight(x, y int)

func (*Surface) ResizeTop

func (s *Surface) ResizeTop(x, y int)

func (Surface) SetDimensions

func (h Surface) SetDimensions(width, height int)

func (*Surface) Undock

func (s *Surface) Undock()

type TextBox

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

func NewTextBox

func NewTextBox(x, y, width int, textColor, bgColor color.Color) *TextBox

func (*TextBox) Height

func (tb *TextBox) Height() int

func (*TextBox) Render

func (tb *TextBox) Render(ctx gui.DrawContext)

func (*TextBox) SetText

func (tb *TextBox) SetText(text string)

func (*TextBox) Update

func (tb *TextBox) Update()

type Toggle

type Toggle struct {
	Node
	// 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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳