• How to fill a Surface.DrawCircle ?
    7 replies, posted
Hello! I've recently started experimenting on polygons and circles (actually circles, i'll continue with polygons later :smile:) So I got up with something fairly simple; [code] surface.DrawCircle(25, 740, 50, Color(255,255,255)) [/code] But it only gives me a "stroke" (if we can call it like that) How would I fill it of a color, easily? (I could always set the radius 1 unit lower but I'm pretty sure that's not recommended haha) Thanks in advance! Also, surface.SetDrawColor does not seem to work for the circle, or maybe i'm retarded and can't use it properly
Use a texture instead for a filled in circle
[QUOTE=brandonj4;46429893]Use a texture instead for a filled in circle[/QUOTE] Do you have any example as I am fairly new to that? (by example I mean the hook basically like surface.DrawCircle) Thanks for the quick reply btw
DrawTexturedRect with a circle for the material. You would make the circle in paint.net or photoshop
[QUOTE=Divize;46429912]Do you have any example as I am fairly new to that? (by example I mean the hook basically like surface.DrawCircle) Thanks for the quick reply btw[/QUOTE] They are not to difficult to figure out. Have a read of these and you should get it. [url]http://wiki.garrysmod.com/page/surface/DrawTexturedRect[/url] [url]http://wiki.garrysmod.com/page/surface/SetTexture[/url]
Use the second example from [URL="https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4287.html"]that[/URL]
If do you want an anti-aliased circle, use a texture, otherwise with free resource (And edgy) use maths
You could use a Poly: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/poly/simplified_circles_with_poly.lua.html[/url] Set it up outside of your hudpaint so you're not creating a new poly table each frame; on resolution change update it. Hook: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_hooks/playerchangedresolution/lua/autorun/client/cl_gm_playerchangedresolution.lua[/url] Example: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_hooks/playerchangedresolution/example_usage.lua[/url]
Sorry, you need to Log In to post a reply to this thread.