0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-23 09:26:51 -05:00

added demo support for hash + '-inspect' to start the inspector

This commit is contained in:
liabru 2014-05-04 22:41:39 +01:00
parent 1fac632f98
commit c28c9cde69

View file

@ -30,7 +30,7 @@
_sceneName, _sceneName,
_mouseConstraint, _mouseConstraint,
_sceneEvents = [], _sceneEvents = [],
_useInspector = false, _useInspector = window.location.hash.indexOf('-inspect') !== -1,
_isMobile = /(ipad|iphone|ipod|android)/gi.test(navigator.userAgent); _isMobile = /(ipad|iphone|ipod|android)/gi.test(navigator.userAgent);
// initialise the demo // initialise the demo
@ -61,7 +61,7 @@
// get the scene function name from hash // get the scene function name from hash
if (window.location.hash.length !== 0) if (window.location.hash.length !== 0)
_sceneName = window.location.hash.replace('#', ''); _sceneName = window.location.hash.replace('#', '').replace('-inspect', '');
// set up a scene with bodies // set up a scene with bodies
Demo[_sceneName](); Demo[_sceneName]();
@ -1225,6 +1225,8 @@
_engine.enableSleeping = false; _engine.enableSleeping = false;
_engine.world.gravity.y = 1; _engine.world.gravity.y = 1;
_engine.world.gravity.x = 0;
_engine.timing.timeScale = 1;
var offset = 5; var offset = 5;
World.add(_world, [ World.add(_world, [