mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
Added tint component to Bitmap Text.
This commit is contained in:
parent
9bd93f36b2
commit
fb713ab5ec
3 changed files with 15 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
|||
var CHECKSUM = {
|
||||
build: '274ce990-6e15-11e7-a303-3f21b9a8d9b0'
|
||||
build: '9bfd8260-7070-11e7-a8ad-036eabaeebad'
|
||||
};
|
||||
module.exports = CHECKSUM;
|
|
@ -14,6 +14,7 @@ var DynamicBitmapText = new Class({
|
|||
Components.Origin,
|
||||
Components.RenderTarget,
|
||||
Components.Texture,
|
||||
Components.Tint,
|
||||
Components.Transform,
|
||||
Components.Visible,
|
||||
Components.ScrollFactor,
|
||||
|
@ -22,19 +23,28 @@ var DynamicBitmapText = new Class({
|
|||
|
||||
initialize:
|
||||
|
||||
function DynamicBitmapText (scene, x, y, font, text, size, align)
|
||||
function DynamicBitmapText (scene, x, y, font, text, size)
|
||||
{
|
||||
if (text === undefined) { text = ''; }
|
||||
if (align === undefined) { align = 'left'; }
|
||||
|
||||
GameObject.call(this, scene, 'DynamicBitmapText');
|
||||
|
||||
this.fontData = this.scene.sys.cache.bitmapFont.get(font);
|
||||
this.font = font;
|
||||
|
||||
var entry = this.scene.sys.cache.bitmapFont.get(font);
|
||||
|
||||
this.fontData = entry.data;
|
||||
|
||||
this.text = (Array.isArray(text)) ? text.join('\n') : text;
|
||||
|
||||
this.fontSize = size || this.fontData.size;
|
||||
|
||||
this.setTexture(entry.texture, entry.frame);
|
||||
this.setPosition(x, y);
|
||||
this.setOrigin(0, 0);
|
||||
|
||||
this._bounds = this.getTextBounds();
|
||||
|
||||
this.scrollX = 0;
|
||||
this.scrollY = 0;
|
||||
|
||||
|
@ -42,9 +52,6 @@ var DynamicBitmapText = new Class({
|
|||
this.height = 0;
|
||||
|
||||
this.displayCallback;
|
||||
|
||||
this.setTexture(font);
|
||||
this.setPosition(x, y);
|
||||
},
|
||||
|
||||
setSize: function (width, height)
|
||||
|
|
|
@ -17,6 +17,7 @@ var BitmapText = new Class({
|
|||
Components.RenderTarget,
|
||||
Components.ScaleMode,
|
||||
Components.Texture,
|
||||
Components.Tint,
|
||||
Components.Transform,
|
||||
Components.Visible,
|
||||
Components.ScrollFactor,
|
||||
|
|
Loading…
Reference in a new issue