Fading an object in...(Solved)

Started by Pinback, Sun 13/12/2009 18:46:28

Previous topic - Next topic

Pinback

I found the following code in the manual to fade objects out,

Example:

int trans = object[0].Transparency;
while (trans < 100) {
 trans++;
 object[0].Transparency = trans;
 Wait(1);
}


But I can't seem to get it to do the opposite effect, ie, fade an object in.
Played around with it for a few hours but I'm kinda stumped. Anyone know how to do this?

NsMn

Just replace the line "object[0].Transparency = trans" with "object[0].Transparency = 100-trans", that should work.

Pinback

Thanks man, that works great.

Helme

Take a look at the tween-module. It contains a command called tween.transparency which is a simply shorter and includes more options for fading.

SMF spam blocked by CleanTalk