Help with z ordering

0 favourites
  • 7 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I have a function that creates a bunch of text object.

    here is a part of it, to give an idea:

    I run a loop that executes that function a bunch of times creating a list.

    I then set some UI elements to the top of that layer so that the text will scroll underneath it.

    here's a screen of that part:

    However setting the UI elements to the top of the layer is not working. the text elements are always above in the z order.

    I'm specifically trying to avoid putting the UI elements on a layer above.

    thanks in advance

  • I suggest running the project in Debug Mode (Shift+F4). Check each object - make sure it's on the right layer, check their z-index and z-elevation.

    I noticed that you have a bunch of "Wait for previous action to complete" on your second screenshot. It should only be used with asynchronous actions, the way you are using it is wrong and it potentially can cause some bugs. If you need to wait till the end of the tick, use "Wait 0 seconds"

  • Lol I know. I've been throwing spaghetti at the wall trying to get it to do something different. Nothing is working. The text objects always end up at zorders higher than the elements that I explicitly push to the top.

    What's odd is that in the loop part, I add a white box behind the text... THAT ends up below the UI elements...

    So for some reason it's JUST the text objects that refuse to be lower than whatever I push to the top of the layer.

    I will probably have to cave and make a new layer... Which, in my case, is a very annoying amount of work. Oy vey!

    Post reply

    ❤Following(3)

  • Well, it's hard to tell what could be wrong without the project file. One possible reason is that the object you are trying to move to top/bottom hasn't been created yet. If you create the object in the same tick, you have to wait until the end of the tick in other events to pick and make changes to it.

    Try adding a test event and see if it works:

    On key "Z" pressed -> Object move to bottom of layer

  • yeah i tried that. the highest the element gets is 22... for some reason all the text is much higher.

  • Check z-elevation, it may override z-ordering.

    And make sure there are no other events which can change z-order.

    I can't think of anything else that can cause this problem.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • welp you were right. thanks so much for sticking with me on this. lol. I was totally discounting that it could be elevation since i had done this exact thing on a different layer without this issue... and it just didn't seem likely.

    anyway, When creating the objects i had to explicitly set the z elevation to 0. The top of the layer was 22, which is where it would set my UI element. But for some reason the z ORDER of the text was WELL above that. but also the z elevaTION for the text was at 1 for some reason... instead of 0 (they should all be 0). DOH! Thanks again!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)