bus

package module
v0.0.0-...-b5449f6 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2023 License: Apache-2.0 Imports: 3 Imported by: 3

README

bus

Main event bus to talk to game engines

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioEvent

type AudioEvent interface {
	GetAudioFile() string
}

type AudioEventListener

type AudioEventListener interface {
	OnAudioEvent(audioChannel <-chan AudioEvent)
}

type ControlEvent

type ControlEvent interface{}

func NewWindowTitleEvent

func NewWindowTitleEvent(data string) ControlEvent

/////WindowTitleEvent//////

type ControlEventListener

type ControlEventListener interface {
	OnControlEvent(controlChannel <-chan ControlEvent)
}

type CursorPoint

type CursorPoint interface {
	GetX() int32
	GetY() int32
	To() (int32, int32)
}

type DrawEvent

type DrawEvent interface {
}

/////////// DrawEvent and the drawEvent struct are no-ops or signaling at best.

func NewDrawEvent

func NewDrawEvent() DrawEvent

type DrawEventListener

type DrawEventListener interface {
	OnDrawEvent(drawChannel <-chan DrawEvent)
}

type DrawLayersEvent

type DrawLayersEvent interface {
	DrawEvent
	Reset()
	GetImageLayers() []lib.ImageLayerData
	AddImageLayer(imgLayer lib.ImageLayerData) DrawEvent
}

func NewDrawLayersEvent

func NewDrawLayersEvent() DrawLayersEvent

type KeyEvent

type KeyEvent interface {
	ToRune() rune
	EqualsRune(keyRune rune) bool
	IsPressed() bool
	IsReleased() bool
}

func NewKeyEvent

func NewKeyEvent(key key.Event) KeyEvent

type KeyEventListener

type KeyEventListener interface {
	OnKeyEvent(keyChannel <-chan KeyEvent)
}

type KeysRegistrationEvent

type KeysRegistrationEvent interface {
	GetRunes() []rune
}

////////////////////////////////////////////////////////////////////

func NewKeyRegistrationEvent

func NewKeyRegistrationEvent(keys []rune) KeysRegistrationEvent

type KeysRegistrationEventListener

type KeysRegistrationEventListener interface {
	OnKeyRegistrationEvent(keyRegistrationChannel <-chan KeysRegistrationEvent)
}

type MouseEvent

type MouseEvent interface {
	GetCursorPoint() CursorPoint
	IsWheel() bool
	IsReleased(button mouse.Button) bool
	IsPressed(button mouse.Button) bool
}

func NewMouseEvent

func NewMouseEvent(event mouse.Event) MouseEvent

type MouseEventListener

type MouseEventListener interface {
	OnMouseEvent(mouseChannel <-chan MouseEvent)
}

type MultilineTextEvent

type MultilineTextEvent interface {
	TextEvent
	lib.Font
	GetText() []lib.TextLine
	AddTextLine(lib.TextLine) MultilineTextEvent
	AddText(string) MultilineTextEvent
	GetId() int32
}

func NewMultilineTextEvent

func NewMultilineTextEvent(font string, fontSize, x, y int32) MultilineTextEvent

type PlayAudioEvent

type PlayAudioEvent interface {
	AudioEvent
	IsLoop() bool
}

func NewPlayAudioEvent

func NewPlayAudioEvent(state lib.AudioState) PlayAudioEvent

type StopAudioEvent

type StopAudioEvent interface {
	AudioEvent
}

func NewStopAudioEvent

func NewStopAudioEvent(state lib.AudioState) StopAudioEvent

type TextEvent

type TextEvent interface {
	Reinitialize() TextEvent
	GetLocation() (x, y int32)
	SetLocation(x, y int32) TextEvent
}

type TextEventListener

type TextEventListener interface {
	OnTextEvent(textChannel <-chan TextEvent)
}

type VorpalBus

type VorpalBus interface {

	///Individual listeners....
	AddKeyEventListener(eventListener KeyEventListener)
	AddMouseListener(eventListener MouseEventListener)
	AddDrawEventListener(eventListener DrawEventListener)
	AddAudioEventListener(eventListener AudioEventListener)
	AddTextEventListener(eventListener TextEventListener)
	AddKeysRegistrationEventListener(eventListener KeysRegistrationEventListener)
	AddControlEventListener(eventListener ControlEventListener)

	SendMouseEvent(event MouseEvent)
	SendKeysRegistrationEvent(event KeysRegistrationEvent)
	SendKeyEvent(event KeyEvent)
	SendDrawEvent(event DrawEvent)
	SendAudioEvent(event AudioEvent)
	SendTextEvent(event TextEvent)
	SendControlEvent(event ControlEvent)
}

func GetVorpalBus

func GetVorpalBus() VorpalBus

type WindowSizeEvent

type WindowSizeEvent interface {
	ControlEvent
	GetWindowSize() (int, int)
}

func NewWindowSizeEvent

func NewWindowSizeEvent(width, height int) WindowSizeEvent

//WindowSizeEvent

type WindowTitleEvent

type WindowTitleEvent interface {
	ControlEvent
	GetTitle() string
}

Jump to

Keyboard shortcuts

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