Page 1 of 1

Where to slide to destroy something

Posted: 10 January 2021, 21:46
by HumanBot
So I ended up using the Zone class to build out each player's public hand. Not sure if that was the intended use of zone as I'm using a zone for each card type, but I decided to use it for now since each card type were a different size, had varying number of cards, and I needed a different way to organize between some of the types.

Now zone uses a function called .removeFromZone() which can remove the item from my zone by sliding it and destroy it, but it must have a sliding destination. Is there a garbage can location people normally use like the corner of the map or some symbol? Alternatively, a fadeOut option would work better, but I'm not sure how I'd change the zone functionality to do that.

Re: Where to slide to destroy something

Posted: 10 January 2021, 21:56
by HumanBot
Actually I just came up with a cool idea that solves this. I do "removeFromZone" on the card with the destination set to its own zone. Then I do a fadeOutAndDestroy on that object. The result is the item slides up slightly as it fades away. Pretty cool.

Re: Where to slide to destroy something

Posted: 13 January 2021, 05:38
by Loreroth
You can simply use null as the destination, it will then fade out and destroy the object in place.

Re: Where to slide to destroy something

Posted: 13 January 2021, 23:22
by HumanBot
Ah okay thanks. That's good to know