Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Pixelbox

Create 2D games in JavaScript, made easier · By Cedric Stoquer

How do I change the font?

A topic by hexakon created Jan 29, 2021 Views: 522 Replies: 1
Viewing posts 1 to 2

As title says, I’d like to use other bitmap fonts. Also, I don’t know if it’s intentional nor if this is reproducable on other computers, but disabling Minitext causes print() to open the printer dialog instead of printing text onto the screen.

Thank you very much in advance

With the recent version of pixelbox (2.0.5), it’s now possible to change the bitmap font. To be correctly recognised by Pixelbox, the bitmap font must an image with transparent background, where characters are set in a 16 by 6 grid in ASCII order. Once you added a charset image in the assets folder of your project, you can change the font with the following command:

$screen.setCharset(assets.charset);

Note that you need to have Minitext option enabled in the project settings to have pixelbox’s text API installed.

I added a demo project to the download section.