Hello everyone!
I’m having an issue with my game, and I really hope you can help me.
I wanted to display an HUD, similar to the strategic games’ one (like in DotA 2, Warcraft III, Starcraft II or Age of Empires). I didn’t really know how to do it, so I managed to create a Texture Object and placed it in front of the scene. The image attached is the HUD itself, with some transparent “holes” in which I placed the cameras. I don’t know if this description explains well what I’m trying to say, so I made this screenshot:
The HUD is just a png image with a greater z-index. The image has three “holes”: one for the gameboard, one for the dices, and one for the spells you can see on the right. The holes are filled with the cameras, so we can see the objects beyond the transparency. Everything looks quite nice.
But if I change aspect ratio (which was “Free Aspect”), my layout gets completely screwed up.
Notice that the HUD borders are not fully displayed; the spells on the right are misplaced, and so are the dices.
I managed to get the free aspect resolution, it is 1440x720, a perfect 2:1. But, even if I change my resolution to 800x400, things are not getting better.
I’ve read something about pillarboxing and letterboxing, but I’m not sure that those techniques will help me with this issue. Is there something I can do to resize my objects and my cameras dynamically to fit the screen like in the first screenshot?
Of course, if you have any other solutions to achieve the same result, I’ll be glad to learn!
Thank you guys.


