How do I prevent buttons in the same Z order from conflicting?

0 favourites
  • 6 posts
From the Asset Store
J-BoB Game Button Sound Pack comes with 300 high-quality sound effects
  • Greetings everyone. Hope all is well.

    I'm sure there is a trick to this that is escaping me at the moment. On the 3 layers I have worked on, the menu buttons line up and when one is pushed, even though the other layers are hidden, they conflict.

    How do I code that? And besides hiding them, is there some other option to make them disappear until they are needed to reappear?

    Thanks in advance for your time.

  • There are a few ways.

    You could give them all a variable, and use it for the pick condition.

    Use a pick criteria, is visible.

    Move the ones not being used off screen when not visible.

    (probably a million more ways, but one of those should work)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Very clever ideas. Gives me something to think about going forward.

  • There are a few ways.

    You could give them all a variable, and use it for the pick condition.

    Use a pick criteria, is visible.

    Move the ones not being used off screen when not visible.

    (probably a million more ways, but one of those should work)

    I know this will sound dumb but do you have a tutorial on either idea as my simple brain isn't getting it and any guide would be a help. Thank you in advance.

  • Move the ones not being used off screen when not visible.

    With this option, when I export the game to play it other platforms (like the web?), what happens to those objects? I guess they are still there, just out of sight? Does that tie up system resources?

  • If it's just a couple buttons it'll be minimal rendering to keep them around. (technically you could destroy and recreate each time)

    I'd probably just move the buttons off screen when you make them invisible and then move whichever one you need when you make it's layer visible.

    You can check the FPS and CPU profiler (debug preview), but it likely will not affect performance in any noticeable way.

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