cc Module

The main namespace of Cocos2d-JS, all engine core classes, functions, properties and constants are defined in this namespace.

Classes

Enums

Index

Properties
  • ENGINE_VERSION String The current version of Cocos2d being used....
  • easing Easing This is a Easing instance.
  • director Director Director
  • game Game This is a Game instance.
  • systemEvent SystemEvent The System event singleton for global usage
  • offset Number The offset of the range.
  • length Number The length of the range.
  • data BufferRange The data range of this bundle.
  • formats VertexFormat The attribute formats.
  • vertexBundleIndices [Number] The vertex bundle that the primitive use.
  • data BufferRange The data range of the primitive.
  • indexUnit Number The type of this primitive's indices.
  • topology Number The primitive's topology.
  • view View cc.view is the shared view object.
  • winSize Size cc.winSize is the alias object for the size of the current game window.
  • Integer string Specify that the input value must be integer in Inspector.
  • Float string Indicates that the elements in array should be type double.
  • Boolean string Indicates that the elements in array should be type boolean.
  • String string Indicates that the elements in array should be type string.
  • IDENTITY Mat3 Identity of Mat3
  • m Float64Array | Float32Array Matrix Data
  • EPSILON number
  • time Number Time between the start of the particle system and the trigger of this Brust
  • minCount Number Minimum number of emitted particles
  • maxCount Number Maximum number of emitted particles
  • repeatCount Number The number of times Burst was triggered.
  • repeatInterval Number Interval of each trigger
  • count CurveRange Number of particles emitted
  • enable Boolean The enable of ColorOvertimeModule.
  • mode Mode Curve type.
  • curve AnimationCurve The curve to use when mode is Curve.
  • curveMin AnimationCurve The lower limit of the curve to use when mode is TwoCurves
  • curveMax AnimationCurve The upper limit of the curve to use when mode is TwoCurves
  • constant Number When mode is Constant, the value of the curve.
  • constantMin Number The lower limit of the curve to use when mode is TwoConstants
  • constantMax Number The upper limit of the curve to use when mode is TwoConstants
  • multiplier Number Coefficients applied to curve interpolation.
  • enable Boolean The enable of ColorOvertimeModule.
  • space Space Coordinate system used in acceleration calculation.
  • x CurveRange X-axis acceleration component.
  • y CurveRange Y-axis acceleration component.
  • z CurveRange Z-axis acceleration component.
  • mode Mode Gradient type.
  • color Color The color when mode is Color.
  • colorMin Color Lower color limit when mode is TwoColors.
  • colorMax Color Upper color limit when mode is TwoColors.
  • gradient Gradient Color gradient when mode is Gradient
  • gradientMin Gradient Lower color gradient limit when mode is TwoGradients.
  • gradientMax Gradient Upper color gradient limit when mode is TwoGradients.
  • enable Boolean The enable of LimitVelocityOvertimeModule.
  • space Space The coordinate system used when calculating the lower speed limit.
  • separateAxes Boolean Whether to limit the three axes separately.
  • limit CurveRange Lower speed limit
  • limitX CurveRange Lower speed limit in X direction.
  • limitY CurveRange Lower speed limit in Y direction.
  • limitZ CurveRange Lower speed limit in Z direction.
  • dampen Number Interpolation of current speed and lower speed limit.
  • enable Boolean The enable of RotationOvertimeModule.
  • separateAxes Boolean Whether to set the rotation of three axes separately (not currently supported)
  • x CurveRange Set rotation around X axis.
  • y CurveRange Set rotation around Y axis.
  • z CurveRange Set rotation around Z axis.
  • enable Boolean The enable of SizeOvertimeModule.
  • separateAxes Boolean Decide whether to control particle size independently on each axis.
  • size CurveRange Define a curve to determine the size change of particles during their life cycle.
  • x CurveRange Defines a curve to determine the size change of particles in the X-axis direction during their life cycle.
  • y CurveRange Defines a curve to determine the size change of particles in the Y-axis direction during their life cycle.
  • z CurveRange Defines a curve to determine the size change of particles in the Z-axis direction during their life cycle.
  • enable Boolean The enable of VelocityOvertimeModule.
  • space Space Coordinate system used in speed calculation.
  • x CurveRange Velocity component in X axis direction
  • y CurveRange Velocity component in Y axis direction
  • z CurveRange Velocity component in Z axis direction
  • speedModifier CurveRange Speed correction factor (only supports CPU particles).
  • enable Boolean The enable of shapeModule.
  • shapeType ShapeType Particle emitter type.
  • emitFrom EmitLocation The emission site of the particle.
  • radius Number Particle emitter radius.
  • radiusThickness Number Particle emitter emission position (not valid for Box type emitters):...
  • angle Number The angle between the axis of the cone and the generatrix...
  • arc Number Particle emitters emit in a fan-shaped range.
  • arcMode ArcMode How particles are emitted in the sector range.
  • arcSpread Number Controls the discrete intervals around the arcs where particles might be generated.
  • arcSpeed CurveRange The speed at which particles are emitted around the circumference.
  • length Number Axis length from top of cone to bottom of cone .
  • boxThickness Vec3 Particle emitter emission location (for box-type particle emitters).
  • position Vec3 Particle Emitter Position
  • rotation Vec3 Particle emitter rotation angle.
  • scale Vec3 Particle emitter scaling
  • alignToDirection Boolean The direction of particle movement is determined based on the initial direction of the particles.
  • randomDirectionAmount Number Set particle generation direction randomly.
  • sphericalDirectionAmount Number Interpolation between the current emission direction and the direction from the current position to the center of the node.
  • enable Boolean The enable of trailModule.
  • mode TrailMode Sets how particles generate trajectories.
  • lifeTime CurveRange Life cycle of trajectory.
  • minParticleDistance Number Minimum spacing between each track particle
  • space Space The coordinate system of trajectories.
  • existWithParticles Boolean Whether the particle itself exists.
  • textureMode TextureMode Set the texture fill method
  • widthFromParticle Boolean Whether to use particle width
  • widthRatio CurveRange Curves that control track length
  • colorFromParticle Boolean Whether to use particle color
  • colorOverTrail GradientRange The color of trajectories.
  • colorOvertime GradientRange Trajectories color over time.
  • dynamicAtlasManager DynamicAtlasManager
  • matrix Array The matrix storage
Methods
  • speed or less (speed < 1) time.
  • follow Create a follow action which makes its target follows another node.
  • setPoints Points setter
  • cardinalSplineTo Creates an action with a Cardinal Spline array of points and tension.
  • updatePosition update position of target
  • cardinalSplineBy Creates an action with a Cardinal Spline array of points and tension.
  • catmullRomTo Creates an action with a Cardinal Spline array of points and tension.
  • catmullRomBy Creates an action with a Cardinal Spline array of points and tension.
  • easeIn Creates the action easing object with the rate parameter.
  • easeOut Creates the action easing object with the rate parameter.
  • easeInOut Creates the action easing object with the rate parameter.
  • easeExponentialIn Creates the action easing object with the rate parameter.
  • easeExponentialOut Creates the action easing object.
  • easeExponentialInOut Creates an EaseExponentialInOut action easing object.
  • easeSineIn Creates an EaseSineIn action.
  • easeSineOut Creates an EaseSineOut action easing object.
  • easeSineInOut Creates the action easing object.
  • easeElasticIn Creates the action easing object with the period in radians (default is 0.3).
  • easeElasticOut Creates the action easing object with the period in radians (default is 0.3).
  • easeElasticInOut Creates the action easing object with the period in radians (default is 0.3).
  • easeBounceIn Creates the action easing object.
  • easeBounceOut Creates the action easing object.
  • easeBounceInOut Creates the action easing object.
  • easeBackIn Creates the action easing object.
  • easeBackOut Creates the action easing object.
  • easeBackInOut Creates the action easing object.
  • easeBezierAction Creates the action easing object.
  • easeQuadraticActionIn Creates the action easing object.
  • easeQuadraticActionOut Creates the action easing object.
  • easeQuadraticActionInOut Creates the action easing object.
  • easeQuarticActionIn Creates the action easing object.
  • easeQuarticActionOut Creates the action easing object.
  • easeQuarticActionInOut Creates the action easing object.
  • easeQuinticActionIn Creates the action easing object.
  • easeQuinticActionOut Creates the action easing object.
  • easeQuinticActionInOut Creates the action easing object.
  • easeCircleActionIn Creates the action easing object.
  • easeCircleActionOut Creates the action easing object.
  • easeCircleActionInOut Creates the action easing object.
  • easeCubicActionIn Creates the action easing object.
  • easeCubicActionOut Creates the action easing object.
  • easeCubicActionInOut Creates the action easing object.
  • show Show the Node.
  • hide Hide the node.
  • toggleVisibility Toggles the visibility of a node.
  • removeSelf Create a RemoveSelf object with a flag indicate whether the target should be cleaned up while removing.
  • flipX Create a FlipX action to flip or unflip the target.
  • flipY Create a FlipY action to flip or unflip the target.
  • place Creates a Place action with a position.
  • callFunc Creates the action with the callback.
  • sequence Helper constructor to create an array of sequenceable actions
  • repeat Creates a Repeat action.
  • repeatForever Create a acton which repeat forever, as it runs forever, it can't be added into cc.sequence and cc.spawn.
  • spawn Create a spawn action which runs several actions in parallel.
  • rotateTo Rotates a Node object to a certain angle by modifying its angle property.
  • rotateBy Rotates a Node object clockwise a number of degrees by modifying its angle property.
  • moveBy Moves a Node object x,y pixels by modifying its position property.
  • moveTo Moves a Node object to the position x,y.
  • skewTo Create a action which skews a Node object to given angles by modifying its skewX and skewY properties.
  • skewBy Skews a Node object by skewX and skewY degrees.
  • jumpBy Moves a Node object simulating a parabolic jump movement by modifying it's position property.
  • jumpTo Moves a Node object to a parabolic position simulating a jump movement by modifying its position property.
  • bezierBy An action that moves the target with a cubic Bezier curve by a certain distance.
  • bezierTo An action that moves the target with a cubic Bezier curve to a destination point.
  • scaleTo Scales a Node object to a zoom factor by modifying it's scale property.
  • scaleBy Scales a Node object a zoom factor by modifying it's scale property.
  • blink Blinks a Node object by modifying it's visible property.
  • fadeTo Fades an object that implements the cc.RGBAProtocol protocol.
  • fadeIn Fades In an object that implements the cc.RGBAProtocol protocol.
  • fadeOut Fades Out an object that implements the cc.RGBAProtocol protocol.
  • tintTo Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one.
  • tintBy Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one.
  • delayTime Delays the action a certain amount of seconds.
  • reverseTime Executes an action in reverse order, from time=duration to time=0.
  • targetedAction Create an action with the specified action and forced target.
  • tween
  • error Outputs an error message to the Cocos Creator Console (editor) or Web Console (runtime)....
  • warn Outputs a warning message to the Cocos Creator Console (editor) or Web Console (runtime).
  • log Outputs a message to the Cocos Creator Console (editor) or Web Console (runtime).
  • rotate3DTo Rotates a Node object to a certain angle by modifying its quternion property.
  • rotate3DBy Rotates a Node object counter clockwise a number of degrees by modifying its quaternion property.
  • point_plane the distance between a point and a plane
  • pt_point_plane the closest point on plane to a given point
  • pt_point_aabb the closest point on aabb to a given point
  • pt_point_obb the closest point on obb to a given point
  • ray_cast Check whether ray intersect with nodes
  • ray_plane ray-plane intersect
  • line_plane line-plane intersect
  • ray_triangle ray-triangle intersect
  • line_triangle line-triangle intersect
  • line_quad line-quad intersect
  • ray_sphere ray-sphere intersect
  • ray_aabb ray-aabb intersect
  • ray_obb ray-obb intersect
  • aabb_aabb aabb-aabb intersect
  • aabb_obb aabb-obb intersect
  • aabb_plane aabb-plane intersect
  • aabb_frustum aabb-frustum intersect, faster but has false positive corner cases
  • aabb_frustum_accurate aabb-frustum intersect, handles most of the false positives correctly
  • obb_point obb-point intersect
  • obb_plane obb-plane intersect
  • obb_frustum obb-frustum intersect, faster but has false positive corner cases
  • obb_frustum_accurate obb-frustum intersect, handles most of the false positives correctly
  • obb_obb obb-obb intersect
  • sphere_plane phere-plane intersect, not necessarily faster than obb-plane...
  • sphere_frustum sphere-frustum intersect, faster but has false positive corner cases
  • sphere_frustum_accurate sphere-frustum intersect, handles the false positives correctly
  • sphere_sphere sphere-sphere intersect
  • sphere_aabb sphere-aabb intersect
  • sphere_obb sphere-obb intersect
  • resolve The intersection detection of g1 and g2 can fill in the shape in the basic geometry.
  • Class Defines a CCClass using the given specification, please see Class for details.
  • _isCCClass Checks whether the constructor is created by cc.Class
  • Enum Define an enum type.
  • getList
  • handleTouchesBegin
  • handleTouchesMove
  • handleTouchesEnd
  • handleTouchesCancel
  • getSetOfTouchesEndOrCancel
  • getPreTouch
  • setPreTouch
  • getTouchByXY
  • getMouseEvent
  • getPointByEvent
  • getTouchesByEvent
  • registerSystemEvent
  • update
  • isValid When an object's destroy is called, it is actually destroyed after the end of this frame.
  • deserialize Deserialize json to cc.Asset
  • instantiate Clones the object original and returns the clone, or instantiate a node from the Prefab.
  • find Finds a node by hierarchy path, the path is case-sensitive.
  • color Alpha channel is optional.
  • toArray Matrix transpose array
  • fromArray Transfer matrix array
  • constructor Creates a matrix, with elements specified separately.
  • mat4 The convenience method to create a new cc.Mat4.
  • quat The convenience method to create a new cc.Quat.
  • rect The convenience method to create a new Rect.
  • size Helper function that creates a cc.Size....
  • clamp Clamps a value between a minimum float and maximum float value.
  • clamp01 Clamps a value between 0 and 1.
  • lerp
  • random
  • randomRange Returns a floating-point random number between min (inclusive) and max (exclusive).
  • randomRangeInt Returns a random integer between min (inclusive) and max (exclusive).
  • pseudoRandom Linear congruential generator using Hull-Dobell Theorem.
  • pseudoRandomRange Returns a floating-point pseudo-random number between min (inclusive) and max (exclusive).
  • pseudoRandomRangeInt Returns a pseudo-random integer between min (inclusive) and max (exclusive).
  • nextPow2 Returns the next power of two for the value
  • repeat Returns float remainder for t / length
  • repeat Returns time wrapped in ping-pong mode
  • repeat Returns ratio of a value within a given range
  • sign Returns -1, 0, +1 depending on sign of x.
  • v2 The convenience method to create a new cc.Vec2.
  • v3 The convenience method to create a new cc.Vec3.
  • get Get an element
  • set Set an element
  • reset Sets all elements to zero

Details

Properties

ENGINE_VERSION

The current version of Cocos2d being used.
Please DO NOT remove this String, it is an important flag for bug tracking.
If you post a bug to forum, please attach this flag.

meta description
Type String
Defined in predefine.js:211
easing

This is a Easing instance.

meta description
Type Easing
Defined in cocos2d/animation/easing.js:534
director

Director

meta description
Type Director
Defined in cocos2d/core/CCDirector.js:1224
game

This is a Game instance.

meta description
Type Game
Defined in cocos2d/core/CCGame.js:903
systemEvent

The System event singleton for global usage

meta description
Type SystemEvent
Defined in cocos2d/core/event/system-event.js:200
offset

The offset of the range.

meta description
Type Number
Defined in cocos2d/core/mesh/mesh-data.js:38
length

The length of the range.

meta description
Type Number
Defined in cocos2d/core/mesh/mesh-data.js:43
data

The data range of this bundle. This range of data is essentially mapped to a GPU vertex buffer.

meta description
Type BufferRange
Defined in cocos2d/core/mesh/mesh-data.js:70
formats

The attribute formats.

meta description
Type VertexFormat
Defined in cocos2d/core/mesh/mesh-data.js:79
vertexBundleIndices

The vertex bundle that the primitive use.

meta description
Type [Number]
Defined in cocos2d/core/mesh/mesh-data.js:101
data

The data range of the primitive. This range of data is essentially mapped to a GPU indices buffer.

meta description
Type BufferRange
Defined in cocos2d/core/mesh/mesh-data.js:109
indexUnit

The type of this primitive's indices.

meta description
Type Number
Defined in cocos2d/core/mesh/mesh-data.js:118
topology

The primitive's topology.

meta description
Type Number
Defined in cocos2d/core/mesh/mesh-data.js:123
view

cc.view is the shared view object.

meta description
Type View
Defined in cocos2d/core/platform/CCView.js:1547
winSize

cc.winSize is the alias object for the size of the current game window.

meta description
Type Size
Defined in cocos2d/core/platform/CCView.js:1556
Integer

Specify that the input value must be integer in Inspector. Also used to indicates that the elements in array should be type integer.

meta description
Type string
Defined in cocos2d/core/platform/attribute.js:120
Examples
// in cc.Class
member: {
    default: [],
    type: cc.Integer
}
// ES6 ccclass
Float

Indicates that the elements in array should be type double.

meta description
Type string
Defined in cocos2d/core/platform/attribute.js:139
Examples
// in cc.Class
member: {
    default: [],
    type: cc.Float
}
// ES6 ccclass
Boolean

Indicates that the elements in array should be type boolean.

meta description
Type string
Defined in cocos2d/core/platform/attribute.js:164
Examples
// in cc.Class
member: {
    default: [],
    type: cc.Boolean
}
// ES6 ccclass
String

Indicates that the elements in array should be type string.

meta description
Type string
Defined in cocos2d/core/platform/attribute.js:182
Examples
// in cc.Class
member: {
    default: [],
    type: cc.String
}
// ES6 ccclass
IDENTITY

Identity of Mat3

meta description
Type Mat3
Defined in cocos2d/core/value-types/mat3.ts:41
m

Matrix Data

meta description
Type Float64Array | Float32Array
Defined in cocos2d/core/value-types/mat3.ts:832
EPSILON
meta description
Type number
Defined in cocos2d/core/value-types/utils.ts:13
time

Time between the start of the particle system and the trigger of this Brust

meta description
Type Number
Defined in cocos2d/core/3d/particle/burst.ts:14
minCount

Minimum number of emitted particles

meta description
Type Number
Defined in cocos2d/core/3d/particle/burst.ts:29
maxCount

Maximum number of emitted particles

meta description
Type Number
Defined in cocos2d/core/3d/particle/burst.ts:37
repeatCount

The number of times Burst was triggered.

meta description
Type Number
Defined in cocos2d/core/3d/particle/burst.ts:48
repeatInterval

Interval of each trigger

meta description
Type Number
Defined in cocos2d/core/3d/particle/burst.ts:63
count

Number of particles emitted

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/burst.ts:71
enable

The enable of ColorOvertimeModule.

meta description
Type Boolean
Defined in cocos2d/core/3d/particle/animator/color-overtime.ts:13
mode

Curve type.

meta description
Type Mode
Defined in cocos2d/core/3d/particle/animator/curve-range.ts:20
curve

The curve to use when mode is Curve.

meta description
Type AnimationCurve
Defined in cocos2d/core/3d/particle/animator/curve-range.ts:30
curveMin

The lower limit of the curve to use when mode is TwoCurves

meta description
Type AnimationCurve
Defined in cocos2d/core/3d/particle/animator/curve-range.ts:40
curveMax

The upper limit of the curve to use when mode is TwoCurves

meta description
Type AnimationCurve
Defined in cocos2d/core/3d/particle/animator/curve-range.ts:50
constant

When mode is Constant, the value of the curve.

meta description
Type Number
Defined in cocos2d/core/3d/particle/animator/curve-range.ts:60
constantMin

The lower limit of the curve to use when mode is TwoConstants

meta description
Type Number
Defined in cocos2d/core/3d/particle/animator/curve-range.ts:68
constantMax

The upper limit of the curve to use when mode is TwoConstants

meta description
Type Number
Defined in cocos2d/core/3d/particle/animator/curve-range.ts:77
multiplier

Coefficients applied to curve interpolation.

meta description
Type Number
Defined in cocos2d/core/3d/particle/animator/curve-range.ts:85
enable

The enable of ColorOvertimeModule.

meta description
Type Boolean
Defined in cocos2d/core/3d/particle/animator/force-overtime.ts:18
space

Coordinate system used in acceleration calculation.

meta description
Type Space
Defined in cocos2d/core/3d/particle/animator/force-overtime.ts:26
x

X-axis acceleration component.

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/force-overtime.ts:36
y

Y-axis acceleration component.

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/force-overtime.ts:47
z

Z-axis acceleration component.

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/force-overtime.ts:58
mode

Gradient type.

meta description
Type Mode
Defined in cocos2d/core/3d/particle/animator/gradient-range.ts:33
color

The color when mode is Color.

meta description
Type Color
Defined in cocos2d/core/3d/particle/animator/gradient-range.ts:61
colorMin

Lower color limit when mode is TwoColors.

meta description
Type Color
Defined in cocos2d/core/3d/particle/animator/gradient-range.ts:69
colorMax

Upper color limit when mode is TwoColors.

meta description
Type Color
Defined in cocos2d/core/3d/particle/animator/gradient-range.ts:77
gradient

Color gradient when mode is Gradient

meta description
Type Gradient
Defined in cocos2d/core/3d/particle/animator/gradient-range.ts:85
gradientMin

Lower color gradient limit when mode is TwoGradients.

meta description
Type Gradient
Defined in cocos2d/core/3d/particle/animator/gradient-range.ts:95
gradientMax

Upper color gradient limit when mode is TwoGradients.

meta description
Type Gradient
Defined in cocos2d/core/3d/particle/animator/gradient-range.ts:105
enable

The enable of LimitVelocityOvertimeModule.

meta description
Type Boolean
Defined in cocos2d/core/3d/particle/animator/limit-velocity-overtime.ts:26
space

The coordinate system used when calculating the lower speed limit.

meta description
Type Space
Defined in cocos2d/core/3d/particle/animator/limit-velocity-overtime.ts:34
separateAxes

Whether to limit the three axes separately.

meta description
Type Boolean
Defined in cocos2d/core/3d/particle/animator/limit-velocity-overtime.ts:44
limit

Lower speed limit

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/limit-velocity-overtime.ts:52
limitX

Lower speed limit in X direction.

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/limit-velocity-overtime.ts:63
limitY

Lower speed limit in Y direction.

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/limit-velocity-overtime.ts:74
limitZ

Lower speed limit in Z direction.

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/limit-velocity-overtime.ts:85
dampen

Interpolation of current speed and lower speed limit.

meta description
Type Number
Defined in cocos2d/core/3d/particle/animator/limit-velocity-overtime.ts:96
enable

The enable of RotationOvertimeModule.

meta description
Type Boolean
Defined in cocos2d/core/3d/particle/animator/rotation-overtime.ts:14
separateAxes

Whether to set the rotation of three axes separately (not currently supported)

meta description
Type Boolean
Defined in cocos2d/core/3d/particle/animator/rotation-overtime.ts:25
x

Set rotation around X axis.

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/rotation-overtime.ts:44
y

Set rotation around Y axis.

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/rotation-overtime.ts:56
z

Set rotation around Z axis.

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/rotation-overtime.ts:68
enable

The enable of SizeOvertimeModule.

meta description
Type Boolean
Defined in cocos2d/core/3d/particle/animator/size-overtime.ts:14
separateAxes

Decide whether to control particle size independently on each axis.

meta description
Type Boolean
Defined in cocos2d/core/3d/particle/animator/size-overtime.ts:22
size

Define a curve to determine the size change of particles during their life cycle.

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/size-overtime.ts:30
x

Defines a curve to determine the size change of particles in the X-axis direction during their life cycle.

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/size-overtime.ts:40
y

Defines a curve to determine the size change of particles in the Y-axis direction during their life cycle.

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/size-overtime.ts:50
z

Defines a curve to determine the size change of particles in the Z-axis direction during their life cycle.

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/size-overtime.ts:60
enable

The enable of VelocityOvertimeModule.

meta description
Type Boolean
Defined in cocos2d/core/3d/particle/animator/velocity-overtime.ts:18
space

Coordinate system used in speed calculation.

meta description
Type Space
Defined in cocos2d/core/3d/particle/animator/velocity-overtime.ts:26
x

Velocity component in X axis direction

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/velocity-overtime.ts:36
y

Velocity component in Y axis direction

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/velocity-overtime.ts:47
z

Velocity component in Z axis direction

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/velocity-overtime.ts:58
speedModifier

Speed correction factor (only supports CPU particles).

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/animator/velocity-overtime.ts:69
enable

The enable of shapeModule.

meta description
Type Boolean
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:18
shapeType

Particle emitter type.

meta description
Type ShapeType
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:29
emitFrom

The emission site of the particle.

meta description
Type EmitLocation
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:63
radius

Particle emitter radius.

meta description
Type Number
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:73
radiusThickness

Particle emitter emission position (not valid for Box type emitters):

  • 0 means emitted from the surface;
  • 1 means launch from the center;
  • 0 ~ 1 indicates emission from the center to the surface.
meta description
Type Number
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:81
angle

The angle between the axis of the cone and the generatrix Determines the opening and closing of the cone launcher

meta description
Type Number
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:98
arc

Particle emitters emit in a fan-shaped range.

meta description
Type Number
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:117
arcMode

How particles are emitted in the sector range.

meta description
Type ArcMode
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:131
arcSpread

Controls the discrete intervals around the arcs where particles might be generated.

meta description
Type Number
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:141
arcSpeed

The speed at which particles are emitted around the circumference.

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:149
length

Axis length from top of cone to bottom of cone . Determines the height of the cone emitter.

meta description
Type Number
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:159
boxThickness

Particle emitter emission location (for box-type particle emitters).

meta description
Type Vec3
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:169
position

Particle Emitter Position

meta description
Type Vec3
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:180
rotation

Particle emitter rotation angle.

meta description
Type Vec3
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:197
scale

Particle emitter scaling

meta description
Type Vec3
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:214
alignToDirection

The direction of particle movement is determined based on the initial direction of the particles.

meta description
Type Boolean
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:228
randomDirectionAmount

Set particle generation direction randomly.

meta description
Type Number
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:236
sphericalDirectionAmount

Interpolation between the current emission direction and the direction from the current position to the center of the node.

meta description
Type Number
Defined in cocos2d/core/3d/particle/emitter/shape-module.ts:244
enable

The enable of trailModule.

meta description
Type Boolean
Defined in cocos2d/core/3d/particle/renderer/trail.ts:129
mode

Sets how particles generate trajectories.

meta description
Type TrailMode
Defined in cocos2d/core/3d/particle/renderer/trail.ts:153
lifeTime

Life cycle of trajectory.

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/renderer/trail.ts:163
minParticleDistance

Minimum spacing between each track particle

meta description
Type Number
Defined in cocos2d/core/3d/particle/renderer/trail.ts:176
space

The coordinate system of trajectories.

meta description
Type Space
Defined in cocos2d/core/3d/particle/renderer/trail.ts:194
existWithParticles

Whether the particle itself exists.

meta description
Type Boolean
Defined in cocos2d/core/3d/particle/renderer/trail.ts:213
textureMode

Set the texture fill method

meta description
Type TextureMode
Defined in cocos2d/core/3d/particle/renderer/trail.ts:221
widthFromParticle

Whether to use particle width

meta description
Type Boolean
Defined in cocos2d/core/3d/particle/renderer/trail.ts:231
widthRatio

Curves that control track length

meta description
Type CurveRange
Defined in cocos2d/core/3d/particle/renderer/trail.ts:240
colorFromParticle

Whether to use particle color

meta description
Type Boolean
Defined in cocos2d/core/3d/particle/renderer/trail.ts:250
colorOverTrail

The color of trajectories.

meta description
Type GradientRange
Defined in cocos2d/core/3d/particle/renderer/trail.ts:258
colorOvertime

Trajectories color over time.

meta description
Type GradientRange
Defined in cocos2d/core/3d/particle/renderer/trail.ts:268
dynamicAtlasManager
meta description
Type DynamicAtlasManager
Defined in cocos2d/core/renderer/utils/dynamic-atlas/manager.js:254
matrix

The matrix storage

meta description
Type Array
Defined in cocos2d/core/3d/physics/cocos/utils/array-collision-matrix.ts:34

Methods

speed

Creates the speed action which changes the speed of an action, making it take longer (speed > 1) or less (speed < 1) time.
Useful to simulate 'slow motion' or 'fast forward' effect.

meta description
Returns Action
Defined in cocos2d/actions/CCAction.js:372
Parameters
Examples
// change the target action speed;
var action = cc.scaleTo(0.2, 1, 0.6);
var newAction = cc.speed(action, 0.5);
follow

Create a follow action which makes its target follows another node.

meta description
Returns Action | Null
Defined in cocos2d/actions/CCAction.js:556
Parameters
Examples
// example
// creates the action with a set boundary
var followAction = cc.follow(targetNode, cc.rect(0, 0, screenWidth * 2 - 100, screenHeight));
node.runAction(followAction);

// creates the action with no boundary set
var followAction = cc.follow(targetNode);
node.runAction(followAction);
setPoints

Points setter

meta description
Defined in cocos2d/actions/CCActionCatmullRom.js:226
Parameters
cardinalSplineTo

Creates an action with a Cardinal Spline array of points and tension.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionCatmullRom.js:236
Parameters
Examples
//create a cc.CardinalSplineTo
var action1 = cc.cardinalSplineTo(3, array, 0);
updatePosition

update position of target

meta description
Defined in cocos2d/actions/CCActionCatmullRom.js:319
Parameters
cardinalSplineBy

Creates an action with a Cardinal Spline array of points and tension.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionCatmullRom.js:340
Parameters
catmullRomTo

Creates an action with a Cardinal Spline array of points and tension.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionCatmullRom.js:388
Parameters
Examples
var action1 = cc.catmullRomTo(3, array);
catmullRomBy

Creates an action with a Cardinal Spline array of points and tension.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionCatmullRom.js:437
Parameters
Examples
var action1 = cc.catmullRomBy(3, array);
easeIn

Creates the action easing object with the rate parameter.
From slow to fast.

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:35
Parameters
Examples
action.easing(cc.easeIn(3.0));
easeOut

Creates the action easing object with the rate parameter.
From fast to slow.

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:58
Parameters
Examples
action.easing(cc.easeOut(3.0));
easeInOut

Creates the action easing object with the rate parameter.
Slow to fast then to slow.

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:81
Parameters
Examples
action.easing(cc.easeInOut(3.0));
easeExponentialIn

Creates the action easing object with the rate parameter.
Reference easeInExpo:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:109
Examples
action.easing(cc.easeExponentialIn());
easeExponentialOut

Creates the action easing object.
Reference easeOutExpo:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:135
Examples
action.easing(cc.easeExponentialOut());
easeExponentialInOut

Creates an EaseExponentialInOut action easing object.
Reference easeInOutExpo:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:161
Examples
action.easing(cc.easeExponentialInOut());
easeSineIn

Creates an EaseSineIn action.
Reference easeInSine:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:194
Examples
action.easing(cc.easeSineIn());
easeSineOut

Creates an EaseSineOut action easing object.
Reference easeOutSine:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:220
Examples
action.easing(cc.easeSineOut());
easeSineInOut

Creates the action easing object.
Reference easeInOutSine:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:246
Examples
action.easing(cc.easeSineInOut());
easeElasticIn

Creates the action easing object with the period in radians (default is 0.3).
Reference easeInElastic:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:276
Parameters
Examples
// example
action.easing(cc.easeElasticIn(3.0));
easeElasticOut

Creates the action easing object with the period in radians (default is 0.3).
Reference easeOutElastic:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:322
Parameters
Examples
// example
action.easing(cc.easeElasticOut(3.0));
easeElasticInOut

Creates the action easing object with the period in radians (default is 0.3).
Reference easeInOutElastic:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:362
Parameters
Examples
// example
action.easing(cc.easeElasticInOut(3.0));
easeBounceIn

Creates the action easing object.
Eased bounce effect at the beginning.

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:434
Examples
// example
action.easing(cc.easeBounceIn());
easeBounceOut

Creates the action easing object.
Eased bounce effect at the ending.

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:451
Examples
// example
action.easing(cc.easeBounceOut());
easeBounceInOut

Creates the action easing object.
Eased bounce effect at the begining and ending.

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:476
Examples
// example
action.easing(cc.easeBounceInOut());
easeBackIn

Creates the action easing object.
In the opposite direction to move slowly, and then accelerated to the right direction.

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:508
Examples
// example
action.easing(cc.easeBackIn());
easeBackOut

Creates the action easing object.
Fast moving more than the finish, and then slowly back to the finish.

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:534
Examples
// example
action.easing(cc.easeBackOut());
easeBackInOut

Creates the action easing object.
Begining of cc.EaseBackIn. Ending of cc.EaseBackOut.

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:561
Examples
// example
action.easing(cc.easeBackInOut());
easeBezierAction

Creates the action easing object.
Into the 4 reference point.
To calculate the motion curve.

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:592
Parameters
  • p0 Number The first bezier parameter
  • p1 Number The second bezier parameter
  • p2 Number The third bezier parameter
  • p3 Number The fourth bezier parameter
Examples
// example
action.easing(cc.easeBezierAction(0.5, 0.5, 1.0, 1.0));
easeQuadraticActionIn

Creates the action easing object.
Reference easeInQuad:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:621
Examples
//example
action.easing(cc.easeQuadraticActionIn());
easeQuadraticActionOut

Creates the action easing object.
Reference easeOutQuad:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:648
Examples
//example
action.easing(cc.easeQuadraticActionOut());
easeQuadraticActionInOut

Creates the action easing object.
Reference easeInOutQuad:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:675
Examples
//example
action.easing(cc.easeQuadraticActionInOut());
easeQuarticActionIn

Creates the action easing object.
Reference easeIntQuart:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:710
Examples
//example
action.easing(cc.easeQuarticActionIn());
easeQuarticActionOut

Creates the action easing object.
Reference easeOutQuart:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:737
Examples
//example
action.easing(cc.QuarticActionOut());
easeQuarticActionInOut

Creates the action easing object.
Reference easeInOutQuart:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:765
easeQuinticActionIn

Creates the action easing object.
Reference easeInQuint:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:793
Examples
//example
action.easing(cc.easeQuinticActionIn());
easeQuinticActionOut

Creates the action easing object.
Reference easeOutQuint:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:820
Examples
//example
action.easing(cc.easeQuadraticActionOut());
easeQuinticActionInOut

Creates the action easing object.
Reference easeInOutQuint:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:848
Examples
//example
action.easing(cc.easeQuinticActionInOut());
easeCircleActionIn

Creates the action easing object.
Reference easeInCirc:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:879
Examples
//example
action.easing(cc.easeCircleActionIn());
easeCircleActionOut

Creates the action easing object.
Reference easeOutCirc:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:906
Examples
//example
actioneasing(cc.easeCircleActionOut());
easeCircleActionInOut

Creates the action easing object.
Reference easeInOutCirc:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:934
Examples
//example
action.easing(cc.easeCircleActionInOut());
easeCubicActionIn

Creates the action easing object.
Reference easeInCubic:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:965
Examples
//example
action.easing(cc.easeCubicActionIn());
easeCubicActionOut

Creates the action easing object.
Reference easeOutCubic:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:992
Examples
//example
action.easing(cc.easeCubicActionOut());
easeCubicActionInOut

Creates the action easing object.
Reference easeInOutCubic:
http://www.zhihu.com/question/21981571/answer/19925418

meta description
Returns Object
Defined in cocos2d/actions/CCActionEase.js:1020
show

Show the Node.

meta description
Returns ActionInstant
Defined in cocos2d/actions/CCActionInstant.js:102
Examples
// example
var showAction = cc.show();
hide

Hide the node.

meta description
Returns ActionInstant
Defined in cocos2d/actions/CCActionInstant.js:141
Examples
// example
var hideAction = cc.hide();
toggleVisibility

Toggles the visibility of a node.

meta description
Returns ActionInstant
Defined in cocos2d/actions/CCActionInstant.js:180
Examples
// example
var toggleVisibilityAction = cc.toggleVisibility();
removeSelf

Create a RemoveSelf object with a flag indicate whether the target should be cleaned up while removing.

meta description
Returns ActionInstant
Defined in cocos2d/actions/CCActionInstant.js:230
Parameters
Examples
// example
var removeSelfAction = cc.removeSelf();
flipX

Create a FlipX action to flip or unflip the target.

meta description
Returns ActionInstant
Defined in cocos2d/actions/CCActionInstant.js:288
Parameters
  • flip Boolean Indicate whether the target should be flipped or not
Examples
var flipXAction = cc.flipX(true);
flipY

Create a FlipY action to flip or unflip the target.

meta description
Returns ActionInstant
Defined in cocos2d/actions/CCActionInstant.js:343
Parameters
Examples
var flipYAction = cc.flipY(true);
place

Creates a Place action with a position.

meta description
Returns ActionInstant
Defined in cocos2d/actions/CCActionInstant.js:406
Parameters
Examples
// example
var placeAction = cc.place(cc.v2(200, 200));
var placeAction = cc.place(200, 200);
callFunc

Creates the action with the callback.

meta description
Returns ActionInstant
Defined in cocos2d/actions/CCActionInstant.js:516
Parameters
  • selector function
  • selectorTarget object
  • data Any data for function, it accepts all data types.
Examples
// example
// CallFunc without data
var finish = cc.callFunc(this.removeSprite, this);

// CallFunc with data
var finish = cc.callFunc(this.removeFromParentAndCleanup, this._grossini,  true);
sequence

Helper constructor to create an array of sequenceable actions The created action will run actions sequentially, one after another.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:439
Parameters
Examples
// example
// create sequence with actions
var seq = cc.sequence(act1, act2);

// create sequence with array
var seq = cc.sequence(actArray);
repeat

Creates a Repeat action. Times is an unsigned integer between 1 and pow(2,30)

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:617
Parameters
Examples
// example
var rep = cc.repeat(cc.sequence(jump2, jump1), 5);
repeatForever

Create a acton which repeat forever, as it runs forever, it can't be added into cc.sequence and cc.spawn.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:721
Parameters
Examples
// example
var repeat = cc.repeatForever(cc.rotateBy(1.0, 360));
spawn

Create a spawn action which runs several actions in parallel.

meta description
Returns FiniteTimeAction
Defined in cocos2d/actions/CCActionInterval.js:836
Parameters
Examples
// example
var action = cc.spawn(cc.jumpBy(2, cc.v2(300, 0), 50, 4), cc.rotateBy(2, 720));
todo:It should be the direct use new
rotateTo

Rotates a Node object to a certain angle by modifying its angle property.
The direction will be decided by the shortest angle.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:939
Parameters
  • duration Number duration in seconds
  • dstAngle Number dstAngle in degrees.
Examples
// example
var rotateTo = cc.rotateTo(2, 61.0);
rotateBy

Rotates a Node object clockwise a number of degrees by modifying its angle property. Relative to its properties to modify.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:1022
Parameters
  • duration Number duration in seconds
  • deltaAngle Number deltaAngle in degrees
Examples
// example
var actionBy = cc.rotateBy(2, 360);
moveBy

Moves a Node object x,y pixels by modifying its position property.
x and y are relative to the position of the object.
Several MoveBy actions can be concurrently called, and the resulting
movement will be the sum of individual movements.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:1137
Parameters
Examples
// example
var actionTo = cc.moveBy(2, cc.v2(windowSize.width - 40, windowSize.height - 40));
moveTo

Moves a Node object to the position x,y. x and y are absolute coordinates by modifying its position property.
Several MoveTo actions can be concurrently called, and the resulting
movement will be the sum of individual movements.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:1214
Parameters
Examples
// example
var actionBy = cc.moveTo(2, cc.v2(80, 80));
skewTo

Create a action which skews a Node object to given angles by modifying its skewX and skewY properties. Changes to the specified value.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:1308
Parameters
Examples
// example
var actionTo = cc.skewTo(2, 37.2, -37.2);
skewBy

Skews a Node object by skewX and skewY degrees.
Relative to its property modification.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:1383
Parameters
  • t Number time in seconds
  • sx Number sx skew in degrees for X axis
  • sy Number sy skew in degrees for Y axis
Examples
// example
var actionBy = cc.skewBy(2, 0, -90);
jumpBy

Moves a Node object simulating a parabolic jump movement by modifying it's position property. Relative to its movement.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:1510
Parameters
Examples
// example
var actionBy = cc.jumpBy(2, cc.v2(300, 0), 50, 4);
var actionBy = cc.jumpBy(2, 300, 0, 50, 4);
jumpTo

Moves a Node object to a parabolic position simulating a jump movement by modifying its position property.
Jump to the specified location.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:1592
Parameters
Examples
// example
var actionTo = cc.jumpTo(2, cc.v2(300, 300), 50, 4);
var actionTo = cc.jumpTo(2, 300, 300, 50, 4);
bezierBy

An action that moves the target with a cubic Bezier curve by a certain distance. Relative to its movement.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:1728
Parameters
Examples
// example
var bezier = [cc.v2(0, windowSize.height / 2), cc.v2(300, -windowSize.height / 2), cc.v2(300, 100)];
var bezierForward = cc.bezierBy(3, bezier);
bezierTo

An action that moves the target with a cubic Bezier curve to a destination point.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:1797
Parameters
Examples
// example
var bezier = [cc.v2(0, windowSize.height / 2), cc.v2(300, -windowSize.height / 2), cc.v2(300, 100)];
var bezierTo = cc.bezierTo(2, bezier);
scaleTo

Scales a Node object to a zoom factor by modifying it's scale property.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:1883
Parameters
  • duration Number
  • sx Number scale parameter in X
  • sy Number scale parameter in Y, if Null equal to sx
Examples
// example
// It scales to 0.5 in both X and Y.
var actionTo = cc.scaleTo(2, 0.5);

// It scales to 0.5 in x and 2 in Y
var actionTo = cc.scaleTo(2, 0.5, 2);
scaleBy

Scales a Node object a zoom factor by modifying it's scale property. Relative to its changes.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:1933
Parameters
  • duration Number duration in seconds
  • sx Number sx scale parameter in X
  • sy Number | Null sy scale parameter in Y, if Null equal to sx
Examples
// example without sy, it scales by 2 both in X and Y
var actionBy = cc.scaleBy(2, 2);

//example with sy, it scales by 0.25 in X and 4.5 in Y
var actionBy2 = cc.scaleBy(2, 0.25, 4.5);

Blinks a Node object by modifying it's visible property.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:2019
Parameters
  • duration Number duration in seconds
  • blinks Number blinks in times
Examples
// example
var action = cc.blink(2, 10);
fadeTo

Fades an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from the current value to a custom one.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:2086
Parameters
Examples
// example
var action = cc.fadeTo(1.0, 0);
fadeIn

Fades In an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 0 to 255.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:2142
Parameters
  • duration Number duration in seconds
Examples
//example
var action = cc.fadeIn(1.0);
fadeOut

Fades Out an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 255 to 0.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:2191
Parameters
  • d Number duration in seconds
Examples
// example
var action = cc.fadeOut(1.0);
tintTo

Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:2275
Parameters
Examples
// example
var action = cc.tintTo(2, 255, 0, 255);
tintBy

Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one. Relative to their own color change.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:2368
Parameters
Examples
// example
var action = cc.tintBy(2, -127, -255, -127);
delayTime

Delays the action a certain amount of seconds.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:2412
Parameters
  • d Number duration in seconds
Examples
// example
var delay = cc.delayTime(1);
reverseTime

Executes an action in reverse order, from time=duration to time=0.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:2498
Parameters
Examples
// example
 var reverse = cc.reverseTime(this);
targetedAction

Create an action with the specified action and forced target.

meta description
Returns ActionInterval
Defined in cocos2d/actions/CCActionInterval.js:2586
Parameters
tween
meta description
Returns Tween
Defined in cocos2d/actions/tween.js:517
Parameters
  • target Object the target to animate
error

Outputs an error message to the Cocos Creator Console (editor) or Web Console (runtime).

  • In Cocos Creator, error is red.
  • In Chrome, error have a red icon along with red message text.
meta description
Defined in cocos2d/core/CCDebug.js:114
Parameters
  • msg Any A JavaScript string containing zero or more substitution strings.
  • subst Any JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.
warn

Outputs a warning message to the Cocos Creator Console (editor) or Web Console (runtime).

  • In Cocos Creator, warning is yellow.
  • In Chrome, warning have a yellow warning icon with the message text.
meta description
Defined in cocos2d/core/CCDebug.js:158
Parameters
  • msg Any A JavaScript string containing zero or more substitution strings.
  • subst Any JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.
log

Outputs a message to the Cocos Creator Console (editor) or Web Console (runtime).

meta description
Defined in cocos2d/core/CCDebug.js:188
Parameters
  • msg String | Any A JavaScript string containing zero or more substitution strings.
  • subst Any JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.
rotate3DTo

Rotates a Node object to a certain angle by modifying its quternion property.
The direction will be decided by the shortest angle.

meta description
Returns ActionInterval
Defined in cocos2d/core/3d/actions.js:90
Parameters
  • duration Number duration in seconds
  • dstAngleX Number | Vec3 | Quat dstAngleX in degrees.
  • dstAngleY Number dstAngleY in degrees.
  • dstAngleZ Number dstAngleZ in degrees.
Examples
// example
var rotate3DTo = cc.rotate3DTo(2, cc.v3(0, 180, 0));
rotate3DBy

Rotates a Node object counter clockwise a number of degrees by modifying its quaternion property. Relative to its properties to modify.

meta description
Returns ActionInterval
Defined in cocos2d/core/3d/actions.js:202
Parameters
  • duration Number duration in seconds
  • deltaAngleX Number | Vec3 deltaAngleX in degrees
  • deltaAngleY Number deltaAngleY in degrees
  • deltaAngleZ Number deltaAngleZ in degrees
Examples
// example
var actionBy = cc.rotate3DBy(2, cc.v3(0, 360, 0));
point_plane

the distance between a point and a plane

meta description
Returns Unknown
Defined in cocos2d/core/geom-utils/distance.ts:42
Parameters
  • point Vec3
  • plane Plane
pt_point_plane

the closest point on plane to a given point

meta description
Returns Unknown
Defined in cocos2d/core/geom-utils/distance.ts:56
Parameters
  • out Unknown Closest point
  • point Unknown Given point
  • plane Unknown
pt_point_aabb

the closest point on aabb to a given point

meta description
Returns Vec3
Defined in cocos2d/core/geom-utils/distance.ts:72
Parameters
  • out Vec3 Closest point.
  • point Vec3 Given point.
  • aabb Aabb Align the axis around the box.
pt_point_obb

the closest point on obb to a given point

meta description
Returns Vec3
Defined in cocos2d/core/geom-utils/distance.ts:98
Parameters
  • out Vec3 Closest point
  • point Vec3 Given point
  • obb Obb Direction box
ray_cast

Check whether ray intersect with nodes

meta description
Returns
Defined in cocos2d/core/geom-utils/intersect.ts:84
Parameters
  • root Node If root is null, then traversal nodes from scene node
  • worldRay Ray
  • handler Function
  • filter Function
ray_plane

ray-plane intersect

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:196
Parameters
  • ray Ray
  • plane Plane
line_plane

line-plane intersect

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:217
Parameters
  • line Line
  • plane Plane
ray_triangle

ray-triangle intersect

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:237
Parameters
  • ray Ray
  • triangle Triangle
  • doubleSided boolean
line_triangle

line-triangle intersect

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:279
Parameters
  • line Line
  • triangle Triangle
  • outPt Vec3 optional, The intersection point
line_quad

line-quad intersect

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:343
Parameters
  • p Vec3 A point on a line segment
  • q Vec3 Another point on the line segment
  • a Vec3 Quadrilateral point a
  • b Vec3 Quadrilateral point b
  • c Vec3 Quadrilateral point c
  • d Vec3 Quadrilateral point d
  • outPt Vec3 optional, The intersection point
ray_sphere

ray-sphere intersect

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:435
Parameters
  • ray Ray
  • sphere Sphere
ray_aabb

ray-aabb intersect

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:465
Parameters
  • ray Ray
  • aabb Aabb Align the axis around the box
ray_obb

ray-obb intersect

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:497
Parameters
  • ray Ray
  • obb Obb Direction box
aabb_aabb

aabb-aabb intersect

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:576
Parameters
  • aabb1 Aabb Axis alignment surrounds box 1
  • aabb2 Aabb Axis alignment surrounds box 2
aabb_obb

aabb-obb intersect

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:664
Parameters
  • aabb Aabb Align the axis around the box
  • obb Obb Direction box
aabb_plane

aabb-plane intersect

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:718
Parameters
  • aabb Aabb Align the axis around the box
  • plane Plane
