Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

How would I go about creating a menu system with fonts in OpenGL? I want to make a dungeon crawler and will need a menu for inventory and stats for the weapons. I can draw a world made out of blocks ok but I'm not quite sure how to do this.

I think I need to use the matrix that glortho applies to the matrix stack. Specifically I'm using WebGL and I don't have access to fonts so it seems like I have to create my own.

Any help with how I would go about doing this would be appreciated.

share|improve this question
    
Do any of the answers in this question help: gamedev.stackexchange.com/questions/7562/… –  Tetrad May 1 '11 at 19:35
    
I don't think so. –  Xavier May 1 '11 at 20:53

3 Answers 3

up vote 2 down vote accepted

OpenGL know nothing of fonts, so you have two choices. Either use bitmap fonts (a font written into a texture) or use Canvas/HTML to display your text.

Most regular OpenGL games uses bitmap fonts.

share|improve this answer

If you're using WebGL, using the properties of the underlying 'canvas' element from which you created the context from to draw text. Don't make it harder than it needs to be until it needs to be.

share|improve this answer

Maybe I just don't understand your question, but if you want to draw text, you can use function glutBitmapCharacter.

share|improve this answer
    
Assuming he is even using GLUT –  Daniel May 2 '11 at 15:15
    
GLUT isn't available for WebGL. –  Xavier May 2 '11 at 22:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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