Author Topic: Need help with object order. [SOLVED]  (Read 7697 times)

flaviobello

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Need help with object order. [SOLVED]
« on: April 21, 2016, 07:16:46 PM »
Hi all! i just discovered this awesome frontend. and i'm moving from hyperspin.

i just made a layout but i face a issu i can't fi. the order of objects, as you can see in the attached image, the logo (wheel) is in front of the video, as it suposed to be, but i can't put this object in front of background. i'm trying to user zorder but it's not working. any ideas?

thanks in advance!

« Last Edit: April 22, 2016, 04:42:02 AM by flaviobello »

chrisvg

  • Full Member
  • ***
  • Posts: 78
    • View Profile
Re: Need help with object order.
« Reply #1 on: April 21, 2016, 07:36:50 PM »
Stuff will get displayed on the screen in the order that the script is parsed by AM.

In your layout file, is your declaration for the border image around the screenshot AFTER the declaration for the wheel artwork?

flaviobello

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Re: Need help with object order.
« Reply #2 on: April 21, 2016, 07:47:07 PM »
i just made the theme using the simple one.

i'll post the code here.

thks for the help man

Code: [Select]

//
// Attract-Mode Front-End - "Arcade" sample layout
//
fe.layout.width=1920;
fe.layout.height=1080;

local t = fe.add_artwork( "snap", 990, 200, 890, 700 );
t.trigger = Transition.EndNavigation;

t = fe.add_artwork( "marquee", 1533, 72, 347, 95 );
t.trigger = Transition.EndNavigation;

t = fe.add_artwork( "wheel", 1512, 920, 360, 160 );
t.trigger = Transition.EndNavigation;
t.zorder = 1



local l = fe.add_listbox( 25, 190, 920, 810 );
l.charsize = 28;
l.rows = 20
l.set_rgb( 100, 100, 100 )
l.set_sel_rgb( 255, 255, 255 );
l.set_selbg_rgb( 0, 0, 0 )
// l.sel_style = Style.Bold;
l.align = Align.Left;

local l = fe.add_image( "bg.png", 0, 0 );
l.zorder = 9


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

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

l = fe.add_text( "Played [PlayedCount] Times", 400, 1020, 320, 16 );
l.set_rgb( 255, 255, 255 );
l.align = Align.Left;

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


bionictoothpick

  • Sr. Member
  • ****
  • Posts: 320
  • He who laughs lasts.
    • View Profile
Re: Need help with object order.
« Reply #3 on: April 21, 2016, 08:45:31 PM »
I'm thinking you bg.png is what you want in the background, so put this early in your code:

fe.layout.width=1920;
fe.layout.height=1080;

local l = fe.add_image( "bg.png", 0, 0 );

chrisvg

  • Full Member
  • ***
  • Posts: 78
    • View Profile
Re: Need help with object order.
« Reply #4 on: April 21, 2016, 09:11:34 PM »
I'm really not familiar with using the zorder property, but after doing some tests on my own, I'm not so sure it is working as you would expect it to.

I'd recommend you move fe.add_image( "bg.png", 0, 0 ) to the start of the file so it is drawn first.  With a layout script like this, where you're just drawing a bunch of objects one after the other, the zorder will go in the order you've written the script from top to bottom. ie:

Code: [Select]
background = fe.add_image(...)

middle = fe.add_image(...)

front = fe.add_image(...)

background will be drawn first, then middle on top of that, then front will be drawn over the top of that.

omegaman

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 880
    • View Profile
Re: Need help with object order.
« Reply #5 on: April 21, 2016, 11:24:47 PM »
flaviobello-

Chris gave you an excellent explanation. To simplify it even more, you're basically stacking  images one on top of another, layering if you will.

This is your draw order. So, in your case the bg is the beginning of the stack - the first to be drawn. Then you stack the snap, marquee, and wheel art on top of it - the 2nd, 3rd, 4th to be drawn etc...

Don't bother with that z order crap.

flaviobello

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Re: Need help with object order.
« Reply #6 on: April 22, 2016, 04:07:11 AM »
thank a lot for the help!! i'll try this tips.

i'll post result.

cheers!

[edit]

thanks a lot guys, now it's fixed, and i learn a lot on layer order.
« Last Edit: April 22, 2016, 04:31:49 AM by flaviobello »

bionictoothpick

  • Sr. Member
  • ****
  • Posts: 320
  • He who laughs lasts.
    • View Profile
Re: Need help with object order. [SOLVED]
« Reply #7 on: April 22, 2016, 04:50:34 AM »
I like it...I like the icon at top right too.