Event

From ENIGMA

Jump to: navigation, search
Events as they appear in LateralGM.

In event-oriented scripting languages, and in ENIGMA, events are functions that are invoked when certain circumstances are met. For instance, in ENIGMA, an event can be invoked when a certain key is pressed. Events are shared with each instance of a given object. In LateralGM, they are presented visually in a tree view in the object editor dialog. Each event has an icon representing its type. From there, events can be added or removed, and users can add separate code to each of them.

Event types

For extensibility reasons, events in ENIGMA are stored and loaded from the file events.res. It is there that you can find a detailed listing of each offered event.

The events, however, do fall into a small set of generic categories:

Event create.png Create
Happen only once when an object is first created.
Event destroy.png Destroy
Happen when objects are destroyed.
Event alarm.png Alarm
Alarm events are used to sequence things to the number of updates or 'steps' the game has processed.
Event step.png Step
Triggered at regular intervals according to the room_speed and allow you to update objects before they are rendered.
Event collision.png Collision
Occur when objects come in contact with each other.
Event collision.png Physics
Similar to collision events but specific to the Box2D physics engine.
Event keyboard.png Keyboard
Handle when a keyboard button is pressed and then held.
Event key press.png Key Press
Handle when keyboard keys are pressed.
Event key release.png Key Release
Handle when keyboard keys are released.
Event mouse.png Mouse
Handle mouse input including button clicks.
Event joystick.png Joystick
Handle joystick input for a variety of joystick devices.
Event gamepad.png Gamepad
Handle gamepad input using a more streamlined interface.
Paintbrush.png Draw
Occur after the end step event and are for when you are ready to draw objects to the screen.
Paintbrush.png Draw GUI
Is for drawing things on a layer on top of everything else rendered, basically buttons and things. The event is called after all regular draw events occur and performs depth sorting on the objects and resets the projection to orthographic ignoring scaling and other view transformations.
Event other.png Other
Events not covered in other categories, such as those defined by the user.
Event other.png Room
Are for when things change about the current room, such as it restarts or ends.
Event other.png Game
Are global to the entire game, such as just before the window closes and the game ends.
Personal tools
Namespaces
Variants
Actions
Navigation
ENIGMA
Other
Toolbox