How can I find out where two lines touch?

Hello there!

I’m new to Phaser, and trying to find out how I can highlight an object where it touches another one.

As seen in the image below I would like to overlap two game elements (for example two squares), and find the area where the black and gray square overlap (marked red in the image):

Is there any way in which I can accomplish this?

1 Like

Hello @samme,

This is perfect, it got me exactly what I was looking for, thank you so much!