i made cards with darg and drop behavior. How can i drop card in free space(position). if i dropped card in position and there is another card in that position the second card back to its recent position.
I'm not sure if this is your problem
if you start dragging then you store the XY as a variable and if on drop is overlapping with objCard then set position to variable.
Can you write steps ?
Here is a version (not the best, but works)
just make an instance variable to objCards
didn't like the version I made.
So here is the better one - that doesn't have flaws
In your first example all cards move to the same position
Develop games in your browser. Powerful, performant & highly capable.
No, only the one card you drag gets a new position (that's what the instance variable is for). Except - this is the flaw - if you overlap with two cards, two of them get a new position - could be easily fixed, but version 2 is better and so there is no need for that.
Yes it's better than another one, but i don't want cards move to top of layer!
Here is a version that doesn't change the order
fm4fanAT Thank you very much.