Game Development Reference
In-Depth Information
Receiving events
Receiving events requires you to create a callback function and then register that callback
with the sandbox. The callback function itself receives the sandbox, the sandbox object that
registered with the callback, the event type, and the event as parameters that are passed into
the callback each time an event is processed:
Callback_Function(sandbox, sandboxObject, eventType, event);
Registering a callback simply requires you to pass the object that owns the callback as well
as the callback function. The reason behind the callback ownership is that in cases where
the owner is destroyed, the sandbox will also destroy any callbacks associated with the
owner:
Sandbox.AddEventCallback(
sandbox, sandboxObject, Callback_Function);
Search WWH ::




Custom Search