Room transitions [SOLVED]

D

Dioramos

Guest
When i trigger warp object, I instantly move to the next room. How to make "Fade in" effect before teleporting? And "fade out" effect in next room.
 

Sergio

Member
You can create an object that draws a rectangle cover the entire screen with its alpha increasing step by step. When the alpha reaches 1, change the room. And, in the next room, the same but with alpha starting on 1 and lowing step by step.
 

pixeltroid

Member
When i trigger warp object, I instantly move to the next room. How to make "Fade in" effect before teleporting? And "fade out" effect in next room.
What I do is I create the "fade out" object when I touch the warp object....and the "fade in" object is created in the next rooms creation code. So when I touch a warp object, the room I'm in turns back and then when it fades out I'm in the next room.
 
Last edited:

pixeltroid

Member
here are the codes I am using for obj_fade_in

Create event
Code:
alpha =1;

Step event
Code:
alpha -= 0.05 //increase alpha
if alpha<0 {
instance_destroy(); //destroy when done
}
Draw event
Code:
draw_set_alpha(alpha)
draw_set_color(c_black)
draw_rectangle(0,0,room_width,room_height,false)
draw_set_alpha(1)
---------------------------------------------------------------------------------------

here are the codes I am using for obj_fade_out

Create event
Code:
alpha =0;

Step event
Code:
alpha += 0.05 //increase alpha
if alpha>1 {
alpha = 1
Draw event
Code:
draw_set_alpha(alpha)
draw_set_color(c_black)
draw_rectangle(0,0,room_width,room_height,false)
draw_set_alpha(1)
 
D

Dioramos

Guest
here are the codes I am using for obj_fade_in

Create event
Code:
alpha =1;

Step event
Code:
alpha -= 0.05 //increase alpha
if alpha<0 {
instance_destroy(); //destroy when done
}
Draw event
Code:
draw_set_alpha(alpha)
draw_set_color(c_black)
draw_rectangle(0,0,room_width,room_height,false)
draw_set_alpha(1)
---------------------------------------------------------------------------------------

here are the codes I am using for obj_fade_out

Create event
Code:
alpha =0;
Step event
Code:
alpha += 0.05 //increase alpha
if alpha>1 {
alpha = 1
Draw event
Code:
draw_set_alpha(alpha)
draw_set_color(c_black)
draw_rectangle(0,0,room_width,room_height,false)
draw_set_alpha(1)
I made "fade out" when touch the warp object, but i cant make working fade in...
 

pixeltroid

Member
youre supposed to create obj_fade in in the next rooms creation code.

I use "instance_create(0,0, obj_fade_in)"
 
Top