SRL Archive - OSR Help

FindObjEx


sm0k3

2011-04-28 14:42:46

FindObjEx(x, y,OBST_T[ObstN],OBST_C[ObstN], tol, 2, MSX1, MSY1, MSX2, MSY2)

will return the x and y of the colors ..

how can i then create a box a little bigger then the x and y lets say + 20 and -20 each way to use as the MSX1 MSY1 MSX2 MSY2 for anouther
FindObjEx(x, y,OBST_T[ObstN],OBST_C[ObstN], tol, 2, MSX1, MSY1, MSX2, MSY2)

Bobzilla69

2011-04-28 14:58:17



procedure findit;
var
x, y:integer;
search:TBox;
begin
if FindObjEx(x, y,OBST_T[ObstN],OBST_C[ObstN], tol, 2, MSX1, MSY1, MSX2, MSY2)then
begin
search.x1:= x - 20;
search.y1:= y - 20;
search.x2:= x + 20;
search.y2:= y + 20;
if FindObjEx(x, y,OBST_T[ObstN],OBST_C[ObstN], tol, 2, searchX1, search1, searchX2, searchY2)then
begin
Writeln('Found it after two searches');
end;
end;
end;

that would do it