Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ma1069/matter-js into ma1…
Browse files Browse the repository at this point in the history
…069-master
  • Loading branch information
liabru committed Feb 7, 2016
2 parents 8fcb893 + 5b755a1 commit c99e6af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/body/Body.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ var Axes = require('../geometry/Axes');
timeScale: 1,
render: {
visible: true,
opacity: 1,
sprite: {
xScale: 1,
yScale: 1,
Expand Down
6 changes: 5 additions & 1 deletion src/render/Render.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,10 @@ var Vector = require('../geometry/Vector');
if (options.showSleeping && body.isSleeping)
c.globalAlpha = 0.5;

if (part.render.opacity !== 1)
c.globalAlpha = part.render.opacity;


c.translate(part.position.x, part.position.y);
c.rotate(part.angle);

Expand All @@ -460,7 +464,7 @@ var Vector = require('../geometry/Vector');
c.rotate(-part.angle);
c.translate(-part.position.x, -part.position.y);

if (options.showSleeping && body.isSleeping)
if ((options.showSleeping && body.isSleeping) || part.render.opacity !== 1)
c.globalAlpha = 1;
} else {
// part polygon
Expand Down

0 comments on commit c99e6af

Please sign in to comment.