Odd behaviour or bug?

  • Hi could someone take a look at this and tell me whats going on.

    The idea is to press space to bring up a selection and choose one of the sprites, let go of the space bar then click the left button to create your choice.

    Two things are happening.

    Selecting the first one works fine but when you click to select the next one the first one is created on the layer underneath.

    The second problem is more puzzling to me. I can select sprites 1 - 4 in order and it does as i would expect, however selecting 4 first means i cant select any of the others.

    If i change the code to select with the right button and create with the left then it works as expected.

    I had hoped to create some sort of easy to access inventory using the left click only.

    dl.dropbox.com/u/84974566/layers.capx

  • Here's how I'd do it:

    sponge_inventory.capx (r116)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey Nimtrix,

    thats nice and neat, thanks <img src="smileys/smiley1.gif" border="0" align="middle" />

    Not sure why mine didnt work though all the same.

  • Oh, I see what was happening now. If you select the 4 in your example, there's nothing stopping the "Create object 4" event from running, so every time you click a number it spawns an instance of 4. So when you're trying to select a number you select from the ones you spawned instead of the ones on the menu, does that make sense? It picks the 4 because it's the last event to run, so if there's a 4 under the menu, it'll pick that instead of the menu numbers.

  • Nimtrix, just wanted to drop in and say thanks for that simple but very effective idea. I've been toying with how to do popup dialogue boxes for a while and for some reason using layers never occurred to me.

    So, thanks!

  • Ha, i see now. makes sense really <img src="smileys/smiley1.gif" border="0" align="middle" /> . Funny how easy it is to become blind to simple things.

    Thanks

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