mirror of
https://github.com/liabru/matter-js.git
synced 2024-12-25 13:39:06 -05:00
changed default render styles
This commit is contained in:
parent
ace1a9f6aa
commit
719ad649fe
4 changed files with 15 additions and 8 deletions
|
@ -80,7 +80,7 @@ var Axes = require('../geometry/Axes');
|
|||
xOffset: 0,
|
||||
yOffset: 0
|
||||
},
|
||||
lineWidth: 1.5
|
||||
lineWidth: 0
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -152,7 +152,7 @@ var Axes = require('../geometry/Axes');
|
|||
});
|
||||
|
||||
// render properties
|
||||
var defaultFillStyle = (body.isStatic ? '#eeeeee' : Common.choose(['#556270', '#4ECDC4', '#C7F464', '#FF6B6B', '#C44D58'])),
|
||||
var defaultFillStyle = (body.isStatic ? '#2e2b44' : Common.choose(['#006BA6', '#0496FF', '#FFBC42', '#D81159', '#8F2D56'])),
|
||||
defaultStrokeStyle = Common.shadeColor(defaultFillStyle, -20);
|
||||
body.render.fillStyle = body.render.fillStyle || defaultFillStyle;
|
||||
body.render.strokeStyle = body.render.strokeStyle || defaultStrokeStyle;
|
||||
|
|
|
@ -60,7 +60,7 @@ var Common = require('../core/Common');
|
|||
var render = {
|
||||
visible: true,
|
||||
lineWidth: 2,
|
||||
strokeStyle: '#666'
|
||||
strokeStyle: '#ffffff'
|
||||
};
|
||||
|
||||
constraint.render = Common.extend(render, constraint.render);
|
||||
|
|
|
@ -275,14 +275,20 @@ var Bodies = require('./Bodies');
|
|||
bodyA: body,
|
||||
pointA: { x: wheelAOffset, y: wheelYOffset },
|
||||
bodyB: wheelA,
|
||||
stiffness: 0.2
|
||||
stiffness: 0.2,
|
||||
render: {
|
||||
lineWidth: 0
|
||||
}
|
||||
});
|
||||
|
||||
var axelB = Constraint.create({
|
||||
bodyA: body,
|
||||
pointA: { x: wheelBOffset, y: wheelYOffset },
|
||||
bodyB: wheelB,
|
||||
stiffness: 0.2
|
||||
stiffness: 0.2,
|
||||
render: {
|
||||
lineWidth: 0
|
||||
}
|
||||
});
|
||||
|
||||
Composite.addBody(car, body);
|
||||
|
|
|
@ -52,7 +52,7 @@ var Mouse = require('../core/Mouse');
|
|||
width: 800,
|
||||
height: 600,
|
||||
pixelRatio: 1,
|
||||
background: '#fafafa',
|
||||
background: '#18181d',
|
||||
wireframeBackground: '#0f0f13',
|
||||
hasBounds: !!options.bounds,
|
||||
enabled: true,
|
||||
|
@ -892,12 +892,13 @@ var Mouse = require('../core/Mouse');
|
|||
|
||||
if (options.wireframes) {
|
||||
c.strokeStyle = 'indianred';
|
||||
c.lineWidth = 1;
|
||||
} else {
|
||||
c.strokeStyle = 'rgba(0,0,0,0.8)';
|
||||
c.strokeStyle = 'rgba(255, 255, 255, 0.4)';
|
||||
c.globalCompositeOperation = 'overlay';
|
||||
c.lineWidth = 2;
|
||||
}
|
||||
|
||||
c.lineWidth = 1;
|
||||
c.stroke();
|
||||
c.globalCompositeOperation = 'source-over';
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue