How to make hudgroups.
Moderators: Lavish Software Team, Moderators
How to make hudgroups.
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
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:
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:
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:
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.
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
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: ${Display.FPS}</Text>
</hudelement>
</Children>
</hud>
</ISUI>
Code: Select all
UIElement -toggle "my hud"