FadeOut non-blocking?

Started by Kinoko, Sun 12/02/2006 07:32:12

Previous topic - Next topic

Kinoko

Would it be possible to make the FadeIn and FadeOut functions non-blocking?

GarageGothic

#1
If you need to fade in and out from black or any other solid color, you could just at add a full-screen GUI with that color background and then change the transparency and control fade in/out time in repeatedly_execute.

Pumaman

Interesting request -- would you also need a way of knowing when the fade had finished? What sort of effect would you use this for?

Kinoko

Ah well, basically, what I was after was a slow fade room transition, going straight into a scrolling room (actively scrolling, that is) for a nice effect.

I've seen discovered that even without the non-blocking aspect, FadeIn and Out doesn't work for me because I can't FadeIn after a room change.

I might have to use the full screen gui after all...

But I might alter my my suggestion to being able to have a slow fade in and out while using ChangeRoom.

Pumaman

Ah ok, I see what you mean.

Woudl anyone else use this?

Kweepa

I think it would be pretty useful. It could make room transitions less rough.
I can see it being used to fade down the music volume, continue to animate a character off the screen, and so on.
Still waiting for Purity of the Surf II

Kinoko

Another suggestion/question:

Would it be possible to fade in and out music tracks? This'd be really handy for me. Is it possible at the moment?

Rui 'Trovatore' Pires

Well, you can crossfade them. Other than that, you can make your own function which changes the volume of a channel, or just the overall voule or whatever, in much the same way as you'd fade, say, a GUI.

Mind you, this might not be a viable solution, depending on what you want to do. Other than that, I dunno.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Kinoko

Oh, that's a good idea... think it'd be possible to do this in a non-blocking way?

Rui 'Trovatore' Pires

#9
Yeah, instead of "Wait"ing for the delay in which you'd do something like this (i.e.,

while (counter<x) {
Ã,  counter++;
Ã,  ChangeWhateverYouWantTo(counter);
Ã,  Wait(1);
}

), you could do something like:

StartFading();
fading=true;

and in rep_exec:

if (fading==true) {
Ã,  if (counter<x) {
Ã,  ChangeWhateverYouWantTo(counter);
Ã,  counter++;
Ã,  }
Ã,  else fading=false;
}

This probably isn't totally right, but you see the logic - make your own timer, or use a built-in AGS one, and use it to make the checks.

EDIT - Yeah, not at all totally like this, it'd be more like:

if (fading==true) {
  if (counter2==0) {
    if (counter<100){
      ChangeWhateverYouWantTo(counter);
      counter++;
      counter2=4;
    }
    else fading=false;
   }
  else counter2--;
}
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman

If crossfading is switched on, then when you stop the music it will fade out automatically.

edmundito

I'd think it'd be useful, and even fadein non blocking. It'd be cool to have cut-scenes fade in on characters already walking or doing some kind of work.

Kinoko

Quote from: Pumaman on Mon 13/02/2006 18:09:08
If crossfading is switched on, then when you stop the music it will fade out automatically.


Oh, excellent! I didn't know that.

SMF spam blocked by CleanTalk