I have question about root windows in a .layout file.

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

IceThatJaw
Just popping in
Just popping in
Posts: 3
Joined: Tue Apr 03, 2012 18:54

I have question about root windows in a .layout file.

Postby IceThatJaw » Sat Apr 07, 2012 23:23

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.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: I have question about root windows in a .layout file.

Postby Kulik » Sun Apr 08, 2012 12:37

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.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 2 guests