Trying to make a film grain screen GUI
#8
Alright, basically here's what you do:

Make a bunch of 800 by 800 transparent "grainy" overlays and upload them to tinypic or wherever. If you have a GIF already, separate the layers and make each one into a PNG.

Then, in the World, put something like this in a script:

[lua]
link(game.Players.ChildAdded, function(player) --this calls it whenever someone joins
if player:isA("Player") then --make sure that we're not trying to put a GUI into some part that ended up here idiotically
local frame = create("UIFrame") -- the main GUI holder
frame.Size = Vec2D(0, 0)
frame.Position = Vec2D(0, 0)
frame.Parent = player.UI -- give it to the player
local overlay = create("UIImageButton")
overlay.Size = Vec2D(0, 0)
overlay.Position = Vec2D(0, 0) --this gets the solid-color background out of the way
overlay.Image = "http://imagehost.com/imagehere.png"
overlay.Parent = frame
-- now we have a non-moving grainy overlay, time to add the flickering
local ns = create("Script")
ns.Name = "Animator"
ns.Source = [[
local images = {"http://imagehost.com/image1here.png", "http://imagehost.com/image2here.png", "http://imagehost.com/image3here.png"}
--put all the URLs in this table like I have done with the examples
lastimage = "" --this so it doesn't keep the same image twice

function getNewRandom()
local randim = math.random(1, #images)
if images[randim] ~= lastimage then
return randim
else
return getNewRandom()
end
end

while true do
sleep(0.1)
local rand = getNewRandom()
script.Parent.Image = images[rand]
lastimage = images[rand]
end
]]
ns.Parent = overlay
end
end)
[/lua]
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 5 Guest(s)