viewer

package
Version: v0.0.0-...-72a9a6f Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynaText

type DynaText struct {
	Color sdl.Color

	X      int32
	Y      int32
	Width  int32
	Height int32
	// contains filtered or unexported fields
}

DynaText represents dynamically changing text. The text is broken down into characters and each character is rendered using an existing character atlas. This is a base class for dynamic text.

func NewDynaText

func NewDynaText(font *Font, renderer *sdl.Renderer, color sdl.Color) *DynaText

NewDynaText creates a Text object.

func (*DynaText) Destroy

func (t *DynaText) Destroy()

Destroy closes the Text

func (*DynaText) Draw

func (t *DynaText) Draw(text string)

Draw renders text

func (*DynaText) DrawAt

func (t *DynaText) DrawAt(x, y int32, text string)

DrawAt renders text at the specified position

type Font

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

Font wraps the SDL TTF fonts.

func NewFont

func NewFont(fontPath string, size int) *Font

NewFont creates a Font object: Ex NewFont("neuropol x rg.ttf", 16)

func (*Font) Destroy

func (f *Font) Destroy()

Destroy closes the font

type IViewer

type IViewer interface {
	// Open(IHost)
	Open()
	Run()
	Close()
	Quit()
	Configure()
	SetFont(fontPath string, size int)
}

IViewer is the graph viewer

func NewViewer

func NewViewer() IViewer

NewViewer creates a new viewer and initializes it.

type Text

type Text struct {
	Bounds sdl.Rect
	// contains filtered or unexported fields
}

Text represents a text texture for rendering.

func NewText

func NewText(font *Font, renderer *sdl.Renderer) *Text

NewText creates a Text object.

func (*Text) Destroy

func (t *Text) Destroy() error

Destroy closes the Text

func (*Text) Draw

func (t *Text) Draw()

Draw renders text

func (*Text) DrawAt

func (t *Text) DrawAt(x, y int32)

DrawAt renders text

func (*Text) SetText

func (t *Text) SetText(text string, color sdl.Color) (err error)

SetText builds an SDL texture. Be sure to call Destroy before program exit.

type Viewer

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

Viewer is the GUI and shows the plots and graphs. It receives commands for graphing and viewing various graphs.

func (*Viewer) Close

func (v *Viewer) Close()

Close closes the viewer. Be sure to setup a "defer x.Close()"

func (*Viewer) Configure

func (v *Viewer) Configure()

Configure view with draw objects

func (*Viewer) Open

func (v *Viewer) Open()

Open shows the viewer and begins event polling (host deuron.IHost)

func (*Viewer) Quit

func (v *Viewer) Quit()

Quit stops the gui from running, effectively shutting it down.

func (*Viewer) Run

func (v *Viewer) Run()

Run starts the polling event loop. This must run on the main thread.

func (*Viewer) SetFont

func (v *Viewer) SetFont(fontPath string, size int)

SetFont sets the font based on path and size.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto