CreateJs Bitmap Text

createjs is a great library for creating games in HTML5. It’s flash like syntax makes it more easier for flash developers to create HTML5 games.

One of the ways to add text to createjs games is using createjs textfield class. The built in textfield class depends on webfont which behaves differently across browsers and does not look smooth.

Another approach is using bitmap fonts but there is no built-in support for bitmap fonts in createjs.  There is one great article for creating bitmap fonts in createjs. It explained how to create a bitmap text field in createjs. But the disadvantage with this method is that all the letters need to be of fixed size and there is no support for kerning. It means we can not follow this approach for creating bitmap fonts with regular font like Arial.

So I ported bitmap text class in starling to createjs.

Here is the git repository for the source and the example.

The demo can be found here.

Features:

  • Multiline text
  • Horizontal and Vertical alignments
  • Kerning
  • Change color of the text using setColor method [Updated!]

If you found any bugs or want to leave some feedback please leave a comment!