Screen transitions

Posted By: Knuckles

Screen transitions - 10/05/07 00:21

How do I make the screen fade in and out to black?
Posted By: badapple

Re: Screen transitions - 10/05/07 00:36


this is a q and a from the aums that might help or you could use a panel (black)
and decrease or increase its alpha


Q: How can I smoothly fade one view into another?
A: Use the code below:

view second_camera{}
action set_second_camera // place any entity in the level and set its proper position and orientation
{
my.invisible = on;
my.passable = on;
wait (3);
second_camera.pos_x = 0;
second_camera.pos_y = 0;
second_camera.size_x = screen_size.x;
second_camera.size_y = screen_size.y;
second_camera.alpha = 0;
second_camera.transparent = on;
camera.alpha = 100;
camera.transparent = on;
second_camera.x = my.x;
second_camera.y = my.y;
second_camera.z = my.z;
second_camera.pan = my.pan;
second_camera.tilt = my.tilt;
second_camera.roll = my.roll;
}

function toggle_cameras()
{
second_camera.visible = on;
while (second_camera.alpha < 99)
{
second_camera.alpha += 2 * time;
camera.alpha -= 2 * time;
wait (1);
}
camera.visible = off;
second_camera.transparent = off;
}

on_t = toggle_cameras;
Posted By: Knuckles

Re: Screen transitions - 10/05/07 02:04

Well I'm not using cameras, I'm just using a simple JPG image. I tried this:


Code:
bmap the_end <the_end.jpg>;

panel the_end_screen
{
layer = 4;
bmap = the_end;
scale_x = 1.6;
scale_y = 1.6;
alpha = 0;
}



function end_screen_transition
{

the_end_screen.visible = on;
the_end_screen.transparent = on;
the_end_screen.alpha = 0;

while(the_end_screen.alpha < 100)
{
the_end_screen.alpha += 2 * time;
wait(1);
}

the_end_screen.transparent = off;

}




but nothing happens. The screen shows up, but it doesn't fade in or anything. It just pops up there normally.
Posted By: Knuckles

Re: Screen transitions - 10/05/07 02:09

Aha, nevermind. I see what happened... I just needed to delete the '* time' part... I guess it was going too fast with the 'time' there.
© 2024 lite-C Forums