Log in

View Full Version : TPointArrayArray help



[Nathan]
12-31-2011, 04:24 AM
I'm using a TPointArrayArray to hold 4 seperate points for 28 different items (inventory). How do I initialize the length? I initially was just going to do one point for each item, but realized that would look bot like so I decided on four. I originally did this:


SetArrayLength(missclickLocs, 28);
missclickLocs[0]:= IntToPoint(0,0);
missclickLocs[1]:= IntToPoint(0,0);
missclickLocs[2]:= IntToPoint(0,0);
missclickLocs[3]:= IntToPoint(0,0);
etc etc etc

I'm not sure how to update it to a TPointArrayArray. I looked through some tuts and couldn't find what I was looking for. I apologize if I was blind and missed something in my searching, I don't want to be that guy who asks a bunch of questions he could have just searched and found the answers for!

Thanks

euphemism
12-31-2011, 04:35 AM
A TPointArrayArray? Like, an array of TPointArray? Like, an ATPA, known as a T2DPointArray? Is that what you are meaning? You would just use SetLength(ATPA, 28).

[Nathan]
12-31-2011, 04:38 AM
A TPointArrayArray? Like, an array of TPointArray? Like, an ATPA, known as a T2DPointArray? Is that what you are meaning? You would just use SetLength(ATPA, 28).
All of those things, yes. So then would I also do:

SetLength(missclickLocs[0], 4);

to set the length of all of the inner arrays?

Thanks for your help

euphemism
12-31-2011, 04:40 AM
;877253']All of those things, yes. So then would I also do:

SetLength(missclickLocs[0], 4);

to set the length of all of the inner arrays?

Thanks for your help


for I := 0 to 27 do
SetLength(missclickLocs[i], 4);

[Nathan]
12-31-2011, 04:51 AM
for I := 0 to 27 do
SetLength(missclickLocs[i], 4);

wonderful thank you!