ctrl

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateTPS added in v0.6.0

func UpdateTPS(tps float64)

https://go.dev/play/p/NgTdSwjyCXC

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   float64
	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 Int32Handler added in v0.6.0

type Int32Handler struct {
	Value *int32
	Min   int32
	Max   int32
	Unit  int32
	Loop  bool
}

func (Int32Handler) Decrease added in v0.6.0

func (h Int32Handler) Decrease()

func (Int32Handler) Increase added in v0.6.0

func (h Int32Handler) Increase()

type Int64Handler added in v0.3.1

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

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   int
	Max   int
	Unit  int
	Loop  bool
}

Todo: merge with Int64Handler into one

func (IntHandler) Decrease

func (h IntHandler) Decrease()

func (IntHandler) Increase

func (h IntHandler) Increase()

type KeyHandler

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

Todo: Modifiers work strangely when there are plural modifiers. Todo: support modifiers for KeyHandler

func (*KeyHandler) Handle added in v0.6.0

func (kh *KeyHandler) Handle() (fired bool)

Update returns whether the handler has fired (triggered) or not.

type UIKeyListener added in v0.6.0

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

Required ticks to trigger pressing key: 0, long, short, short, short, ...

func NewUIKeyListener added in v0.6.0

func NewUIKeyListener(keys []input.Key) UIKeyListener

func (*UIKeyListener) Listen added in v0.6.0

func (kl *UIKeyListener) Listen() input.Key

Jump to

Keyboard shortcuts

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