purerange86
2014-10-19 23:36:32
So I am trying to sort an ATPA by each entry's first tile's proximity to a given tiles (c,d), and eventually click the closest one. Any ideas on how to do this?
right now i have:
Just learned how to use arrays yesterday, please excuse my mistakes. Thanks in advance for everything :)
right now i have:
function clickbankminimap: boolean;
var
c,d,dist,fails: Integer;
TPA,TPA2: TPointArray;
ATPA,ATPA2: T2DPointArray;
mapbox: TBox;
begin
FindColorsTolerance(TPA, floorcolor, 599, 75, MMX2, MMY2, 3);
atpa:= splittpa(tpa,2); //i want to find the entry in atpa that is closest to tile (c,d)
dist := distance(c,d,what the heck do i put here)
SortATPASize(atpa2,true); //maybe I could use the sortatpasize function in combination with the distance(x1,y1,x2,y2) function?
tpa2:=atpa[0];
mapbox := gettpabounds(tpa2); //eventually I would want to output the box to mapbox
end;
Just learned how to use arrays yesterday, please excuse my mistakes. Thanks in advance for everything :)