CapsAdmin

Untitled

Nov 20th, 2011
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.00 KB | None | 0 0
  1. local SEED = "56a6s5as"
  2. local intensity = 0.08
  3.  
  4. function R(min, max, seed)
  5.     seed = seed or SEED
  6.     min = min or 0
  7.     max = max or 2
  8.  
  9.     return min + (max - min) * ((util.CRC(seed) * 0.000000001)%1)
  10. end
  11.  
  12. local mat = Material("particle/Particle_Glow_04_Additive")
  13.  
  14. local hipsters = {}
  15.  
  16. for i=1, R(20) do
  17.     local col = HSVToColor(R()*360, R(0.8, 1), intensity)
  18.  
  19.     hipsters[i] =
  20.     {
  21.         col = col,
  22.         size = {x = R(500,4000, SEED .. "a"), y = R(500,4000, SEED .. "b")},
  23.         pos = {x = R(ScrW(), nil, SEED .. "a"), y = R(ScrH(), nil, SEED .. "a")},
  24.     }
  25.  
  26.     SEED = SEED .. tostring(i)
  27. end
  28.  
  29. hook.Add("PostRenderVGUI", "hip", function()
  30.     surface.SetMaterial(mat)
  31.     for key, hipster in pairs(hipsters) do
  32.         surface.SetDrawColor(hipster.col)
  33.         surface.DrawTexturedRect(
  34.             hipster.pos.x - (hipster.size.x * 0.5),
  35.             hipster.pos.y - (hipster.size.y * 0.5),
  36.  
  37.             hipster.size.x,
  38.             hipster.size.y
  39.         )
  40.     end
  41. end)
  42.  
Advertisement
Add Comment
Please, Sign In to add comment