Added drop shadow to pieces that are unmatched
This commit is contained in:
parent
eeebed10c0
commit
ada2535b62
|
|
@ -1172,6 +1172,16 @@ class PuzzleScene extends Phaser.Scene {
|
||||||
if (po.image.texture.key !== expectedKey && this.textures.exists(expectedKey)) {
|
if (po.image.texture.key !== expectedKey && this.textures.exists(expectedKey)) {
|
||||||
po.image.setTexture(expectedKey);
|
po.image.setTexture(expectedKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Contour-following drop shadow via preFX (Phaser 3.60+)
|
||||||
|
if (po.image.preFX) {
|
||||||
|
if (!isMerged && !po._shadowFX) {
|
||||||
|
po._shadowFX = po.image.preFX.addShadow(2, 2, 0.06, 1, 0x000000, 6);
|
||||||
|
} else if (isMerged && po._shadowFX) {
|
||||||
|
po.image.preFX.remove(po._shadowFX);
|
||||||
|
po._shadowFX = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue