diff --git a/src/render/Render.js b/src/render/Render.js index ae52040e..5295e90d 100644 --- a/src/render/Render.js +++ b/src/render/Render.js @@ -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 @@ -1504,6 +1506,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 *