Hi everyone.
I am trying to build a HUD for an Ogre3D game by creating my own XML file. I figured out how to make my own imagesets and load them in as static images but I still confused about the Root Window.
Since I want my static images to make up parts of the HUD should I just create a root window and leave it blank and then position my HUD components within it? Will it be transparent in the game so that all you see are the HUD elements?
Also, I was wondering how I should implement the Health and Ammo components since they will not be static. How can I get the Health bars and Ammo counter to be dynamic depending on how much health and ammo the player has? If I was using bars for the health would I just have an image for one bar and then load or unload the bars in the gameplay code?
Thanks.
I have question about root windows in a .layout file.
Moderators: CEGUI MVP, CEGUI Team
-
- Just popping in
- Posts: 3
- Joined: Tue Apr 03, 2012 18:54
Re: I have question about root windows in a .layout file.
IceThatJaw wrote:Hi everyone.
Since I want my static images to make up parts of the HUD should I just create a root window and leave it blank and then position my HUD components within it? Will it be transparent in the game so that all you see are the HUD elements?
Exactly. You set MousePassThroughEnabled on the root window and it then acts as just a container for other windows.
IceThatJaw wrote:Also, I was wondering how I should implement the Health and Ammo components since they will not be static. How can I get the Health bars and Ammo counter to be dynamic depending on how much health and ammo the player has? If I was using bars for the health would I just have an image for one bar and then load or unload the bars in the gameplay code?
I would probably do this with a custom looknfeel, you could base it on progress bar and clip the "filler" layer. I believe this is how sumwars does their health "orb".
HTH.
Who is online
Users browsing this forum: No registered users and 2 guests