2DWorlds Forums
Trying to make a film grain screen GUI - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: Help (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=21)
+--- Thread: Trying to make a film grain screen GUI (/showthread.php?tid=9603)



Trying to make a film grain screen GUI - Slendurrman - 07-09-2012

How would I make this if buildism does not support Animated GIFs?


RE: Trying to make a film grain screen GUI - Dignity - 07-09-2012

Fail scripting.
OT: When I posted this, my iCrap keybored was set to French. Don't ask.


RE: Trying to make a film grain screen GUI - Slendurrman - 07-09-2012

(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.



RE: Trying to make a film grain screen GUI - Paradox - 07-09-2012

You could always manually animate it (Make 10 different pictures and set the script to randomly cycle through them).


RE: Trying to make a film grain screen GUI - Dignity - 07-09-2012

(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...


RE: Trying to make a film grain screen GUI - Duck - 07-09-2012

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


RE: Trying to make a film grain screen GUI - Slendurrman - 07-10-2012

I am a terrible scripter, could somebody script it for me?
It's hard enough to learn the English language let alone LUA.


RE: Trying to make a film grain screen GUI - Qwertygiy - 07-10-2012

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]


RE: Trying to make a film grain screen GUI - Slendurrman - 07-10-2012

Going to try that right now, thanks Qwerty.