Game config interface screens

Started by
6 comments, last by Aqua Costa 13 years, 4 months ago
I'm just looking for some general direction.

Within most games, you can set key bindings, change resolution, and other game configuration needs. What I'm trying to wrap my head around is how to manage this 2D interface while the engine is rendering in 3D? Having a consistent look in different resolutions, wide screen or not.

I could render a flat polygon, that covers the whole screen, right next to the near z plane but this sounds clugy to me. I know DirectX has 3D interfaces for buttons and such but do they scale so that in high resolutions, everything isn't very small.

I'm just not sure how to proceed.

[Edited by - howie_007 on December 13, 2010 10:50:50 AM]
Advertisement
If your looking for stretchy interfaces, that scale with resolution you need to come up with an intermediary form of coordinates(I use 0->1 on x and y axis). much like uv's these will allow you to stretch your UI goods to what ever resolution you would like.

In my current system I have classes for each of the UI goodies i use, buttons, textinputs, etc They can be read from a textfile, and the intermediary coordinates are mapped into clip space(with the above example that would equate to x = 2(intermediary.x) - 1. A vertex buffer is created using pre-transformed positions. On each render, the world is rendered, then I disable ztesting and render all of the UI. During mouse events, I test against the gui's root element(it's a tree of UIElements), it recursively tests each of it's children(bubbling).

Quote:I know DirectX has 3D interfaces for buttons..

Do you mean DXUT? That's an interface for DirectX, not a part of DirectX itself.

It's a bit more common to suspend the game as a kindness when the user selects the game config menu. That can also simplify life a bit rendering the menu, getting user keyboard and mouse inputs, etc. It may also simplify changing resolutions, etc.

In any case, as Burnt_Fyr mentions, designing your interface with scaling factors from the start is the way to go.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

I didn't know you could scale interface items. Thanks for that. I believe we are talking about the CustomUI?
Quote:Original post by Buckeye
Do you mean DXUT? That's an interface for DirectX, not a part of DirectX itself.

Do you need to use DXUT? Are there DirectX calls for creating these CustomUI interface items?
You can also use CEGUI (google it).
Quote:Original post by Aqua Costa
You can also use CEGUI (google it).

That's funny. It stands for "Crazy Eddie's Gui System". You can't go wrong with anything named "Crazy Eddie".

Thank you everyone! All your help was the "point in the right direction" I was looking for.

Cheers!

Quote:Are there DirectX calls for creating these CustomUI interface items?

Nope. DXUT does it with sprites.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Quote:Original post by howie_007
Quote:Original post by Aqua Costa
You can also use CEGUI (google it).

That's funny. It stands for "Crazy Eddie's Gui System". You can't go wrong with anything named "Crazy Eddie".

Thank you everyone! All your help was the "point in the right direction" I was looking for.

Cheers!


It is not the best name for an API but it works really well. :D

This topic is closed to new replies.

Advertisement