AffineTransform
Class
cc.AffineTransform class represent an affine transform matrix. It's composed basically by translation, rotation, scale transformations.
Please do not use its constructor directly, use cc.affineTransformMake alias function instead.
Index
Methods
affineTransformMake
Create a cc.AffineTransform object with all contents in the matrix.affineTransformClone
Clone a cc.AffineTransform object from the specified transform.pointApplyAffineTransform
Apply the affine transformation on a point.sizeApplyAffineTransform
Apply the affine transformation on a size.affineTransformMakeIdentity
Create a identity transformation matrix: ...rectApplyAffineTransform
Apply the affine transformation on a rect.obbApplyAffineTransform
Apply the affine transformation on a rect, and truns to an Oriented Bounding Box.affineTransformTranslate
Create a new affine transformation with a base transformation matrix and a translation based on it.affineTransformScale
Create a new affine transformation with a base transformation matrix and a scale based on it.affineTransformRotate
Create a new affine transformation with a base transformation matrix and a rotation based on it.affineTransformConcat
Concatenate a transform matrix to another and return the result:...affineTransformConcatIn
Concatenate a transform matrix to another...affineTransformEqualToTransform
Return true if an affine transform equals to another, false otherwise.affineTransformInvert
Get the invert transform of an AffineTransform object.affineTransformInvert
Put the invert transform of an AffineTransform object into the out AffineTransform object.
Details
Methods
affineTransformMake
Create a cc.AffineTransform object with all contents in the matrix.
meta | description |
---|---|
Returns | AffineTransform |
Defined in | cocos2d/core/value-types/CCAffineTransform.js:56 |
Parameters
affineTransformClone
Clone a cc.AffineTransform object from the specified transform.
meta | description |
---|---|
Returns | AffineTransform |
Defined in | cocos2d/core/value-types/CCAffineTransform.js:72 |
Parameters
pointApplyAffineTransform
Apply the affine transformation on a point.
meta | description |
---|---|
Returns | Vec2 |
Defined in | cocos2d/core/value-types/CCAffineTransform.js:83 |
Parameters
point
Vec2 | Number or x.transOrY
AffineTransform | Number transform matrix or y.t
AffineTransform transform matrix or y.
sizeApplyAffineTransform
Apply the affine transformation on a size.
meta | description |
---|---|
Returns | Size |
Defined in | cocos2d/core/value-types/CCAffineTransform.js:125 |
Parameters
size
Sizet
AffineTransform
affineTransformMakeIdentity
Create a identity transformation matrix:
[ 1, 0, 0,
0, 1, 0 ]
meta | description |
---|---|
Returns | AffineTransform |
Defined in | cocos2d/core/value-types/CCAffineTransform.js:137 |
rectApplyAffineTransform
Apply the affine transformation on a rect.
meta | description |
---|---|
Returns | Rect |
Defined in | cocos2d/core/value-types/CCAffineTransform.js:169 |
Parameters
rect
RectanAffineTransform
AffineTransform
obbApplyAffineTransform
Apply the affine transformation on a rect, and truns to an Oriented Bounding Box.
meta | description |
---|---|
Defined in | cocos2d/core/value-types/CCAffineTransform.js:224 |
Parameters
affineTransformTranslate
Create a new affine transformation with a base transformation matrix and a translation based on it.
meta | description |
---|---|
Returns | AffineTransform |
Defined in | cocos2d/core/value-types/CCAffineTransform.js:258 |
Parameters
t
AffineTransform The base affine transform object.tx
Number The translation on x axis.ty
Number The translation on y axis.
affineTransformScale
Create a new affine transformation with a base transformation matrix and a scale based on it.
meta | description |
---|---|
Returns | AffineTransform |
Defined in | cocos2d/core/value-types/CCAffineTransform.js:278 |
Parameters
t
AffineTransform The base affine transform object.sx
Number The scale on x axis.sy
Number The scale on y axis.
affineTransformRotate
Create a new affine transformation with a base transformation matrix and a rotation based on it.
meta | description |
---|---|
Returns | AffineTransform |
Defined in | cocos2d/core/value-types/CCAffineTransform.js:291 |
Parameters
aTransform
AffineTransform The base affine transform object.anAngle
Number The angle to rotate.
affineTransformConcat
Concatenate a transform matrix to another and return the result:
t' = t1 * t2
meta | description |
---|---|
Returns | AffineTransform |
Defined in | cocos2d/core/value-types/CCAffineTransform.js:311 |
Parameters
t1
AffineTransform The first transform object.t2
AffineTransform The transform object to concatenate.
affineTransformConcatIn
Concatenate a transform matrix to another
The results are reflected in the first matrix.
t' = t1 * t2
meta | description |
---|---|
Returns | AffineTransform |
Defined in | cocos2d/core/value-types/CCAffineTransform.js:332 |
Parameters
t1
AffineTransform The first transform object.t2
AffineTransform The transform object to concatenate.
affineTransformEqualToTransform
Return true if an affine transform equals to another, false otherwise.
meta | description |
---|---|
Returns | Boolean |
Defined in | cocos2d/core/value-types/CCAffineTransform.js:356 |
Parameters
affineTransformInvert
Get the invert transform of an AffineTransform object.
meta | description |
---|---|
Returns | AffineTransform |
Defined in | cocos2d/core/value-types/CCAffineTransform.js:368 |
Parameters
affineTransformInvert
Put the invert transform of an AffineTransform object into the out AffineTransform object.
meta | description |
---|---|
Defined in | cocos2d/core/value-types/CCAffineTransform.js:394 |