How do I control the z order when selecting multiple objects?

Not favoritedFavorited Favorited 0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I'm working on an editor for a card game. I can drag a selection rectangle and move/copy multiple sprites, but the z order gets messed up. Not sure why this is happening, but I thought I could fix the problem by saving the initial z order (and updating this as needed) and then setting the z order again.

    Unfortunately, there's no way to "SET" the z order for a sprite, only the elevation -- which I know is a different thing.

    So how do I fix this? (Thanks!)

  • Setting the z order is done with the actions "Move to top" "Move to bottom" "move to object"

    There is also a specific "Sort Z order" system action that sorts based on an instance variable.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just a quick follow-up that might help someone else in the future...

    I solved this issue by rejiggering my array to put the zIndex values in the first column. Then, before pasting the cards, I do a sort. Unless I'm missing something, array sorts always happen on the first column only, hence the re-jiggering.

    This way the cards get created one-by-one with the appropriate z ordering.

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