16
Scripting / Transition with Input State not workign as expected
« on: January 24, 2019, 09:40:25 AM »
Hi, I am using the following code:
What I am trying to do is to show images of up-arrow and down-arrow when I press up and down. I used the code in layout directly because using a plugin applies the effect on all layouts in use (not isolated). Can anyone please tell me why it isn't working? Does transition require further instructions?
Code: [Select]
local image_up = fe.add_image ("images/up.png", 430, 44, 0, 0);
local image_down = fe.add_image ("images/down.png", 430, 1014, 0, 0);
image_up.visible = false;
image_down.visible = false;
function blink_transition( ttype, var, transition_time )
{ switch ( ttype )
{
case Transition.ToNewSelection:
{
if (fe.get_input_state("Up")==true)
{
image_up.visible = true;
}
else if (fe.get_input_state("Down")==true)
{
image_down.visible = true;
}
return true;
return false;
}
}
}
What I am trying to do is to show images of up-arrow and down-arrow when I press up and down. I used the code in layout directly because using a plugin applies the effect on all layouts in use (not isolated). Can anyone please tell me why it isn't working? Does transition require further instructions?