mirror of
https://github.com/wassname/phaser.git
synced 2026-08-08 11:23:41 +08:00
Testing BitmapFont as a texture.
This commit is contained in:
@@ -152,6 +152,7 @@ Phaser.BitmapData.prototype = {
|
||||
|
||||
if (width !== this.width || height !== this.height)
|
||||
{
|
||||
console.log('bmd resize', width, height);
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.canvas.width = width;
|
||||
@@ -165,6 +166,9 @@ Phaser.BitmapData.prototype = {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* @method Phaser.BitmapData#refreshBuffer
|
||||
*/
|
||||
refreshBuffer: function () {
|
||||
|
||||
this.imageData = this.context.getImageData(0, 0, this.width, this.height);
|
||||
|
||||
@@ -135,7 +135,8 @@ Phaser.BitmapFont = function (game, x, y, key, characterWidth, characterHeight,
|
||||
/**
|
||||
* @property {Phaser.BitmapData} bmd - The internal BitmapData to which the font is rendered.
|
||||
*/
|
||||
this.bmd = new Phaser.BitmapData(game, this.characterWidth, this.characterHeight);
|
||||
// this.bmd = new Phaser.BitmapData(game, this.characterWidth, this.characterHeight);
|
||||
this.bmd = new Phaser.BitmapData(game, 800, 600);
|
||||
|
||||
Phaser.Image.call(this, game, x, y, this.bmd);
|
||||
|
||||
@@ -386,9 +387,14 @@ Phaser.BitmapFont.prototype.buildBitmapFontText = function () {
|
||||
}
|
||||
|
||||
this.bmd.render();
|
||||
|
||||
this.width = this.bmd.width;
|
||||
this.height = this.bmd.height;
|
||||
this.texture.frame.width = this.bmd.width;
|
||||
this.texture.frame.height = this.bmd.height;
|
||||
this.updateFrame = true;
|
||||
this.dirty = true;
|
||||
this.textureChange = true;
|
||||
// this.setTexture(this.bmd.texture);
|
||||
// this.width = this.bmd.width;
|
||||
// this.height = this.bmd.height;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user