Gamalto

Fork me on GitHub

Object Rect Overview

Gamalto. Rect

new Gamalto.Rect(x, y, width, height)

Creates a rectangle shape.

Parameters
Name Type Description
x number

Horizontal position of the top left corner of the rectangle.

y number

Vertical position of the top left corner of the rectangle.

width number

Horizontal size of the rectangle.

height number

Vertical size of the rectangle.

Implements
Extends

Members

origin :Gamalto.IPoint

inherited

Gets of sets the origin of the shape.

Inherited From
Implements

tag :object

inherited

Utility property to exchange data between objects.

Inherited From

Methods

getIntersecting(r1, r2) Gamalto.Rect

static

Gets the intersecting rectangle if any.

Parameters
Name Type Description
r1 Gamalto.IBox

First rectangle to intersect.

r2 Gamalto.IBox

Second rectangle to intersect.

Returns
  • Intersecting rectangle or null.

intersect(r1, r2) boolean

static

Determines if two rectangles intersect.

Parameters
Name Type Description
r1 Gamalto.IBox

First rectangle to test.

r2 Gamalto.IBox

Second rectangle to test.

Returns
  • True if the two rectangles intersect.

clone() Gamalto.Rect

override

Creates a clone of the current object.

Overrides
Returns
  • Copy of the object.

containts(that) boolean

Determines if a rectangle is inscribed in the current rectangle.

Parameters
Name Type Description
that Gamalto.IBox

Rectangle to test.

Returns
  • True if the two rectangles intersect.

equals(that) boolean

Determines if an object is equal to the current object.

Parameters
Name Type Description
that Gamalto.IBox

Object to test.

Returns
  • True if the two objects are equal.

getIntersecting(that) Gamalto.Rect

Gets the intersecting rectangle if any.

Parameters
Name Type Description
that Gamalto.IBox

Rectangle to intersect.

Returns
  • Intersecting rectangle or null.

intersects(that) boolean

Determines if a rectangle intersects with the current rectangle.

Parameters
Name Type Description
that Gamalto.IBox

Rectangle to test.

Returns
  • True if the two rectangles intersect.

pointInShape(x, y) boolean

override

Determines if a point lies inside the shape.

Parameters
Name Type Description
x number

Horizontal position of the point to test.

y number

Vertical position of the point to test.

Overrides
Returns
  • True if the point lies inside the shape.

toBox() Gamalto.Box

override

Gets the bounding box of the shape.

Overrides
Returns
  • Bounding box of the shape.

toString() string

inherited abstract

Converts the object into a string.

Inherited From
Returns
  • string

translate(vec)

override

Translates the shape by the vector.

Parameters
Name Type Description
vec Gamalto.IPoint

Vector to use for the translation.

Overrides
Documentation generated by JSDoc 3.3.2 on Sun Sep 13 2015 20:13:31 GMT+0200 (CEST)