Jump to content
  • Advertisement
Sign in to follow this  
MarkBNJ

Designing an XNA GUI: Some Questions

This topic is 3884 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

Hey folks. I've been working for several days on a windowing system to support my own game projects using XNA. I've written the input controller game component and defined the events that will be used to propagate input out to the window manager and then down to managed windows. The basic architecture is a parent/child window model with bubble-up events. The window objects own their client areas, while the window manager owns the non-client adornments and the list of primitives needed to render the GUI. I'm wrestling with a few questions: - Sprites vs. textured quads. I've seen various opinions on this. Seems like you need sprites for fonts anyway, so I lean in that direction. Is there a huge reason to prefer textured quads? - I'm pretty noobish on 3D matters. If you're rendering the GUI in 3-space, how do you set up the transformations such that it always appears in front, a certain distance out from the camera, and appearing to fill the whole screen? - More 3D noobishness: I assume that with sprites it matters when the spritebatch is drawn, i.e. you render all the 3D vertices and effects and then draw the batch last, on top of everything else. Does that sound correct? If I were to use textured quads I assume it wouldn't matter as much when the GUI stuff was spit out. I'm thinking about this in terms of coupling and the interface to a client program. - Lastly, the actual rendering of window elements. Trying to figure out the best way to render the default appearance of base window and control types, and allow extensibility through derivation. XNA doesn't seem to offer much in the way of 2D drawing primitives, or ways to draw to textures. I could avoid drawing alltogether and just provide every base type with some default texture content for borders, corners, thumbs, etc. Derived classes could load their own textures and replace the defaults at init. I thought about some way of having the base types create their default textures programatically by drawing to a texture, but the only possibility I see there is maybe using GDI+ to manipulate an image in memory and then converting this to a texture2d somehow. Anyway, thanks for listening. Your thoughts would be greatly appreciated.

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!