components

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item[T any] struct {
	Label string
	Value T
}

type List

type List[T any] struct {
	// contains filtered or unexported fields
}

func NewList

func NewList[T any](renderer *sdl.Renderer, maxVisibleItems int, position sdl.Point, itemFormatter fmtFunc[T]) *List[T]

func (*List[T]) Draw

func (l *List[T]) Draw(primaryColor sdl.Color, selectedColor sdl.Color)

func (*List[T]) GetScrollOffset

func (l *List[T]) GetScrollOffset() int

func (*List[T]) GetSelectedIndex

func (l *List[T]) GetSelectedIndex() int

func (*List[T]) GetValues added in v1.4.0

func (l *List[T]) GetValues() []T

func (*List[T]) ScrollDown

func (l *List[T]) ScrollDown()

func (*List[T]) ScrollUp

func (l *List[T]) ScrollUp()

func (*List[T]) SelectedValue added in v1.4.0

func (l *List[T]) SelectedValue() T

func (*List[T]) SetItems

func (l *List[T]) SetItems(items []Item[T])

type TextArea

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

func NewTextArea

func NewTextArea(renderer *sdl.Renderer, text string, font *ttf.Font, maxVisibleLines int, maxWidth int) *TextArea

func (*TextArea) Draw

func (t *TextArea) Draw(primaryColor sdl.Color)

func (*TextArea) GetLines

func (t *TextArea) GetLines() []string

func (*TextArea) GetScrollOffset

func (t *TextArea) GetScrollOffset() int

func (*TextArea) ScrollDown

func (t *TextArea) ScrollDown()

func (*TextArea) ScrollUp

func (t *TextArea) ScrollUp()

type TextView

type TextView struct {
	YOffset int
	// contains filtered or unexported fields
}

func NewTextView

func NewTextView(renderer *sdl.Renderer, size TextViewSize, position sdl.Point) *TextView

func (*TextView) AddText

func (t *TextView) AddText(text string)

func (TextView) AtBottom

func (t TextView) AtBottom() bool

func (TextView) AtTop

func (t TextView) AtTop() bool

func (*TextView) Draw

func (t *TextView) Draw(textColor sdl.Color)

func (*TextView) GetScrollOffset

func (t *TextView) GetScrollOffset() int

func (*TextView) GetText

func (t *TextView) GetText() []string

func (*TextView) GoToBottom

func (t *TextView) GoToBottom()

func (*TextView) ScrollDown

func (t *TextView) ScrollDown(n int)

func (*TextView) ScrollUp

func (t *TextView) ScrollUp(n int)

func (*TextView) SetContent

func (t *TextView) SetContent(text []string)

func (*TextView) SetYOffset

func (t *TextView) SetYOffset(n int)

type TextViewSize added in v1.2.0

type TextViewSize struct {
	Width  int
	Height int
}

Jump to

Keyboard shortcuts

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