CMlScriptIngame::Page::MainFrame

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

User avatar
steeffeen
Translator
Translator
Posts: 2472
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: CMlScriptIngame::Page::MainFrame

Post by steeffeen »

Hi noyranea,

Thanks for the response.
I don't want to use a dedicated root frame mainly because of two reasons:

1. I provide a generic manialink framework that I wanted to enhance with such toggle feature without requiring the consumer to change their manialink elements.

2. Manialinks may contain several elements on root level right now and each of them has its own z-index. If I inject a root frame all these elements would inherit the z-index of the frame which messes up the layering. (This would be solved if it would be possible to somehow disable the new z-indexing of manialink v3 for a frame.)
The manialinks would need to be adjusted or split to use proper z-indexes.

Cheers,
steeffeen
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    zocka
    Posts: 205
    Joined: 15 Jun 2010, 17:56

    Re: CMlScriptIngame::Page::MainFrame

    Post by zocka »

    1. You just render the surrounding frame with the manialink. Noone would be required to change their ML structure.
    Only thing to consider are elements which (at least used to) require being placed at root level (dico, stylesheet, audio?, maybe more?), but you could just put most controls into an internal main frame based on their type.

    2. Currently the z-index is relative to the single virtual-ish MainFrame so I don't see how this would change when they are relative to an actual control.
    manialink minigame shatter
    my manialink: zockaml
    my maniaflash: maniaflash?zocka
    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2472
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: CMlScriptIngame::Page::MainFrame

    Post by steeffeen »

    zocka wrote: 12 Jul 2017, 14:52{...]
    1. I did that as a test and it was indeed no problem. However, I don't know what kind of scripts the consumers may write and forcing some arbitrary frame on them could mess up their manialinks. (Actually audio is a usual control.)

    2. Well it doesn't look like the virtual main frame is considered regarding the z-index because it's possible to set a control z-index high enough so that it's in front of default elements or low enough so that it's behind default elements. This wouldn't be possible anymore with a custom main frame that has z-index 0 (as an example). The manialink creator would need to explicitly set the main frame's z-index to some value that fits his requirements. Looking at the example of different controls in front AND behind of default elements, this wouldn't be feasible.
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks
      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2472
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: CMlScriptIngame::Page::MainFrame

      Post by steeffeen »

      steeffeen wrote: 12 Jul 2017, 15:27[...]
      What i'm asking me right now: How does the frame z-index layering work in detail? Could it be that a z-index of 0 shouldn't be considered at all?
      How I understand the new z-index layering is that a frame's z-index is considered before a child's z-index. if the frame has z-index 0, does that mean that only the child's z-index matters?

      Seems like I need to do some more tests :)
      I will be back...
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks
        User avatar
        steeffeen
        Translator
        Translator
        Posts: 2472
        Joined: 14 Oct 2012, 16:22
        Location: Germany

        Re: CMlScriptIngame::Page::MainFrame

        Post by steeffeen »

        alright i did some testing and i can confirm that a container frame messes up the z-indexes of all the contained elements

        example:

        Code: Select all

        <manialink id="id" version="3" name="id">
            <frame pos="-5 -5">
                <quad z-index="20" size="20 20" bgcolor="f00"/>
            </frame>
            <frame z-index="5">
                <quad z-index="10" size="20 20" bgcolor="0f0"/>
            </frame>
            <frame pos="5 5" z-index="10">
                <quad size="20 20" bgcolor="00f"/>
            </frame>
        </manialink>
        here we see a red quad with z-index=20 which is contained in a frame with z-index=0
        -> this is a dummy container frame containing some content

        the other two green and blue quads have z-indexes of 10 and 0 but are still in front of the red quad because they are contained in frames with z-indexes 5 and 10
        -> these are elements representing other content that the red quad is supposed to overlay

        conclusion:
        if we put a container frame around all elements, these elements inherit the z-index of the container frame so that their own z-indexes don't matter enough making it an incompatible change
        therefore that's no solution
          Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

          ManiaControl, FancyManiaLinks
          reaby
          Posts: 1032
          Joined: 29 Dec 2010, 23:26
          Location: Eastern Finland
          Contact:

          Re: CMlScriptIngame::Page::MainFrame

          Post by reaby »

          I think you got it wrong.... I think this is what noyranea had in mind.

          Code: Select all

          <manialink id="id" version="3" name="id">
          <frame id="MainContainer">    
                    <quad z-index="20" size="20 20" bgcolor="f00"/>
                    <quad z-index="10" size="20 20" bgcolor="0f0"/>
                    <quad size="20 20" bgcolor="00f"/>
          </frame>
          </manialink>
          
          then check the visibility of the MainContainer.. If I'm not totally wrong...
          User avatar
          steeffeen
          Translator
          Translator
          Posts: 2472
          Joined: 14 Oct 2012, 16:22
          Location: Germany

          Re: CMlScriptIngame::Page::MainFrame

          Post by steeffeen »

          as I tried to explain the other elements not contained in the first frame are supposed to represent some other content of other manialinks

          maybe this makes it more clear:

          Code: Select all

          <manialink id="id" version="3" name="id">
              <frame id="MainFrame" pos="-5 -5">
                  <quad z-index="20" size="20 20" bgcolor="f00"/>
              </frame>
              <frame id="Scoreboard" z-index="5">
                  <quad z-index="10" size="20 20" bgcolor="0f0"/>
              </frame>
              <frame id="Minimap" pos="5 5" z-index="10">
                  <quad size="20 20" bgcolor="00f"/>
              </frame>
          </manialink>
          or like that:

          Code: Select all

          <manialink id="CustomManialink" version="3" name="CustomManialink">
              <frame id="MainFrame" pos="-5 -5">
                  <quad z-index="20" size="20 20" bgcolor="f00"/>
              </frame>
          </manialink>
          
          <manialink id="StandardManialink1" version="3" name="StandardManialink1">
              <frame id="Scoreboard" z-index="5">
                  <quad z-index="10" size="20 20" bgcolor="0f0"/>
              </frame>
          </manialink>
          
          <manialink id="StandardManialink2" version="3" name="StandardManialink2">
              <frame id="Minimap" pos="5 5" z-index="10">
                  <quad size="20 20" bgcolor="00f"/>
              </frame>
          </manialink>
            Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

            ManiaControl, FancyManiaLinks
            Post Reply

            Return to “ManiaScript”

            Who is online

            Users browsing this forum: No registered users and 0 guests