Fade-in.. again

Started by Daniel Thomas, Sat 28/01/2006 08:39:42

Previous topic - Next topic

Daniel Thomas

Hi!
I been searching around the board for any kind of fadein & out method, since i think the fadein() and fadeout() are way too fast for me.. I want a slow and smooth fade for ex. intro..

I found some topics but they were mainly about changing the fade-speed between rooms.. Im loking for some sort of function which you can call and doesnt affect all the room changes. Also, those i found had outdated code.

Thanks and looking forward to replies :>
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

Barbarian

#1
From reading your post, I gather that you want the whole screen to slowly (or at the speed you choose) to either "fade to black" or "fade in from black", sort of like dimming or brightening a light in a room.

A "Copy & Paste" from the manual regarding the "FadeOut" command:
=================================================

FadeOut
FadeOut (int speed)

Fades the screen out to black. SPEED is the speed of the fade, from 1 (slowest) to 64 (instant). You can restore the screen with FadeIn.
NOTE: This is a blocking function.

Example:

FadeOut(30);
Wait(40);
FadeIn(10);

will fade the screen to black, wait 1 sec (40 game cycles) and then fade in again.
=============================

Ã,  Ã, Was this wht you're looking for?Ã,  Or was it that the "FadeOut" command wasn't giving you the effect you wanted?

*Edit: I found that setting the speed to 1 gave a fairly nice fading out and fading in effect and didn't seem too fast:

FadeOut(1);
Wait(40);
FadeIn(1);

   But you wanted something even slower?
Conan: "To crush your enemies, see them driven before you, and to hear the lamentation of the women!"
Mongol General: "That is good."

Blade of Rage: www.BladeOfRage.com

Daniel Thomas

the problem with fadeout and fadein functions is that they are, imo, too fast. The fade only last for about 1sec.. I want a way to fade it slower.
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

Ashen

I'd use a while loop, e.g.:
Code: ags

int lumin = 100;
while (lumin >= 0) {
  lumin --;
  Wait(2);
  SetAmientTint(0,0,0,0,lumin);
}


However, I'm not sure if SetAmibentTint(...) will completely back out the room. If the FadeIn/Out() functions are too fast for you, you may have to use a screen-sized object, character or GUI and adjust it's transparency (you could make a custom function, using a loop like above). GUI or character would be best - otherwise you'll need to have an object to use in every room you want to fade - and with a GUI you wouldn't even need to import a screen filling graphic, just set it's background & border colours.

Thank you for at least trying to use the search function first. I couldn't find anything useful on it, although I remember this having been asked before - maybe if you post some of the out dated ode you found, we can update it for you.
I know what you're thinking ... Don't think that.

Daniel Thomas

Ahh, works now :>

I played around with the GUI one, ended up nicely.. Ill post after i got some sleep if anyone are intrested :>
thanks!
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

Barbarian

Hi guys. Well, I don't know if this will be useful to anyone, but I put together a little demo to display a slowly fading-out and fading-in effect.

This zip file includes the complete source code for reference:
Fade.zip 1.21 MB

Once the demo starts up and the initial messages are gone, simply press your "SPACEBAR" key to toggle the Fading-Out & Fading-In effect to see it in action.

View the source code, and in the Global Script, under the "on-key-press" command you will see where I added this feature in.Ã,  Also you will notice that VIEW1 has the sprites replaced with a large black sprite, with the EGO character location set to overlay the whole room.

I'm not the best scripter, and there's probably simpler or neater ways to achieve this same kind of effect, but still I thought sharing this may be of help to some of you out there.

Don't know if this little demo is useful enough to be put in the "Technical Archive", but if the mods here thinks it might be helpful to others, I suppose they could move it there.Ã,  Ã, 
--- Best wishes, "Barbarian".
Conan: "To crush your enemies, see them driven before you, and to hear the lamentation of the women!"
Mongol General: "That is good."

Blade of Rage: www.BladeOfRage.com

SMF spam blocked by CleanTalk