Skip to content
Stoney-FD edited this page Mar 17, 2013 · 3 revisions

Creating a new event

Lyria.Events.on('test', function() { 
  console.log('test'); 
});

Calling an event

Directly call an event

Lyria.Events.trigger('test');

This will now output test in your developer console.

Calling an event with an interval

Lyria.Events.trigger({
  name: test, 
  interval: 3000
});

This will output test after 3000 milliseconds.

Calling an event repeatedly

Lyria.Events.trigger({
  name: test, 
  interval: 3000
});

You should not use this if you want execute an operation on each frame. In that case, you should use Lyria.Loop.