inputviz

package
v3.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Joystick

type Joystick struct {
	// Rect is the rect this joystick should be drawn to.
	// Defaults to (0,0)->(320,240)
	Rect floatgeom.Rect2

	// StickDeadzone is the lowest value of stick movements that should
	// be rendered.
	StickDeadzone int16

	// BaseLayer is the base layer to render the resulting renderables to
	// if -1, it will render only to the layer provided to RenderAndListen.
	BaseLayer int

	event.CID
	// contains filtered or unexported fields
}

Joystick visualizes the inputs sent to a controller

func (*Joystick) CheckedBind

func (j *Joystick) CheckedBind(ev string, f func(*Joystick, *joystick.State))

func (*Joystick) CheckedIDBind

func (j *Joystick) CheckedIDBind(ev string, f func(*Joystick, uint32))

func (*Joystick) Destroy

func (j *Joystick) Destroy()

func (*Joystick) Init

func (j *Joystick) Init() event.CID

func (*Joystick) RenderAndListen

func (j *Joystick) RenderAndListen(ctx *scene.Context, joy *joystick.Joystick, layer int) error

type Keyboard

type Keyboard struct {
	Rect      floatgeom.Rect2
	BaseLayer int
	Colors    map[string]color.Color
	KeyboardLayout

	RenderCharacters bool
	Font             *render.Font

	event.CID
	// contains filtered or unexported fields
}

func (*Keyboard) Destroy

func (k *Keyboard) Destroy()

func (*Keyboard) Init

func (k *Keyboard) Init() event.CID

func (*Keyboard) RenderAndListen

func (k *Keyboard) RenderAndListen(ctx *scene.Context, layer int) error

type KeyboardLayout

type KeyboardLayout interface {
	KeyRect(k string) floatgeom.Rect2
}

type LayoutKey

type LayoutKey interface {
	Pos() LayoutPosition
}

type LayoutPosition

type LayoutPosition struct {
	Key    string
	Gap    bool
	Width  float64
	Height float64
	Row    float64
	Col    float64
}

type LayoutQWERTY

type LayoutQWERTY struct {
	Bounds floatgeom.Rect2
	// contains filtered or unexported fields
}

func (*LayoutQWERTY) KeyRect

func (l *LayoutQWERTY) KeyRect(k string) floatgeom.Rect2

type Mouse

type Mouse struct {
	Rect      floatgeom.Rect2
	BaseLayer int

	event.CID
	// contains filtered or unexported fields
}

func (*Mouse) Destroy

func (m *Mouse) Destroy()

func (*Mouse) Init

func (m *Mouse) Init() event.CID

func (*Mouse) RenderAndListen

func (m *Mouse) RenderAndListen(ctx *scene.Context, layer int) error

Jump to

Keyboard shortcuts

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