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.
It sounds like you want to change the dialog item's Render Priority.
SetDialogItemRenderPriority()
By default, all dialog items have a priority of 512. Setting a new dialog items priority higher than that (511, etc) will cause it to render behind all other dialog items.
If you'd like an example of what schutter is talking about, take a look at this demo
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.
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.
@abvdzh: Go
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.
Didn't know that, will try thanks.
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.
@abvdzh: Go
It sounds like you want to change the dialog item's Render Priority.
By default, all dialog items have a priority of 512. Setting a new dialog items priority higher than that (511, etc) will cause it to render behind all other dialog items.
If you'd like an example of what schutter is talking about, take a look at this demo
@PirateArcade | I make games | Ask me things on Discord
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.