AffineTransform 类型
cc.AffineTransform 类代表一个仿射变换矩阵。它基本上是由平移旋转,缩放转变所组成。
请不要直接使用它的构造,请使用 cc.affineTransformMake 函数代替。
索引
方法
affineTransformMake用在矩阵中的所有内容创建一个 cc.AffineTransform 对象。affineTransformClone克隆指定的 cc.AffineTransform 对象。pointApplyAffineTransform对一个点应用矩阵变换。sizeApplyAffineTransform应用 Size 到仿射变换矩阵上。affineTransformMakeIdentity单位矩阵:...rectApplyAffineTransform应用 Rect 到仿射变换矩阵上。obbApplyAffineTransform应用 Rect 到仿射变换矩阵上, 并转换为有向包围盒affineTransformTranslate基于一个基础矩阵加上一个平移操作来创建一个新的矩阵。affineTransformScale创建一个基础变换矩阵,并在此基础上进行了 Scale 仿射变换。affineTransformRotate创建一个基础变换矩阵,并在此基础上进行了 Rotation 仿射变换。affineTransformConcat拼接两个矩阵,并返回结果:...affineTransformConcatIn拼接两个矩阵,将结果保存到第一个矩阵。affineTransformEqualToTransform判断两个矩阵是否相等。affineTransformInvert求逆矩阵。affineTransformInvert求逆矩阵并存入用户传入的矩阵对象参数。
Details
方法
affineTransformMake
用在矩阵中的所有内容创建一个 cc.AffineTransform 对象。
| meta | description |
|---|---|
| 返回 | AffineTransform |
| 定义于 | cocos2d/core/value-types/CCAffineTransform.js:56 |
参数列表
affineTransformClone
克隆指定的 cc.AffineTransform 对象。
| meta | description |
|---|---|
| 返回 | AffineTransform |
| 定义于 | cocos2d/core/value-types/CCAffineTransform.js:72 |
参数列表
pointApplyAffineTransform
对一个点应用矩阵变换。
| meta | description |
|---|---|
| 返回 | Vec2 |
| 定义于 | cocos2d/core/value-types/CCAffineTransform.js:83 |
参数列表
pointVec2 | Number or x.transOrYAffineTransform | Number transform matrix or y.tAffineTransform transform matrix or y.
sizeApplyAffineTransform
应用 Size 到仿射变换矩阵上。
| meta | description |
|---|---|
| 返回 | Size |
| 定义于 | cocos2d/core/value-types/CCAffineTransform.js:125 |
参数列表
sizeSizetAffineTransform
affineTransformMakeIdentity
单位矩阵:
[ 1, 0, 0,
0, 1, 0 ]
| meta | description |
|---|---|
| 返回 | AffineTransform |
| 定义于 | cocos2d/core/value-types/CCAffineTransform.js:137 |
rectApplyAffineTransform
应用 Rect 到仿射变换矩阵上。
| meta | description |
|---|---|
| 返回 | Rect |
| 定义于 | cocos2d/core/value-types/CCAffineTransform.js:169 |
参数列表
rectRectanAffineTransformAffineTransform
obbApplyAffineTransform
应用 Rect 到仿射变换矩阵上, 并转换为有向包围盒
| meta | description |
|---|---|
| 定义于 | cocos2d/core/value-types/CCAffineTransform.js:224 |
参数列表
affineTransformTranslate
基于一个基础矩阵加上一个平移操作来创建一个新的矩阵。
| meta | description |
|---|---|
| 返回 | AffineTransform |
| 定义于 | cocos2d/core/value-types/CCAffineTransform.js:258 |
参数列表
tAffineTransform The base affine transform object.txNumber The translation on x axis.tyNumber The translation on y axis.
affineTransformScale
创建一个基础变换矩阵,并在此基础上进行了 Scale 仿射变换。
| meta | description |
|---|---|
| 返回 | AffineTransform |
| 定义于 | cocos2d/core/value-types/CCAffineTransform.js:278 |
参数列表
tAffineTransform The base affine transform object.sxNumber The scale on x axis.syNumber The scale on y axis.
affineTransformRotate
创建一个基础变换矩阵,并在此基础上进行了 Rotation 仿射变换。
| meta | description |
|---|---|
| 返回 | AffineTransform |
| 定义于 | cocos2d/core/value-types/CCAffineTransform.js:291 |
参数列表
aTransformAffineTransform The base affine transform object.anAngleNumber The angle to rotate.
affineTransformConcat
拼接两个矩阵,并返回结果:
t' = t1 * t2
| meta | description |
|---|---|
| 返回 | AffineTransform |
| 定义于 | cocos2d/core/value-types/CCAffineTransform.js:311 |
参数列表
t1AffineTransform The first transform object.t2AffineTransform The transform object to concatenate.
affineTransformConcatIn
拼接两个矩阵,将结果保存到第一个矩阵。
t' = t1 * t2
| meta | description |
|---|---|
| 返回 | AffineTransform |
| 定义于 | cocos2d/core/value-types/CCAffineTransform.js:332 |
参数列表
t1AffineTransform The first transform object.t2AffineTransform The transform object to concatenate.
affineTransformEqualToTransform
判断两个矩阵是否相等。
| meta | description |
|---|---|
| 返回 | Boolean |
| 定义于 | cocos2d/core/value-types/CCAffineTransform.js:356 |
参数列表
affineTransformInvert
求逆矩阵。
| meta | description |
|---|---|
| 返回 | AffineTransform |
| 定义于 | cocos2d/core/value-types/CCAffineTransform.js:368 |
参数列表
affineTransformInvert
求逆矩阵并存入用户传入的矩阵对象参数。
| meta | description |
|---|---|
| 定义于 | cocos2d/core/value-types/CCAffineTransform.js:394 |