How do you implement bitmap fonts in C2?

Get help using Construct 2

Post » Fri Sep 21, 2012 1:30 am

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?
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

Post » Fri Sep 21, 2012 5:13 am

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.
B
18
S
9
G
5
Posts: 77
Reputation: 4,946

Post » Fri Sep 21, 2012 5:31 am

[QUOTE=lonehangman] 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.[/QUOTE]


That's a good advice, BUT if the bitmap fonts have unique styles like shadows, gradients, textures, etc. .tff and .woff fonts dont 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...
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

Post » Fri Sep 21, 2012 6:03 am

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.

Davioware2012-09-21 06:05:15
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Fri Sep 21, 2012 6:08 am

[QUOTE=Davioware] 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.

[/QUOTE]

I'm going to make a .capx with your idea and let's see what happens.
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644


Return to How do I....?

Who is online

Users browsing this forum: emoticon, makkancs and 22 guests