Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by OMATASE

Does anyone have experience using an event system in their impact code and wouldn't mind sharing that code?

I didn't realize how badly events were supported in JS for most browsers. Although the w3c spec for JS does call for custom event support it's apparently ignored. It looks like most people opt for writing a hodge podgey class that behaves kind of like a custom events system but there are widespread reports of browser compatibility issues.

I could probably use jquery's since I'm already using that library in my code elsewhere but I just wanted to see what the presiding wisdom was in the impact world before I went that route.

Thanks

1 decade ago by daveb

I created a new events plugin that solves this problem. It does the following things:

Adds an Animation API allowing you to be notified when a particular animation reaches a particular frame or when a particular animation completes.

Adds an Entity API allowing you to add, fire and remove events on entities directly

Adds an event aggregator allowing you to add, fire and remove events on any Javascript object. This aggregator is the basis for the Entity and Animation APIs and effectively decouples publishers from listeners.

This plugin can be found here: http://www.pointofimpactjs.com/plugins/view/7/impact-events
Page 1 of 1
« first « previous next › last »