Advertisement
kila58

Untitled

Aug 23rd, 2014
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1.     local function drawPolygon(tbl)
  2.  
  3.         local len = #tbl
  4.  
  5.  
  6.  
  7.         for i=1, len do
  8.  
  9.             local pa = tbl[i]
  10.  
  11.             local pb = tbl[i%len + 1]
  12.  
  13.  
  14.  
  15.             pa.z = -620
  16.  
  17.             pb.z = -620
  18.  
  19.             pa = pa:ToScreen()
  20.  
  21.             pb = pb:ToScreen()
  22.  
  23.  
  24.  
  25.             if pa.visible and pb.visible then
  26.  
  27.                 surface.DrawLine(pa.x, pa.y, pb.x, pb.y)
  28.  
  29.             end
  30.  
  31.         end
  32.  
  33.     end
  34. ---------------------------------------------
  35. --feed it cords
  36. ---------------------------------------------
  37. local inner = {
  38.  
  39.     Vector( 1735, -11477),
  40.  
  41.     Vector(  893, -10617),
  42.  
  43.     Vector(   78, -10617),
  44.  
  45.     Vector(- 580, -11424),
  46.  
  47.     Vector(- 580, -12107),
  48.  
  49.     Vector(  220, -12841),
  50.  
  51.     Vector(  966, -12841),
  52.  
  53.     Vector( 1735, -12119),
  54.  
  55. }
  56.  
  57. ------------------------------------
  58.  
  59. surface.SetDrawColor(0, 255, 0, 255)
  60.  
  61. drawPolygon(inner)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement