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

Available since 1.0.0

Methods

createFromPoints

createFromPoints
(
  • rect
  • ary
)
annie.Rectangle public static

Defined in libs/Rectangle.js:137

Available since 1.0.0

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

Parameters:

nametypeflagdescription
rect annie.Point
ary ..arg

Returns:

createFromRects

createFromRects
(
  • rect
  • arg
)
public static

Defined in libs/Rectangle.js:89

Available since 1.0.0

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

Parameters:

nametypeflagdescription
rect annie.Rectangle
arg ..arg

destroy

destroy () Void public

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

Available since 2.0.0

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

Returns:

Void:

isPointIn

isPointIn
(
  • point
)
Boolean public

Defined in libs/Rectangle.js:77

Available since 1.0.0

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

Parameters:

nametypeflagdescription
point annie.Point

Returns:

Boolean:

Rectangle

Rectangle
(
  • x
  • y
  • width
  • height
)

构造函数

Parameters:

nametypeflagdescription
x Number
y Number
width Number
height Number

testRectCross

testRectCross
(
  • r1
  • r2
)
Boolean public

Defined in libs/Rectangle.js:176

Available since 1.0.2

判读两个矩形是否相交

Parameters:

nametypeflagdescription
r1 Object
r2 Object

Returns:

Boolean:

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
Top