Author Topic: Clear list box (alpha)  (Read 3035 times)

Dave305

  • Newbie
  • *
  • Posts: 4
    • View Profile
Clear list box (alpha)
« on: March 30, 2015, 11:48:09 PM »
Couple of Q's.

I am trying to make a clear list box but don't know the command. I looked at a couple .nut files, but went nuts trying to see how they did it. An example would be great. Below is wrong I know :(.

local l = fe.add_listbox( 32, 64, 262, 352 );
l.charsize = 12;
l.set_selbg_rgb( 0, 0, 0 );
l.set_sel_rgb( 50, 50, 255 );
l.set_alpha = 100
l.sel_style = Style.Bold;

as you can see I am no programer (know a little basic).

How do you manage layers top, bottom, middle placement. Is it by where they are listed in the nut file?.

O.K.I must say I love this FE, simple, fast loading, easy setup. The last FE I felt this way about was 1up years ago. I loved their setup process and display. One more thing is all this Verification really needed to post (just asking).

cools

  • Full Member
  • ***
  • Posts: 83
  • Arcade Otaku Sysadmin
    • View Profile
    • Arcade Otaku
Re: Clear list box (alpha)
« Reply #1 on: March 31, 2015, 12:10:10 AM »
You're corecr, z-order is done by position in the .nut file

Dave305

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Clear list box (alpha)
« Reply #2 on: March 31, 2015, 12:29:48 AM »
Thanks
I have Alpha going also, but it don't seem to make a diff the value I set. What I want is to drop a resized picture named bg.png into my layout folder and change the background w/o editing it in gimp. Now going for changing fonts and size. Looking better all the time :).

//
// Attract-Mode Front-End - "Basic" sample layout
//
fe.layout.width=640;
fe.layout.height=480;

fe.add_image( "bg.png", 0, 0 );

local t = fe.add_artwork( "snap", 348, 152, 262, 262 );
t.trigger = Transition.EndNavigation;

t = fe.add_artwork( "marquee", 348, 64, 262, 72 );
t.trigger = Transition.EndNavigation;

local l = fe.add_listbox( 32, 64, 262, 352 );
l.charsize = 12;
l.set_selbg_rgb( 0, 0, 0 );
l.set_sel_rgb( 50, 50, 255 );
l.alpha = 150;
l.sel_style = Style.Bold;

l = fe.add_text( "[DisplayName]", 0, 15, 640, 30 );
l.set_rgb( 255, 255, 255 );
l.style = Style.Bold;

fe.add_image( "bg - Clear.png", 0, 0 );

// Left side:

l = fe.add_text( "[Title]", 30, 424, 320, 16 );
l.set_rgb( 0, 255, 0 );
l.align = Align.Left;

l = fe.add_text( "[Year] [Manufacturer]", 30, 441, 320, 16 );
l.set_rgb( 0, 255, 0 );
l.align = Align.Left;

l = fe.add_text( "[Category]", 30, 458, 320, 16 );
l.set_rgb( 0, 255, 0 );
l.align = Align.Left;

// Right side:

l = fe.add_text( "[ListEntry]/[ListSize]", 320, 424, 290, 16 );
l.set_rgb( 0, 255, 0 );
l.align = Align.Right;

l = fe.add_text( "[FilterName]", 320, 441, 290, 16 );
l.set_rgb( 0, 255, 0 );
l.align = Align.Right;


cools

  • Full Member
  • ***
  • Posts: 83
  • Arcade Otaku Sysadmin
    • View Profile
    • Arcade Otaku
Re: Clear list box (alpha)
« Reply #3 on: April 01, 2015, 04:13:35 AM »
Listbox has alpha, bg_alpha, sel_alpha and selbg_alpha available.

raygun

  • Administrator
  • Sr. Member
  • *****
  • Posts: 391
    • View Profile
Re: Clear list box (alpha)
« Reply #4 on: April 09, 2015, 10:03:08 PM »
I hope you got this all sorted out!  I might have gone overboard with the verification for posting after the last spambot attack, I'll double check and relax the settings.

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: Clear list box (alpha)
« Reply #5 on: May 17, 2015, 05:23:26 PM »
Just to add, I used a trick to implement "layers" for z-ordering things... something like this:

Code: [Select]
local layers = {
   bg = fe.add_surface( fe.layout.width, fe.layout.height ),
   middle = fe.add_surface( fe.layout.width, fe.layout.height ),
   fg = fe.add_surface( fe.layout.width, fe.layout.height )
}

Now you can add your objects, not necessarily in order by using layers.bg.add_image("..."), etc..
This might help if you aren't sure when something will be added, but you need it added to a specific layer.