aabb_frustum

aabb-frustum intersect, faster but has false positive corner cases

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:736
Parameters
  • aabb Aabb Align the axis around the box
  • frustum Frustum
aabb_frustum_accurate

aabb-frustum intersect, handles most of the false positives correctly

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:755
Parameters
  • aabb Aabb Align the axis around the box
  • frustum Frustum
obb_point

obb-point intersect

meta description
Returns boolean
Defined in cocos2d/core/geom-utils/intersect.ts:806
Parameters
  • obb Obb Direction box
  • point Vec3
obb_plane

obb-plane intersect

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:824
Parameters
  • obb Obb Direction box
  • plane Plane
obb_frustum

obb-frustum intersect, faster but has false positive corner cases

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:850
Parameters
  • obb Obb Direction box
  • frustum Frustum
obb_frustum_accurate

obb-frustum intersect, handles most of the false positives correctly

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:869
Parameters
  • obb Obb Direction box
  • frustum Frustum
obb_obb

obb-obb intersect

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:927
Parameters
  • obb1 Obb Direction box1
  • obb2 Obb Direction box2
sphere_plane

phere-plane intersect, not necessarily faster than obb-plane
due to the length calculation of the plane normal to factor out
the unnomalized plane distance

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:981
Parameters
  • sphere Sphere
  • plane Plane
sphere_frustum

sphere-frustum intersect, faster but has false positive corner cases

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:999
Parameters
  • sphere Sphere
  • frustum Frustum
sphere_frustum_accurate

sphere-frustum intersect, handles the false positives correctly

meta description
Returns number
Defined in cocos2d/core/geom-utils/intersect.ts:1018
Parameters
  • sphere Sphere
  • frustum Frustum
sphere_sphere

sphere-sphere intersect

meta description
Returns boolean
Defined in cocos2d/core/geom-utils/intersect.ts:1050
Parameters
  • sphere0 Sphere
  • sphere1 Sphere
sphere_aabb

sphere-aabb intersect

meta description
Returns boolean
Defined in cocos2d/core/geom-utils/intersect.ts:1063
Parameters
  • sphere Sphere
  • aabb Aabb
sphere_obb

sphere-obb intersect

meta description
Returns boolean
Defined in cocos2d/core/geom-utils/intersect.ts:1079
Parameters
  • sphere Sphere
  • obb Obb
resolve

The intersection detection of g1 and g2 can fill in the shape in the basic geometry.

meta description
Defined in cocos2d/core/geom-utils/intersect.ts:1130
Parameters
  • g1 Unknown Geometry 1
  • g2 Unknown Geometry 2
  • outPt Unknown optional, Intersection point. (note: only partial shape detection with this return value)
Class

Defines a CCClass using the given specification, please see Class for details.

meta description
Returns Function
Defined in cocos2d/core/platform/CCClass.js:826
Parameters
  • options Object
    • name String The class name used for serialization.
    • extends Function The base class.
    • ctor Function The constructor.
    • __ctor__ Function The same as ctor, but less encapsulated.
    • properties Object The property definitions.
    • statics Object The static members.
    • mixins Function[]
    • editor Object attributes for Component listed below.
      • executeInEditMode Boolean Allows the current component to run in edit mode. By default, all components are executed only at runtime, meaning that they will not have their callback functions executed while the Editor is in edit mode.
      • requireComponent Function Automatically add required component as a dependency.
      • menu String The menu path to register a component to the editors "Component" menu. Eg. "Rendering/Camera".
      • executionOrder Number The execution order of lifecycle methods for Component. Those less than 0 will execute before while those greater than 0 will execute after. The order will only affect onLoad, onEnable, start, update and lateUpdate while onDisable and onDestroy will not be affected.
      • disallowMultiple Boolean If specified to a type, prevents Component of the same type (or subtype) to be added more than once to a Node.
      • playOnFocus Boolean This property is only available when executeInEditMode is set. If specified, the editor's scene view will keep updating this node in 60 fps when it is selected, otherwise, it will update only if necessary.
      • inspector String Customize the page url used by the current component to render in the Properties.
      • icon String Customize the icon that the current component displays in the editor.
      • help String The custom documentation URL
    • update Function lifecycle method for Component, see update
    • lateUpdate Function lifecycle method for Component, see lateUpdate
    • onLoad Function lifecycle method for Component, see onLoad
    • start Function lifecycle method for Component, see start
    • onEnable Function lifecycle method for Component, see onEnable
    • onDisable Function lifecycle method for Component, see onDisable
    • onDestroy Function lifecycle method for Component, see onDestroy
    • onFocusInEditor Function lifecycle method for Component, see onFocusInEditor
    • onLostFocusInEditor Function lifecycle method for Component, see onLostFocusInEditor
    • resetInEditor Function lifecycle method for Component, see resetInEditor
    • onRestore Function for Component only, see onRestore
    • _getLocalBounds Function for Component only, see _getLocalBounds
Examples
// define base class
var Node = cc.Class();

// define sub class
var Sprite = cc.Class({
name: 'Sprite',
extends: Node,

ctor: function () {
this.url = "";
this.id = 0;
},

statics: {
// define static members
count: 0,
getBounds: function (spriteList) {
// compute bounds...
}
},

properties {
width: {
default: 128,
type: cc.Integer,
tooltip: 'The width of sprite'
},
height: 128,
size: {
get: function () {
return cc.v2(this.width, this.height);
}
}
},

load: function () {
// load this.url...
};
});

// instantiate

var obj = new Sprite();
obj.url = 'sprite.png';
obj.load();
_isCCClass

Checks whether the constructor is created by cc.Class

meta description
Returns Boolean
Defined in cocos2d/core/platform/CCClass.js:997
Parameters
Enum

Define an enum type.
If a enum item has a value of -1, it will be given an Integer number according to it's order in the list.
Otherwise it will use the value specified by user who writes the enum definition.

meta description
Returns object
Defined in cocos2d/core/platform/CCEnum.js:34
Parameters
  • obj object a JavaScript literal object containing enum names and values, or a TypeScript enum type
Examples
// JavaScript:

var WrapMode = cc.Enum({
    Repeat: -1,
    Clamp: -1
});

// Texture.WrapMode.Repeat == 0
// Texture.WrapMode.Clamp == 1
// Texture.WrapMode[0] == "Repeat"
// Texture.WrapMode[1] == "Clamp"

var FlagType = cc.Enum({
    Flag1: 1,
    Flag2: 2,
    Flag3: 4,
    Flag4: 8,
});

var AtlasSizeList = cc.Enum({
    128: 128,
    256: 256,
    512: 512,
    1024: 1024,
});

// TypeScript:

// If used in TypeScript, just define a TypeScript enum:
enum Direction {
    Up,
    Down,
    Left,
    Right
}

// If you need to inspect the enum in Properties panel, you can call cc.Enum:
const {ccclass, property} = cc._decorator;

@ccclass
class NewScript extends cc.Component {
    @property({
        type: cc.Enum(Direction)    // call cc.Enum
    })
    direction: Direction = Direction.Up;
}
getList
meta description
Returns Object[]
Defined in cocos2d/core/platform/CCEnum.js:90
Parameters
  • enumDef Object the enum type defined from cc.Enum
handleTouchesBegin
meta description
Defined in cocos2d/core/platform/CCInputManager.js:137
Parameters
handleTouchesMove
meta description
Defined in cocos2d/core/platform/CCInputManager.js:172
Parameters
handleTouchesEnd
meta description
Defined in cocos2d/core/platform/CCInputManager.js:204
Parameters
handleTouchesCancel
meta description
Defined in cocos2d/core/platform/CCInputManager.js:219
Parameters
getSetOfTouchesEndOrCancel
meta description
Returns Array
Defined in cocos2d/core/platform/CCInputManager.js:234
Parameters
getPreTouch
meta description
Returns Touch
Defined in cocos2d/core/platform/CCInputManager.js:260
Parameters
setPreTouch
meta description
Defined in cocos2d/core/platform/CCInputManager.js:280
Parameters
getTouchByXY
meta description
Returns Touch
Defined in cocos2d/core/platform/CCInputManager.js:305
Parameters
getMouseEvent
meta description
Returns Event.EventMouse
Defined in cocos2d/core/platform/CCInputManager.js:322
Parameters
getPointByEvent
meta description
Returns Vec2
Defined in cocos2d/core/platform/CCInputManager.js:340
Parameters
getTouchesByEvent
meta description
Returns Array
Defined in cocos2d/core/platform/CCInputManager.js:363
Parameters
registerSystemEvent
meta description
Defined in cocos2d/core/platform/CCInputManager.js:401
Parameters
update
meta description
Defined in cocos2d/core/platform/CCInputManager.js:560
Parameters
isValid

