开发者

iPhone Game - Open GL ES - How to Display an Integer?

Just a quick question. I have written a game in Open gles. How can I render a val开发者_开发技巧ue such as an integer on the screen ? (In this case int level).


I don't think open gl has any font support, but there are a few font libraries knocking about the internet. There is some discussion of that here:

Is there a decent OpenGL text drawing library for the iPhone SDK?

I needed to do the same thing as you, that fonts are probably overkill for. So, I simply made an array of images 0 to 9, then broke down the integer into a series of those images, by using % 10 to find which digit, then / 10 to move onto the next (more significant) digit.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