Sprite's events

Open Game Engine 2D, Version 1.0.1

In current version, the sprite object has 24 events.

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


OnInit

This event will be fired when a sprite is created.


OnUpdate

This event will happen in every turn of the game cycle. It is an important event.


OnSceneActive 

This event will happen when the sprite's scene is activated.


OnSceneDeactive

This event will happen when the sprite's scene is deactivated.


OnEnter

This event will happen when the sprite enters the screen.


OnLeave

This event will happen when the sprite leaves from the screen.


OnCollide

This event will happen when the sprite collides with another one.


OnMouseIn

This event will happen when mouse moves into a sprite.


OnMouseOut

This event will happen when mouse leaves from a sprite.


OnMouseDown

This event will happen when the sprite catches the mouse and the player presses 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 the sprite catches the mouse and the player presses, and then releases any mouse key.
We may use the API function OGE_GetMouseX(), OGE_GetMouseY(), OGE_IsMouseLeftDown(), OGE_IsMouseRightDown() to get the event info.


OnMouseDrag

This event will happen when the player tries to drag a sprite.
We may use the API function OGE_GetMouseX(), OGE_GetMouseY() to get the event info.


OnMouseDrop

This event will happen when the player drags and drops a sprite.
We may use the API function OGE_GetMouseX(), OGE_GetMouseY() to get the event info.


OnMouseOver

This event will happen when the mouse is moving over the sprite.
We may use the API function OGE_GetMouseX(), OGE_GetMouseY() to get the event info.


OnActive

This event will happen when the sprite is activated.


OnDeactive

This event will happen when the sprite is deactivated.


OnCustomEnd

This event will happen when the sprite's all custom events end.


OnTimerTime

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


OnAnimaFin

This event will happen when the sprite's animation is completed.


OnPathStep

This event will happen when the sprite is moving step by step according to some path.


OnPathFin

This event will happen when the sprite finishes a path.


OnDraw

This event will happen when the sprite is drawing.


OnGetFocus

This event will happen when the sprite gets focus (also when a plot starts).


OnLoseFocus

This event will happen when the sprite loses focus (also when a plot ends).