Hey guys i'm trying sum fancy dialog-based healthbar, which appears when unit takes damage and increasing transparency over time before disappearing. So i made it this way: every time i create a new dialog and attaching it to the unit. So the problem is my health bars appear on top of other UI dialogs, cuz they were created after them. Any solution? I assume i cannot pre-create this ones cuz i don't rly know how much units will be spawned. I tried DialogRTT function with no luck. This rly makes me sad -_-. Plz advise sum great solution. And forget about optimisation plz.
You can attach dialog items in one dialog to dialog items in another dialog.
The solution is to have a dialog created before the rest of your UI, so that it's under everything. When a unit takes damage or whatever, create a dialog and attach it to the unit. In this temporary dialog, you also need a blank image (panel) to which you'll attach the dialog items.
Create the dialog items in the old dialog that's under everything else. Attach the visual dialog items to the blank image (panel) in the mobile dialogs.
In other words, you have a bunch of dialogs as anchors for the unit health bars. You also have one dialog (fullscreen) that contains all the visual dialog items, which are attached to the many dialogs attached to the unit.
You can also make them custom status bars and then hook them up as dialog items. Then they will act just like real HP bars, they will only show when real HP bars show and they will go underneath all of the other UI elements.
Its ok guys, i used charysmatic's approach + set render type to HDR. Now they appear even beneath HDR portraits and minimap, as needed. Thx for all suggestion anyways. I testing some idea for singleplayer rpg so don't rly need to use optimized xml ui elements. And i dont rly want spend time learning how to do it with xml. Probably will do later.