Thread Tools Display Modes
Prev Previous Post   Next Post Next
03-19-18, 03:51 AM   #1
Ethly
A Fallenroot Satyr
Join Date: Mar 2018
Posts: 23
What's the most performant way to draw unit frame health bar?

I want to display unit frame with health, incoming heal, heal absorb, damage absorb, and health deficit. Basically it's 5 adjacent rectangles with different colors. Currently I'm considering 3 different implementations and I don't know which one would be the most performant.

1. Put 4 statusbars for every value and one texture below for health deficit. All statusbars will be fixed, frame levels will be adjusted for proper z-order.

2. Put 4 textures for every value and one texture below. Textures will have fixed left side and Lua will change their width. With something like textureSublevel they will have proper z-order.

3. Put 5 textures one after other using anchors. They will have the same level, but they won't overlap, so it's not a problem.

3-rd variant looks like the best one, because game won't have to redraw pixels multiple times and theoretically could render textures simultaneously, but it seems significantly harder to implement with Lua (because I have to hide unused textures and rearrange their anchors all the time). Also I'm not sure if this layout mechanism performant enough.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » What's the most performant way to draw unit frame health bar?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off