indigo.shared.events

Type members

Classlikes

final case class AccessControl(allowAssetEvents: Boolean, allowCustomEvents: Boolean, allowFrameTick: Boolean, allowKeyboardEvents: Boolean, allowMouseEvents: Boolean, allowNetworkEvents: Boolean, allowStorageEvents: Boolean, allowSubSystemEvents: Boolean, allowViewEvents: Boolean)
A simple type containing flags allowing exact control over the access
rights of different types of events.
sealed trait AssetEvent extends GlobalEvent
Events relating to dynamically loading assets after the game has started.
These events are the underlying events used by the AssetBundleLoader
SubSystem, which makes loading assets a slightly more plesant experience.
Companion
object
object AssetEvent
Companion
class
final case class Combo(mouseInputs: List[MouseInput], keyInputs: List[Key], gamepadInputs: List[GamepadInput])
Companion
object
object Combo
Companion
class
case object EnterFullScreen extends GlobalEvent
Attempt to enter full screen mode
final case class EventFilters(modelFilter: GlobalEvent => Option[GlobalEvent], viewModelFilter: GlobalEvent => Option[GlobalEvent])
EventFilter's control which events will be processed by your model
or view model. You can think of event filters like a firewall for
events, that only permit the wanted events into the model and
view model update functions to avoid conflicts, duplicate, and
needless work.
Events are filtered by mapping from a specific event to an optional
event.
Although the name says "filter", the action is really filter and map,
since there is no requirement to maintain the original event as the
resultant event. For example, you could map FrameTick to
CustomEvents.Update if it make more sense in your domain model.
Value Params
modelFilter
The filter map for the events going into model update
viewModelFilter
The filter map for the events going into view model update
Companion
object
object EventFilters
Companion
class
case object ExitFullScreen extends GlobalEvent
Attempt to exit full screen mode
case object FrameTick extends GlobalEvent
A special event that happens once per frame, at the end of the frame.
Useful for updating anything in your model that "just happens" on every
frame without any other prompting event. Like gravity.
case object FullScreenEnterError extends ViewEvent
A problem occurred trying to enter full screen
case object FullScreenEntered extends ViewEvent
The game entered full screen mode
case object FullScreenExitError extends ViewEvent
A problem occurred trying to exit full screen
case object FullScreenExited extends ViewEvent
The game exited full screen mode
sealed trait GamepadInput
Companion
object
object GamepadInput
Companion
class
A trait that tells Indigo to allow this instance into the event loop for the duration of one frame.
sealed trait InputEvent extends GlobalEvent with Product with Serializable
Tags events for input devices like mice and keyboards.
InputEvents work in partnership with InputState. Events represent
a one time thing that happened since the last frame, while the state
represents the ongoing state of an input.
For example there is a mouse Move event i.e. "The mouse was moved" and
there is also the mouse position on the InputState i.e. "Where is the
mouse now?"
final case class InputMapping[A](oneOf: List[(Combo, A)])
Companion
object
object InputMapping
Companion
class
final class InputState(val mouse: Mouse, val keyboard: Keyboard, val gamepad: Gamepad)
Holds a snapshot of the states of the various input types as they were entering this frame.
Value Params
gamepad
Current state of the gamepad
keyboard
Current state of the keyboard
mouse
Current state of the mouse
Companion
object
object InputState
Companion
class
sealed trait KeyboardEvent extends InputEvent
Represents all keyboard events
Companion
object
Companion
class
sealed trait MouseEvent extends InputEvent
Represents all mouse events
Companion
object
object MouseEvent
Companion
class
sealed trait MouseInput
Companion
object
object MouseInput
Companion
class
A class of events representing inbound communication over a network protocol
A class of events representing outbound communication over a network protocol
final case class PlaySound(assetName: AssetName, volume: Volume) extends GlobalEvent
Can be emitted to trigger the one time play back of a sound asset.
Value Params
assetName
Reference to the loaded asset
volume
What volume level to play at
final case class RendererDetails(renderingTechnology: RenderingTechnology, clearColor: RGBA, magnification: Int) extends ViewEvent
Event to inform the game which rendering choices are active.
For example a view may wish to behave differently depending on the rendering technology available.
This event is only fired once during start up.
Value Params
clearColor
The clear color set during initialisation
magnification
The magnification set during initialisation
renderingTechnology
WebGL 1.0 or WebGL 2.0
sealed trait StorageEvent extends GlobalEvent
Events relating to manipulating locally stored data
Companion
object
object StorageEvent
Companion
class
A trait whose presence signals that this event should only be routed to subsystems, not the main game.
case object ToggleFullScreen extends GlobalEvent
Attempt to enter or exit full screen mode
sealed trait ViewEvent extends GlobalEvent with Product with Serializable
final case class ViewportResize(gameViewPort: GameViewport) extends ViewEvent
Fired whenever the game window changes size, so that the view can respond.
Value Params
gameViewPort
The actual size in pixels, you can ask it to apply magnification.