• DrawRect without filling it?
    6 replies, posted
As the title states is there a way to draw a rectangle and not fill the inside? If not what would be an easy simple way to do it without drawing multiple shapes around what I'm trying to border (A HP bar and Armor bar in this case) [CODE] surface.SetDrawColor( Color(220,220,220,255) ); surface.DrawRect( (width * 0.01),(height * 0.97), 100 * width * 0.0015, height * 0.009 ); surface.SetDrawColor( Color(255,0,0,255) ); surface.DrawRect( (width * 0.01),(height * 0.97), LocalPlayer():Health()* width * 0.0015, height * 0.009 ); surface.SetDrawColor( Color(220,220,220,255) ); surface.DrawRect( (width * 0.01),(height * 0.956), 100 * width * 0.0015, height * 0.009 ); surface.SetDrawColor( Color(100,149,237,255) ); surface.DrawRect( (width * 0.01),(height * 0.956), LocalPlayer():Armor()* width * 0.0015, height * 0.009 );[/CODE]
Although it doesn't support thickness, there's always [url=http://wiki.garrysmod.com/page/surface/DrawOutlinedRect]surface.DrawOutlinedRect( x, y, w, h )[/url].
would drawing that several times getting wider each time be laggy?
It'd be easier to just draw 4 rectangles if you want an outline > 1px.
[QUOTE=LauScript;43052815]would drawing that several times getting wider each time be laggy?[/QUOTE] Not if you were only drawing a few of them. You could also modify the current draw function to take a width argument.
[QUOTE=CallMePyro;43053625]Not if you were only drawing a few of them. You could also modify the current draw function to take a width argument.[/QUOTE] Modify the draw function? Could you elaborate on what you mean by that?
[QUOTE=Lone Wolf807;43057897]Modify the draw function? Could you elaborate on what you mean by that?[/QUOTE] Don't listen to that silly man, he doesn't know what he's talking about. Just draw 4 squares and be done with it.
Sorry, you need to Log In to post a reply to this thread.