Skip to main content

Location class

Provides an object that describes a coordinate. An object of this type is required as a parameter in some methods.

Location method

Syntax

let obj = new Location(location);

let obj = new Location(x, y);

Parameters

location

Type: LocationPlain

Another location object whose coordinate value is cloned to create this object.

x

Type: number

The horizontal coordinate of the point in pixels (from the left of the image).

y

Type: number

The vertical coordinate of the point in pixels (from the top of image).

Return value

Type: Location

x property

Syntax

obj.x = value;
value = obj.x;

Type: number

y property

Syntax

obj.y = value;
value = obj.y;

Type: number