How do you implement bitmap fonts in C2?

0 favourites
  • 5 posts
From the Asset Store
A cool way for kids to write and practice English Alphabets
  • I know there a third party plugins is called SpriteFont, but is currently not supported for appMobi and CocconJS which can export to the mobiles because the developer told me about a technology draw Glyph isn't avaliable yet on cocconJS and appMobi.

    Do you have an idea to make an workaround to implement bitmap fonts?

  • Try convert it to TTF and then to .woff, then follow Ashely's tutorial on how to get web fonts implemented. I've never worked with bitmap fonts so sorry if this is a bit obscure, I'm just speaking from using TTF and converting to woff.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Try convert it to TTF and then to .woff, then follow Ashely's tutorial on how to get web fonts implemented. I've never worked with bitmap fonts so sorry if this is a bit obscure, I'm just speaking from using TTF and converting to woff.

    That's a good advice, BUT if the bitmap fonts have unique styles like shadows, gradients, textures, etc. .tff and .woff fonts don?t help.

    I was thinking to create a sprite with multi frames like 0=A 1=B 2=C...

    The biggest problem is how to type a text with bitmap fonts...

  • You'll have to make your own text system if you want to use animation frame based text. It's not that hard with monospaced fonts, but it can get tricky if you want proper wrapping. Have a "base sprite" to serve as a bounding box, then give it a few text variables. Have one var for the text, and one for the currently drawn text. When the draw variable is different to the "text" variable, get the first letter of "text", draw a letter sprite with frame equal to text value, increment the counter, and link the letter sprite to the base object by uid. The wrapping is a bit more involved, but it's simpler if you don't want active wrapping (which means you can resize the bounding box after the text is drawn, and have the words wrap as you resize.). Bonus with this is that the letters can do individual animations like wobbling and stuff.

  • You'll have to make your own text system if you want to use animation frame based text. It's not that hard with monospaced fonts, but it can get tricky if you want proper wrapping. Have a "base sprite" to serve as a bounding box, then give it a few text variables. Have one var for the text, and one for the currently drawn text. When the draw variable is different to the "text" variable, get the first letter of "text", draw a letter sprite with frame equal to text value, increment the counter, and link the letter sprite to the base object by uid. The wrapping is a bit more involved, but it's simpler if you don't want active wrapping (which means you can resize the bounding box after the text is drawn, and have the words wrap as you resize.). Bonus with this is that the letters can do individual animations like wobbling and stuff.

    I'm going to make a .capx with your idea and let's see what happens.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)