Why does text look different when I test the game?

Get help using Construct 2

Post » Thu Dec 29, 2011 10:38 pm

Only way that i can see to end this problem is rendering text as image, that is sprite fonts. Native text rendering of all browsers currently it's awful. I had no option but make all text of my games as static images. If you want nice smooth gradiented fancy text that's the only way right now. I'm pretty picky with text looks :D
B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Post » Thu Dec 29, 2011 10:52 pm

canvas (the html element where all the c2 magic occur) is just an array of pixels on which we draw with js to display the game. The engine to draw in canvas isn't the same as the engine that handle text in your browser. (:Yann2011-12-29 22:52:35
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Dec 29, 2011 11:32 pm

Maybe it's missing ClearType which you get on an ordinary HTML page. I don't know, but it's certainly better than aliased!
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Dec 30, 2011 11:28 am

Thanks for all the responses. So, what exactly are sprite fonts? Is this just a specific font or is it more involved than that?
B
1
G
1
Posts: 7
Reputation: 439

Post » Fri Dec 30, 2011 11:56 am

@terblus - see the SpriteFont plugin by Mipey. Rather than text rendered to an image, SpriteFonts are dynamic text which is based off having an image with each letter of the font rendered to an image (e.g. "abcdefghijklmnopqrstuv...". Then it builds up text by drawing individual letters from the image. That might be a good substitute for the Text object while keeping identical rendering.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Dec 30, 2011 11:57 am

SpriteFont is a way to display sprites (pictures) of a text. Each sprite displays one letter and is positionned so it looks like formatted text.

Edit: ninja'd by AshKyatric2011-12-30 11:58:15
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Sat Dec 31, 2011 11:02 pm

Does that slow down the game? Adding a sprite per letter seems like a real resource hog. Also, why is this preferable to simply typing text in paint and then using that picture as a sprite? Then all the text would only be one sprite.
B
1
G
1
Posts: 7
Reputation: 439

Post » Sun Jan 01, 2012 1:58 am

SpriteFont use only one texture (a letter sheet) and it's all encompassed in one object. There's no real overhead I think. Under the hood It just draws some rectangle picking the corresponding texture area for each letter.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Previous

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests