by DST » Wed Sep 01, 2010 3:39 am
okay, 2 things:
Transparency is a float, its min value is 0 and it's max value is 1. So it will never be greater than 2.
So you say, transp +=whatever, and then, if you want to disable it, do this:
if (transp>0.99){
VisibilityState("Event Actor", DISABLE);}
now that disables all drawing (and also collision/mousedown) for this actor. But consider this too...create an actor, real, variable. That will be a float (decimal).
So then try:
transp+=myfade;
if(transp>0.99){
VisibilityState("Event Actor", DISABLE);}
and just set myfade to 0.2 on startup.
Now, at any time, like when you get ready to end the level, or the player leaves the game, and you want black to come BACK, try
VisibilityState("black", ENABLE); //will still be invisible cause transp is still at 1
black.myfade=-0.2; //will start fading back in
now, transp+=myfade....1+-.02 =.98....suddenly, you see, you can make black fade in and out at any time, by simply changing the value of the real actor variable 'myfade'. When black is visible, it stays visible until you give myfade a positive value. You can call black.myfade from any actor or script....from player click on button to boss death to score tallied up to player exits game. From any event, you can just call black.myfade and give it a value.
If black becomes transparent, it will always use 'visibility state' to turn itself off. You just have to remember to turn it on again when you want it back.