Skip to content

Commit 98b1cc2

Browse files
committed
Although the Blitter object had the Alpha component, setting it made no difference. Setting Blitter alpha now impacts the rendering of all children, in both Canvas and WebGL, and you can also specify an alpha per Bob as well.
1 parent bcacfeb commit 98b1cc2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/renderer/webgl/pipelines/TextureTintPipeline.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,8 @@ var TextureTintPipeline = new Class({
665665

666666
var prevTextureSourceIndex;
667667

668+
var alpha = camera.alpha * blitter.alpha;
669+
668670
for (var batchIndex = 0; batchIndex < batchCount; ++batchIndex)
669671
{
670672
var batchSize = Math.min(length, this.maxQuads);
@@ -673,15 +675,15 @@ var TextureTintPipeline = new Class({
673675
{
674676
var bob = list[batchOffset + index];
675677
var frame = bob.frame;
676-
var alpha = bob.alpha;
678+
var bobAlpha = bob.alpha * alpha;
677679

678-
if (alpha === 0)
680+
if (bobAlpha === 0)
679681
{
680682
// Nothing to see here, moving on ...
681683
continue;
682684
}
683685

684-
var tint = getTint(0xffffff, alpha);
686+
var tint = getTint(0xffffff, bobAlpha);
685687
var uvs = frame.uvs;
686688
var flipX = bob.flipX;
687689
var flipY = bob.flipY;

0 commit comments

Comments
 (0)