Results 1 to 2 of 2

Thread: how to create a menu with text

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    15

    how to create a menu with text

    How would I go about creating a menu system with fonts in WebGL? 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. And I get the feeling I need to some how create my own font because it doesn't sound like any are available to me.

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

  2. #2
    Senior Member
    Join Date
    May 2010
    Posts
    207

    Re: how to create a menu with text

    Well, you could create a font in a texture and render quadrilaterals with the appropriate texture coordinates to create letters.

    But why bother? You have the whole of HTML5 at your disposal?

    I started writing my own game using WebGL-rendered fonts - but to save implementation time, I switched over to using HTML to render on-screen text and GUI elements. The result is really neat - you can even use CSS to set up the style of the thing. My game has user-switchable 'skins' now - it's trival to do that by switching CSS files.

Similar Threads

  1. API for menu that will draw on top of canvas/webGL
    By miroslav_karpis in forum WebGL - General
    Replies: 2
    Last Post: 01-10-2012, 12:10 AM
  2. UG, Vincent, There is a way to create text?
    By Eymerich in forum OpenGL ES general technical discussions
    Replies: 0
    Last Post: 04-02-2008, 02:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •