TBox

This file holds all types related to TBox.

The source for this file can be found here.

TBox.isPointInside

function TBox.isPointInside(const point: TPoint): boolean;

Returns true if the point is in the TBox.

Note

  • by Olly

Example:

result := box.isPointInside(point(250, 100));

TBox.getDimensions

procedure TBox.getDimensions(var w, h: integer);

Returns the width and the height of the box in vars. W and H.

Note

  • by Olly

Example:

var
  w, h: integer;
begin
  box.getDimensions(w, h);

TBox.getWidth

function TBox.getWidth(): integer;

Returns the width of the TBox.

Note

  • by Olly

Example:

w := box.getWidth();

TBox.getHeight

function TBox.getHeight(): integer;

Returns the height of the TBox.

Note

  • by Olly

Example:

h := box.getHeight();

TBox.getMiddle

function TBox.getMiddle(): TPoint;

Returns TPoint of the TBox’s middle.

Note

  • by Dgby714

Example:

pt := b.getMidPoint();

TBox.getColors

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

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

Note

  • by Coh3n

Example:

cols := b.getColors();

TBox.colorExists

function TBox.colorExists(color: integer; tolerance: integer = 0): Boolean;

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

Note

  • by Olly

Example:

result := b.colorExists(OUTLINE_BLACK);

TBox.dtmExists

function TBox.dtmExists(const dtm: integer): boolean;

Returns true if the dtm is found within the TBox.

Note

  • by Olly

Example:

result := b.dtmExists(thedtm);

TBox.bitmapExists

function TBox.bitmapExists(const bitmap, tolerance: integer): boolean;

Returns true if the bitmap is found within the TBox.

Note

  • by Olly

Example:

result := b.bitmapExists(aBitmap, 25);

TBox.createTPA

function TBox.createTPA: TPointArray;

Creates and returns a TPointArray of the TBox.

Note

  • by Olly

Example:

TPA := box.createTPA;

TBox.createTPAEdge

function TBox.createTPAEdge: TPointArray;

Creates and returns a TPointArray of the edge of the TBox.

Note

  • by Olly

Example:

tpa := myBox.createTPAEdge;

TBox.mouse

procedure TBox.mouse(const mouseAction: integer = MOUSE_MOVE);

Peforms the desired mouse action on the box (uses mouseBox).

Note

  • by Olly

Example:

box.mouse();

TBox.equals

function TBox.isVaild(compareBox: TBox): boolean;

Returns true if the TBox is equal to compareBox.

Note

  • by Coh3n

Example:

if b.equals(b2) then
  writeln('boxes are equal.);

TBox.isVaild

function TBox.isVaild(invaildBox: TBox = [-1, -1, -1, -1]): boolean;

Returns true if the TBox is vaild or not, an invaild box is considered by default (-1, -1, -1, -1), but can be changed (invaildBox).

Note

  • by Olly

Example:

if b.isVaild() then
  writeln('box is vaild.);

TBox.setBounds

procedure TBox.setBounds(const xs, ys, xe, ye: integer);

Sets the bounds of the TBox.

Note

  • by Olly

Example:

b.setBounds(50, 50, 250, 250);

TBox.normalize()

procedure TBox.normalize(b: TBox);

Makes sure the box is top-left to bottom-right

Note

  • by bonsai

Example:

someBox.normalize();

TBox.setLimit

procedure TBox.setLimit(b: TBox);

Limits the TBox to another TBox (b).

Note

  • by Olly
  • modified by bonsai 20140719

Example:

b.limit(intToBox(50, 50, 100, 100));

TBox.copy()

function TBox.copy(): TBox;

Results a copy of the TBox.

Note

  • by Olly

Example:

b := myBox.copy();

TBox.offset

procedure TBox.offset(const p: TPoint);

Offsets the TBox by “p”.

Note

  • by Olly

Example:

myBox.offset(point(10, 10));

TBox.edit

procedure TBox.edit(const x1_, y1_, x2_, y2_: integer);

Edits the TBox values.

Note

  • by Olly

Example:

myBox.edit(-10, -10, + 10, + 10);

TBox.combine

function TBox.combine(b: TBox): TBox;

Combines the TBox(self) and B and results the combined box into one.

Note

  • by Olly

Example:

newBox := box.combine(intToBox(50, 50, 100, 100));

TBox.split

function TBox.split(const width, height: integer): TBoxArray;

Splits the TBox into a TBoxArray by “width” and “height”.

Note

  • by Home

Example:

tba := myBox.split(25, 25);

TBox.getGaussPoint

function TBox.getGaussPoint: TPoint;

Returns a gauss point in the TBox. See gaussBox (tmp.simba) for more.

Note

  • by Olly

Example:

p := myBox.getGaussPoint();

TBox.getRandomPoint

function TBox.getRandomPoint: TPoint;

Returns a 100% random point in the TBox.

Note

  • by Olly

Example:

p := myBox.getRandomPoint();

TBox.getRandomPoint

function TBox.getRandomPoint(clearBoxes: TBoxArray): TPoint;

Will return a random point that is in the TBox, but is not in any of “clearBoxes”.

Note

  • by Olly

Example:

p := myBox.getRandomPoint(boxArr);

TBox.overlap

function TBox.overlap(b: TBox): boolean;

Returns true if the TBox is in any kind of contact with the TBox “b”.

Note

  • by Janilabo
  • Last Updated: 17 August 2013 by Olly

Example:

if b.overlap(box2) then
  writeln('boxes overlap');

TBox.hasEqualDimensions

function TBox.hasEqualDimensions(other: TBox): Boolean;

Returns true if the TBox has equal width & height, with TBox “other”.

Note

  • by Le Jingle(Fratello)

Example:

if someBox.hasEqualDimensions(anotherBox) then
  writeln('boxes have same width and height');

TBox.expand

procedure TBox.expand(const size: integer);

Increases (expands) the size of the box by “size”.

Note

  • by Olly
  • Last Updated: 02 September 2013 by Olly

Example:

box.expand(10);

TBox.shrink

procedure TBox.shrink(const size: integer);

Shrinks the size of the box by ‘size’.

Note

  • by Olly
  • Last Updated: 08 March 2014 by Olly

Example:

box.shrink(10);