T
Tofu Heavy Industries
Guest
I have an object that acts as black fade-in fade-out transition thingie. Whenever I use it, if the room has a view, the view in the room will be snapped back to x0 y0. I don't know why this is happening. But will retain the correct size of the view itself.
The calling object is persistent in the room its in, with a depth of 1.
calling line
Object Properties: obj_fader
Sprite:
Solid: false
Visible: true
Depth: -9999
Persistent: true
Parent:
Children:
Mask:
No Physics Object
obj_fader: Create
obj_fader: Draw
The calling object is persistent in the room its in, with a depth of 1.
calling line
Code:
instance_create(view_xview[0],view_yview[0],obj_fader);
Sprite:
Solid: false
Visible: true
Depth: -9999
Persistent: true
Parent:
Children:
Mask:
No Physics Object
obj_fader: Create
Code:
AlphaLevel = 0;
fade = 1;
Code:
AlphaLevel = clamp(AlphaLevel + (fade * 0.05),0,1);
if (AlphaLevel == 1) {
room_goto(global.room_going_to);
fade = -1;
}
if ((AlphaLevel == 0) && (fade == -1)) {
instance_destroy();
}
draw_set_colour(c_black);
draw_set_alpha(AlphaLevel);
draw_rectangle(view_xview[0],view_yview[0],view_xview[0] + view_wview[0],view_yview[0] + view_hview[0],0);
draw_set_alpha(1);