nwge-docs

Event

The engine will receive events from the operating system and either handle them internally (such as window resizing) and pass them onto the game state (such as mouse clicks and other input).

Event Types

This is a simple explainer for the event types that will be passed on to your game’s state and sub-states. The nwge::Event structure is defined in the <nwge/event.hpp> header.

MouseMotion

Emitted when the user moves the mouse cursor within the game window. Data for this event is stored in the motion field of the Event structure. The Motion structure contains the following fields:

MouseDown & MouseUp

Emitted when the user presses down a mouse button (MouseDown) and when the user releases a mouse button (MouseUp). Data for these events is stored in the click field of the Event structure. The Click structure contains the following fields:

MouseScroll

Emitted when the user scrolls with the scroll wheel of the mouse. Data for this event is stored in the scroll field of the Event structure. The data is a 32-bit signed integer. A positive value is scrolling downwards (alike window-space positioning) and a negative value is scrolling upwards.

PostLoad

Emitted after the engine finishes loading data in the background. Assuming default engine configuration, of data is enqueued to be loaded outside the main state’s preload() method, it will be loaded in the background. Once all data enqueued in the background is loaded, successfully or not, this event will be emitted.

See Also