创建一个新 Rectangle 对象,其左上角由 x 和 y 参数指定,并具有指定的 width 和 height 参数。
矩形左上角的 x 坐标。
矩形左上角的 y 坐标。
矩形的宽度(以像素为单位)。
矩形的高度(以像素为单位)。
矩形左上角的 x 坐标。
矩形左上角的 y 坐标。
矩形的宽度(以像素为单位)。
The height of the rectangle, in pixels.
StaticreleaseStaticcreate将 Rectangle 的成员设置为指定值
矩形左上角的 x 坐标。
矩形左上角的 y 坐标。
矩形的宽度(以像素为单位)。
矩形的高度(以像素为单位)。
如果在 toIntersect 参数中指定的 Rectangle 对象与此 Rectangle 对象相交,则返回交集区域作为 Rectangle 对象。如果矩形不相交, 则此方法返回一个空的 Rectangle 对象,其属性设置为 0。
要对照比较以查看其是否与此 Rectangle 对象相交的 Rectangle 对象。
等于交集区域的 Rectangle 对象。如果该矩形不相交,则此方法返回一个空的 Rectangle 对象;即,其 x、y、width 和 height 属性均设置为 0 的矩形。
确定在 toIntersect 参数中指定的对象是否与此 Rectangle 对象相交。此方法检查指定的 Rectangle 对象的 x、y、width 和 height 属性,以查看它是否与此 Rectangle 对象相交。
要与此 Rectangle 对象比较的 Rectangle 对象。
如果两个矩形相交,返回true,否则返回false
返回一个新的 Rectangle 对象,其 x、y、width 和 height 属性的值与原始 Rectangle 对象的对应值相同。
新的 Rectangle 对象,其 x、y、width 和 height 属性的值与原始 Rectangle 对象的对应值相同。
确定由此 Rectangle 对象定义的矩形区域内是否包含指定的点。 此方法与 Rectangle.contains() 方法类似,只不过它采用 Point 对象作为参数。
包含点对象
如果包含,返回true,否则返回false
确定此 Rectangle 对象内是否包含由 rect 参数指定的 Rectangle 对象。 如果一个 Rectangle 对象完全在另一个 Rectangle 的边界内,我们说第二个 Rectangle 包含第一个 Rectangle。
所检查的 Rectangle 对象
如果此 Rectangle 对象包含您指定的 Rectangle 对象,则返回 true 值,否则返回 false。
确定在 toCompare 参数中指定的对象是否等于此 Rectangle 对象。 此方法将某个对象的 x、y、width 和 height 属性与此 Rectangle 对象所对应的相同属性进行比较。
要与此 Rectangle 对象进行比较的矩形。
如果对象具有与此 Rectangle 对象完全相同的 x、y、width 和 height 属性值,则返回 true 值,否则返回 false。
增加 Rectangle 对象的大小。此方法与 Rectangle.inflate() 方法类似,只不过它采用 Point 对象作为参数。
The x property of this Point object is used to increase the horizontal dimension of the Rectangle object. The y property is used to increase the vertical dimension of the Rectangle object.
将 Point 对象用作参数来调整 Rectangle 对象的位置。此方法与 Rectangle.offset() 方法类似,只不过它采用 Point 对象作为参数。
要用于偏移此 Rectangle 对象的 Point 对象。
Rectangle 对象是按其位置(由它左上角的点 (x, y) 确定)以及宽度和高度定义的区域。
Rectangle 类的 x、y、width 和 height 属性相互独立;更改一个属性的值不会影响其他属性。 但是,right 和 bottom 属性与这四个属性是整体相关的。例如,如果更改 right 属性的值,则 width 属性的值将发生变化;如果更改 bottom 属性,则 height 属性的值将发生变化。
Version
Egret 2.4
Platform
Web
Include Example
egret/geom/Rectangle.ts
Language
zh_CN