How to make hudgroups.

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
ConPollo
GamingTools Subscriber
Posts: 2
Joined: Sat Jul 09, 2005 4:30 am

How to make hudgroups.

Post by ConPollo » Tue Aug 23, 2005 9:53 pm

I know how to add in hud elements, that is easy. I was wondering how to turn those custome hud elements into hudgroups so that I can use a key binding to toggle them on and off. I looked around on the wiki for it, and did a search here on the boards but found no info on it. If there is some place that it is documented, well I apologize for creating a thread. Any help is appreciated, thanks

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Tue Aug 23, 2005 10:07 pm

Nope, valid question. It's not really documented right now.

The only way to create a group of hud elements at this time is to create them via UI xml, and set it there. The hud command is just there for convenience. If you have HUD elements that you want permanently, you put them in the UI directly.

Also, you dont necessarily need to have hud elements in a group to use a key to toggle them. They can also be toggled like so:

Code: Select all

UIElement[main hud]:Child[my hud element]:ToggleVisible
If you want to make a group, you need to make a copy of DefaultUI.xml, called MyUI.xml or such. Then change PreInit.iss to use MyUI.xml instead of DefaultUI.xml. Edit MyUI.xml to your specifications and that's it.

Another way to do it is to create a completely separate UI file, say MyHud.xml, and create a hud in it with a name other than main hud, something like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<!-- 
  My HUD
-->
<ISUI>
	<hud name='my hud'>
		<X>0</X>
		<Y>0</Y>
		<Width>100%</Width>
		<Height>100%</Height>
		<Children>
			<hudelement name='my hud element'>
				<X>20</X>
				<Y>5</Y>
				<Text>FPS&#58; $&#123;Display.FPS&#125;</Text>
			</hudelement>
		</Children>
	</hud>
</ISUI>
This is effectively a hud group, but you would toggle it by toggling the "my hud" ui element instead of the hud group, with the UIElement command, like so:

Code: Select all

UIElement -toggle "my hud"
Your new hud would not be usable via the hud commands, because those only apply to the hud called "main hud"... but if you set it up the way you want, you dont need the commands anyway.

ConPollo
GamingTools Subscriber
Posts: 2
Joined: Sat Jul 09, 2005 4:30 am

Post by ConPollo » Tue Aug 23, 2005 10:30 pm

wow, thanks. That explains it all and is pretty simple to do. :)

Post Reply