Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tex = Texture(32, 32, ETF_A8R8G8B8)
- ffi.cdef("typedef struct { uint8_t r, g, b, a; } rgba_pixel;")
- local size = 32*32
- local img = ffi.new("rgba_pixel[?]", size)
- for i = 0, size-1 do
- img[i].r = math.random(255)
- img[i].g = math.random(255)
- img[i].b = math.random(255)
- img[i].a = math.random(255)
- end
- tex:SetData(img)-- ????
- local rect = Rect(0, 0, 32*8, 32*8)
- hook.Add("PostDrawMenu", "draw_texture_noise", function()
- graphics.Set2DFlags()
- rect.x, rect.y = mouse.GetPos()
- graphics.DrawTexture(tex, rect, nil, nil, true)
- end)
Advertisement
Add Comment
Please, Sign In to add comment