In a layout I use this code so that when I do not change the game in the listbox for a while, the listbox is hidden. And when I press up or down key (back game, previous game) come back.
fe.do_nut("mds/animate.nut");
local lbx = flx*0.74;
local lby = fly*0.17;
local lbw = flw*0.25;
local lbh = flh*0.84;
// Listbox
::OBJECTS <- {lbx = fe.add_listbox(lbx, lby, lbw, lbh)}
OBJECTS.lbx.rows = 21;
OBJECTS.lbx.selbg_alpha=0;
OBJECTS.lbx.set_rgb(R,G,B);
OBJECTS.lbx.set_sel_rgb(R2,G2,B2);
OBJECTS.lbx.align = my_align;
local move_lbx1 = {when = Transition.ToNewSelection, property ="x", start = OBJECTS.lbx.x + OBJECTS.lbx.width, end = OBJECTS.lbx.x, time = 1}
local move_lbx2 = {when = When.ToNewSelection, property ="x", start = OBJECTS.lbx.x, end = OBJECTS.lbx.x + (OBJECTS.lbx.width*1.5), time = 600, delay=3500}
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx1));
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx2));
I have the problem when I change the filter with the left and right keys (prev filter, next filter): I do not know what code to include so that pressing the left or right returns the listbox, which it does not do, obviously.
I have tried this, but it does not work well, the actions are duplicated and not synchronized:
fe.do_nut("mds/animate.nut");
local lbx = flx*0.74;
local lby = fly*0.17;
local lbw = flw*0.25;
local lbh = flh*0.84;
// Listbox
::OBJECTS <- {lbx = fe.add_listbox(lbx, lby, lbw, lbh)}
OBJECTS.lbx.rows = 21;
OBJECTS.lbx.selbg_alpha=0;
OBJECTS.lbx.set_rgb(R,G,B);
OBJECTS.lbx.set_sel_rgb(R2,G2,B2);
OBJECTS.lbx.align = my_align;
local move_lbx1 = {when = Transition.ToNewSelection, property ="x", start = OBJECTS.lbx.x + OBJECTS.lbx.width, end = OBJECTS.lbx.x, time = 1}
local move_lbx2 = {when = When.ToNewSelection, property ="x", start = OBJECTS.lbx.x, end = OBJECTS.lbx.x + (OBJECTS.lbx.width*1.5), time = 600, delay=3500}
local move_lbx3 = {when = Transition.ToNewList, property ="x", start = OBJECTS.lbx.x + OBJECTS.lbx.width, end = OBJECTS.lbx.x, time = 1}
local move_lbx4 = {when = When.ToNewList, property ="x", start = OBJECTS.lbx.x, end = OBJECTS.lbx.x + (OBJECTS.lbx.width*1.5), time = 600, delay=3500}
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx1));
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx2));
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx3));
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx4));
This does not work either:
local move_lbx1 = {when = Transition.ToNewSelection && Transition.ToNewList, property ="x", start = OBJECTS.lbx.x + OBJECTS.lbx.width, end = OBJECTS.lbx.x, time = 1}
local move_lbx2 = {when = When.ToNewSelection && When.ToNewList, property ="x", start = OBJECTS.lbx.x, end = OBJECTS.lbx.x + (OBJECTS.lbx.width*1.5), time = 600, delay=3500}
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx1));
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx2));