Jump to content
  • Advertisement
Sign in to follow this  
67rtyus

Using DirectX for GUI design

This topic is 3818 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi; I want to design a GUI system for my strategy game. I don't have any problems with the inner workings of a GUI system; things like message passing, window trees etc. What I want to know is, how I can implement the visual side of a UI with DirectX. For example, if there is a message box, how can i draw it to the screen? Should I draw it as a rectangle, consisting of 4 vertices and 2 triangles,with a DrawPrimitive call? And what about the UI graphics, are they implemented as textures, covered on the rectangles of the windows,menus and other UI controls? Shortly, how should I draw the UI, using DirectX? Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
Quote:
how should I draw the UI, using DirectX?

It depends entirely on the complexity you want to support. If you want just a messagebox occasionally, draw a textured quad on top of the scene or a sprite and set flags to accept only mouse-clicks in the appropriate rectangle.

If you want a generalized HUD to which you can add buttons and edit controls later, a lot of examples in the SDK setup an extensive UI. You can adapt that code to your own purposes.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!