Show:

annie.Rectangle Class

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

Available since 1.0.0

Methods

createFromPoints

(
  • rect
  • ary
)
annie.Rectangle public static

Defined in libs/Rectangle.js:146

Available since 1.0.0

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

Parameters:

Returns:

createFromRects

(
  • rect
  • arg
)
public static

Defined in libs/Rectangle.js:98

Available since 1.0.0

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

Parameters:

destroy

() Void public

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

Available since 2.0.0

销毁一个对象 销毁之前一定要做完其他善后工作,否则有可能会出错 特别注意不能在对象自身方法或事件里调用此方法。 比如,不要在显示对象自身的 annie.Event.ON_REMOVE_TO_STAGE 或者其他类似事件调用,一定会报错

Returns:

Void:

isPointIn

(
  • point
)
Boolean public

Defined in libs/Rectangle.js:86

Available since 1.0.0

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

Parameters:

Returns:

Rectangle

(
  • x
  • y
  • width
  • height
)

构造函数

Parameters:

testRectCross

(
  • r1
  • r2
)
Boolean public

Defined in libs/Rectangle.js:185

Available since 1.0.2

判读两个矩形是否相交

Parameters:

Returns:

Properties

height

Number public

Defined in libs/Rectangle.js:69

Available since 1.0.0

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

Default: 0

instanceId

Number public

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

Available since 1.0.0

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

Example:

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

instanceType

String public

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

Available since 1.0.3

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

width

Number public

Defined in libs/Rectangle.js:60

Available since 1.0.0

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

Default: 0

x

Number public

Defined in libs/Rectangle.js:42

Available since 1.0.0

矩形左上角的 x 坐标

Default: 0

y

Number public

Defined in libs/Rectangle.js:51

Available since 1.0.0

矩形左上角的 y 坐标

Default: 0