T
Look into the background_alpha function. You should be able to use this to fade the current background out, change backgrounds, and then fade the new background in.
I personally would draw the background image manually using draw functions rather than actually setting a background.
That's a good idea.
I would do that too, but it's kind of complicated since the background has been set to move through the screen.
So I tested your idea by creating and object that I call "fader" but for some reason it fails to fade out one time, instead it fades it many times.
This is the code I'm testing:
Create Event
Step Event
Code:
if(background_alpha[0] > 0 && !fade_in) // Fading out actual background.
background_alpha[0] -= 0.01;
if(background_alpha[0] == 0) //Changing background and setting new background alpha
{
background_index[0] = bg_space2;
fade_in = true;
background_alpha[0] = 0.01;
}
if(background_alpha[0] > 0 && fade_in){ // Fading in next background.
if(background_alpha == 1){
instance_destroy(self);
}
else
background_alpha[0] += 0.01;
}
show_debug_message(background_alpha[0]);
The alpha goes down to 0 and then it starts adding up, but for some reason when it gets to 0.50 it gets stuck and I it fades in the next background way later than it should be. Is there something I'm missing about the Step event?