screen fade using raw function

Started by left, Fri 07/01/2005 14:53:32

Previous topic - Next topic

left

Hi, in my game i am trying to create a night to morning fade. I found the raw function which does sets the frame transparency in the maual, but im un sure how to use this.
What exactly is the script for doing this. i have tried making a list with declining transparency values but this doers not work. The manual alse states that you have to keep on calling the restore screen function but i just cant understand how you make it fade slowly?
i'm sure im just being stupid.
thanks in advance

strazer

#1
Normal background: Night (Frame 0)
Animated frame 1: Day (Frame 1)

Code: ags

  // script for room: Player enters screen (before fadein)
  //...

  SetBackgroundFrame(0); // disable background frame animation
  RawSaveScreen(); // save night background for restoring

  //...


Code: ags

  // script for interaction where you want the transition to happen
  //...
  
  int trans=99;
  while (trans >= 0) {
    RawRestoreScreen(); // restore night background
    RawDrawFrameTransparent(1, trans); // draw day background on night background at trans transparency
    Wait(1); // wait 1 gameloop (increase this to slow down transition speed)
    trans -= 1; // decrease transparency by 1
  }

  //..


Note: As the manual states, this only works with hi-color backgrounds.

SMF spam blocked by CleanTalk