1
\$\begingroup\$

I am making a game using OpenGL ES 1.0 and I want to keep player score. So I need to draw text dinamically. What is the best approach? Some library, textures, bitmaps? I tried to use TextView but when I want to update text I need to do that from main thread, and there is an obvious lag in the game.

\$\endgroup\$
  • \$\begingroup\$ TextView ? Are you referring to Android? If so you may want to tag your question with the android tag. Also, a TextView would be a nice choice, I'm not sure what you mean you need to update it from the main thread, did you try it and there was lag or are you just assuming? \$\endgroup\$ – TomTsagk Sep 5 '18 at 9:08
1
\$\begingroup\$

The typical way is to use a texture atlas with glyphs.

Personally, I am a fan of vector text, where you actually define the shape of the character with geometry, not with texels.

The advantage of this is that your text is completely resolution independent. You can zoom in on your text as far as you like, without every seeing aliasing or jaggies.

Now granted, the curves in text means that they will look best with curve primitives, or high poly counts.

But if you are OK with crude shapes, and want a simple approach, may I suggest Dutch Blunt?

enter image description here

DISCLAIMER: I am the author.

For a more professional solution (paid) you can look into Slug.

\$\endgroup\$
1
\$\begingroup\$

One common, easy way to do it is to simply make a texture atlas with the characters you'll need (probably lowercase letters, uppercase letters, numbers, and maybe some punctuation). Then simply pull out the section you need to draw each letter.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.