Find_OnLine

Category: Objects / Search
Since engine version: 1.0 OC

Description

Search criterion: finds all objects which overlap a line going from one point to the other.

Syntax

array Find_OnLine(int x1, int y1, int x2, int y2);

Parameters

x1:
X coordinate of the starting point. Relative to the calling object's center in local calls.
y1:
Y coordinate of the starting point. Relative to the calling object's center in local calls.
x2:
X coordinate of the end point. Relative to the calling object's center in local calls.
y2:
Y coordinate of the end point. Relative to the calling object's center in local calls.

Remarks

This is equivalent to checking Find_AtPoint for each point on the line.
For additional information on the use of this function see FindObjects.

Example

for(var obj in FindObjects( Find_OnLine(0,0, LandscapeWidth()-GetX(),0), Find_OCF(OCF_Alive) ))
  obj->Kill();
Railgun: Kills everything that's on the same height right of the executing object.
See also: FindObjects, FindObjects
PeterW, 2011