Type Snapshot

type Snapshot struct {
	Title         string
	Width, Height int
	Clear         Color
	Primitives    []Primitive
	Labels        []Label
	// Editor is nil unless a text field is being edited natively.
	Editor *Editor
	// Texts is every text the application painted this frame, before clipping,
	// for queries; Labels holds what is actually drawn.
	Texts []ui.Text
	// Runs are the text runs Texts refer to; see TextRuns.
	Runs []ui.TextRun
	Hits []ui.Hit
	// Tree is the identity tree the hits are named in, for printing them.
	Tree *ui.Tree
	// Focused and Hovered are hit identities (0 for none).
	Focused ui.ID
	Hovered ui.ID
	Cursor  Cursor
	Now     time.Duration
}

Snapshot is everything visible and interactive at one moment.

Methods

TextRuns#

func (snapshot Snapshot) TextRuns(text ui.Text) []ui.TextRun

TextRuns returns the runs of one of the snapshot's Texts.