• surface.DrawPoly not working propperly.
    4 replies, posted
For some reason when I do surface.DrawPoly it doesnt show all of the polygons. I dont know why this is but I have tried everything and no luck. This is a darkrp hud. Also errors dont appear when this happens as well. [CODE]-snip-[/CODE] [IMG]http://image.prntscr.com/image/00eea4562fbc406a8654ec8e8d004172.png[/IMG] Who ever helps me fix this will get a cookie :P
[QUOTE=Martin132;50761968]Who ever helps me fix this will get a cookie :P[/QUOTE] What flavour?
[QUOTE=Moku;50762095]What flavour?[/QUOTE] I wasn't serious
This is absolutely terrible code. You are calling the function Polygons(), which creates the triangle tables and registers the hooks [b] inside of HUDPaint [/b]. This is stupidly unnecessary overhead. Move your hook.Add calls outside of any function, there is no reason for them to be inside one. This isn't even stupid, it's [b]abhorrently wrong[/b]. Second, your triangles are drawing properly, but they are overlapping. See this screenshot. [t]https://i.imgur.com/gSThaWl.jpg[/t] You need to adjust your offsets. [b]EDIT:[/b] Honestly, your code structure makes no sense. You have 5 different hooks, and a load of unnecessary do/end blocks. At least make sure everything is called from the same hook so that the render order is consistent with what you want.
[QUOTE=typedef state;50764085]This is absolutely terrible code. You are calling the function Polygons(), which creates the triangle tables and registers the hooks [b] inside of HUDPaint [/b]. This is stupidly unnecessary overhead. Move your hook.Add calls outside of any function, there is no reason for them to be inside one. This isn't even stupid, it's [b]abhorrently wrong[/b]. Second, your triangles are drawing properly, but they are overlapping. See this screenshot. [t]https://i.imgur.com/gSThaWl.jpg[/t] You need to adjust your offsets. [b]EDIT:[/b] Honestly, your code structure makes no sense. You have 5 different hooks, and a load of unnecessary do/end blocks. At least make sure everything is called from the same hook so that the render order is consistent with what you want.[/QUOTE] Its Fine i have fixed it turns out all of the above quote was incorrect as the points on the poly need to be in a clockwise manner as i have fixed now Thanks For All Your Negative Reply's :)
Sorry, you need to Log In to post a reply to this thread.