Skip to content

Commit

Permalink
changed default render styles
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Jan 19, 2017
1 parent ace1a9f commit 719ad64
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/body/Body.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ var Axes = require('../geometry/Axes');
xOffset: 0,
yOffset: 0
},
lineWidth: 1.5
lineWidth: 0
}
};

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/constraint/Constraint.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 8 additions & 2 deletions src/factory/Composites.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 4 additions & 3 deletions src/render/Render.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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';
};
Expand Down

0 comments on commit 719ad64

Please sign in to comment.