Unconventionally shaped health bar issue
Hi, when experimenting with oUF I came across a healthbar style I like, which is fatter at low health so it's easier to notice. However, when implementing it, I realized that statusbars don't actually shrink or clip... they just slide along their axis.
Please look at this image on full life: And now, when I am damaged: The dark health bar is just moving, which makes sense for some layouts, but not for something like this. I had thought, due to some previous discussion, that unconventionally shaped status bars weren't a problem these days. I'm unsure how to proceed to get the desired effect of just clipping off the end of the bar with the more damage you take. Here's the current code generating my health bar. Any advice on what to add or change to be able to use this awkwardly-shaped health effectively would be very appreciated. Lua Code:
|
The only real way to do it is by usong a scrollframe. You put two identical textures representing your full bar and the background (the red one). The scrollframe will "cut" the texture above displaying the one behind and give the illusion of a strangely shaped bar.
|
What you actually want to do is to create a mask texture that follows the outline of the health bar shape you want and then apply it to the status bar texture of your health bar.
Lua Code:
For instance, that's my old odd shaped unitframe (rip "round" layout :(): And here's the mask I used for its health bar: |
All times are GMT -6. The time now is 10:21 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI