Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Candle on Thu 30/12/2004 01:34:16

Title: FadeOut FadeIn [SOLVED]
Post by: Candle on Thu 30/12/2004 01:34:16
How would you do CrossFade or  BackboxOut etc ? Can't seem to find it in the manual.

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

BackboxOut(30);
Wait(40);
BackboxIn(10);

Like that ?
Title: Re: FadeOut FadeIn
Post by: strazer on Thu 30/12/2004 07:36:27
I don't think that's possible at the moment. The transition styles are used only when changing rooms.

Try this as workaround:


// Script for room: Player enters screen (before fadein)

  if (GetGlobalInt(77) == 1) { // if waiting enabled
    Wait(40);
    SetGlobalInt(77, 0); // disable waiting when re-entering this room
  }



  //...

  SetNextScreenTransition(TRANSITION_BOXOUT);
  SetGlobalInt(77, 1); // enable waiting when re-entering this room
  NewRoom(character[GetPlayerCharacter()].room); // re-enter current room

  //...


Edit:

If you need it on more than one occasion, put the first part in the on_event/ENTER_ROOM function and create your own custom function for the second part.

Like this:


// main global script file

function on_event(int event, int data) {

  if (event == ENTER_ROOM) {

    if (GetGlobalInt(77)) {
      Wait(GetGlobalInt(77));
      SetGlobalInt(77, 0);
    }

  }

}



// main global script file

function FadeEx(int style, int waitloops) {
  SetNextScreenTransition(style);
  SetGlobalInt(77, waitloops);
  NewRoom(character[GetPlayerCharacter()].room);
}



// Main script header file

import function FadeEx(int style, int waitloops);



  //...

  FadeEx(TRANSITION_BOXOUT, 40);

  //...


Please tell me if it works... ;)
Title: Re: FadeOut FadeIn
Post by: Radiant on Thu 30/12/2004 19:21:39
You can duplicate the box-in effect by using RawDraw functions to create black boxes on screen.
Title: Re: FadeOut FadeIn
Post by: Candle on Thu 30/12/2004 21:05:04
Thanks got it to work .