How do I make thumbnail collect in top based on button clicked and others disappear.

  • Hi Friends,

    Need a help.

    want to make a group of thumbnails. These thumbnails must collect in row together when its respective button is clicked and other should hide. For example I show in pic where on start all jumbled tiles a,b,c,d are visible. when user clicks on A button, other tiles move away but only A tiles get collected in the first row. Similarly if user clicks on B button then all tiles go away and only tiles with "b" gets collected in first row.

    How to do that ?can anyone help me in that ?

  • Add an instance variable on the sprite and you could put value for them are A-B-C-D.

    A global variable that call selectionX

    When you press a button. You will set the selectionX to that button text.

    Then pick all sprite not equal the selectionX to invisible.

  • Thanks for the quick reply. Also, want to share that challenge im facing is not to make non selection invisible but the selected ones to collect in first row. How to make that stack collect in first row?

    It would be great if I get solution around this too.

    Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • jatin1726

    well, there are some pretty complex concepts in there...

    my sample is only 21 events but it may not be very easy to understand what is happening if you haven't used lerp or modulo, or have a firm grasp of how picking works. There are probably a million other ways to do it, and you could add all kinds of effects as the thumbs are flying around - rotate them, scale them, change opacity, etc...

    I made it very generic - it will work for any number of columns and rows (you can enter those values at the top and then click the generate button to make the thumbnails). or just keep clicking generate to get a new set to play with.

    I have all the thumbnail images in one sprite object as different animations. If you really wanted separate sprites for each thumbnail, then you would have to put them in a family and change the code to work with the family.

    it was a fun exercise... and like I said - there is lots of room for improvement by adding additional effects.

    https://www.rieperts.com/games/forum/thumbs.capx

  • Thank you so much you made my life easy to live. It worked like a charm. It will be inspiration for all.

  • jatin1726

    thanks!

    I made a couple of minor improvements - made it use a family, and filter based on a Group variable in the family (like Maverick suggested), so that it is easier to integrate into an inventory system, shop, or gallery...

    so, re-download from the link above.

    good luck with your project!

  • jatin1726

    thanks!

    I made a couple of minor improvements - made it use a family, and filter based on a Group variable in the family (like Maverick suggested), so that it is easier to integrate into an inventory system, shop, or gallery...

    so, re-download from the link above.

    good luck with your project!

    Thankyou so much once again

  • jatin1726

    thanks!

    I made a couple of minor improvements - made it use a family, and filter based on a Group variable in the family (like Maverick suggested), so that it is easier to integrate into an inventory system, shop, or gallery...

    so, re-download from the link above.

    good luck with your project!

    Allan, can you help me out that instead of button click, if I have search bar sort of thing and I type A or B then all relevant box start collecting together and others fade out or disappear. This feature is seen on websites where u type one alphabet and list below start showing options below.

  • jatin1726

    thanks!

    I made a couple of minor improvements - made it use a family, and filter based on a Group variable in the family (like Maverick suggested), so that it is easier to integrate into an inventory system, shop, or gallery...

    so, re-download from the link above.

    good luck with your project!

    Also, need one help. If i create more rows, then it makes icons smaller. Instead of that can we do somethin g where icons can be scrolled vertically if rows are more then viewport area? can u help me out with this?

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