Hi!
OK, this is my first post in this forum.
I've got trouble with making an "object switch".
What I basically want to do is to
change the display on a "windscreen".
I made both the windscreen displays objects, stack them on each other and change them by switching objects on and off.
It works fine this far.
But then, I want to make the switch "invisible" within a fadeout, so I tried this code:
FadeOut(10);
ObjectOn (0);
ObjectOff(1);
ObjectOff(2);
while (IsObjectOn(0) == 0) Wait(1);
FadeIn(10);
But the switch always occurs after the FadeIn.
Does anybody know how to prevent it?
Bye, straston
its becuase in the second last line you tell them to turn it on so put that line after the last. i think that will work...
Get rid of the while (IsObjectOn(0) == 0) and just leave the Wait(1); bit in.
Quote from: Archangel on Tue 01/07/2003 19:18:55
Get rid of the while (IsObjectOn(0) == 0) and just leave the Wait(1); bit in.
I'm not sure I understand why, but it works now. :)
So thanks.
Bye,
Straston
It's because even though you've used ObjectOn(0);, it isn't processed (ie. the object isn't actually turned on) until something happens to redraw the screen, such as Wait(). So the object isn't on when you try the conditional "while (IsObjectOn(0) == 0)", and so the wait command never gets called, and the screen doesn't get updated until the end of the FadeIn() function.
I think that's why anyway, someone please correct me if I'm wrong.