Best way to create an UI?

edited September 2012 in Help request
I have been writing a dungeon explore game for fun.

I am finishing the monster handling module right now, and the next thing to do is UI. Is it better to create viewports or draw the menus in the the screen (with the lowest Z, so they will always be rendered) and move them as the character moves?

The second one seems a lot easier to code, but way slower too...

Some other suggestions are welcome.

Thanks in advance.

Comments

  • edited September 2012
    My favourite way of doing it is by standard normal objects that use your game camera as parent. This way when your camera moves, so does your UI.

    The other (big) advantage is that you can place/scale your UI elements relatively to your camera size (which maps to your screen space via your viewport). This way if you modify your aspect ratio or screen resolution, your UI elements should still be placed correctly.
  • edited September 2012
    Wow, nice, hadn't consider that.

    Thanks.
  • edited September 2012
    My pleasure! Let us know if you have any other questions!
Sign In or Register to comment.