Results 1 to 5 of 5

Thread: Little more explanation on Tpoint, please.

  1. #1
    Join Date
    May 2007
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Little more explanation on Tpoint, please.

    Yes, I've read all the tutorials.

    1. So a TPA (TpoinArray) is an array of x's and y's. Correct?
    [code]TPA[0] := IntToPoint(10, 5);
    2. That's how a Tpoint is set. I can set TPA[1..XXX] like this too?
    3. How many points are there in the standard TPA? Are they automatically created? Do I need SetArrayLength?
    Code:
      For I := 0 To High(TPA) Do // High = highest slot
    4.Is High(TPA) the highest declared numbered array? For instance, if I declared TPA[5], would the High(TPA) be 5?
    5. In this small script from n3ss3s tutorial;

    Code:
    Procedure TPAMouseExample;
    Var
      TPA: TPointArray;
      I, C: Integer;
    Begin
      SetArrayLength(TPA, 10);
      For I := 0 To High(TPA) Do // High = highest slot
      Begin
        TPA[i].x := (i + 1) * 10;
        TPA[i].y := (i + 1) * 20;
      End;
      // Now, we go through with it using mouse, watch...
      For C := 0 To High(TPA) Do
      Begin
        MoveMouse(TPA[c].x, TPA[c].y);
        Wait(250);
      End;
    End;
    how come i is never declared?
    Originally Posted by YoHoJo
    I like hentai.

  2. #2
    Join Date
    Jul 2008
    Location
    England
    Posts
    763
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    1. Yes.
    2. Yes.
    3. It depends whether the array is dynamic or not.
    4. The High() function is like Length(TPA) -1.
    5. var I: Integer;..?
    lol

  3. #3
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    1. Yes correct

    2. You can set a TPoint like this TPA[0] := [Point(5, 10)]. Or like:
    SCAR Code:
    Var TP : TPoint;

    Begin
      TP := Point(6, 9);
      TP.x := 6;
      TP.y := 9;
    End;
    ^ da same.

    3. You have to set the length of the TPointArray, this is done by manually filling them in or by using a FindColors[].

    4. You need to be more specific, but for what info you've given: yes.

    5. All integers when declared for the first time in a script are 0. Furthermore, it is declared:

    SCAR Code:
    For I := 0

    See .

  4. #4
    Join Date
    May 2007
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for clearing up the integer issue. I get stumped over the littlest things, and I somehow missed that :=0, .

    When I need x, y, do I need to call TPA[X].x, TPA[X].y, or can I simply call TPA[X]?
    Originally Posted by YoHoJo
    I like hentai.

  5. #5
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    tpa[index].x and tpa[index].y, where index is the point you want (for example 1 or 2 or w/ever).
    I made a new script, check it out!.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •