Class: Pixel

Pixel

屏幕像素坐标类。

new Pixel()

Source:
View2D/BaseTypes/Pixel.js

Members


x :Number

x坐标。
Type:
  • Number
Source:
View2D/BaseTypes/Pixel.js

y :Number

y坐标。
Type:
  • Number
Source:
View2D/BaseTypes/Pixel.js

Methods


add(x, y)

{GeoGlobe.Pixel} 一个新像素,这个像素的x和y通过传入的值增加。
Parameters:
Name Type Description
x Integer x坐标。
y Integer y坐标。
Source:
View2D/BaseTypes/Pixel.js

clone()

返回这个像素对象的副本。
Source:
View2D/BaseTypes/Pixel.js
Returns:
克隆后的像素值。
Type
GeoGlobe.Pixel

distanceTo(px)

返回作为参数传递的像素点的距离。
Parameters:
Name Type Description
px GeoGlobe.Pixel 像素坐标
Source:
View2D/BaseTypes/Pixel.js
Returns:
将像素点作为参数传递到计算距离函数中。
Type
Float

equals()

确定一个像素是否等于另一个像素
Parameters:
Name Type Description
GeoGlobe.Pixelpx GeoGlobe.Pixel | Object 一个GeoGlobe像素 或者 带有x、y属性的对象。
Source:
View2D/BaseTypes/Pixel.js
Returns:
如果传入的PX为NULL,则返回false。
Type
Boolean

initialize(x, y)

创造一个示例化对象。
Parameters:
Name Type Description
x Number x坐标。
y Number y坐标。
Source:
View2D/BaseTypes/Pixel.js
Returns:
GeoGlobe.Pixel实例。

offset(px)

Parameters:
Name Type Description
px GeoGlobe.Pixel | Object 一个GeoGlobe像素 或者 带有x、y属性的对象。
Source:
View2D/BaseTypes/Pixel.js
Returns:
一个新像素
Type
GeoGlobe.Pixel

toString()

将此对象转换为字符串。
Source:
View2D/BaseTypes/Pixel.js
Returns:
像素的字符串表示. ex: "x=200.4,y=242.2"
Type
String