Skip to content

Commit 50f10b3

Browse files
committed
The Bitmap Text Game Object WebGL Renderer function has been updated to support multi-texture units.
1 parent 446389b commit 50f10b3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/gameobjects/bitmaptext/static/BitmapTextWebGLRenderer.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage,
3030
{
3131
return;
3232
}
33-
33+
3434
var pipeline = this.pipeline;
3535

3636
renderer.setPipeline(pipeline, src);
@@ -77,7 +77,7 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage,
7777
var tintBL = Utils.getTintAppendFloatAlpha(src._tintBL, camera.alpha * src._alphaBL);
7878
var tintBR = Utils.getTintAppendFloatAlpha(src._tintBR, camera.alpha * src._alphaBR);
7979

80-
pipeline.setTexture2D(texture, 0);
80+
var textureUnit = renderer.setTextureSource(frame.source);
8181

8282
var xAdvance = 0;
8383
var yAdvance = 0;
@@ -140,11 +140,11 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage,
140140
{
141141
lineOffsetX = (lineData.longest - lineData.lengths[currentLine]);
142142
}
143-
143+
144144
xAdvance = 0;
145145
yAdvance += lineHeight;
146146
lastGlyph = null;
147-
147+
148148
continue;
149149
}
150150

@@ -223,7 +223,7 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage,
223223
ty3 = Math.round(ty3);
224224
}
225225

226-
pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, 0);
226+
pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit);
227227
}
228228
};
229229

0 commit comments

Comments
 (0)