Trying to make a film grain screen GUI
#1
How would I make this if buildism does not support Animated GIFs?
Reply
#2
Fail scripting.
OT: When I posted this, my iCrap keybored was set to French. Don't ask.
Reply
#3
(07-09-2012, 05:47 AM)Dignity Wrote: Fail scripting.
OT: When I posted this, my iCrap keybored was set to French. Don't ask.
That didn't help me at all.
Reply
#4
You could always manually animate it (Make 10 different pictures and set the script to randomly cycle through them).
Reply
#5
(07-09-2012, 07:04 AM)Paradox Wrote: You could always manually animate it (Make 10 different pictures and set the script to randomly cycle through them).

That's what I meant.
Except if the picture doesn't load before its put off...
Reply
#6
you have to load them before the gui plays for best effect by leaving them in a tiny gui in the corner for 10 seconds or putting them in the game as a decal on a hidden block
Reply
#7
I am a terrible scripter, could somebody script it for me?
It's hard enough to learn the English language let alone LUA.
Reply
#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
#9
Going to try that right now, thanks Qwerty.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)