events

package
v0.0.0-...-aac1211 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 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 EventsProvider

type EventsProvider interface {
	Mouse() *Mouse
	Gamepad() *Gamepad
	Keyboard() *KeyBoard
	Input() *Input
	Window() *Window
}

func UseEvents

func UseEvents() EventsProvider

type Gamepad

type Gamepad struct {
	GamepadPress
}

func NewGamepad

func NewGamepad() *Gamepad

type GamepadPress

type GamepadPress struct{}

func (*GamepadPress) AreGamepadButtonsCombined

func (g *GamepadPress) AreGamepadButtonsCombined(button1, button2 ebiten.GamepadButton) bool

func (*GamepadPress) AreGamepadButtonsCombinedInOrder

func (g *GamepadPress) AreGamepadButtonsCombinedInOrder(m, s ebiten.GamepadButton) bool

func (*GamepadPress) AreGamepadButtonsCombinedOnce

func (g *GamepadPress) AreGamepadButtonsCombinedOnce(button1, button2 ebiten.GamepadButton) bool

func (*GamepadPress) IsAnyButtonPressed

func (g *GamepadPress) IsAnyButtonPressed() bool

func (*GamepadPress) IsGamepadButtonPressed

func (g *GamepadPress) IsGamepadButtonPressed(button ebiten.GamepadButton) bool

func (*GamepadPress) IsGamepadButtonPressedOnce

func (g *GamepadPress) IsGamepadButtonPressedOnce(button ebiten.GamepadButton) bool

func (*GamepadPress) IsGamepadConnected

func (g *GamepadPress) IsGamepadConnected() bool

Checks if any gamepad is connected

type IBuffer

type IBuffer interface {
	Clean()

	UpdateCursorBlink()
	CleanBlinking()
	CleanBlinkingUnfocus()

	Push(rune)
	Pop()
	ReadClean() string
	Last() rune
	Read() string
}

func NewBuffer

func NewBuffer() IBuffer

type Input

type Input struct {
	InputBuffers
}

func NewInput

func NewInput() *Input

type InputBuffers

type InputBuffers struct {
	SettingsMenuNameBuffer, JoinGameBuffer IBuffer
}

func (*InputBuffers) CleanBuffersBlinking

func (i *InputBuffers) CleanBuffersBlinking()

type KeyBoard

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

func NewKeyBoard

func NewKeyBoard() *KeyBoard

func (*KeyBoard) AreKeysCombinedInOrder

func (k *KeyBoard) AreKeysCombinedInOrder(m, s ebiten.Key) bool

func (*KeyBoard) CleanPressedKey

func (k *KeyBoard) CleanPressedKey(key ebiten.Key) string

func (*KeyBoard) HandleKeyPress

func (k *KeyBoard) HandleKeyPress(b IBuffer, ke []KeyBoardEntity)

func (*KeyBoard) IsAnyKeyPressed

func (k *KeyBoard) IsAnyKeyPressed() bool

Checks if any keyboard key pressed

func (*KeyBoard) IsKeyInList

func (b *KeyBoard) IsKeyInList(k ebiten.Key, l []ebiten.Key) bool

type KeyBoardEntity

type KeyBoardEntity struct {

	//Describes single keys like "T", "A"...
	SingleKeys []ebiten.Key

	//Describes combined keys like: "CTRL+V" or "CTRL+C"
	Combination struct {
		AwaitKey   []ebiten.Key
		ControlKey ebiten.Key
	}
	Pressed  bool
	Callback func(IBuffer, rune)
}

Keyboard entity which is used for key handler with further callback

type Mouse

type Mouse struct {
	MousePress
	MouseWheel
}

func NewMouse

func NewMouse() *Mouse

func (*Mouse) IsAnyMouseButtonsPressed

func (p *Mouse) IsAnyMouseButtonsPressed() bool

func (*Mouse) IsAnyMovementButtonPressed

func (p *Mouse) IsAnyMovementButtonPressed() bool

type MousePress

type MousePress struct{}

func (*MousePress) IsMousePressLeftOnce

func (p *MousePress) IsMousePressLeftOnce(m sources.MetadataModel) bool

func (*MousePress) IsMousePressLeftOnceStatic

func (p *MousePress) IsMousePressLeftOnceStatic(m sources.MetadataModel) bool

It checks collision with a static object, which won't change its size after window resizing

type MouseWheel

type MouseWheel struct {
	IsMoved bool

	LastMouseWheelX, LastMouseWheelY float64
	OffsetX, OffsetY                 float64
	// contains filtered or unexported fields
}

func (*MouseWheel) UpdateMouseWheelOffsets

func (p *MouseWheel) UpdateMouseWheelOffsets()

Saves mouse wheel offsets using ebiten API or uses offsets gotten from gamepad

type Window

type Window struct{}

func NewWindow

func NewWindow() *Window

func (*Window) OnClose

func (w *Window) OnClose()

func (*Window) OnStartUp

func (w *Window) OnStartUp()

Jump to

Keyboard shortcuts

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