Fade In/Out?
Displaying 1-4 of 4 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Arkhan

Hey guys! ive been MIA for awhile, but havent stopped working on the game!

Ive got a working menu, shops, and two populated towns!!!

Once I get some more artwork, I can do the dungeons and whatnot, but anyways...

Id like to have the screen fade out when you change maps, and then fade back in when you get to the next one...


Awhile back I tried using the v1 stuff but it would always crash, so I sort of abandoned it.

Does anyone know a good way to fade the whole screen in/out?

Posted on 2007-06-04 11:07:13

CrazyAznGamer

Are you sure? The v1 lib should work fine...
Well, the only functions you really need to fade in/out are "FadeIn" and "FadeOut" from vecna's v1_maineffects:

// copied from vecna's v1_maineffects.vc

// Fades the screen from black to normal over the specified duration.
// This renders over everything.
void FadeIn(int _dur)
{
timer = 0;
while (timer<_dur)
{
Render();
SetLucent(timer*100/_dur);
RectFill(0, 0, ImageWidth(screen), ImageHeight(screen), 0, screen);
SetLucent(0);
ShowPage();
}
}


// Fades the screen from normal to black over the specified time.
//
// This renders over everything.
void FadeOut(int _dur)
{
timer = 0;
while (timer<_dur)
{
Render();
SetLucent(100 - (timer*100/_dur));
RectFill(0, 0, ImageWidth(screen), ImageHeight(screen), 0, screen);
SetLucent(0);
ShowPage();
}
}

The basic gist of what you're trying to do is to call FadeIn before you call Map(), and FadeOut in the initialization function of your map.

Posted on 2007-06-04 12:39:30

Arkhan

Quote:Originally posted by CrazyAznGamer

Are you sure? The v1 lib should work fine...
Well, the only functions you really need to fade in/out are "FadeIn" and "FadeOut" from vecna's v1_maineffects:

// copied from vecna's v1_maineffects.vc

// Fades the screen from black to normal over the specified duration.
// This renders over everything.
void FadeIn(int _dur)
{
timer = 0;
while (timer<_dur)
{
Render();
SetLucent(timer*100/_dur);
RectFill(0, 0, ImageWidth(screen), ImageHeight(screen), 0, screen);
SetLucent(0);
ShowPage();
}
}


// Fades the screen from normal to black over the specified time.
//
// This renders over everything.
void FadeOut(int _dur)
{
timer = 0;
while (timer<_dur)
{
Render();
SetLucent(100 - (timer*100/_dur));
RectFill(0, 0, ImageWidth(screen), ImageHeight(screen), 0, screen);
SetLucent(0);
ShowPage();
}
}

The basic gist of what you're trying to do is to call FadeIn before you call Map(), and FadeOut in the initialization function of your map.


whenever i tried running my game with the V1 library stuff there, it would cry.

But, this also proves im a retard. It never occured to me to just go in and copy paste those two things.

:) Thanks!

Posted on 2007-06-04 12:53:15

Overkill

Quote:Originally posted by CrazyAznGamer

The basic gist of what you're trying to do is to call FadeIn FadeOut before you call Map(), and FadeOut FadeIn in the initialization function of your map.
:D

Posted on 2007-06-04 13:12:23


Displaying 1-4 of 4 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.