Help with z-order position

0 favourites
  • 7 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi Everyone,

    I have 10 sprites all of the same size, and with the same X,Y position. I want to be able to push a button and bring the sprite at the bottom of the layer up to the top, and I'd like to be able to do this for all ten. I know sprites have a z-order on layers, but can't find a way to check on individual sprites z-order position. I was thinking I'd probably need to keep track of each sprites position using variables, but I'm not sure exactly how to do that.

    Can somebody let me know how I might achieve this?


  • You want all ten sprites bring to top layer at the same time, or one by one?

  • Hi shinkan,

    Thanks for your reply. I want to bring individual sprites to the top of the layer 1 at a time. So each time I press a button the sprite at the bottom of the pile comes to the top. Do you know how I could do that?


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sprite: Pick bottom instance -> Sprite move to layer 1

    This will pick the Sprite with lowest Zindex and move it to layer 1.

    If you have many different Sprites put them into a family and then

    Family: Pick bottom instance -> Family move to layer 1

  • Thanks

    I think I may have explained my issue badly. All of the sprites are already on the same layer, and each sprite is different (so not many copies of one sprite).

    I want to be able to separately pick up each of the sprites with the mouse. The problem is, because they?re stacked directly on top of each other, I can only select the sprite at the top of the stack. That's why I need a way to push a button and change the sprites z-order, so that I can make an individual sprite come to the top of the stack. Can using families help me with this?

    Thanks again for your help.

  • Okay I've set up a family and I can now easily bring bottom sprite to top of the stack, thank you

  • Alright then. If you need some more help just ask.

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