Show:

annie.Rectangle Class

Extends annie.AObject
Defined in: libs/Rectangle.js:11
Module: annie

Available since 1.0.0

Methods

createFromPoints

(
  • p1
  • ary
)
annie.Rectangle public static

Defined in libs/Rectangle.js:137

Available since 1.0.0

通过一系列点来生成一个矩形 返回包含所有给定的点的最小矩形

Parameters:

Returns:

createFromRects

(
  • rect
  • arg
)
public static

Defined in libs/Rectangle.js:89

Available since 1.0.0

将多个矩形合成为一个矩形,并将结果存到第一个矩形参数,并返回

Parameters:

createRectform2Point

(
  • rect
  • p1
  • p2
)
Void static

通过两个点来确定一个矩形

Parameters:

Returns:

Void:

destroy

() Void public

Inherited from annie.AObject: libs/EventDispatcher.js:55

Available since 2.0.0

销毁一个对象 销毁之前一定要做完其他善后工作,否则有可能会出错

Returns:

Void:

isPointIn

(
  • point
)
Boolean public

Defined in libs/Rectangle.js:77

Available since 1.0.0

判断一个点是否在矩形内包括边

Parameters:

Returns:

Rectangle

(
  • x
  • y
  • width
  • height
)

构造函数

Parameters:

testRectCross

(
  • r1
  • r2
)
Boolean public

Defined in libs/Rectangle.js:201

Available since 1.0.2

判读两个矩形是否相交

Parameters:

Returns:

Properties

height

Number public

Defined in libs/Rectangle.js:61

Available since 1.0.0

矩形的高度(以像素为单位)

Default: 0

instanceId

Number public

Inherited from annie.AObject: libs/EventDispatcher.js:23

Available since 1.0.0

每一个annie引擎对象都会有一个唯一的id码。

Example:

 //获取 annie引擎类对象唯一码
 console.log(this.instanceId);

instanceType

String public

Inherited from annie.AObject: libs/EventDispatcher.js:41

Available since 1.0.3

每一个annie类都有一个实例类型字符串,通过这个字符串,你能知道这个实例是从哪个类实例而来

width

Number public

Defined in libs/Rectangle.js:52

Available since 1.0.0

矩形的宽度(以像素为单位)

Default: 0

x

Number public

Defined in libs/Rectangle.js:34

Available since 1.0.0

矩形左上角的 x 坐标

Default: 0

y

Number public

Defined in libs/Rectangle.js:43

Available since 1.0.0

矩形左上角的 y 坐标

Default: 0