Hiya all, i’m trying to figure out how to make a circular progress bar, but i’m not 100% sure how to pull it off. Does anyone know how to do it?
I believe a polygon can work.
I saw something before where someone did a circular health hud like that by drawing a rotated vtf and scissoring it.
Depends a little on what background you want, because if you have a transparent background, or one with a plain color. The way you would do it in EGP is making a wedge and then making a circle with the background color on top of the wedge. I really have no idea how you would make one with transparent background, maybe something with the polygon and lots of math.
I have a handy function that makes thick arcs, or semicircles, using rectangles. Add me on steam.
Just post it here?
You want to avoid using the drawing functions directly for things like this.
What you want to use is textures.
function DrawPartialCircle( x, y, radius, linewidth, startangle, endangle, aa )
– Thanks for getting me started on how to do this python1320 <3
aa = aa or 1;
startangle = clamp( startangle or 0, 0, 360 );
endangle = clamp( endangle or 360, 0, 360 );
if endangle < startangle then local temp = endangle; endangle = startangle; startangle = temp; end for i=startangle, endangle, aa do local _i = i * deg2rad; surface.DrawTexturedRectRotated(cos( _i ) * (radius - linewidth) + x,sin( _i ) * (radius - linewidth) + y, linewidth, aa*2, -i ); end