SRL Archive - SRL Suggestions

function InBox(P: TPoint, Box: TBox): Boolean


Runaway

2012-06-12 01:54:33

I don't know if there is already a function for this since I'm not on my computer, so I figured I'd just write it up real quick. If it is, then my bad :S


function InBox(P: TPoint, Box: TBox): Boolean;
begin
Result := False;
if (P.x > Box.x1) and (P.x < Box.x2) and (P.y > Box.y1) and (P.y < Box.y2) then
Result := True;
end;

Err, now that I've typed it out it really doesn't look that useful. It definitely simplifies the process though.

Brandon

2012-06-12 01:56:05

PointInBox.

Runaway

2012-06-12 02:01:17

From: Brandon
PointInBox.


Haha yep, figured there would already be one. Guess this can be closed :)