mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-23 09:26:51 -05:00
change examples to render using a fixed resolution
This commit is contained in:
parent
6108a31f27
commit
0895d81fa1
44 changed files with 89 additions and 87 deletions
|
@ -27,6 +27,8 @@
|
|||
inline: false,
|
||||
preventZoom: true,
|
||||
resetOnOrientation: true,
|
||||
routing: true,
|
||||
startExample: 'mixed',
|
||||
examples: [
|
||||
{
|
||||
name: 'Air Friction',
|
||||
|
|
|
@ -18,8 +18,8 @@ Example.airFriction = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showVelocity: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -25,8 +25,8 @@ Example.avalanche = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -25,8 +25,8 @@ Example.ballPool = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -22,8 +22,8 @@ Example.bridge = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -20,8 +20,8 @@ Example.broadphase = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true,
|
||||
showBroadphase: true
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@ Example.car = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true,
|
||||
showCollisions: true
|
||||
}
|
||||
|
|
|
@ -22,8 +22,8 @@ Example.catapult = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true,
|
||||
showCollisions: true,
|
||||
showVelocity: true
|
||||
|
|
|
@ -22,8 +22,8 @@ Example.chains = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true,
|
||||
showCollisions: true,
|
||||
showVelocity: true
|
||||
|
|
|
@ -19,8 +19,8 @@ Example.circleStack = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -20,8 +20,8 @@ Example.cloth = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600)
|
||||
width: 800,
|
||||
height: 600
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ Example.collisionFiltering = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
wireframes: false,
|
||||
background: '#111'
|
||||
}
|
||||
|
|
|
@ -21,8 +21,8 @@ Example.compositeManipulation = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -20,8 +20,8 @@ Example.compound = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAxes: true,
|
||||
showConvexHulls: true
|
||||
}
|
||||
|
|
|
@ -20,8 +20,8 @@ Example.compoundStack = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -21,8 +21,8 @@ Example.concave = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600)
|
||||
width: 800,
|
||||
height: 600
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ Example.constraints = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -24,8 +24,8 @@ Example.doublePendulum = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
wireframes: false,
|
||||
background: '#0f0f13'
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@ Example.events = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
wireframes: false
|
||||
}
|
||||
});
|
||||
|
|
|
@ -18,8 +18,8 @@ Example.friction = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showVelocity: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -20,8 +20,8 @@ Example.gravity = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showVelocity: true,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
|
|
|
@ -20,8 +20,8 @@ Example.gyro = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -20,8 +20,8 @@ Example.manipulation = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAxes: true,
|
||||
showCollisions: true,
|
||||
showConvexHulls: true
|
||||
|
|
|
@ -20,9 +20,9 @@ Example.mixed = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
showAngleIndicator: true
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true,
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ Example.newtonsCradle = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showVelocity: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -19,8 +19,8 @@ Example.pyramid = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -25,8 +25,8 @@ Example.ragdoll = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true,
|
||||
background: '#0f0f13'
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ Example.raycasting = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -18,8 +18,8 @@ Example.restitution = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true,
|
||||
showCollisions: true,
|
||||
showVelocity: true
|
||||
|
|
|
@ -18,8 +18,8 @@ Example.rounded = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAxes: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -19,8 +19,8 @@ Example.sensors = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
wireframes: false,
|
||||
background: '#111'
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@ Example.sleeping = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -21,8 +21,8 @@ Example.slingshot = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -19,8 +19,8 @@ Example.softBody = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: false
|
||||
}
|
||||
});
|
||||
|
|
|
@ -20,8 +20,8 @@ Example.sprites = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
background: '#0f0f13',
|
||||
showAngleIndicator: false,
|
||||
wireframes: false
|
||||
|
|
|
@ -19,8 +19,8 @@ Example.stack = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -21,8 +21,8 @@ Example.staticFriction = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showVelocity: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -19,8 +19,8 @@ Example.stress = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600)
|
||||
width: 800,
|
||||
height: 600
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ Example.stress2 = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600)
|
||||
width: 800,
|
||||
height: 600
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ Example.svg = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600)
|
||||
width: 800,
|
||||
height: 600
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@ Example.terrain = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600)
|
||||
width: 800,
|
||||
height: 600
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ Example.timescale = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
});
|
||||
|
|
|
@ -23,8 +23,8 @@ Example.views = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
hasBounds: true,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
|
|
|
@ -20,8 +20,8 @@ Example.wreckingBall = function() {
|
|||
element: document.body,
|
||||
engine: engine,
|
||||
options: {
|
||||
width: Math.min(document.documentElement.clientWidth, 800),
|
||||
height: Math.min(document.documentElement.clientHeight, 600),
|
||||
width: 800,
|
||||
height: 600,
|
||||
showAngleIndicator: true
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue