Sprite font vs text

Get help using Construct 2

Post » Tue Jul 14, 2015 6:28 pm

Hi ppl,

I've made a quiz/trivia game. It is obvious that this kind of games rely mostly on text. Now when I released my game to Google Play some players leave comments regarding problems with text like:

- text blurs sometimes,
- sometimes instead of question they see some unknown characters (this happened only on Galaxy Tab 3 - it's some encoding issue I believe)
- other less frequent issues

I know that Text can be rendered differently on different devices and I believe this is the cause of all the issues. So I figured out that if I do it with Sprite Fonts then all devices should render it the same way. But that's the teory only. Have anyone tried Sprite Fonts in official project and can confirm that there are no rendering issues on various devices?

I know Sprie Fonts renders faster than Text but is the text quality good on all devices?
ImageImageImage
B
28
S
16
G
82
Posts: 1,030
Reputation: 45,804

Post » Tue Jul 14, 2015 6:35 pm

Sprite fonts are... sprites, so, it renders just like any other sprite. It works perfect.
The only "issue" is to set the right space between characters because the space between an "i" and an "l" is not the same between a "w" and an "m". You can adjust it in an event sheet, character by character. You'll just need to test your character space configuration with several diferent text.

;)
Lead developer at Octeto Studios
Visit our portfolio at: http://www.octetostudios.com/ :)
Facebook || Twitter || Youtube
B
37
S
7
G
5
Posts: 217
Reputation: 5,613

Post » Tue Jul 14, 2015 7:05 pm

B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Tue Jul 14, 2015 7:18 pm

korbaach wrote:Sprite Font Generator


Wow! Cool, I didn't know that plugin.
I'll try it in the next project even though in that plugin you can't adjust character by character and you can only do it globally.

Thank you :)
Lead developer at Octeto Studios
Visit our portfolio at: http://www.octetostudios.com/ :)
Facebook || Twitter || Youtube
B
37
S
7
G
5
Posts: 217
Reputation: 5,613

Post » Tue Jul 14, 2015 7:29 pm

Yup. I am using that generator. My only concern is regarding the quality. Cause in C2 and browser (preview) I see sprite fonts blurred, bad quality, but when I run project on my mobile then it is really perfect. But I guess @GamerGon is right - sprite is sprite so I believe it's all about to generate high resolution SpriteFont and then scale it.
ImageImageImage
B
28
S
16
G
82
Posts: 1,030
Reputation: 45,804

Post » Tue Jul 14, 2015 7:33 pm

I didn't have quality problems on my projects because we usually create our own spritefonts with 128x128 characters ;)
Lead developer at Octeto Studios
Visit our portfolio at: http://www.octetostudios.com/ :)
Facebook || Twitter || Youtube
B
37
S
7
G
5
Posts: 217
Reputation: 5,613

Post » Tue Jul 14, 2015 8:30 pm

An how do you resize it in the project then? I've generated a white Sprite Font now with size of 72, which is 74x88px, and then when I use it in my project I have to resize it, so I use "scale" parameter. Problem is that when I resize it using scale then white color turns into blured gray color. I'm kinda stucked here... Is there any other way of resizing SpriteFont?
ImageImageImage
B
28
S
16
G
82
Posts: 1,030
Reputation: 45,804

Post » Tue Jul 14, 2015 8:56 pm

First,
in the spritefont every character has to have the same size in pixels and power of 2... so 64x64, 128x128, etc...

About the size inside the game... scale/size is the only way. With fonts of 128x128 I think is enough... I've never needed larger characters than that.
Scaling up a spritefont will have the same problems that scaling up a sprite.
Lead developer at Octeto Studios
Visit our portfolio at: http://www.octetostudios.com/ :)
Facebook || Twitter || Youtube
B
37
S
7
G
5
Posts: 217
Reputation: 5,613

Post » Tue Jul 14, 2015 10:27 pm

You can get round the spacing issue by using a font that is designed to be monospaced. This, with a bit of tinkering with the character spacing for the string overall, produces a reasonable result.
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328

Post » Thu Jul 16, 2015 1:19 pm

Thanks for help guys. It suddenly started to work after I generated spritefonts again. Maybe there was some generation glitch.

So to wrap up I use spritefont generator mentioned above, and it works great, fonts are very sharp on mobile no matter how much I resize them (using scale).

ps. Fonts are very sharp only on mobile, in C2 preview mode they are blured - but that is not my concern now, just mentioning.
ImageImageImage
B
28
S
16
G
82
Posts: 1,030
Reputation: 45,804

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests