Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Monk on Wed 02/07/2008 17:39:51

Title: Fade In Problems
Post by: Monk on Wed 02/07/2008 17:39:51
i am using this code to have my title (its an object) fading in... its working.. but now it also looping endless and make my title blinking... anyone please help me?

function room_Load()
{
object[0].Transparency = 100;
}
function room_RepExec()
{
int trans = 100;
while (trans > 0) {
trans--;
object[0].Transparency = trans;
Wait(1);
}
}
Title: Re: Fade In Problems
Post by: TwinMoon on Wed 02/07/2008 17:48:53
Rep_exe is used to do something every game cycle.
So every game cycle, trans is set to 100 and object[0] fades in.

Move everything in room_RepExec to room_AfterFadein to the function room_Load, that should fix your problem.
Title: Re: Fade In Problems
Post by: Monk on Wed 02/07/2008 17:57:00
i moved it onto this..

function room_Load()
{
object[0].Transparency = 100;
}

function room_AfterFadeIn()
{
int trans = 100;
while (trans > 0) {
trans--;
object[0].Transparency = trans;
Wait(1);
}
}


ITS WORKING!!!! thank you very very much!