mirror of
https://github.com/liabru/matter-js.git
synced 2024-12-26 13:49:01 -05:00
Merge branch 'master' of https://github.com/ma1069/matter-js into ma1069-master
This commit is contained in:
commit
c99e6afb1c
2 changed files with 6 additions and 1 deletions
|
@ -71,6 +71,7 @@ var Axes = require('../geometry/Axes');
|
||||||
timeScale: 1,
|
timeScale: 1,
|
||||||
render: {
|
render: {
|
||||||
visible: true,
|
visible: true,
|
||||||
|
opacity: 1,
|
||||||
sprite: {
|
sprite: {
|
||||||
xScale: 1,
|
xScale: 1,
|
||||||
yScale: 1,
|
yScale: 1,
|
||||||
|
|
|
@ -445,6 +445,10 @@ var Vector = require('../geometry/Vector');
|
||||||
if (options.showSleeping && body.isSleeping)
|
if (options.showSleeping && body.isSleeping)
|
||||||
c.globalAlpha = 0.5;
|
c.globalAlpha = 0.5;
|
||||||
|
|
||||||
|
if (part.render.opacity !== 1)
|
||||||
|
c.globalAlpha = part.render.opacity;
|
||||||
|
|
||||||
|
|
||||||
c.translate(part.position.x, part.position.y);
|
c.translate(part.position.x, part.position.y);
|
||||||
c.rotate(part.angle);
|
c.rotate(part.angle);
|
||||||
|
|
||||||
|
@ -460,7 +464,7 @@ var Vector = require('../geometry/Vector');
|
||||||
c.rotate(-part.angle);
|
c.rotate(-part.angle);
|
||||||
c.translate(-part.position.x, -part.position.y);
|
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;
|
c.globalAlpha = 1;
|
||||||
} else {
|
} else {
|
||||||
// part polygon
|
// part polygon
|
||||||
|
|
Loading…
Reference in a new issue