components

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 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 struct {
	Text  string
	ID    string
	Value string
}

type List

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

func NewList

func NewList(renderer *sdl.Renderer, maxVisibleItems int, position sdl.Point, itemFormatter func(index int, item Item) string) *List

func (*List) Draw

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

func (*List) GetItems

func (l *List) GetItems() []Item

func (*List) GetScrollOffset

func (l *List) GetScrollOffset() int

func (*List) GetSelectedIndex

func (l *List) GetSelectedIndex() int

func (*List) ScrollDown

func (l *List) ScrollDown()

func (*List) ScrollUp

func (l *List) ScrollUp()

func (*List) SetItems

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

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