Skip to content

Commit 1fe9a65

Browse files
committed
Fixed bug that stopped it rendering. Also added in new color data component.
1 parent 15a749d commit 1fe9a65

3 files changed

Lines changed: 18 additions & 8 deletions

File tree

v3/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextCanvasRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ var DynamicBitmapTextCanvasRenderer = function (renderer, src, interpolationPerc
122122

123123
if (displayCallback)
124124
{
125-
var output = displayCallback({ index: index, charCode: charCode, x: x, y: y, scale: scale, rotation: 0, data: glyph.data });
125+
var output = displayCallback({ tint: { topLeft: 0, topRight: 0, bottomLeft: 0, bottomRight: 0 }, index: index, charCode: charCode, x: x, y: y, scale: scale, rotation: 0, data: glyph.data });
126126

127127
x = output.x;
128128
y = output.y;

v3/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextWebGLRenderer.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var tempMatrixChar = new TransformMatrix();
44

55
var DynamicBitmapTextWebGLRenderer = function (renderer, gameObject, interpolationPercentage, camera)
66
{
7-
var text = src.text;
7+
var text = gameObject.text;
88
var textLength = text.length;
99

1010
if (this.renderMask !== this.renderFlags || textLength === 0 || (this.cameraFilter > 0 && (this.cameraFilter & camera._id)))
@@ -151,17 +151,27 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, gameObject, interpolati
151151

152152
if (displayCallback)
153153
{
154-
var output = displayCallback({ tint: { topLeft: tintTL, topRight: tintTR, bottomLeft: tintBL, bottomRight: tintBR }, index: index, charCode: charCode, x: x, y: y, scale: scale, rotation: 0, data: glyph.data });
154+
var output = displayCallback({ color: 0, tint: { topLeft: tintTL, topRight: tintTR, bottomLeft: tintBL, bottomRight: tintBR }, index: index, charCode: charCode, x: x, y: y, scale: scale, rotation: 0, data: glyph.data });
155155

156156
x = output.x;
157157
y = output.y;
158158
scale = output.scale;
159159
rotation = output.rotation;
160160

161-
tintTL = output.tint.topLeft;
162-
tintTR = output.tint.topRight;
163-
tintBL = output.tint.bottomLeft;
164-
tintBR = output.tint.bottomRight;
161+
if (output.color)
162+
{
163+
tintTL = output.color;
164+
tintTR = output.color;
165+
tintBL = output.color;
166+
tintBR = output.color;
167+
}
168+
else
169+
{
170+
tintTL = output.tint.topLeft;
171+
tintTR = output.tint.topRight;
172+
tintBL = output.tint.bottomLeft;
173+
tintBR = output.tint.bottomRight;
174+
}
165175
}
166176

167177
x -= gameObject.scrollX | 0;

v3/src/gameobjects/bitmaptext/static/BitmapTextWebGLRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var tempMatrix = new TransformMatrix();
33

44
var BitmapTextWebGLRenderer = function (renderer, gameObject, interpolationPercentage, camera)
55
{
6-
var text = src.text;
6+
var text = gameObject.text;
77
var textLength = text.length;
88

99
if (this.renderMask !== this.renderFlags || textLength === 0 || (this.cameraFilter > 0 && (this.cameraFilter & camera._id)))

0 commit comments

Comments
 (0)