YesNoOk
avatar

Screen Fading to white and back to normal (Read 814 times)

Started by Tsunamidusher, June 17, 2014, 06:32:27 pm
Share this topic:
Screen Fading to white and back to normal
#1  June 17, 2014, 06:32:27 pm
  • avatar
  • ****
  • Pixel Animator
  • "I'm done trying with you."
    • USA
I've been trying to create a screen fade to white effect and fade back with no luck...
I tried an explod, but couldn't set that up properly. Tried creating a helper with a solid white anim and using trans states with no luck.

Been cruising through this board looking for a solution, but still at a loss...

What's a solid approach to this?
Re: Screen Fading to white and back to normal
#2  June 17, 2014, 06:47:20 pm
  • ******
  • Video Game Veteran
  • Can you do it? SUREYOUCAN!
    • USA
    • gcnmario.free.fr
I tried doing the same thing for one of my characters. The best I can say is just use a huge white explod R255,G255,B255, and just experiment with alpha transparency until you get the results. Basically, you don't need to mess with colors at all, but how much of the image is shown through each frame it fades into when it finally gets to the solid white frame. :)

"You must defeat my flaming
dragon punch to stand a chance."
Re: Screen Fading to white and back to normal
#3  June 17, 2014, 07:21:52 pm
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
Code:
[statedef your helper]
anim = your white anim
...

[State 1415, fade in]
type = trans
trigger1 = time < T1
trans = addalpha
alpha = X*(time), 256-X*(time)

[State 1415, solid]
type = trans
trigger1 = time = [T1,T2]
trans = addalpha
alpha = 256,0

[State 1415, fade out]
type = trans
trigger1 = time > T2
trans = addalpha
alpha = figure it out yourself ! :P

From time=0 to time=T1, there's the fade in. You must set X in order for the alpha value to go from 0,256 to 256,0 in T1 ticks.
From T1 to T2, you have the solid state
From T2 to whatever, you apply the inverse formula to go back to alpha=0,256
Re: Screen Fading to white and back to normal
#4  June 17, 2014, 08:04:29 pm
  • avatar
  • ****
  • Pixel Animator
  • "I'm done trying with you."
    • USA
Spoiler, click to toggle visibilty
Wonderful! I've been wracking my head for a while now with the math solutions. I got it to work based on what you wrote there!

Here's how mine came out:
Code:
[statedef 3053]
anim = 2999

[State 1415, fade in]
type = trans
trigger1 = time < 20
trans = addalpha
alpha = 12*(time), 256-12*(time)

[State 1415, solid]
type = trans
trigger1 = time = [20,30]
trans = addalpha
alpha = 256,0

[State 1415, fade out]
type = trans
trigger1 = time > 30
trans = addalpha
alpha = 12*(time-30), 256-12*-(time-30)

[state 1415, destroyself]
type = destroyself
trigger1 = time = 50

The whole process came to 50 ticks. 20 fade in, 10 solid white, 20 fade out. While the fade out isn't completely elegant, it's still very clean.

Many Thanks!