Setting object transparency (SOLVED)

Started by R4L, Sun 26/10/2008 07:23:46

Previous topic - Next topic

R4L

Code: ags
function room_AfterFadeIn()
{
  int trans = object[0].Transparency;
Wait(120);
cRobot.Walk(54, 225, eBlock, eAnywhere);
cRobot.FaceLocation(54, 100);
Wait(120);
Switch.SetView(3, 0, 1);
Retro.Visible = true;
while(trans >0){
trans--;
object[0].Transparency=trans;

}

cRobot.Walk(425, 225, eBlock, eAnywhere);


}


OK, after all the edits, I made it work. My object doesn't fade in though. It's instant, like I'm just making the object visible. Anyway to slow it down a bit?

Pumaman

You need to put a Wait(1) in your while loop, otherwise the while loop will complete in a fraction of a second and the player will never see the gradual transition.

R4L

#2
Ahh. Makes sense. :)

Thanks CJ!

EDIT: Perfect! Thanks again CJ! :)

SMF spam blocked by CleanTalk