Jump to content
shadowrecon

TPA TPointArray Help! =)

Recommended Posts

Okay so ive been going through the Library's and looking at the functions, and messing around with them. I Came across the TPA function and figured oh cool, so i can just set up an array of points with data and the pull the data later. Didnt seem to work as i thought tho. In C++ you can define the array, set the data, and then call it back latter in the program as long as the array was initialized as global variable. So something like this

 

Array[9] = array; // making 10 spots starting at zero

 

void function{

....

fill array [0] - [9];

..

}

 

void loop {

int = i;

i == Array[4]; // Lets say Array[4] contains the number 3 and is set to i

i++ // i is increased by 1

println(i); // now i is printed and contains 4

}

(obviously this has no real point just an example i type up really quick =P)

 

 

Can i get the same functionality out of scar like c++? or do i need to go about storing values another way? and if so whats the best method to store values in a function and call them later in the script or program?

 

 

 

Thank You Sorry for the inconvenience i may cause =/

Edited by shadowrecon
Link to comment
Share on other sites

I guess it would help to explain what im doing. Im using This function FindColorsTolerance

var

w, h: Integer;

TPA: TPointArray;

 

begin

GetClientDimensions(w, h);

if FindColorsTolerance(TPA, 4, 0, 0, w - 1, h - 1, 5) then

begin

WriteLn('Found color ' + IntToStr(Length(TPA)) + ' times');

WriteLn('Coordinates: ' + TPAToStr(TPA));

end;

end.

id like to use the function like this..

var

TPA: TPointArray;

 

Function FindSomething (Color : integer) : Boolean;

var

w, h: Integer;

begin

GetClientDimensions(w, h);

if FindColorsTolerance(TPA, Color, 0, 0, w - 1, h - 1, 5) then

results := true

end;

 

Then pull the information out of the TPA for mouse movements.

make sense? or am i making it more difficult than it needs to be?

Edited by shadowrecon
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...