Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make the background of my frame change gradually?

Asked by
zadobyte 692 Moderation Voter
4 years ago

I need help changing my backround from black to white gradually, no sudden changes.

if script.Parent.TextTransparency > 0 then
    script.Parent.Visible = false
end

After this line of code is executed, I want to make sure the script detects that the text is invisible so it can start the transition. Anything that needs to be explained hopefully will be.

0
so u want to know how to slowly change color? TheluaBanana 946 — 4y
0
Yes, that is my question. zadobyte 692 — 4y

2 answers

Log in to vote
0
Answered by
Prestory 1395 Moderation Voter
4 years ago
Edited 4 years ago

Place this inside the frame

for i = 0, 255, 3 do -- Change '3' To Increase/Decrease The Speed
    script.Parent.BackgroundColor3 = Color3.fromRGB(i, i, i)
    wait()
end
0
This was basically what I needed, thanks a lot man. zadobyte 692 — 4y
0
Np i got you Prestory 1395 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

There are many ways to do this, a common (and best way in my opinion) are loops! There are three main loops: repeat until, While True Do, and for.

The Code Below Demonstrates two types of loops In action with your frame below!

while script.Parent.TextTransparency > 0 then
    wait(0.1) -- Change to how fast you want to increase transparency
    script.Parent.TextTransparency = script.Parent.TextTransparency  + 0.01 -- the higher / lower this is the more time it will take to fade. the higher it is the more spikey, the less it is the more smooth! I reccomend these settings
end

repeat 
    wait(0.1) -- Change to how fast you want to increase transparency
    script.Parent.TextTransparency = script.Parent.TextTransparency  + 0.01 -- the higher / lower this is the more time it will take to fade. the higher it is the more spikey, the less it is the more smooth! I reccomend these settings
until script.Parent.TextTransparency = 1

-- if you want to make the object to appear and not dissapear, remove the + signs and change them to minus.

I hope this helped, If not please respond why and I'll try to check later

Sincerely, lolmarkdude2
0
In addition remember to make it The frame.Visble to true or false depending on if you want it to appear or not! MarkHasReset 77 — 4y
0
The problem isn't the text not going transparent, it's that I don't know how to format an gradual change to the background's color. It appears (r,g,b) doesn't work, and I doubt "r,g,b" works as well. zadobyte 692 — 4y
0
What colors do you want it to go Prestory 1395 — 4y
0
Black to white zadobyte 692 — 4y

Answer this question