Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: TheRoger on Sat 06/03/2010 20:50:25

Title: Blinking backgrounds SOLVED
Post by: TheRoger on Sat 06/03/2010 20:50:25
I added 2 backgrounds into room, one is for lit chamber, other is for dark one. I used SetBackgroundFrame() in lamp script, then blinking stopped and room bacame lit. How to do that when you start room, it would be dark?
Title: Re: Blinking backgrounds
Post by: Khris on Sat 06/03/2010 20:56:26
What did you put inside the ()?

(Note: with questions like this, ALWAYS post the exact code you've used. Saves you and us time.)
Title: Re: Blinking backgrounds
Post by: TheRoger on Sun 07/03/2010 07:31:58
I putted 0 later 1, tried all backgrounds I have (sorry about that)
Title: Re: Blinking backgrounds
Post by: monkey0506 on Sun 07/03/2010 07:38:46
If I understand the problem you're saying that the room is animating between all the backgrounds until you interact with the lamp where you are calling SetBackgroundFrame which is then locking the background to the lit background frame.

Just use the enters room after fade-in event and call SetBackgroundFrame. It should be in events pane just like where you went to link the event for the lamp's interaction, but you need to select the events for the room itself instead of the events for a hotspot/object.

AGS automatically animates rooms that have more than one background unless SetBackgroundFrame has been used to lock the background to a specific frame.
Title: Re: Blinking backgrounds
Post by: TheRoger on Sun 07/03/2010 08:12:22
Found my mistake, I forgot to set code in room events tab, sorry for your time.