Scene's events

Open Game Engine 2D, Version 1.0.1

In current version, the scene object has 20 events.

In every event, we may use the API function OGE_GetScene() to get current scene's id.


OnInit

This event will be fired when a scene is created.


OnUpdate

This event will happen in every turn of the game cycle.


OnKeyDown

This event will happen when players press any keyboard key.
We may use the API function OGE_GetKey() to get the key pressed.


OnKeyUp

This event will happen when players press any keyboard key and release it.
We may use the API function OGE_GetKey() to get the key released.


OnActive

This event will happen when the scene is activated.


OnDeactive

This event will happen when the scene is deactivated.


OnOpen

This event will happen when the scene is activated and the scene's fade-in effect is finished.


OnClose

This event will happen before the scene's fade-out effect starts.


OnMouseDown

This event will happen when players press any mouse key.
We may use the API function OGE_GetMouseX(), OGE_GetMouseY(), OGE_IsMouseLeftDown(), OGE_IsMouseRightDown() to get the event info.


OnMouseUp

This event will happen when players press any mouse key and release it.
We may use the API function OGE_GetMouseX(), OGE_GetMouseY(), OGE_IsMouseLeftUp(), OGE_IsMouseRightUp() to get the event info.


OnMouseOver

This event will happen when the mouse is moving over the scene and it is not catched by any sprite in the scene.
We may use the API function OGE_GetMouseX(), OGE_GetMouseY() to get the event info.


OnDrawSprFin

This event will happen when all non-window sprites are drawn.


OnDrawWinFin

This event will happen when all window sprites are drawn.


OnDraw

This event will happen when the scene is drawing.


OnTimerTime

This event will happen when the scene's timer time is up.


OnAcceptClient

This event will happen when a server is connected by a client.


OnReceiveFromRemoteClient

This event will happen when a server receives something from a client.


OnRemoteClientDisconnect

This event will happen when a server is losing a client.


OnRemoteServerDisconnect

This event will happen when a client is losing a server.


OnReceiveFromRemoteServer

This event will happen when a client receives something from a server.