Author Topic: List box fade out  (Read 2616 times)

Yaron2019

  • Guest
List box fade out
« on: August 26, 2019, 10:58:26 AM »
The following code is supposed to fade out an entire list box, but the current selection in the list doesn't fade. What am I doing wrong?

local lb = fe.add_listbox( flx*0.385, fly*0.09, flw*0.31, flh*0.4 );
lb.rows = 25;
lb.align = Align.Left;
lb.set_rgb(0,255,0);
lb.set_sel_rgb(0,255,0);
lb.charsize = 22;
lb.bg_alpha=0;
lb.selbg_alpha=0;
lb.rotation = -3;


function transition_callback( ttype, var, ttime )
{
   switch ( ttype )
   {
      case Transition.ToNewSelection:
                local animConfig = {
                property = "alpha",
                start = 255,
                end = 0,
                time = 1000
            }
            animation.add( PropertyAnimation( lb, animConfig ) );
   }
   return false;
}
fe.add_transition_callback( "transition_callback" )


You can see the problem here:
https://www.youtube.com/watch?v=uxk2fKhXQjo&feature=youtu.be
« Last Edit: August 26, 2019, 11:03:48 AM by Yaron2019 »

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: List box fade out
« Reply #1 on: August 26, 2019, 11:39:11 AM »
just put code in new theme..to test....and i love it,

dont have an answer though...  ill fart around with it...and see

this will be a great code snip...  once its figured out...thanks


note: i have had shit not pan out before because of animation module ....  by far not perfect..
could be a bug..     im hoping not,                                it all looks right.
« Last Edit: August 26, 2019, 11:50:15 AM by jedione »
help a friend....

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: List box fade out
« Reply #2 on: August 26, 2019, 12:51:15 PM »
help a friend....

rand0m

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: List box fade out
« Reply #3 on: August 27, 2019, 12:56:05 AM »
Try putting the list (lb) on a surface then hide the surface via animation or code, make the trigger for visibility up and down keys.

Yaron2019

  • Guest
Re: List box fade out
« Reply #4 on: August 27, 2019, 03:56:59 AM »
Thanks! both solutions work.
« Last Edit: August 27, 2019, 04:12:27 AM by Yaron2019 »