Cocos Creator API

1.3.0

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

AffineTransform

: 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.

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

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

affineTransformClone
(
  • t
)
AffineTransform

Clone a cc.AffineTransform object from the specified transform.

pointApplyAffineTransform
(
  • point
  • transOrY
  • t
)
Vec2

Apply the affine transformation on a point.

point Vec2 | Number

or x.

transOrY AffineTransform | Number

transform matrix or y.

t AffineTransform

transform matrix or y.

:

: Vec2

sizeApplyAffineTransform
(
  • size
  • t
)
Size

Apply the affine transformation on a size.

:

: Size

affineTransformMakeIdentity ( ) AffineTransform

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

rectApplyAffineTransform
(
  • rect
  • anAffineTransform
)
Rect

Apply the affine transformation on a rect.

rect Rect
anAffineTransform AffineTransform

:

: Rect

obbApplyAffineTransform
(
  • rect
  • anAffineTransform
  • out_bl
  • out_tl
  • out_tr
  • out_br
)

Apply the affine transformation on a rect, and truns to an Oriented Bounding Box.

rect Rect
anAffineTransform AffineTransform
out_bl Vec2
out_tl Vec2
out_tr Vec2
out_br Vec2

affineTransformTranslate
(
  • t
  • tx
  • ty
)
AffineTransform

Create a new affine transformation with a base transformation matrix and a translation based on it.

t AffineTransform

The base affine transform object.

tx Number

The translation on x axis.

ty Number

The translation on y axis.

affineTransformScale
(
  • t
  • sx
  • sy
)
AffineTransform

Create a new affine transformation with a base transformation matrix and a scale based on it.

t AffineTransform

The base affine transform object.

sx Number

The scale on x axis.

sy Number

The scale on y axis.

affineTransformRotate
(
  • aTransform
  • anAngle
)
AffineTransform

Create a new affine transformation with a base transformation matrix and a rotation based on it.

aTransform AffineTransform

The base affine transform object.

anAngle Number

The angle to rotate.

affineTransformConcat
(
  • t1
  • t2
)
AffineTransform

Concatenate a transform matrix to another and return the result:
t' = t1 * t2

t1 AffineTransform

The first transform object.

t2 AffineTransform

The transform object to concatenate.

:

: AffineTransform

The result of concatenation.

affineTransformConcatIn
(
  • t1
  • t2
)
AffineTransform

Concatenate a transform matrix to another
The results are reflected in the first matrix.
t' = t1 * t2

t1 AffineTransform

The first transform object.

t2 AffineTransform

The transform object to concatenate.

:

: AffineTransform

The result of concatenation.

affineTransformEqualToTransform
(
  • t1
  • t2
)
Boolean

Return true if an affine transform equals to another, false otherwise.

:

affineTransformInvert
(
  • t
)
AffineTransform

Get the invert transform of an AffineTransform object.

:

: AffineTransform

The inverted transform object.

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index