Menus and HUD

This week I was tasked with setting up the functionality of most of the game’s menus the temporary HUD. I started this by trying to use direct2D to draw text and images in screen space and quickly decided that that was unnecessary. For the most part, we did not need any dynamic text, which is the one useful thing direct2D does, so I decided to stick with just using 3D instead. I was given a bunch of textures in the form of pngs and just slapped them on a screen space quad. After messing with sizing and spacing for long enough it turned out to look pretty good. To add more functionality to the menu, I gave each menu object a top and bottom position, so that when they are selected they lerp between those two positions to make it look like they are animating. Also, each selectable object has a function pointer, so that if the confirm button is pressed when they are selected, their function pointer is just called. The trickiest menu to implement was the upgrades menu because that one did require dynamic text for the pricing of the upgrades. For this, I used a combination of Direct3D and Direct2D, so lining the two of them up correctly was a little bit of a pain.




Comments

Popular Posts