Indeed, I have to hack everything. Maybe I'll have more luck with your workaround now, that I got a night's sleep.
Taking the D3 Layout as an example, do I only need to use the corresponding parts of the CreateOrb and UpdatePlayerHealth functions, or there is something else needed as well?
Edit: I've aswered my own question, I got it to work :> Thanks for your help (This time, in providing the example code)
--------------------------------------------------
Completely new problem, here is what my current unit frame looks like, and the texture for the bars:
The problem is, I want the bars resized, but without changing the anle of the slope (since if I make it more narrow, the slope becomes more steep).
I thought about using a stock status bar texture, making it as wide as I want it, then disort it to the sloped shape. I started playing with SetTexCoord, but it outputs a rectangular texture from any given region, and I need it the other way around: A disorted region from a rectangle.
I saw you did some nice tricks in texture transformations with your ring addon, so maybe you could point me to a method I could use, or a different trick to make these bars.
Thanks!
Edit x+1: It seems I'm able to keep answering my own questions. I found out you can give coordinates outside the 0-1 region of the texture, and this way I can get it skewed and thinner without issues. Now I'll just have to figure out the formula to display paralelograms with the correct height, width and slope.
Edit x+2:
It's alive, it's aliiive!
With a little math and geometry, I managed to make the transformations which makes the needed texture
Code:
local updatePlayerHealth = function(bar, unit, min, max)
fill=min/max
textureWidth = SLOPE*BAR_HEIGHT + HEALTH_WIDTH
bar.filling:SetTexCoord(
fill,-(fill*(textureWidth-HEALTH_WIDTH)/HEALTH_WIDTH),
0,0,
fill,1 +((1-fill)*(textureWidth-HEALTH_WIDTH)/HEALTH_WIDTH),
0,1+(textureWidth-HEALTH_WIDTH)/HEALTH_WIDTH)
bar.filling:SetWidth(textureWidth)
bar.filling:SetHeight(BAR_HEIGHT*fill)
end
Works perfectly, with one little issue: The bar texture needs a 1px transparent border around it, otherwise it will disort in an ugly fashion (on the pic the alpha is not completely 0 I think, that's why there is a slight color artifact)