perandersson / playstate

PlayState
2 stars 0 forks source link

Add Event support for components #23

Closed perandersson closed 11 years ago

perandersson commented 11 years ago

Add support for events:

self:PostEvent(evt)

Events should be possible from the Scene, the SceneGroup and on a specific SceneNode.

perandersson commented 11 years ago

Fixed. You can now fire events globally (from the Scene and from the SceneGroup). You can also fire events on SceneNodes (useful for inter-component communication).

Functions exposed are:

-- Works on SceneNodes and Components
self:FireEvent(UniqueID, MessageID)

-- Works on SceneGroups
self:FireEvent(UniqueID, MessageID)
self:FireEvent(UniqueID, MessageID, typeMask)

-- Works on Scene
Scene.FireEvent(UniqueID, MessageID)
Scene.FireEvent(UniqueID, MessageID, typeMask)