inputviz

package
v4.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package inputviz provides components that enable visualization of user input (e.g. mouse, keyboard) for debugging

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.CallerID
	// contains filtered or unexported fields
}

Joystick visualizes the inputs sent to a controller

func (*Joystick) CID

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

func (*Joystick) Destroy

func (j *Joystick) Destroy()

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[key.Code]color.Color
	KeyboardLayout

	RenderCharacters bool
	Font             *render.Font

	event.CallerID
	// contains filtered or unexported fields
}

func (*Keyboard) CID

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

func (*Keyboard) Destroy

func (k *Keyboard) Destroy()

func (*Keyboard) RenderAndListen

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

type KeyboardLayout

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

type LayoutKey

type LayoutKey interface {
	Pos() LayoutPosition
}

type LayoutPosition

type LayoutPosition struct {
	Key    key.Code
	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 key.Code) floatgeom.Rect2

type Mouse

type Mouse struct {
	Rect      floatgeom.Rect2
	BaseLayer int

	event.CallerID
	// contains filtered or unexported fields
}

func (*Mouse) CID

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

func (*Mouse) Destroy

func (m *Mouse) Destroy()

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