ALKMaps.Pixel

This class represents a screen coordinate, in x and y coordinates

Summary
ALKMaps.PixelThis class represents a screen coordinate, in x and y coordinates
Properties
x{Number} The x coordinate
y{Number} The y coordinate
Constructor
ALKMaps.PixelCreate a new ALKMaps.Pixel instance
Functions
toStringCast this object into a string
cloneReturn a clone of this pixel object
equalsDetermine whether one pixel is equivalent to another
distanceToReturns the distance to the pixel point passed in as a parameter.
add
offsetParameters px - {<ALKMaps.Pixel>|Object} An ALKMaps.Pixel or an object with a ‘x’ and ‘y’ properties.

Properties

x

{Number} The x coordinate

y

{Number} The y coordinate

Constructor

ALKMaps.Pixel

Create a new ALKMaps.Pixel instance

Parameters

x{Number} The x coordinate
y{Number} The y coordinate

Returns

An instance of ALKMaps.Pixel

Functions

toString

toString:function()

Cast this object into a string

Returns

{String} The string representation of Pixel. ex: “x=200.4,y=242.2”

clone

clone:function()

Return a clone of this pixel object

Returns

{ALKMaps.Pixel} A clone pixel

equals

equals:function(px)

Determine whether one pixel is equivalent to another

Parameters

px{<ALKMaps.Pixel>|Object} An ALKMaps.Pixel or an object with a ‘x’ and ‘y’ properties.

Returns

{Boolean} The point passed in as parameter is equal to this.  Note that if px passed in is null, returns false.

distanceTo

distanceTo:function(px)

Returns the distance to the pixel point passed in as a parameter.

Parameters

px{ALKMaps.Pixel}

Returns

{Float} The pixel point passed in as parameter to calculate the distance to.

add

add:function(x,
y)

Parameters

x{Integer}
y{Integer}

Returns

{ALKMaps.Pixel} A new Pixel with this pixel’s x&y augmented by the values passed in.

offset

offset:function(px)

Parameters px - {<ALKMaps.Pixel>|Object} An ALKMaps.Pixel or an object with a ‘x’ and ‘y’ properties.

Returns

{ALKMaps.Pixel} A new Pixel with this pixel’s x&y augmented by the x&y values of the pixel passed in.

toString:function()
Cast this object into a string
clone:function()
Return a clone of this pixel object
equals:function(px)
Determine whether one pixel is equivalent to another
distanceTo:function(px)
Returns the distance to the pixel point passed in as a parameter.
add:function(x,
y)
offset:function(px)
Parameters px - {<ALKMaps.Pixel>|Object} An ALKMaps.Pixel or an object with a ‘x’ and ‘y’ properties.
Create a new ALKMaps.Pixel instance
Close