• 6 years ago
create an object to draw a black rectangle on the screen. by raising increasing the alpha of the object, we provide a fade effect, when switching rooms.

best to call the object in the Room Creation Code.

let's for example name the object, obj_fade,

Code:[
Create event
alpha = 1;
alphaRate = 0.003; // determine how fast or slow we want the transparency to go

Normal Step Event
alpha -=alphaRate

Draw Event
draw_set_color(c_black);
draw_set_alpha(alpha);

//draw_set_color(c_black);
//draw_set_alpha(fade);
draw_rectangle(
view_xview[0],
view_yview[0],
view_xview[0]+view_wview[0],
view_xview[0]+view_hview[0],
0);


In your Room Creation Code
instance_create(x, y, obj_fade)


NB
make sure that your fade object has the highest depth of all the other objects in the game

Recommended