RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    z-index support for themes (input needed)

    Scheduled Pinned Locked Moved Ideas and Development
    themeszindex
    7 Posts 4 Posters 1.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jdrassa
      last edited by

      I have been working on added z-index support to themes. Currently, I have it working for the gamelist views. I am going to wait until the carousel changes land for system view before trying to tackle it there.

      I wanted to get input on what default z-index values should be for various elements.

      Here is the current order that the various elements are rendered. For the individual extras, they are rendered in the order they initially appear in the theme xml.

      • Background
      • Video
      • Extras
      • Game List
      • Marquee Image
      • Image
      • Game Metadata fields
      • Header Text/Image

      So my question is, should the default z-index value be zero for all elements or should I assign default values. The advantage of assigning non-zero default values is that it will make it easier for theme makers to position a single element without having to specify z-index values for everything.

      Thinking about something like the following for default values:

      • Background = 0
      • Extras = 10
      • Game List = 20
      • Marquee Image = 30
      • Image = 30
      • Video = 30
      • Game Metadata fields = 40
      • Header Text/Image = 50

      I am also thinking that the default position of the video element should be moved to the same level as the images vs. its current position under the extras.

      Get latest build of EmulationStation for Windows here

      mattrixkM 1 Reply Last reply Reply Quote 2
      • FlyingTomahawkF
        FlyingTomahawk
        last edited by FlyingTomahawk

        Maybe, marquee image change to 35? So that it can be placed over the image or video if needed?

        1 Reply Last reply Reply Quote 0
        • mattrixkM
          mattrixk @jdrassa
          last edited by

          @jdrassa This is some great work, and long overdue I think.

          What you have suggested sounds good, and I agree with @FlyingTomahawk that the Marquee should be above the Image and Video (to be honest I thought it already was, because I use "md_image" as a screenshot/video backup and "md_marquee as the box-art/logo over the top of the screenshot).

          I'm curious what you mean by "Header Text/Image". Is that the System Logo (and the system name that displays when no logo image is present)? If so, it makes sense for that/them to remain at the highest level.

          Would we be able to move certain "Extras" to level 30/40/50 etc. while other "Extra" elements stay at level 10? Or would all "Extra" elements have to stay at the same x-index level as each other?

          My ES themes: MetaPixel | Spare | Io | Indent

          J 1 Reply Last reply Reply Quote 0
          • J
            jdrassa @mattrixk
            last edited by

            @mattrixk said in z-index support for themes (input needed):

            What you have suggested sounds good, and I agree with @FlyingTomahawk that the Marquee should be above the Image and Video (to be honest I thought it already was, because I use "md_image" as a screenshot/video backup and "md_marquee as the box-art/logo over the top of the screenshot).

            Currently, the video is specifically placed below the extras (and therefore the images) so themes could place an image overlay on top of the video. As part of this, I was going to move the video up the same level as the images. If a theme maker wants to put something above the video, they could use the z-index to do so.

            I'm curious what you mean by "Header Text/Image". Is that the System Logo (and the system name that displays when no logo image is present)? If so, it makes sense for that/them to remain at the highest level.

            Yes, I mean the System Logo. "Header Text/Image" is just what it is named in the code.

            Would we be able to move certain "Extras" to level 30/40/50 etc. while other "Extra" elements stay at level 10? Or would all "Extra" elements have to stay at the same x-index level as each other?

            Of course. The idea is that these would be the default values that would apply unless the theme overrides them. The values are I suggested are purposeful spaced apart to make it easier to place something in between them. As an example, for themes that want to apply an overlay on top of the video and then the marquee image on top of both, you might have video at the default value of 30, overlay at 31, and marquee at 32.

            Get latest build of EmulationStation for Windows here

            mattrixkM 1 Reply Last reply Reply Quote 0
            • mattrixkM
              mattrixk @jdrassa
              last edited by

              @jdrassa said in z-index support for themes (input needed):

              Of course. The idea is that these would be the default values that would apply unless the theme overrides them. The values are I suggested are purposeful spaced apart to make it easier to place something in between them. As an example, for themes that want to apply an overlay on top of the video and then the marquee image on top of both, you might have video at the default value of 30, overlay at 31, and marquee at 32.

              Awesome. I was a little worried because someone mentioned a while ago that ES saw all the "extras" as one big block, so splitting them apart would be difficult.

              My ES themes: MetaPixel | Spare | Io | Indent

              1 Reply Last reply Reply Quote 0
              • pjftP
                pjft
                last edited by

                I'm keen on learning where you're tweaking these at rendering time. Could you point me in the right direction in your code/one of your branches?

                We are currently trying to sort out some things with the video player and wanted to check what approach you're taking here as it may bring in a new perspective to a few problems, especially when using hardware acceleration.

                @fieldofcows For tracking as well.

                Thanks for the good work!

                J 1 Reply Last reply Reply Quote 0
                • J
                  jdrassa @pjft
                  last edited by

                  @pjft My code isn't up on github yet. Once it is I will post an update. Currently, the rendering order is determined by the order in which GuiComponents are added to the gamelist view (with the exception of the video component, which is specifically being inserted between the background and the extras). My implementation is pretty simplistic in that the vector of GuiComponents is sorted by z-index after the theme is applied so that the GuiComponents are in the proper order for rendering.

                  I did a little research into using the OpenGL depth buffer, but that approach doesn't work if want to use transparency, which most themes do.

                  Get latest build of EmulationStation for Windows here

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post

                  Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                  Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.