How do I check an object is fully overlapping another

Get help using Construct 2

Post » Fri Jun 27, 2014 6:07 am

Hi,

Is there a way to check an object is 100% overlapping/covering another object?

Thanks :)
B
26
S
6
Posts: 39
Reputation: 1,574

Post » Fri Jun 27, 2014 7:26 am

Hi. I think I saw an example of this in the past. It was a combination of "is overlapping" and some comparisions about position and size of the objects.
After searching I found this: viewtopic.php?f=147&t=93157&p=726257&hilit=objects+overlapping+completely#p726257
It uses on collision as workaround. But there was another example I cannot find right now. :/
B
53
S
16
G
6
Posts: 718
Reputation: 9,150

Post » Fri Jun 27, 2014 8:13 am

Here's a very quick example. Just drag the red square around and it'll change to green when it fully overlaps the blue square.

overlapcompletely.capx


And if you need it to test multiple objects you just need this simple addition.

overlapcompletely-multiple.capx
You do not have the required permissions to view the files attached to this post.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Fri Jun 27, 2014 11:01 am

Perfect thanks @Minor. Helps a lot.
I'm using it so the player has to scrub the enemy objects off the screen. So I just changed the expressions.
B
26
S
6
Posts: 39
Reputation: 1,574


Return to How do I....?

Who is online

Users browsing this forum: plinkie, SERG 04, Yahoo [Bot] and 2 guests