Skip to content

Commit fb713ab

Browse files
committed
Added tint component to Bitmap Text.
1 parent 9bd93f3 commit fb713ab

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

v3/src/checksum.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
var CHECKSUM = {
2-
build: '274ce990-6e15-11e7-a303-3f21b9a8d9b0'
2+
build: '9bfd8260-7070-11e7-a8ad-036eabaeebad'
33
};
44
module.exports = CHECKSUM;

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ var DynamicBitmapText = new Class({
1414
Components.Origin,
1515
Components.RenderTarget,
1616
Components.Texture,
17+
Components.Tint,
1718
Components.Transform,
1819
Components.Visible,
1920
Components.ScrollFactor,
@@ -22,29 +23,35 @@ var DynamicBitmapText = new Class({
2223

2324
initialize:
2425

25-
function DynamicBitmapText (scene, x, y, font, text, size, align)
26+
function DynamicBitmapText (scene, x, y, font, text, size)
2627
{
2728
if (text === undefined) { text = ''; }
28-
if (align === undefined) { align = 'left'; }
2929

3030
GameObject.call(this, scene, 'DynamicBitmapText');
3131

32-
this.fontData = this.scene.sys.cache.bitmapFont.get(font);
32+
this.font = font;
33+
34+
var entry = this.scene.sys.cache.bitmapFont.get(font);
35+
36+
this.fontData = entry.data;
3337

3438
this.text = (Array.isArray(text)) ? text.join('\n') : text;
3539

3640
this.fontSize = size || this.fontData.size;
3741

42+
this.setTexture(entry.texture, entry.frame);
43+
this.setPosition(x, y);
44+
this.setOrigin(0, 0);
45+
46+
this._bounds = this.getTextBounds();
47+
3848
this.scrollX = 0;
3949
this.scrollY = 0;
4050

4151
this.width = 0;
4252
this.height = 0;
4353

4454
this.displayCallback;
45-
46-
this.setTexture(font);
47-
this.setPosition(x, y);
4855
},
4956

5057
setSize: function (width, height)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var BitmapText = new Class({
1717
Components.RenderTarget,
1818
Components.ScaleMode,
1919
Components.Texture,
20+
Components.Tint,
2021
Components.Transform,
2122
Components.Visible,
2223
Components.ScrollFactor,

0 commit comments

Comments
 (0)