GUI implementation week 03

As you’d probably have noticed, I changed this blog series title from “Menu” to “GUI” since I decided to make it work for both cases :p

For Cosmos Conflict, I needed to be able to render an in-game radial menu for players to make decisions. Therefore, I decided to implement it using the current design of the IGF v0.5 menu system. It was so easy to setup (after a few changes to the classes structure) that I decided that would be the basis for the GUI and Menu system.

Here is the current result:

For your information, I have a HUD class that takes care of all the GUI initialization and rendering. Since I wanted to render the HUD in 3d, I set my HUD class to inherit from SceneEntity and implement IRenderEntity to render a slightly bended quad model with a SunBurnBasicEffect instance (highly recommended: it fixes very annoying XNA 4 bugs) using a Screen.Texture (actually the RenderTarget2D to which I’m rendering the GUI too)  as its diffuse texture.

The radial menu inherits from the Control class and handles special input cases to switch between different states.

I played also with the opacity of the controls so that the HUD border is slightly transparent and the center of the radial menu lets the player see what he’ll selected to assign his orders.

I’m right now satisfied with the current implementation and I should move next week on implementing the Windows Mouse & Keyboard specificities. Once done, I’ll release v0.5.

3 Comments

  1. Nick Metnik says:

    Looking great Philippe! I’m really excited for your next implementation.

  2. Nick Lanng says:

    This is looking really good! Looking forward to getting to a point where I can use all this stuff!

  3. Philippe Da Silva says:

    Thank you guys! I hope the Windows mouse input won’t be too heavy to implement (I still need to create a Cursor class for you to replace with your own custom cursor if you want :p).

Leave a Reply