Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added beginRender lifecycle event. #1064

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/render/Render.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
*
Expand Down