# Drawing a circle that's filled in.

I used this code:
surface.DrawCircle(ScrW()*0.9, ScrH()*0.9, 100, Color(255,255,255,255))
to draw a circle but all I see is the white outline of the circle. How do I fill in the circle completely white?

I’ve yet to find a way.
Guess you could use the surface poly function.

use the drawcircle function like a thousan times and make it 1 unit smaller each time so that its filled in XD

Yeah, because that’s obviously a good idea…

end[/lua]

Will likely lag, you have been warned.

[lua]
local quality = 360
local circle = {}
for i=1,quality do
circle* = {}
circle
.y = math.cos(i/quality
end
–In draw hook or whatever
surface.DrawPoly(circle)
[/lua]

Even I think op doesn’t deserve this.

Above code is wrong.

[lua]
local circle = {};
for i=1,quality do
circle* = {};
circle
end
return circle;
end
[/lua]

you could make a crappy one with draw.RoundedBox()

Best way is to make a texture that is a circle. You could make it white so you can change the color with lua.

I did some tests… when you have static circle you should a poly otherwise a texture.

Also what the fuck we are doing here, OP is banned and a total asshole.

Bump- I still need help.

[lua]
local circle = {};
for i=1,quality do
circle* = {};
circle
end
return circle;
end
[/lua]

And then in a draw hook:

[lua]
surface.DrawPoly(circle)
[/lua]

‘circle’ obviously already being defined by surface.CreatePoly(x, y, 100, 360)

I’m not Cubar.

[editline]25th December 2010[/editline]

You shittin’ me bro? You reposted broken code.

Code works fine, you must be Cubar if you can’t get it to work.

Cubar was pro at Lua and he was a god. Do not disrespect him.

:cawg: at post above mine’s.

I tried that method the other day, and it works fine.

-snip- FP Lagged.

he probably doesn’t know to put it in a draw hook

No, I don’t. I put it in a HUDPaint hook. Was that wrong? What’s a draw hook?