Cocos Creator API

1.4.x

Cocos Creator is a highly customizable game development tool that utilizes the power of cocos2d-x.

AffineTransform

Module: cc

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.

Methods

affineTransformMake
(
  • a
  • b
  • c
  • d
  • tx
  • ty
)
AffineTransform

Create a cc.AffineTransform object with all contents in the matrix.

name type description
a Number
b Number
c Number
d Number
tx Number
ty Number

returns:

affineTransformClone
(
  • t
)
AffineTransform

Clone a cc.AffineTransform object from the specified transform.

name type description
t AffineTransform

returns:

pointApplyAffineTransform
(
  • point
  • transOrY
  • t
)
Vec2

Apply the affine transformation on a point.

name type description
point Vec2 | Number

or x.

transOrY AffineTransform | Number

transform matrix or y.

t AffineTransform

transform matrix or y.

returns:

type: Vec2

sizeApplyAffineTransform
(
  • size
  • t
)
Size

Apply the affine transformation on a size.

name type description
size Size
t AffineTransform

returns:

type: Size

affineTransformMakeIdentity ( ) AffineTransform

Create a identity transformation matrix:
[ 1, 0, 0,
0, 1, 0 ]

returns:

rectApplyAffineTransform
(
  • rect
  • anAffineTransform
)
Rect