0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-01-21 17:14:38 -05:00

Added beginRender lifecycle event.

This commit is contained in:
Joe Gaffey 2021-11-22 18:18:23 +00:00
parent e909b0466c
commit 531aa34acc

View file

@ -348,6 +348,8 @@ var Mouse = require('../core/Mouse');
context.fillRect(0, 0, canvas.width, canvas.height);
context.globalCompositeOperation = 'source-over';
Events.trigger(render, "beginRender", event);
// handle bounds
if (options.hasBounds) {
// filter out bodies that are not in view
@ -1546,6 +1548,16 @@ var Mouse = require('../core/Mouse');
* @param {} event.name The name of the event
*/
/**
* Fired at the beginning of rendering after canvas is cleared
*
* @event beginRender
* @param {} event An event object
* @param {number} event.timestamp The engine.timing.timestamp of the event
* @param {} event.source The source object of the event
* @param {} event.name The name of the event
*/
/**
* Fired after rendering
*