0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-12-24 13:29:01 -05:00

show debug stats in dev demo

This commit is contained in:
liabru 2021-04-26 00:18:59 +01:00
parent c5028d5029
commit 2f14ec5eb6

View file

@ -40,8 +40,6 @@ var demo = function(examples, isDev) {
document.body.appendChild(demo.dom.root);
document.title = 'Matter.js Demo' + (isDev ? ' ・ Dev' : '');
MatterTools.Demo.start(demo);
if (isDev) {
var buttonSource = demo.dom.buttonSource;
var buttonCompare = buttonSource.cloneNode(true);
@ -55,7 +53,13 @@ var demo = function(examples, isDev) {
event.preventDefault();
});
buttonSource.parentNode.insertBefore(buttonCompare, buttonSource.nextSibling);
Matter.before('Render.create', function(renderOptions) {
renderOptions.options.showDebug = true;
});
}
MatterTools.Demo.start(demo);
};
module.exports = { demo: demo };