Box Arrays

A file that stores type functions to manipulate TBoxArrays.

The source for this file can be found here.

TBoxArray.addIndex

procedure TBoxArray.addIndex(const b : TBox; const index : Integer);

Used to add a value to a TBoxArray at a chosen index.

Note

  • by Zyt3x

Example:

tba.addIndex([5,5,100,100], 0);

TBoxArray.deleteIndex

procedure TBoxArray.deleteIndex(const index : Integer);

Used to delete a value of a TBoxArray at a chosen index.

Note

  • by Zyt3x

Example:

tba.deleteIndex(0);

TBoxArray.append

procedure TBoxArray.append(const b : TBox);

Used to append a value to a TBoxArray.

Note

  • by Zyt3x

Example:

tba.append([5,5,100,100]);

TBoxArray.combine

procedure TBoxArray.combine(const arr : TBoxArray);

Used to combine two TBoxArray variables.

Note

  • by bonsai
  • Last Updated: 25 May 2015 by Zyt3x

Example:

tba.combine(tba2);

TBoxArray.returnInArray

function TBoxArray.returnInArray(const b : TBox) : Integer;

Returns the index of where the value was found in a TBoxArray. Returns -1 if not found.

Note

  • by bonsai
  • Last Updated: 10 October 2014 by bonsai

Example:

writeLn(tba.returnInArray([5,5,100,100]));

TBoxArray.isInArray

function TBoxArray.isInArray(const b : TBox) : Boolean;

Returns True if the value is present in the TBoxArray.

Note

  • by bonsai
  • Last Updated: 15 May 2016 by Zyt3x

Example:

if (tba.isInArray([5,5,100,100])) then ... ;

TBoxArray.include

function TBoxArray.include(const arr : TBoxArray) : TBoxArray;

Returns a TBoxArray which contains values that are present in both arrays.

Note

  • by Zyt3x

Example:

tba := tba2.include(tba);

TBoxArray.exclude

function TBoxArray.exclude(const arr : TBoxArray) : TBoxArray;

Returns a TBoxArray which contains values that are not present in both arrays.

Note

  • by Zyt3x

Example:

tba := tba2.exclude(tba);

TBoxArray.swap

procedure TBoxArray.swap(var arr : TBoxArray);

Used to swap two TBoxArray variables.

Note

  • by Zyt3x
  • Last Updated: 10 October 2014 by bonsai

Example:

tba.swap(tba2);

TBoxArray.clearEquals

procedure TBoxArray.clearEquals();

Used to clear duplicates in a TBoxArray.

Note

  • by Zyt3x
  • Last Updated: 10 October 2014 by bonsai

Example:

tba.clearEquals();

TBoxArray.invert

procedure TBoxArray.invert();

Used to invert the TBoxArray.

Note

  • by bonsai
  • Last Updated: 10 October 2014 by bonsai

Example:

tba.invert();

TBoxArray.toATPA

function TBoxArray.toATPA() : T2DPointArray;

Turns a TBoxArray into a T2DPointArray.

Note

  • by bonsai
  • Last Updated: 10 October 2014 by bonsai

Example:

atpa := tba.toATPA();

TBoxArray.toTPA

function TBoxArray.toTPA() : TPointArray;

Turns a TBoxArray into a TPointArray.

Note

  • by bonsai
  • Last Updated: 10 October 2014 by bonsai

Example:

atpa := tba.toTPA();

TBoxArray.copy

function TBoxArray.copy() : TBoxArray;

Copies a TBoxArray

Note

  • by bonsai
  • Last Updated: 10 October 2014 by bonsai

Example:

newTba := tba.copy();

TBoxArray.getBounds

function TBoxArray.getBounds(): TBox;

Returns the bounds of the TBoxArray.

Note

  • by Janilabo
  • Last Updated: 17 September 2013 by Janilabo

Example:

b := tba.getBounds();

TBoxArray.equals

function TBoxArray.equals() : boolean;

Compares two TBoxArrays

Note

  • by bonsai
  • Last Updated: 10 October 2014 by bonsai

Example:

if (tba.equals(otherTBA)) then ... ;

TBoxArray.offset

procedure TBoxArray.offset(const p: TPoint);

Offsets all boxes in the array by “P”

Note

  • by bonsai
  • Last Updated: 10 October 2014 by bonsai

Example:

tba.offset([110,68]);

TBoxArray.getMiddle

function TBoxArray.getMiddle(): TPoint;

Returns the center of the (bounds of the) box array

Note

  • by bonsai
  • Last Updated: 10 October 2014 by bonsai

Example:

midpoint := tba.getMiddle();

TBoxArray.setLimit

procedure TBoxArray.setLimit(const b: TBox);

Offsets all boxes in the array by “P”

Note

  • by bonsai
  • Last Updated: 10 October 2014 by bonsai

Example:

tba.setLimit(mainscreen.getBounds());

TBoxArray.expand

procedure TBoxArray.expand(const size: integer);

Increases (expands) the size of all boxes in the array by “size”.

Note

  • by bonsai
  • Last Updated: 10 October 2014 by bonsai

Example:

tba.expand(5);

TBoxArray.shrink

procedure TBoxArray.shrink(const size: integer);

Shrinks the size of all boxes in the array by ‘size’.

Note

  • by bonsai
  • Last Updated: 10 October 2014 by bonsai

Example:

tba.shrink(12);

TBoxArray.pixelShiftAverage

function TBoxArray.pixelShiftAverage(wait: integer = 200; max: integer = 810): TIntegerArray;

Measures the average pixel shift of each box over time

Note

  • by bonsai
  • Last Updated: 10 October 2014 by bonsai

Example:

tia := tba.pixelShiftAverage(150, 5000);

TBoxArray.pixelShift

function TBoxArray.pixelShift(time: integer = 200): TIntegerArray;

Measures the pixel shift of each box over a time period

Note

  • by bonsai
  • Last Updated: 10 October 2014 by bonsai

Example:

tia := tba.pixelShift(150);

TBoxArray.getColors

function TBoxArray.getColors(clearSame: boolean = true): TIntegerArray;

Returns an array of the colors found inside the TBoxArray. Will clear the same colors if clearSame is set to true.

Note

  • by bonsai
  • Last Updated: 10 October 2014 by bonsai

Example:

tia := tba.getColors();

TBoxArray.colorExists

function TBoxArray.colorExists(color: integer; tolerance: integer = 0): boolean;

Returns true if the color is found within the TBoxArray. Also includes a optional tolerance parameter.

Note

  • by bonsai
  • Last Updated: 10 October 2014 by bonsai

Example:

if (tba.colorExists(512290, 7)) then ... ;