Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: ZZjZmoz on Wed 19/11/2003 21:11:30

Title: Background Animation
Post by: ZZjZmoz on Wed 19/11/2003 21:11:30
How do I get the background to animate only when I tell it to? I can only get it to animate automatically.

Thanks a lot.
With love,
Your grandmother  ;D

P.S. Stop eating those frosty treats (you little punks).
Title: Re:Background Animation
Post by: MrColossal on Wed 19/11/2003 22:51:36
from the manual:

SetBackgroundFrame (int frame)

Locks the background to frame number FRAME of an animating-background screen. (Values for FRAME are from 0 to 4). This allows you to use the animating backgrounds feature for another purpose - you can have two frames of the background, one for example with a spaceship crashed on it. Then, once the right event has happened, call SetBackgroundFrame in the Player Enters Screen event to set the background before the screen fades in.
Call SetBackgroundFrame(-1) to set the default animating frames.

The frame lock is released when the game changes rooms.

Example:

if (GetGlobalInt(20)==1)
   SetBackgroundFrame(4);

will change the current room?s background frame to 4 if the global integer 20 is 1.


good luck
eric
Title: Re:Background Animation
Post by: ZZjZmoz on Wed 19/11/2003 23:35:52
AHA!!! I never knew that I had to use SetBackgroundFrame(). thanks.