Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local W,H = 1024, 1024
- local tex = Texture(1024, 1024, ETF_A8R8G8B8)
- local length = W*H
- local img = ffi.new("unsigned char[?]", length)
- local rect = Rect(0, 0, W, H)
- local r = math.random
- hook.Add("PostDrawMenu", "draw_texture_noise", function()
- for i = 0, length-1 do
- img[i+0] = r(255)
- img[i+1] = r(255)
- img[i+2] = r(255)
- img[i+3] = 255
- end
- tex:SetData(img)
- rect.x, rect.y = mouse.GetPos()
- graphics.Set2DFlags()
- graphics.DrawTexture(tex, rect, nil, nil, true)
- end)
Advertisement
Add Comment
Please, Sign In to add comment