CapsAdmin

Untitled

Sep 13th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local W,H = 1024, 1024
  2. local tex =  Texture(1024, 1024, ETF_A8R8G8B8)
  3.  
  4. local length = W*H
  5. local img = ffi.new("unsigned char[?]", length)
  6.  
  7. local rect = Rect(0, 0, W, H)
  8. local r = math.random
  9.  
  10. hook.Add("PostDrawMenu", "draw_texture_noise", function()
  11.     for i = 0, length-1 do
  12.         img[i+0] = r(255)
  13.         img[i+1] = r(255)
  14.         img[i+2] = r(255)
  15.         img[i+3] = 255
  16.     end
  17.  
  18.     tex:SetData(img)
  19.  
  20.     rect.x, rect.y = mouse.GetPos()
  21.    
  22.     graphics.Set2DFlags()
  23.     graphics.DrawTexture(tex, rect, nil, nil, true)
  24. end)
Advertisement
Add Comment
Please, Sign In to add comment