Hi there,
I have a theme where the wheels fade out, I'm wondering if anyone would know how to code it so the wheel you're currently on doesn't fare out while the rest do.
Thanks for any help, the code below is what is in the layout.nut for the wheels to fade:
//Wheel fading
if ( wheel_fade_ms > 0 )
{
function wheel_fade_transition( ttype, var, ttime )
{
if ( ttype == Transition.ToNewSelection || ttype == Transition.ToNewList )
first_tick = -1;
}
fe.add_transition_callback( "wheel_fade_transition" );
function wheel_alpha( ttime )
{
if (first_tick == -1)
stop_fading = false;
if ( !stop_fading )
{
local elapsed = 0;
if (first_tick > 0)
elapsed = ttime - first_tick;
local count = conveyor.m_objs.len();
for (local i=0; i < count; i++)
{
if ( elapsed > wheel_fade_ms)
conveyor.m_objs.alpha = 0;
else
//uses hardcoded default alpha values does not use wheel_a
//4 = middle one -> full alpha others use 80
if (i == 4)
conveyor.m_objs.alpha = (255 * (wheel_fade_ms - elapsed)) / wheel_fade_ms;
else
conveyor.m_objs.alpha = (80 * (wheel_fade_ms - elapsed)) / wheel_fade_ms;
}
if ( elapsed > wheel_fade_ms)
{
//So we don't keep doing the loop above when all values have 0 alpha
stop_fading = true;
}
if (first_tick == -1)
first_tick = ttime;
}
}
fe.add_ticks_callback( "wheel_alpha" );
}