Fix: use globalAlpha since renderer.setAlpha doesn't work with ctx manipulation

This commit is contained in:
Michael Hadley 2017-12-03 08:55:53 -06:00
parent e53fa0e716
commit d686cd7140

View file

@ -24,7 +24,7 @@ var StaticTilemapLayerCanvasRenderer = function (renderer, gameObject, interpola
ctx.rotate(gameObject.rotation); ctx.rotate(gameObject.rotation);
ctx.scale(gameObject.scaleX, gameObject.scaleY); ctx.scale(gameObject.scaleX, gameObject.scaleY);
ctx.scale(gameObject.flipX ? -1 : 1, gameObject.flipY ? -1 : 1); ctx.scale(gameObject.flipX ? -1 : 1, gameObject.flipY ? -1 : 1);
renderer.setAlpha(gameObject.alpha); ctx.globalAlpha = gameObject.alpha;
for (var index = 0; index < tileCount; ++index) for (var index = 0; index < tileCount; ++index)
{ {