mirror of
https://github.com/liabru/matter-js.git
synced 2025-01-21 17:14:38 -05:00
show debug stats in dev demo
This commit is contained in:
parent
c5028d5029
commit
2f14ec5eb6
1 changed files with 6 additions and 2 deletions
|
@ -40,8 +40,6 @@ var demo = function(examples, isDev) {
|
||||||
document.body.appendChild(demo.dom.root);
|
document.body.appendChild(demo.dom.root);
|
||||||
document.title = 'Matter.js Demo' + (isDev ? ' ・ Dev' : '');
|
document.title = 'Matter.js Demo' + (isDev ? ' ・ Dev' : '');
|
||||||
|
|
||||||
MatterTools.Demo.start(demo);
|
|
||||||
|
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
var buttonSource = demo.dom.buttonSource;
|
var buttonSource = demo.dom.buttonSource;
|
||||||
var buttonCompare = buttonSource.cloneNode(true);
|
var buttonCompare = buttonSource.cloneNode(true);
|
||||||
|
@ -55,7 +53,13 @@ var demo = function(examples, isDev) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
buttonSource.parentNode.insertBefore(buttonCompare, buttonSource.nextSibling);
|
buttonSource.parentNode.insertBefore(buttonCompare, buttonSource.nextSibling);
|
||||||
|
|
||||||
|
Matter.before('Render.create', function(renderOptions) {
|
||||||
|
renderOptions.options.showDebug = true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MatterTools.Demo.start(demo);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = { demo: demo };
|
module.exports = { demo: demo };
|
||||||
|
|
Loading…
Add table
Reference in a new issue