Checks whether the object is non-nil and not yet destroyed.
When an object's destroy is called, it is actually destroyed after the end of this frame. So isValid will return false from the next frame, while isValid in the current frame will still be true. If you want to determine whether the current frame has called destroy, use cc.isValid(obj, true), but this is often caused by a particular logical requirements, which is not normally required.

meta description
Returns Boolean
Defined in cocos2d/core/platform/CCObject.js:508
Parameters
  • value Any
  • strictMode Boolean If true, Object called destroy() in this frame will also treated as invalid.
Examples
var node = new cc.Node();
cc.log(cc.isValid(node));    // true
node.destroy();
cc.log(cc.isValid(node));    // true, still valid in this frame
// after a frame...
cc.log(cc.isValid(node));    // false, destroyed in the end of last frame
deserialize

Deserialize json to cc.Asset

meta description
Returns object
Defined in cocos2d/core/platform/deserialize.js:774
Parameters
  • data String | Object the serialized cc.Asset json string or json object.
  • details Details additional loading result
  • options Object
instantiate

Clones the object original and returns the clone, or instantiate a node from the Prefab.

meta description
Returns Node | Object
Defined in cocos2d/core/platform/instantiate.js:37
Parameters
  • original Prefab | Node | Object An existing object that you want to make a copy of.
Examples
// instantiate node from prefab
var scene = cc.director.getScene();
var node = cc.instantiate(prefabAsset);
node.parent = scene;
// clone node
var scene = cc.director.getScene();
var node = cc.instantiate(targetNode);
node.parent = scene;
find

Finds a node by hierarchy path, the path is case-sensitive. It will traverse the hierarchy by splitting the path using '/' character. This function will still returns the node even if it is inactive. It is recommended to not use this function every frame instead cache the result at startup.

meta description
Returns Node | Null
Defined in cocos2d/core/utils/find.js:30
Parameters
color

The convenience method to create a new Color/Color:method Alpha channel is optional. Default value is 255.

meta description
Returns Color
Defined in cocos2d/core/value-types/color.ts:854
Parameters
Examples
-----------------------
// 1. All channels seperately as parameters
var color1 = new cc.Color(255, 255, 255, 255);
// 2. Convert a hex string to a color
var color2 = new cc.Color("#000000");
// 3. An color object as parameter
var color3 = new cc.Color({r: 255, g: 255, b: 255, a: 255});
toArray

Matrix transpose array

meta description
Defined in cocos2d/core/value-types/mat3.ts:800
Parameters
  • ofs Unknown 数组内的起始偏移量
fromArray

Transfer matrix array

meta description
Defined in cocos2d/core/value-types/mat3.ts:816
Parameters
  • ofs Unknown 数组起始偏移量
constructor

Creates a matrix, with elements specified separately.

meta description
Defined in cocos2d/core/value-types/mat3.ts:840
mat4

The convenience method to create a new cc.Mat4.

meta description
Returns Mat4
Defined in cocos2d/core/value-types/mat4.ts:1978
Parameters
  • m00 Number Component in column 0, row 0 position (index 0)
  • m01 Number Component in column 0, row 1 position (index 1)
  • m02 Number Component in column 0, row 2 position (index 2)
  • m03 Number Component in column 0, row 3 position (index 3)
  • m10 Number Component in column 1, row 0 position (index 4)
  • m11 Number Component in column 1, row 1 position (index 5)
  • m12 Number Component in column 1, row 2 position (index 6)
  • m13 Number Component in column 1, row 3 position (index 7)
  • m20 Number Component in column 2, row 0 position (index 8)
  • m21 Number Component in column 2, row 1 position (index 9)
  • m22 Number Component in column 2, row 2 position (index 10)
  • m23 Number Component in column 2, row 3 position (index 11)
  • m30 Number Component in column 3, row 0 position (index 12)
  • m31 Number Component in column 3, row 1 position (index 13)
  • m32 Number Component in column 3, row 2 position (index 14)
  • m33 Number Component in column 3, row 3 position (index 15)
quat

The convenience method to create a new cc.Quat.

meta description
Returns Quat
Defined in cocos2d/core/value-types/quat.ts:985
Parameters
rect

The convenience method to create a new Rect. see Rect/Rect:method

meta description
Returns Rect
Defined in cocos2d/core/value-types/rect.ts:433
Parameters
Examples
var a = new cc.Rect(0 , 0, 10, 0);
size

Helper function that creates a cc.Size.
Please use cc.p or cc.v2 instead, it will soon replace cc.Size.

meta description
Returns Size
Defined in cocos2d/core/value-types/size.ts:170
Parameters
Examples
var size1 = cc.size();
var size2 = cc.size(100,100);
var size3 = cc.size(size2);
var size4 = cc.size({width: 100, height: 100});
clamp

Clamps a value between a minimum float and maximum float value.

meta description
Returns number
Defined in cocos2d/core/value-types/utils.ts:56
Parameters
clamp01

Clamps a value between 0 and 1.

meta description
Returns number
Defined in cocos2d/core/value-types/utils.ts:69
Parameters
lerp
meta description
Returns number
Defined in cocos2d/core/value-types/utils.ts:80
Parameters
random
meta description
Defined in cocos2d/core/value-types/utils.ts:109
randomRange

Returns a floating-point random number between min (inclusive) and max (exclusive).

meta description
Returns number
Defined in cocos2d/core/value-types/utils.ts:114
Parameters
randomRangeInt

Returns a random integer between min (inclusive) and max (exclusive).

meta description
Returns number
Defined in cocos2d/core/value-types/utils.ts:126
Parameters
pseudoRandom

Linear congruential generator using Hull-Dobell Theorem.

meta description
Returns number
Defined in cocos2d/core/value-types/utils.ts:138
Parameters
pseudoRandomRange

Returns a floating-point pseudo-random number between min (inclusive) and max (exclusive).

meta description
Returns number
Defined in cocos2d/core/value-types/utils.ts:150
Parameters
pseudoRandomRangeInt

Returns a pseudo-random integer between min (inclusive) and max (exclusive).

meta description
Returns number
Defined in cocos2d/core/value-types/utils.ts:163
Parameters
nextPow2

Returns the next power of two for the value

meta description
Returns number
Defined in cocos2d/core/value-types/utils.ts:176
Parameters
repeat

Returns float remainder for t / length

meta description
Returns number
Defined in cocos2d/core/value-types/utils.ts:195
Parameters
repeat

Returns time wrapped in ping-pong mode

meta description
Returns number
Defined in cocos2d/core/value-types/utils.ts:207
Parameters
repeat

Returns ratio of a value within a given range

meta description
Returns number
Defined in cocos2d/core/value-types/utils.ts:221
Parameters
sign

Returns -1, 0, +1 depending on sign of x.

meta description
Defined in cocos2d/core/value-types/utils.ts:234
Parameters
v2

The convenience method to create a new cc.Vec2.

meta description
Returns Vec2
Defined in cocos2d/core/value-types/vec2.ts:1080
Parameters
Examples
var v1 = cc.v2();
var v2 = cc.v2(0, 0);
var v3 = cc.v2(v2);
var v4 = cc.v2({x: 100, y: 100});
v3

The convenience method to create a new cc.Vec3.

meta description
Returns Vec3
Defined in cocos2d/core/value-types/vec3.ts:1352
Parameters
Examples
var v1 = cc.v3();
var v2 = cc.v3(0, 0, 0);
var v3 = cc.v3(v2);
var v4 = cc.v3({x: 100, y: 100, z: 0});
get

Get an element

meta description
Returns Number
Defined in cocos2d/core/3d/physics/cocos/utils/array-collision-matrix.ts:41
Parameters
set

Set an element

meta description
Defined in cocos2d/core/3d/physics/cocos/utils/array-collision-matrix.ts:57
Parameters
reset

Sets all elements to zero

meta description
Defined in cocos2d/core/3d/physics/cocos/utils/array-collision-matrix.ts:73

results matching ""

    No results matching ""