-1

I'm a beginner in android development and i started to code a game few days ago. I've almost finished it and now i want to have some nice texts in my canvas. I want to display the scores, the bonuses that the player has and some other stuff. The problem is i have no idea how to make them look nice. I dont want a normal text to be displayed, and i want to make it pop on the screen when an action is done. Can anybody give me some advice?

I want to make it look like this http://static.appgamer.net/images/articles/screen568x568_2.jpeg

Cristian
  • 71
  • 6
  • I didn't downvote you, but my guess is that whoever did probably wants you to show more detail -- especially what have you tried so far (posting code you've tried already is a really good idea!). Your question should probably be more specific-- the site is designed to answer specific questions. The more detail you can give, the better chance you have of getting a helpful answer! – transistor1 Jan 23 '15 at 19:09
  • I haven't tried anything cause i dont know to do it, exept of using a textview.. which is not what i want. I just asked how can i display a "game like" text, like the one in the picture. – Cristian Jan 23 '15 at 19:13
  • So on this site you probably would want to ask something more like "how do you draw text on a Canvas?" (which seems to have an answer already [(link)](http://stackoverflow.com/questions/4039713/how-to-draw-text-on-canvas)) – transistor1 Jan 23 '15 at 19:18

1 Answers1

0

What you're looking for is called bitmap fonts. Here you can find a pretty good article about the technique: http://obviam.net/index.php/using-bitmap-fonts-in-android/

Basically you have to prepare your font as a bitmap composed of separate glyphs. Then load the bitmap and create a description of each glyph (name, position, size). Then you have to just walk through a string you want to draw and draw parts of the font bitmap instead.

Zielony
  • 16,239
  • 6
  • 34
  • 39
  • +1 - this was interesting. you might want to clarify that this is different than drawText, though, because it will allow you to use "pretty" graphical fonts with colors, rather than just standard text. Pretty sure drawText would only allow standard fonts in single colors – transistor1 Jan 23 '15 at 19:59
  • Thank your very much for your advice. i will check that link and try to understand how it's done! – Cristian Jan 23 '15 at 20:23