events

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: Apache-2.0 Imports: 5 Imported by: 9

Documentation

Overview

Package events contain the events for our engine

Index

Constants

This section is empty.

Variables

TYPE hold the reflect.Type for our events

Functions

This section is empty.

Types

type ChangeGameStage

type ChangeGameStage struct {
	// Stage is the name of the stage to change to, it must be created with engine.AddGameStage
	Stage string
}

ChangeGameStage is an event that indicates that change game stage, all entities, systems, sprites sheets and textures will be removed. If the Stage does not exist the game.Run method will return an error. Stages must be created with engine.AddGameStage

type ChangeMasterVolumeEvent added in v0.1.9

type ChangeMasterVolumeEvent struct {
	Volume float32 // Volume to be set
}

ChangeMasterVolumeEvent to a given Volume

type ChangeMusicVolumeEvent added in v0.1.9

type ChangeMusicVolumeEvent struct {
	Name   string
	Volume float32
}

ChangeMusicVolumeEvent is an event to change the volume of a music stream

type ClearFocusEvent added in v0.1.13

type ClearFocusEvent struct{}

ClearFocusEvent is a signal to clear all focussed control

type DelaySignal added in v0.1.5

type DelaySignal struct {
	Signal interface{} // Signal that will be emitted after the Time
	Time   float32     // Time to this Signal to be emitted, in seconds
}

DelaySignal is a signal that will happen after a time

type FocusOnControlEvent added in v0.1.13

type FocusOnControlEvent struct {
	Control *goecs.Entity
}

FocusOnControlEvent is a signal to change the focussed control

type GameCloseEvent

type GameCloseEvent struct{}

GameCloseEvent is an event that indicates that game need to close

type GamePadButtonDownEvent added in v0.1.13

type GamePadButtonDownEvent struct {
	Gamepad int32
	Button  device.GamepadButton
}

GamePadButtonDownEvent this event triggers when a gamepad button is down

type GamePadButtonUpEvent added in v0.1.13

type GamePadButtonUpEvent struct {
	Gamepad int32
	Button  device.GamepadButton
}

GamePadButtonUpEvent this event triggers when a gamepad button is up

type GamePadStickMoveEvent added in v0.1.13

type GamePadStickMoveEvent struct {
	Gamepad  int32
	Stick    device.GamepadStick
	Movement geometry.Point
}

GamePadStickMoveEvent this event triggers when a gamepad stick moves

type KeyDownEvent added in v0.1.6

type KeyDownEvent struct {
	Key device.Key
}

KeyDownEvent this event triggers when a key is down

type KeyUpEvent added in v0.1.6

type KeyUpEvent struct {
	Key device.Key
}

KeyUpEvent this event triggers when a key is up

type MouseDownEvent added in v0.1.6

type MouseDownEvent struct {
	// Point is the geometry.Point where the mouse is when pressed
	Point geometry.Point
	// MouseButton is the device.MouseButton been pressed
	MouseButton device.MouseButton
}

MouseDownEvent is an event that indicates that the mouse is pressed

type MouseMoveEvent

type MouseMoveEvent struct {
	geometry.Point
}

MouseMoveEvent is an event that indicates that the mouse is moving

type MouseUpEvent

type MouseUpEvent struct {
	// Point is the geometry.Point where the mouse is when released
	Point geometry.Point
	// MouseButton is the device.MouseButton been released
	MouseButton device.MouseButton
}

MouseUpEvent is an event that indicates that the mouse is release

type MusicStateChangeEvent

type MusicStateChangeEvent struct {
	Name string                  // Name of the music
	Old  audio.MusicPlayingState // Old is the previous audio.MusicPlayingState
	New  audio.MusicPlayingState // New is the current audio.MusicPlayingState
}

MusicStateChangeEvent is a event trigger when a music state change

type PauseMusicEvent

type PauseMusicEvent struct {
	Name string
}

PauseMusicEvent is an event to pause a music stream

type PlayMusicEvent

type PlayMusicEvent struct {
	Name   string
	Volume float32
}

PlayMusicEvent is an event to play a music stream

type PlaySoundEvent

type PlaySoundEvent struct {
	Name   string
	Volume float32
}

PlaySoundEvent is an event to play a sound wave

type ResumeMusicEvent

type ResumeMusicEvent struct {
	Name string
}

ResumeMusicEvent is an event to resume a music stream

type StopMusicEvent

type StopMusicEvent struct {
	Name string
}

StopMusicEvent is an event to play a music stream

Jump to

Keyboard shortcuts

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