

If your font is installed system-wide you can skip the Add font file step and just select the name of the font directly. Then select the name of the font in the Font dropdown.Prepare your font as a TTF file or similar.You can download this generated example in the format that Phaser can use here: pixel_bitmap_font.zip Įnter fullscreen mode Exit fullscreen mode

Here's an example I generated from this public domain font. An XML file that defines the x/y/width/height of each character in the image.An image containing all the possible characters.From the Phaser docs:īitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability to use Web Fonts, however you trade this flexibility for rendering speed The bottom image has the crisp, pixelated rendering expected in retro games.īitmap fonts may also be faster to render. This creates what looks like blurry artifacts at the small scale of pixel art games. Note the antialiasing inside letters like g, a, or o in the top image. The bottom is a bitmap version of the same font. The top is the standard font rendering in Phaser. The main use case is if you're creating a pixel art game & want your text to match the retro style and have no antialiasing.īelow is an example from a recent game I made. I'll be using BMFont which is Windows only.
Fonty y omar how to#
This guide explains how to generate bitmap fonts from TTF or OTF files for use in PhaserJS.
