I'm making a derma menu and wish to make the AvatarImage circular. At first I thought I could simply paint over it, thusly:
[lua]local centerx, centery = 28, 58
local radiusx, radiusy = 36, 36
surface.SetDrawColor(Color(0, 255, 0, 255))
for i = 0, math.pi * 2, 1 / math.max(radiusx, radiusy) do
surface.DrawRect( centerx + math.sin(i) * radiusx, centery + math.cos(i) * radiusy, 12, 12)
end[/lua]
but this just paints underneath it.
I'm not sure what I can do.
Did you use that in a "Paint" hook?
Yes. I'm guessing that's wrong then?
Use the "PaintOver" hook if you want to draw over something.
Never knew that existed, but the quality of the circle is shithouse. Can I anti-alias it somehow?
You should probably make a .png as an overlay instead of drawing like that.
Might as well. I thought there would've been a way to physically crop the avatar. Thanks for your help.
Sorry, you need to Log In to post a reply to this thread.