Show:

annie.Matrix Class

Extends annie.AObject
Defined in: libs/Matrix.js:46
Module: annie

Available since 1.0.0

2维矩阵,不熟悉的朋友可以找相关书箱看看

Methods

clone

() annie.Matrix public

Defined in libs/Matrix.js:172

Available since 1.0.0

复制一个矩阵

Returns:

createBox

(
  • x
  • y
  • scaleX
  • scaleY
  • rotation
  • skewX
  • skewY
  • ax
  • ay
)
public

Defined in libs/Matrix.js:252

Available since 1.0.0

设置一个矩阵通过普通的显示对象的相关九大属性

Parameters:

destroy

() Void public

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

Available since 2.0.0

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

Returns:

Void:

identity

() public

Defined in libs/Matrix.js:199

Available since 1.0.0

将矩阵恢复成原始矩阵

invert

() Matrix public

Defined in libs/Matrix.js:210

Available since 1.0.0

反转一个矩阵

Returns:

Matrix:

isEqual

(
  • m1
  • m2
)
Boolean public static

Defined in libs/Matrix.js:301

Available since 1.0.0

判断两个矩阵是否相等

Parameters:

Returns:

Matrix

(
  • a
  • b
  • c
  • d
  • tx
  • ty
)
public

Defined in libs/Matrix.js:55

Available since 1.0.0

构造函数

Parameters:

prepend

(
  • mtx
)
public

Defined in libs/Matrix.js:138

Available since 1.0.0

矩阵相乘

Parameters:

rotate

(
  • angle
)
public

Defined in libs/Matrix.js:325

Available since 1.0.3

对矩阵应用旋转转换。

Parameters:

scale

(
  • sx
  • sy
)
public

Defined in libs/Matrix.js:342

Available since 1.0.3

对矩阵应用缩放转换。

Parameters:

  • sx Number

    用于沿 x 轴缩放对象的乘数。

  • sy Number

    用于沿 y 轴缩放对象的乘数。

setFrom

(
  • mtx
)
public

Defined in libs/Matrix.js:183

Available since 1.0.0

从一个矩阵里赋值给这个矩阵

Parameters:

transformPoint

(
  • x
  • y
  • 默认为空,如果不为null,则返回的是Point就是此对象,如果为null,则返回来的Point是新建的对象
)
annie.Point public

Defined in libs/Matrix.js:118

Available since 1.0.0

将一个点通过矩阵变换后的点

Parameters:

  • x Number
  • y Number
  • 默认为空,如果不为null,则返回的是Point就是此对象,如果为null,则返回来的Point是新建的对象 annie.Point

Returns:

translate

(
  • dx
  • dy
)
public

Defined in libs/Matrix.js:359

Available since 1.0.3

沿 x 和 y 轴平移矩阵,由 dx 和 dy 参数指定。

Parameters:

  • dx Number

    沿 x 轴向右移动的量(以像素为单位

  • dy Number

    沿 y 轴向右移动的量(以像素为单位

Properties

a

Number public

Defined in libs/Matrix.js:75

Available since 1.0.0

Default: 1

b

Number public

Defined in libs/Matrix.js:83

Available since 1.0.0

c

Number public

Defined in libs/Matrix.js:90

Available since 1.0.0

d

Number public

Defined in libs/Matrix.js:97

Available since 1.0.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类都有一个实例类型字符串,通过这个字符串,你能知道这个实例是从哪个类实例而来

tx

Number public

Defined in libs/Matrix.js:104

Available since 1.0.0

ty

Number public

Defined in libs/Matrix.js:111

Available since 1.0.0