ctrl

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ToTick = times.ToTick
	ToTime = times.ToTime
)

Functions

This section is empty.

Types

type BoolHandler

type BoolHandler struct {
	Value *bool
}

func (BoolHandler) Decrease

func (h BoolHandler) Decrease()

func (BoolHandler) Increase

func (h BoolHandler) Increase()

type FloatHandler

type FloatHandler struct {
	Value    *float64
	Min, Max float64
	Unit     float64
}

func (FloatHandler) Decrease

func (h FloatHandler) Decrease()

func (FloatHandler) Increase

func (h FloatHandler) Increase()

type Handler

type Handler interface {
	Decrease()
	Increase()
}

type Int added in v0.3.1

type Int interface{ int | int64 }

type Int64Handler added in v0.3.1

type Int64Handler struct {
	Value    *int64
	Min, Max int64
	Loop     bool
	Unit     int64
}

Todo: merge with IntHandler into one Todo: add Unit to IntHandler?

func (Int64Handler) Decrease added in v0.3.1

func (h Int64Handler) Decrease()

func (Int64Handler) Increase added in v0.3.1

func (h Int64Handler) Increase()

type IntHandler

type IntHandler struct {
	Value    *int
	Min, Max int
	Loop     bool
}

func (IntHandler) Decrease

func (h IntHandler) Decrease()

func (IntHandler) Increase

func (h IntHandler) Increase()

type KeyHandler

type KeyHandler struct {
	Handler
	Modifiers []input.Key // Handler works only when all Modifier are pressed.
	Keys      [2]input.Key
	Sounds    [2]audios.Sounder
	Volume    *float64
	// contains filtered or unexported fields
}

func (*KeyHandler) Update

func (h *KeyHandler) Update() (set bool)

Update returns whether the handler has set off (triggered) or not. Todo: set off the stricter handler only

Jump to

Keyboard shortcuts

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