July 19, 2009

Conspiracy Menu System

Posted in Computer Graphics at 10:53 pm by sagito

Hi all! There is a brand new feature on the Conspiracy Engine! Now it can render a menu system. Everyone knows and loves menu systems, those nice menus that serve as an intro for a game, for setting options, etc. So, how do you set up a menu system with DirectX? The base idea is quite simple. DirectX provides a nice support for this kind of stuff called Sprites. What can sprites do? They are 2D entities that live either in a 2D or 3D space. So, they can be used for menus, HUD, life bars, 2D animations and static scenarios, etc.

So, to start things off, I created a Sprite class that deals with every sprite related problem, such as creation, deletion, rendering, transformations, etc… Then, on top of this I created a menu system that features hierarchy, selection, positioning, and above all… I’m developing an external editor to customize the menus! Of course that since the Windows API is such a pain, I’m creating the editor in C#. The menus are configured through a file that can be easily loaded through a specialized parser called MenuReader.

The parser was build using the partial reflection mentioned before and is capable of easily configuring everything that can be customized on the menu, from the position of each element to the hierarchy, passing by the order and actions that each menu item will have. However, I’m still facing some problems. For example, in the DirectX Documentation the ID3DXFont class says that can be rendered over a Sprite. This would be great for menus, as they could actually have their own contained text. However, that does not seem to be working at all. And I’ve proof that the Font interface is working, because it is rendered nicely if there is no sprite. I’ll be working a little bit more before I post a screenshot of this system… 😛 And of course, I will give you news very soon! 😉


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: