Jump to content
  • Advertisement
Sign in to follow this  
emforce

In game menus

This topic is 3260 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 guys i was wondering how you create in game menus? like for instance in wow when you open up the equipement menu to see your gear. How do they do that? do they render a box and a texture with some gui buttons? Im just wondering cause im looking into putting small inventory boxes and menus for random things in my games/ apps

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by emforce
hi guys i was wondering how you create in game menus? like for instance in wow when you open up the equipement menu to see your gear. How do they do that? do they render a box and a texture with some gui buttons? Im just wondering cause im looking into putting small inventory boxes and menus for random things in my games/ apps
It's usually a quad with a texture, or multiple quads depending on how you want to structure things.

You can also use third party libraries that handle all of the drudgery for you. In my game I use CEGUI for example.

Share this post


Link to post
Share on other sites
ok so i got the textured quad running but how would i make it so it was like in orthogonal projection? aka so it was predominant in the screen

Share this post


Link to post
Share on other sites
Render it with 2D coordinates, possibly relative if you want it to cover the same percentage of the screen at different resolutions.
How you do that depends on which API. Direct3D supports pre-transformed vertices (D3DFVF_XYZRHW for 9 or an empty vertex shader for 10), and OpenGL can do it for example with an identity projection matrix and glVertex2d.

Share this post


Link to post
Share on other sites
That would be with D3DXMatrixOrthoLH. That'll create an orthographic projection matrix which you can use to display your GUI with (You'll need to set that matrix on the device though, presumably by setting a shader param).

Share this post


Link to post
Share on other sites
i tried using the D3DXMatrixOrthoLH but to no avail. I set the zn and zf to 1.0f and 1000.0f respectively but if i try to render the square it will just disappear. How do i set the matrix on the device? and how would i set a shader parameter?

Share this post


Link to post
Share on other sites
ID3D9Device::SetTransform with D3DTS_PROJECTION for D3D9 fixed-function, or using for example ID3D10Effect::GetVariableByName as described in the Set Effect State (Direct3D 10) guide for D3D10 with effects. If you're not using the effect interface you need to create a constant buffer manually.

This is all covered in the D3D10 tutorials and samples, starting at Tutorial 0: Win32 Basics, which should be completed in order. Specifically tutorial 7 seems to be covering constant buffers.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!