FadeOut FadeIn [SOLVED]

Started by Candle, Thu 30/12/2004 01:34:16

Previous topic - Next topic

Candle

How would you do CrossFade or  BackboxOut etc ? Can't seem to find it in the manual.

Code: ags
FadeOut(30);
Wait(40);
FadeIn(10); 

Code: ags
BackboxOut(30);
Wait(40);
BackboxIn(10); 

Like that ?

strazer

#1
I don't think that's possible at the moment. The transition styles are used only when changing rooms.

Try this as workaround:

Code: ags

// 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
  }


Code: ags

  //...

  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:

Code: ags

// main global script file

function on_event(int event, int data) {

  if (event == ENTER_ROOM) {

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

  }

}


Code: ags

// main global script file

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


Code: ags

// Main script header file

import function FadeEx(int style, int waitloops);


Code: ags

  //...

  FadeEx(TRANSITION_BOXOUT, 40);

  //...


Please tell me if it works... ;)

Radiant

You can duplicate the box-in effect by using RawDraw functions to create black boxes on screen.

Candle

Thanks got it to work .

SMF spam blocked by CleanTalk