X and Y of HUD corners?

Hello, i’m trying to draw a 64x64 texture on my HUD, but I can never seem to get the positioning right… Can anyone tell me what the X and Y of each corner of the huds are? This is part of the code i’m using:

[lua]
surface.SetDrawColor(255, 255, 255, 255)
surface.SetTexture(chrishansen)
surface.DrawTexturedRect( 0, ( ScrH() / 1 ), 64, 64)
[/lua]

I’m trying to get “surface.DrawTexturedRect( 0, ( ScrH() / 1 ), 64, 64)” to make the texture draw in the bottom right of the screen for all resolutions. Any help would be brilliant.

Top left = 0, 0
Top right = ScrW(), 0
Bottom left = ScrH(), 0
Bottom right = ScrH(), ScrW()

[lua]surface.DrawTextureRect(ScrW()-64, ScrH()-64, 64, 64)[/lua]

Thanks for your help. I’ll try that now :smile:


Top-Left: 0,0
Top-Right: ScrW(), 0
Bottom-Left: 0, ScrH()
Bottom-Right: ScrW(), ScrH()


You wann do something like this:

[lua]
local width, height, spacer = 64, 64, 8
surface.SetDrawColor(255, 255, 255, 255)
surface.SetTexture(chrishansen)
surface.DrawTexturedRect( ScrW() - (spacer + width) , ScrH() - (spacer + height), width, height)
[/lua]

http://dl.dropbox.com/u/9791791/hl2%202011-01-06%2018-51-35-84.png

It works. Thanks for the help.

Totally worth helping out.

Hahahahahaha.