RetroFont now uses Phaser.scaleModes.NEAREST by default for its RenderTexture to preserve scaling.

This commit is contained in:
photonstorm 2014-05-27 13:36:38 +01:00
parent cdde45a292
commit 5a0d5b4887
2 changed files with 23 additions and 1 deletions

View file

@ -57,6 +57,7 @@ Version 2.0.6 - "Jornhill" - -in development-
* BitmapData.draw now has two optional parameters: width and height, to let you stretch the image being drawn if needed.
* Group.destroy now removes any set filters (thanks @Jmaharman fix #844)
* RetroFont charsPerRow paramters is now optional. If not given it will take the image width and divide it by the characterWidth value.
* RetroFont now uses Phaser.scaleModes.NEAREST by default for its RenderTexture to preserve scaling.
### New Features

View file

@ -164,7 +164,7 @@ Phaser.RetroFont = function (game, key, characterWidth, characterHeight, chars,
*/
this.stamp = new Phaser.Image(game, 0, 0, key, 0);
Phaser.RenderTexture.call(this, game);
Phaser.RenderTexture.call(this, game, 100, 100, '', Phaser.scaleModes.NEAREST);
/**
* @property {number} type - Base Phaser object type.
@ -585,3 +585,24 @@ Object.defineProperty(Phaser.RetroFont.prototype, "text", {
}
});
/**
* @name Phaser.BitmapText#smoothed
* @property {string} text - Set this value to update the text in this sprite. Carriage returns are automatically stripped out if multiLine is false. Text is converted to upper case if autoUpperCase is true.
*/
Object.defineProperty(Phaser.RetroFont.prototype, "smoothed", {
get: function () {
return this.stamp.smoothed;
},
set: function (value) {
this.stamp.smoothed = value;
this.buildRetroFontText();
}
});