new IWPoint(x, y)
Creates a new point at the specified coordinate.
If
x
and y
are not specified (0, 0) is returned.
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | horizontal coordinate |
y |
Number | vertical coordinate |
Extends
Methods
-
add(other)
-
Returns a point whose value is (this + other).
Parameters:
Name Type Description other
IWPoint another a point Returns:
- Type
- IWPoint
-
clone()
-
Returns a new instance of this object.
- Overrides:
Returns:
- Type
- IWPoint
-
distanceFrom(other)
-
Returns the distance between this point and another one in pixels.
Parameters:
Name Type Description other
IWPoint another a point Returns:
- Type
- Number
-
equals(other)
-
Checks whether this point equals another one. Two points are equal when both have the same x and y values.
Parameters:
Name Type Description other
IWPoint another a point Returns:
- Type
- boolean
-
getX()
-
Returns the horizontal position of this point.
Returns:
- Type
- Number
-
getY()
-
Returns the vertical position of this point.
Returns:
- Type
- Number
-
setX(x)
-
Sets the horizontal position of this point.
Parameters:
Name Type Description x
Number new horizontal coordinate Returns:
- Type
- void
-
setY(y)
-
Sets the vertical position of this point.
Parameters:
Name Type Description y
Number new vertical coordinate Returns:
- Type
- void
-
substract(other)
-
Returns a point whose value is (this - other).
Parameters:
Name Type Description other
IWPoint another a point Returns:
- Type
- IWPoint
-
toString()
-
Returns a string representation of this point.
Returns:
- Type
- String