Skip to content

Commit 5a0d5b4

Browse files
committed
RetroFont now uses Phaser.scaleModes.NEAREST by default for its RenderTexture to preserve scaling.
1 parent cdde45a commit 5a0d5b4

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Version 2.0.6 - "Jornhill" - -in development-
5757
* BitmapData.draw now has two optional parameters: width and height, to let you stretch the image being drawn if needed.
5858
* Group.destroy now removes any set filters (thanks @Jmaharman fix #844)
5959
* RetroFont charsPerRow paramters is now optional. If not given it will take the image width and divide it by the characterWidth value.
60+
* RetroFont now uses Phaser.scaleModes.NEAREST by default for its RenderTexture to preserve scaling.
6061

6162
### New Features
6263

src/gameobjects/RetroFont.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Phaser.RetroFont = function (game, key, characterWidth, characterHeight, chars,
164164
*/
165165
this.stamp = new Phaser.Image(game, 0, 0, key, 0);
166166

167-
Phaser.RenderTexture.call(this, game);
167+
Phaser.RenderTexture.call(this, game, 100, 100, '', Phaser.scaleModes.NEAREST);
168168

169169
/**
170170
* @property {number} type - Base Phaser object type.
@@ -585,3 +585,24 @@ Object.defineProperty(Phaser.RetroFont.prototype, "text", {
585585
}
586586

587587
});
588+
589+
/**
590+
* @name Phaser.BitmapText#smoothed
591+
* @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.
592+
*/
593+
Object.defineProperty(Phaser.RetroFont.prototype, "smoothed", {
594+
595+
get: function () {
596+
597+
return this.stamp.smoothed;
598+
599+
},
600+
601+
set: function (value) {
602+
603+
this.stamp.smoothed = value;
604+
this.buildRetroFontText();
605+
606+
}
607+
608+
});

0 commit comments

Comments
 (0)