How to draw a rectangle from right to left?

Usually a rectangle is drawn horizontally from left to right. But to draw the HUD, I need to draw a rectangle from right to left. Tell me, is there any other way to draw a rectangle?

P.S. I need to draw this triangle, depending on the amount of HP.


surface.DrawRect( (ScrW() - ScrW() + 16), (ScrH() - 64), math.Clamp(HP, 0, 100 )*4.17 , 26 )

You’ll need to use some MATH.

Basically, your X coordinate needs to look like this this:
x + ( max length - current length )

Thank you very much! You is Lua GOD! :words: