 I created a shape. It will be a room.
I created a shape. It will be a room.
here is the code:
        room = new Sprite();
        room.graphics.beginFill(0xFFFF00, 1);
        room.graphics.moveTo(0, 0);
        room.graphics.lineTo(0, 500);
        room.graphics.lineTo(500, 500);
        room.graphics.lineTo(500, 250);
        room.graphics.lineTo(300, 250);
        room.graphics.lineTo(300, 0);
        room.graphics.endFill();
        addChild(room);
and i have a red rectangle at the middle. I wanna know which wall and two point is close to this rectangle. For example: in this screenshot left wall is nearest.
Thank you
 
     
    