How do I Check If One Object Is Directly Over Another

Get help using Construct 2

Post » Thu Feb 12, 2015 8:33 pm

Hello - anyone have any visual samples (capx) I could see to illustrate how to check is an object is directly over another object of exact same shape... I want to create a drag and drop type simulation that when say a square is dragged over another square it has to be dropped exactly ontop the other corner for corner... possible?
Need Sprites For Your Next Project?
100% Vector Animated Sprites
B
8
S
2
Posts: 170
Reputation: 1,086

Post » Thu Feb 12, 2015 8:55 pm

Every sprite has "Z-Index expression".
Image

If you want to check "corner to corner: you should check if their X, Y coordinates and width and height are the same.
B
38
S
15
G
6
Posts: 238
Reputation: 7,780

Post » Thu Feb 12, 2015 8:57 pm

You could check their coordinates are equal (within a given tolerance because the numbers will not be exact).
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596


Return to How do I....?

Who is online

Users browsing this forum: Phoenixbowman, Zion and 6 guests