Namespace cc

Method Summary

Field Detail

<static> <constant> cc.ACTION_TAG_INVALID
Default Action tag
Defined in: CCAction.js.
<static> <constant> {Number} cc.ADJUST_FACTOR
The adjust factor is needed to prevent issue #442
One solution is to use DONT_RENDER_IN_SUBPIXELS images, but NO
The other issue is that in some transitions (and I don't know why)
the order should be reversed (In in top of Out or vice-versa).
Defined in: CCTransition.js.
<static> <constant> {Number} cc.ALIGN_BOTTOM
Horizontal center and vertical bottom.
Defined in: CCTexture2D.js.
<static> <constant> {Number} cc.ALIGN_BOTTOM_LEFT
Horizontal left and vertical bottom.
Defined in: CCTexture2D.js.
<static> <constant> {Number} cc.ALIGN_BOTTOM_RIGHT
Horizontal right and vertical bottom.
Defined in: CCTexture2D.js.
<static> <constant> {Number} cc.ALIGN_CENTER
Horizontal center and vertical center.
Defined in: CCTexture2D.js.
<static> <constant> {Number} cc.ALIGN_LEFT
Horizontal left and vertical center.
Defined in: CCTexture2D.js.
<static> <constant> {Number} cc.ALIGN_RIGHT
Horizontal right and vertical center.
Defined in: CCTexture2D.js.
<static> <constant> {Number} cc.ALIGN_TOP
Horizontal center and vertical top.
Defined in: CCTexture2D.js.
<static> <constant> {Number} cc.ALIGN_TOP_LEFT
Horizontal left and vertical top.
Defined in: CCTexture2D.js.
<static> <constant> {Number} cc.ALIGN_TOP_RIGHT
Horizontal right and vertical top.
Defined in: CCTexture2D.js.
<static> <constant> cc.ATTRIBUTE_NAME_COLOR

Defined in: CCGLProgram.js.
<static> <constant> cc.ATTRIBUTE_NAME_POSITION

Defined in: CCGLProgram.js.
<static> <constant> cc.ATTRIBUTE_NAME_TEX_COORD

Defined in: CCGLProgram.js.
<static> <constant> {Number} cc.BLEND_DST
default gl blend dst function. Compatible with premultiplied alpha images.
Defined in: CCMacro.js.
<static> <constant> {Number} cc.BLEND_SRC
default gl blend src function. Compatible with premultiplied alpha images.
Defined in: CCMacro.js.
<static> <constant> {Number} cc.COCOSNODE_RENDER_SUBPIXEL

If enabled, the cc.Node objects (cc.Sprite, cc.Label,etc) will be able to render in subpixels.
If disabled, integer pixels will be used.

To enable set it to 1. Enabled by default.


Defined in: CCConfig.js.
<static> cc.CONTROL_EVENT_TOTAL_NUMBER
Number of kinds of control event.
Defined in: CCControl.js.
<static> cc.CONTROL_EVENT_TOUCH_DOWN
Kinds of possible events for the control objects.
Defined in: CCControl.js.
<static> cc.CONTROL_STATE_NORMAL
The possible state for a control.
Defined in: CCControl.js.
<static> <constant> {Number} cc.CURRENT_ITEM
default tag for current item
Defined in: CCMenuItem.js.
<static> <constant> {String} cc.DEFAULT_ENGINE
default engine
Defined in: CCConfig.js.
<static> <constant> {Number} cc.DEFAULT_PADDING

Defined in: CCMenu.js.
<static> <constant> {Number} cc.DEFAULT_SPRITE_BATCH_CAPACITY

Defined in: CCSpriteBatchNode.js.
<static> {Number} cc.defaultFPS
set default fps to 60
Defined in: CCDirector.js.
<static> <constant> {Number} cc.DEG

Defined in: CCMacro.js.
<static> <constant> {Number} cc.DEVICE_MAX_ORIENTATIONS
In browsers, we only support 2 orientations by change window size.
Defined in: CCDirector.js.
<static> <constant> {Number} cc.DEVICE_ORIENTATION_LANDSCAPE_LEFT
Device oriented horizontally, home button on the right (UIDeviceOrientationLandscapeLeft)
Defined in: CCDirector.js.
<static> <constant> {Number} cc.DEVICE_ORIENTATION_LANDSCAPE_RIGHT
Device oriented horizontally, home button on the left (UIDeviceOrientationLandscapeRight)
Defined in: CCDirector.js.
<static> <constant> {Number} cc.DEVICE_ORIENTATION_PORTRAIT
Device oriented vertically, home button on the bottom (UIDeviceOrientationPortrait)
Defined in: CCDirector.js.
<static> <constant> {Number} cc.DEVICE_ORIENTATION_PORTRAIT_UPSIDE_DOWN
Device oriented vertically, home button on the top (UIDeviceOrientationPortraitUpsideDown)
Defined in: CCDirector.js.
<static> <constant> {Number} cc.DIRECTOR_FPS_INTERVAL

Senconds between FPS updates.
0.5 seconds, means that the FPS number will be updated every 0.5 seconds.
Having a bigger number means a more reliable FPS

Default value: 0.1f


Defined in: CCConfig.js.
<static> <constant> {Number} cc.DIRECTOR_PROJECTION_2D
sets a 2D projection (orthogonal projection)
Defined in: CCDirector.js.
<static> <constant> {Number} cc.DIRECTOR_PROJECTION_3D
sets a 3D projection with a fovy=60, znear=0.5f and zfar=1500.
Defined in: CCDirector.js.
<static> <constant> {Number} cc.DIRECTOR_PROJECTION_CUSTOM
it calls "updateProjection" on the projection delegate.
Defined in: CCDirector.js.
<static> <constant> {Number} cc.DIRECTOR_PROJECTION_DEFAULT
Default projection is 3D projection
Defined in: CCDirector.js.
<static> <constant> {cc.Point} cc.DIRECTOR_STATS_POSITION
Position of the FPS (Default: 0,0 (bottom-left corner))
Defined in: CCConfig.js.
<static> <constant> {Number} cc.DISABLE_TAG
default disabled tag
Defined in: CCMenuItem.js.
<static> cc.DisplayLinkDirector
************************************************ implementation of DisplayLinkDirector ************************************************
Defined in: CCDirector.js.
<static> <constant> {Number} cc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_ALL_CHARACTERS
Capitalize all characters automatically.
Defined in: CCEditBox.js.
<static> <constant> {Number} cc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_SENTENCE
This flag is a hint to the implementation that during text editing, the initial letter of each sentence should be capitalized.
Defined in: CCEditBox.js.
<static> <constant> {Number} cc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_WORD
This flag is a hint to the implementation that during text editing, the initial letter of each word should be capitalized.
Defined in: CCEditBox.js.
<static> <constant> {Number} cc.EDITBOX_INPUT_FLAG_PASSWORD
Indicates that the text entered is confidential data that should be obscured whenever possible. This implies EDIT_BOX_INPUT_FLAG_SENSITIVE.
Defined in: CCEditBox.js.
<static> <constant> {Number} cc.EDITBOX_INPUT_FLAG_SENSITIVE
Indicates that the text entered is sensitive data that the implementation must never store into a dictionary or table for use in predictive, auto-completing, or other accelerated input schemes. A credit card number is an example of sensitive data.
Defined in: CCEditBox.js.
<static> <constant> {Number} cc.EDITBOX_INPUT_MODE_ANY
The EditBoxInputMode defines the type of text that the user is allowed * to enter.
Defined in: CCEditBox.js.
<static> <constant> {Number} cc.EDITBOX_INPUT_MODE_DECIMAL
The user is allowed to enter a real number value. This extends kEditBoxInputModeNumeric by allowing a decimal point.
Defined in: CCEditBox.js.
<static> <constant> {Number} cc.EDITBOX_INPUT_MODE_EMAILADDR
The user is allowed to enter an e-mail address.
Defined in: CCEditBox.js.
<static> <constant> {Number} cc.EDITBOX_INPUT_MODE_NUMERIC
The user is allowed to enter an integer value.
Defined in: CCEditBox.js.
<static> <constant> {Number} cc.EDITBOX_INPUT_MODE_PHONENUMBER
The user is allowed to enter a phone number.
Defined in: CCEditBox.js.
<static> <constant> {Number} cc.EDITBOX_INPUT_MODE_SINGLELINE
The user is allowed to enter any text, except for line breaks.
Defined in: CCEditBox.js.
<static> <constant> {Number} cc.EDITBOX_INPUT_MODE_URL
The user is allowed to enter a URL.
Defined in: CCEditBox.js.
<static> <constant> {Number} cc.ENABLE_GL_STATE_CACHE

If enabled, cocos2d will maintain an OpenGL state cache internally to avoid unnecessary switches.
In order to use them, you have to use the following functions, insead of the the GL ones:
- ccGLUseProgram() instead of glUseProgram()
- ccGLDeleteProgram() instead of glDeleteProgram()
- ccGLBlendFunc() instead of glBlendFunc()

If this functionality is disabled, then ccGLUseProgram(), ccGLDeleteProgram(), ccGLBlendFunc() will call the GL ones, without using the cache.
It is recommened to enable whenever possible to improve speed.
If you are migrating your code from GL ES 1.1, then keep it disabled. Once all your code works as expected, turn it on.


Defined in: CCConfig.js.
<static> <constant> cc.ENABLE_STACKABLE_ACTIONS

If enabled, actions that alter the position property (eg: CCMoveBy, CCJumpBy, CCBezierBy, etc..) will be stacked.
If you run 2 or more 'position' actions at the same time on a node, then end position will be the sum of all the positions.
If disabled, only the last run action will take effect.


Defined in: CCConfig.js.
<static> <constant> {String} cc.ENGINE_VERSION

The current version of Cocos2d-html5 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.


Defined in: CCConfig.js.
<static> cc.eventManager

Defined in: CCEventManager.js.
<static> <constant> {Number} cc.FIX_ARTIFACTS_BY_STRECHING_TEXEL

If enabled, the texture coordinates will be calculated by using this formula:
- texCoord.left = (rect.x*2+1) / (texture.wide*2);
- texCoord.right = texCoord.left + (rect.width*2-2)/(texture.wide*2);

The same for bottom and top.

This formula prevents artifacts by using 99% of the texture.
The "correct" way to prevent artifacts is by using the spritesheet-artifact-fixer.py or a similar tool.

Affected nodes:
- cc.Sprite / cc.SpriteBatchNode and subclasses: cc.LabelBMFont, cc.TMXTiledMap
- cc.LabelAtlas
- cc.QuadParticleSystem
- cc.TileMap

To enabled set it to 1. Disabled by default.


Defined in: CCConfig.js.
<static> <constant> {Number} cc.FLT_EPSILON

Defined in: CCMacro.js.
<static> <constant> {Number} cc.FLT_MAX

Defined in: CCMacro.js.
<static> <constant> {Number} cc.FMT_JPG
Image Format:JPG
Defined in: CCCommon.js.
<static> <constant> {Number} cc.FMT_PNG
Image Format:PNG
Defined in: CCCommon.js.
<static> <constant> {Number} cc.FMT_RAWDATA
Image Format:RAWDATA
Defined in: CCCommon.js.
<static> <constant> {Number} cc.FMT_TIFF
Image Format:TIFF
Defined in: CCCommon.js.
<static> <constant> {Number} cc.FMT_UNKNOWN
Image Format:UNKNOWN
Defined in: CCCommon.js.
<static> <constant> {Number} cc.FMT_WEBP
Image Format:WEBP
Defined in: CCCommon.js.
<static> <constant> cc.GL_ALL
GL server side states
Defined in: CCGLStateCache.js.
<static> cc.Grabber
FBO class that grabs the the contents of the screen
Defined in: CCGrabber.js.
<static> <constant> {Number} cc.IMAGE_FORMAT_JPEG
enum for jpg
Defined in: CCRenderTexture.js.
<static> <constant> {Number} cc.IMAGE_FORMAT_PNG
enum for png
Defined in: CCRenderTexture.js.
<static> <constant> {Number} cc.IMAGE_FORMAT_RAWDATA
enum for raw
Defined in: CCRenderTexture.js.
<static> <constant> {Number} cc.INVALID_INDEX

Defined in: CCMacro.js.
<static> <constant> {Number} cc.IS_RETINA_DISPLAY_SUPPORTED
whether or not support retina display
Defined in: CCConfig.js.
<static> <constant> {Number} cc.ITEM_SIZE
default size for font size
Defined in: CCMenuItem.js.
<static> <constant> {object} cc.KEY
keymap
Defined in: CCCommon.js.
//Example
//to mark a keydown
cc.keyDown[65] = true;
//or
cc.keyMap[cc.KEY.a]

//to mark a keyup
do cc.keyDown[65] = false;

//to find out if a key is down, check
if(cc.keyDown[65])
//or
if,(cc.keyDown[cc.KEY.space])
//if its undefined or false or null, its not pressed
<static> <constant> {Number} cc.KEYBOARD_RETURNTYPE_DEFAULT

Defined in: CCEditBox.js.
<static> <constant> {Number} cc.KEYBOARD_RETURNTYPE_DONE

Defined in: CCEditBox.js.
<static> <constant> {Number} cc.KEYBOARD_RETURNTYPE_GO

Defined in: CCEditBox.js.

Defined in: CCEditBox.js.
<static> <constant> {Number} cc.KEYBOARD_RETURNTYPE_SEND

Defined in: CCEditBox.js.
<static> <constant> {Number} cc.LABEL_AUTOMATIC_WIDTH

Defined in: CCLabelBMFont.js.
<static> <constant> {Number} cc.LABELATLAS_DEBUG_DRAW

If enabled, all subclasses of cc.LabeltAtlas will draw a bounding box
Useful for debugging purposes only. It is recommened to leave it disabled.

To enable set it to a value different than 0. Disabled by default.


Defined in: CCConfig.js.
<static> <constant> {Number} cc.LABELBMFONT_DEBUG_DRAW

If enabled, all subclasses of cc.LabelBMFont will draw a bounding box
Useful for debugging purposes only. It is recommened to leave it disabled.

To enable set it to a value different than 0. Disabled by default.


Defined in: CCConfig.js.
<static> cc.max
The min corner of the box
Defined in: aabb.js.
<static> <constant> {Number} cc.MENU_HANDLER_PRIORITY

Defined in: CCMenu.js.
<static> <constant> {Number} cc.MENU_STATE_TRACKING_TOUCH

Defined in: CCMenu.js.
<static> <constant> {Number} cc.MENU_STATE_WAITING

Defined in: CCMenu.js.
<static> cc.min
The max corner of the box
Defined in: aabb.js.
<static> <constant> cc.NODE_ON_ENTER
Node on enter
Defined in: CCNode.js.
<static> <constant> cc.NODE_ON_EXIT
Node on exit
Defined in: CCNode.js.
<static> <constant> {Number} cc.NODE_TAG_INVALID
Default Node tag
Defined in: CCNode.js.
<static> cc.NodeGrid

NodeGrid class is a class serves as a decorator of cc.Node,
Grid node can run grid actions over all its children


Defined in: CCNodeGrid.js.
<static> <constant> {Number} cc.NORMAL_TAG
default tag for normal
Defined in: CCMenuItem.js.
<static> <constant> {Number} cc.ONE

Defined in: CCMacro.js.
<static> <constant> {Number} cc.ONE_MINUS_DST_COLOR

Defined in: CCMacro.js.
<static> <constant> {Number} cc.ONE_MINUS_SRC_ALPHA

Defined in: CCMacro.js.
<static> <constant> {Number} cc.OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA

If most of your imamges have pre-multiplied alpha, set it to 1 (if you are going to use .PNG/.JPG file images).
Only set to 0 if ALL your images by-pass Apple UIImage loading system (eg: if you use libpng or PVR images)

To enable set it to a value different than 0. Enabled by default.


Defined in: CCConfig.js.
<static> <constant> {Number} cc.PARTICLE_BALL_SHAPE
Ball Shape for ShapeMode of Particle
Defined in: CCParticleSystem.js.
<static> <constant> {Number} cc.PARTICLE_DEFAULT_CAPACITY
paticle default capacity
Defined in: CCParticleBatchNode.js.
<static> <constant> {Number} cc.PARTICLE_DURATION_INFINITY
The Particle emitter lives forever
Defined in: CCParticleSystem.js.
<static> <constant> {Number} cc.PARTICLE_MODE_GRAVITY
Gravity mode (A mode)
Defined in: CCParticleSystem.js.
<static> <constant> {Number} cc.PARTICLE_MODE_RADIUS
Radius mode (B mode)
Defined in: CCParticleSystem.js.
<static> <constant> {Number} cc.PARTICLE_SHAPE_MODE
Shape Mode of Particle Draw
Defined in: CCParticleSystem.js.
<static> <constant> {Number} cc.PARTICLE_STAR_SHAPE
Star Shape for ShapeMode of Particle
Defined in: CCParticleSystem.js.
<static> <constant> {Number} cc.PARTICLE_START_RADIUS_EQUAL_TO_END_RADIUS
The starting radius of the particle is equal to the ending radius
Defined in: CCParticleSystem.js.
<static> <constant> {Number} cc.PARTICLE_START_SIZE_EQUAL_TO_END_SIZE
The starting size of the particle is equal to the ending size
Defined in: CCParticleSystem.js.
<static> <constant> {Number} cc.PARTICLE_TEXTURE_MODE
Texture Mode of Particle Draw
Defined in: CCParticleSystem.js.
<static> <constant> {Number} cc.PARTICLE_TYPE_FREE
Living particles are attached to the world and are unaffected by emitter repositioning.
Defined in: CCParticleSystem.js.
<static> <constant> {Number} cc.PARTICLE_TYPE_GROUPED
Living particles are attached to the emitter and are translated along with it.
Defined in: CCParticleSystem.js.
<static> <constant> {Number} cc.PARTICLE_TYPE_RELATIVE
Living particles are attached to the world but will follow the emitter repositioning.
Use case: Attach an emitter to an sprite, and you want that the emitter follows the sprite.
Defined in: CCParticleSystem.js.
<static> <constant> {Number} cc.PI
PI is the ratio of a circle's circumference to its diameter.
Defined in: CCMacro.js.
<static> <constant> {Number} cc.POINT_EPSILON
smallest such that 1.0+FLT_EPSILON != 1.0
Defined in: CCPointExtension.js.
<static> <constant> {Number} cc.PRIORITY_NON_SYSTEM
Minimum priority level for user scheduling.
Defined in: CCScheduler.js.
<static> <constant> {Number} cc.PROGRESS_TEXTURE_COORDS

Defined in: CCProgressTimer.js.
<static> <constant> {Number} cc.PROGRESS_TEXTURE_COORDS_COUNT

Defined in: CCProgressTimer.js.
<static> <constant> {Number} cc.PROGRESS_TIMER_TYPE_BAR
Bar
Defined in: CCProgressTimer.js.
<static> <constant> {Number} cc.PROGRESS_TIMER_TYPE_RADIAL
Radial Counter-Clockwise
Defined in: CCProgressTimer.js.
<static> <constant> {Number} cc.RAD

Defined in: CCMacro.js.
<static> <constant> {Number} cc.REPEAT_FOREVER

Defined in: CCMacro.js.
<static> <constant> {String} cc.RETINA_DISPLAY_FILENAME_SUFFIX

It's the suffix that will be appended to the files in order to load "retina display" images.

On an iPhone4 with Retina Display support enabled, the file @"sprite-hd.png" will be loaded instead of @"sprite.png".
If the file doesn't exist it will use the non-retina display image.

Platforms: Only used on Retina Display devices like iPhone 4.


Defined in: CCConfig.js.
<static> <constant> {Number} cc.RETINA_DISPLAY_SUPPORT

If enabled, cocos2d supports retina display.
For performance reasons, it's recommended disable it in games without retina display support, like iPad only games.

To enable set it to 1. Use 0 to disable it. Enabled by default.

This value governs only the PNG, GIF, BMP, images.
This value DOES NOT govern the PVR (PVR.GZ, PVR.CCZ) files. If NPOT PVR is loaded, then it will create an NPOT texture ignoring this value.


Defined in: CCConfig.js.
Deprecated:
This value will be removed in 1.1 and NPOT textures will be loaded by default if the device supports it.
<static> {Number} cc.s_globalOrderOfArrival
XXX: Yes, nodes might have a sort problem once every 15 days if the game runs at 60 FPS and each frame sprites are reordered.
Defined in: CCNode.js.
<static> <constant> {Number} cc.SCENE_FADE
A tag constant for identifying fade scenes
Defined in: CCTransition.js.
<static> <constant> {Number} cc.SCENE_RADIAL
tag for scene redial
Defined in: CCTransitionProgress.js.
<static> <constant> {Number} cc.SELECTED_TAG
default selected tag
Defined in: CCMenuItem.js.
<static> <constant> cc.SHADER_POSITION_COLOR

Defined in: CCGLProgram.js.
<static> <constant> cc.SHADER_POSITION_COLOR_FRAG

Defined in: CCShaders.js.
<static> <constant> cc.SHADER_POSITION_COLOR_LENGTH_TEXTURE_FRAG

Defined in: CCShaders.js.
<static> <constant> cc.SHADER_POSITION_COLOR_LENGTH_TEXTURE_VERT

Defined in: CCShaders.js.
<static> <constant> cc.SHADER_POSITION_COLOR_VERT

Defined in: CCShaders.js.
<static> <constant> cc.SHADER_POSITION_LENGTHTEXTURECOLOR

Defined in: CCGLProgram.js.
<static> <constant> cc.SHADER_POSITION_TEXTURE

Defined in: CCGLProgram.js.
<static> <constant> cc.SHADER_POSITION_TEXTURE_A8COLOR_FRAG

Defined in: CCShaders.js.
<static> <constant> cc.SHADER_POSITION_TEXTURE_A8COLOR_VERT

Defined in: CCShaders.js.
<static> <constant> cc.SHADER_POSITION_TEXTURE_COLOR_ALPHATEST_FRAG

Defined in: CCShaders.js.
<static> <constant> cc.SHADER_POSITION_TEXTURE_COLOR_FRAG

Defined in: CCShaders.js.
<static> <constant> cc.SHADER_POSITION_TEXTURE_COLOR_VERT

Defined in: CCShaders.js.
<static> <constant> cc.SHADER_POSITION_TEXTURE_FRAG

Defined in: CCShaders.js.
<static> <constant> cc.SHADER_POSITION_TEXTURE_UCOLOR

Defined in: CCGLProgram.js.
<static> <constant> cc.SHADER_POSITION_TEXTURE_UCOLOR_FRAG

Defined in: CCShaders.js.
<static> <constant> cc.SHADER_POSITION_TEXTURE_UCOLOR_VERT

Defined in: CCShaders.js.
<static> <constant> cc.SHADER_POSITION_TEXTURE_VERT

Defined in: CCShaders.js.
<static> <constant> cc.SHADER_POSITION_TEXTUREA8COLOR

Defined in: CCGLProgram.js.
<static> <constant> cc.SHADER_POSITION_TEXTURECOLOR

Defined in: CCGLProgram.js.
<static> <constant> cc.SHADER_POSITION_TEXTURECOLORALPHATEST

Defined in: CCGLProgram.js.
<static> <constant> cc.SHADER_POSITION_UCOLOR

Defined in: CCGLProgram.js.
<static> <constant> cc.SHADER_POSITION_UCOLOR_FRAG

Defined in: CCShaders.js.
<static> <constant> cc.SHADER_POSITION_UCOLOR_VERT

Defined in: CCShaders.js.
<static> <constant> cc.SHADEREX_SWITCHMASK_FRAG

Defined in: CCShaders.js.
<static> <constant> {Number} cc.SPRITE_DEBUG_DRAW

If enabled, all subclasses of cc.Sprite will draw a bounding box
Useful for debugging purposes only. It is recommened to leave it disabled.

To enable set it to a value different than 0. Disabled by default:
0 -- disabled
1 -- draw bounding box
2 -- draw texture box


Defined in: CCConfig.js.
<static> <constant> {Number} cc.SPRITE_INDEX_NOT_INITIALIZED
cc.Sprite invalid index on the cc.SpriteBatchNode
Defined in: CCSprite.js.
<static> <constant> {Number} cc.SPRITEBATCHNODE_DEBUG_DRAW

If enabled, all subclasses of cc.Sprite that are rendered using an cc.SpriteBatchNode draw a bounding box.
Useful for debugging purposes only. It is recommened to leave it disabled.

To enable set it to a value different than 0. Disabled by default.


Defined in: CCConfig.js.
<static> <constant> {Number} cc.SPRITEBATCHNODE_RENDER_SUBPIXEL

If enabled, the cc.Sprite objects rendered with cc.SpriteBatchNode will be able to render in subpixels.
If disabled, integer pixels will be used.

To enable set it to 1. Enabled by default.


Defined in: CCConfig.js.
<static> <constant> {Number} cc.SRC_ALPHA

Defined in: CCMacro.js.
<static> {Number} cc.stencilBits
the value of stencil bits.
Defined in: CCClippingNode.js.
<static> <constant> cc.TABLEVIEW_FILL_BOTTOMUP
The constant value of the fill style from bottom to top for cc.TableView
Defined in: CCTableView.js.
<static> <constant> cc.TABLEVIEW_FILL_TOPDOWN
The constant value of the fill style from top to bottom for cc.TableView
Defined in: CCTableView.js.
<static> cc.TableViewDataSource
Data source that governs table backend data.
Defined in: CCTableView.js.
<static> cc.TableViewDelegate
Sole purpose of this delegate is to single touch event in this version.
Defined in: CCTableView.js.
<static> <constant> {Number} cc.TEXT_ALIGNMENT_CENTER
text alignment : center
Defined in: CCTypes.js.
<static> <constant> {Number} cc.TEXT_ALIGNMENT_LEFT
text alignment : left
Defined in: CCTypes.js.
<static> <constant> {Number} cc.TEXT_ALIGNMENT_RIGHT
text alignment : right
Defined in: CCTypes.js.
<static> <constant> {Number} cc.TEXTURE_ATLAS_USE_TRIANGLE_STRIP

Use GL_TRIANGLE_STRIP instead of GL_TRIANGLES when rendering the texture atlas.
It seems it is the recommend way, but it is much slower, so, enable it at your own risk

To enable set it to a value different than 0. Disabled by default.


Defined in: CCConfig.js.
<static> <constant> {Number} cc.TEXTURE_ATLAS_USE_VAO

By default, cc.TextureAtlas (used by many cocos2d classes) will use VAO (Vertex Array Objects).
Apple recommends its usage but they might consume a lot of memory, specially if you use many of them.
So for certain cases, where you might need hundreds of VAO objects, it might be a good idea to disable it.

To disable it set it to 0. disable by default.(Not Supported on WebGL)


Defined in: CCConfig.js.
<static> <constant> {Number} cc.TEXTURE_NPOT_SUPPORT

If enabled, NPOT textures will be used where available. Only 3rd gen (and newer) devices support NPOT textures.
NPOT textures have the following limitations:
- They can't have mipmaps
- They only accept GL_CLAMP_TO_EDGE in GL_TEXTURE_WRAP_{S,T}

To enable set it to a value different than 0. Disabled by default.

This value governs only the PNG, GIF, BMP, images.
This value DOES NOT govern the PVR (PVR.GZ, PVR.CCZ) files. If NPOT PVR is loaded, then it will create an NPOT texture ignoring this value.


Defined in: CCConfig.js.
Deprecated:
This value will be removed in 1.1 and NPOT textures will be loaded by default if the device supports it.
<static> <constant> {Number} cc.TGA_ERROR_COMPRESSED_FILE

Defined in: CCTGAlib.js.
<static> <constant> {Number} cc.TGA_ERROR_FILE_OPEN

Defined in: CCTGAlib.js.
<static> <constant> {Number} cc.TGA_ERROR_INDEXED_COLOR

Defined in: CCTGAlib.js.
<static> <constant> {Number} cc.TGA_ERROR_MEMORY

Defined in: CCTGAlib.js.
<static> <constant> {Number} cc.TGA_ERROR_READING_FILE

Defined in: CCTGAlib.js.
<static> <constant> {Number} cc.TGA_OK

Defined in: CCTGAlib.js.
<static> <constant> {Number} cc.TMX_LAYER_ATTRIB_BASE64

Defined in: CCTMXXMLParser.js.
<static> <constant> {Number} cc.TMX_LAYER_ATTRIB_GZIP

Defined in: CCTMXXMLParser.js.
<static> <constant> {Number} cc.TMX_LAYER_ATTRIB_NONE

Defined in: CCTMXXMLParser.js.
<static> <constant> {Number} cc.TMX_LAYER_ATTRIB_ZLIB

Defined in: CCTMXXMLParser.js.
<static> <constant> {Number} cc.TMX_ORIENTATION_HEX
Hexagonal orientation
Defined in: CCTMXTiledMap.js.
<static> <constant> {Number} cc.TMX_ORIENTATION_ISO
Isometric orientation
Defined in: CCTMXTiledMap.js.
<static> <constant> {Number} cc.TMX_ORIENTATION_ORTHO
Orthogonal orientation
Defined in: CCTMXTiledMap.js.
<static> <constant> {Number} cc.TMX_PROPERTY_LAYER

Defined in: CCTMXXMLParser.js.
<static> <constant> {Number} cc.TMX_PROPERTY_MAP

Defined in: CCTMXXMLParser.js.
<static> <constant> {Number} cc.TMX_PROPERTY_NONE

Defined in: CCTMXXMLParser.js.
<static> <constant> {Number} cc.TMX_PROPERTY_OBJECT

Defined in: CCTMXXMLParser.js.
<static> <constant> {Number} cc.TMX_PROPERTY_OBJECTGROUP

Defined in: CCTMXXMLParser.js.
<static> <constant> {Number} cc.TMX_PROPERTY_TILE

Defined in: CCTMXXMLParser.js.
<static> <constant> {Number} cc.TMX_TILE_DIAGONAL_FLAG

Defined in: CCTMXXMLParser.js.
<static> <constant> {Number} cc.TMX_TILE_FLIPPED_ALL

Defined in: CCTMXXMLParser.js.
<static> <constant> {Number} cc.TMX_TILE_FLIPPED_MASK

Defined in: CCTMXXMLParser.js.
<static> <constant> {Number} cc.TMX_TILE_HORIZONTAL_FLAG

Defined in: CCTMXXMLParser.js.
<static> <constant> {Number} cc.TMX_TILE_VERTICAL_FLAG

Defined in: CCTMXXMLParser.js.
<static> <constant> {Number} cc.TRANSITION_ORIENTATION_DOWN_OVER
vertical orientation type where the Bottom is nearer
Defined in: CCTransition.js.
<static> <constant> {Number} cc.TRANSITION_ORIENTATION_LEFT_OVER
horizontal orientation Type where the Left is nearer
Defined in: CCTransition.js.
<static> <constant> {Number} cc.TRANSITION_ORIENTATION_RIGHT_OVER
horizontal orientation type where the Right is nearer
Defined in: CCTransition.js.
<static> <constant> {Number} cc.TRANSITION_ORIENTATION_UP_OVER
vertical orientation type where the Up is nearer
Defined in: CCTransition.js.
<static> cc.UIInterfaceOrientationLandscapeLeft
ignore
Defined in: CCInputManager.js.
<static> <constant> {Number} cc.UINT_MAX
maximum unsigned int value
Defined in: CCMacro.js.
<static> <constant> cc.UNIFORM_ALPHA_TEST_VALUE_S

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_COSTIME

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_COSTIME_S

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_MAX

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_MVMATRIX

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_MVMATRIX_S

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_MVPMATRIX

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_MVPMATRIX_S

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_PMATRIX

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_PMATRIX_S

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_RANDOM01

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_RANDOM01_S

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_SAMPLER

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_SAMPLER_S

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_SINTIME

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_SINTIME_S

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_TIME

Defined in: CCGLProgram.js.
<static> <constant> cc.UNIFORM_TIME_S

Defined in: CCGLProgram.js.
<static> <constant> {Number} cc.USE_LA88_LABELS

If enabled, it will use LA88 (Luminance Alpha 16-bit textures) for CCLabelTTF objects.
If it is disabled, it will use A8 (Alpha 8-bit textures).
LA88 textures are 6% faster than A8 textures, but they will consume 2x memory.

This feature is enabled by default.


Defined in: CCConfig.js.
<static> <constant> cc.VERTEX_ATTRIB_COLOR

Defined in: CCGLProgram.js.
<static> <constant> cc.VERTEX_ATTRIB_FLAG_COLOR

Defined in: CCGLStateCache.js.
<static> <constant> cc.VERTEX_ATTRIB_FLAG_NONE

Defined in: CCGLStateCache.js.
<static> <constant> cc.VERTEX_ATTRIB_FLAG_POS_COLOR_TEX

Defined in: CCGLStateCache.js.
<static> <constant> cc.VERTEX_ATTRIB_FLAG_POSITION

Defined in: CCGLStateCache.js.
<static> <constant> cc.VERTEX_ATTRIB_FLAG_TEX_COORDS

Defined in: CCGLStateCache.js.
<static> <constant> cc.VERTEX_ATTRIB_MAX

Defined in: CCGLProgram.js.
<static> <constant> cc.VERTEX_ATTRIB_POSITION

Defined in: CCGLProgram.js.
<static> <constant> cc.VERTEX_ATTRIB_TEX_COORDS

Defined in: CCGLProgram.js.
<static> <constant> {Number} cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM
text alignment : bottom
Defined in: CCTypes.js.
<static> <constant> {Number} cc.VERTICAL_TEXT_ALIGNMENT_CENTER
text alignment : center
Defined in: CCTypes.js.
<static> <constant> {Number} cc.VERTICAL_TEXT_ALIGNMENT_TOP
text alignment : top
Defined in: CCTypes.js.
<static> {Object} cc.visibleRect

Defined in: CCVisibleRect.js.
<static> <constant> {Number} cc.ZERO

Defined in: CCMacro.js.
<static> <constant> {Number} cc.ZOOM_ACTION_TAG
default tag for zoom action tag
Defined in: CCMenuItem.js.

Method Detail

  • <static> {cc.$} cc.$new(x)
    Creates a new element, and adds cc.$ methods
    Defined in: miniFramework.js.
    Parameters:
    {String} x
    name of the element tag to create
    Returns:
    {cc.$}
  • <static> cc.Acceleration(x, y, z, timestamp)
    the device accelerometer reports values for each axis in units of g-force
    Defined in: CCTypes.js.
    Parameters:
    x
    y
    z
    timestamp
  • <static> cc.AffineTransform(a, b, c, d, tx, ty)

    Defined in: CCAffineTransform.js.
    Parameters:
    {Number} a
    {Number} b
    {Number} c
    {Number} d
    {Number} tx
    {Number} ty
  • <static> {cc.AffineTransform} cc.AffineTransformConcat(t1, t2)
    Concatenate `t2' to `t1' and return the result:
    t' = t1 * t2
    Defined in: CCAffineTransform.js.
    Parameters:
    {cc.AffineTransform} t1
    {cc.AffineTransform} t2
    Returns:
    {cc.AffineTransform} Constructor
  • <static> {Boolean} cc.AffineTransformEqualToTransform(t1, t2)
    Return true if `t1' and `t2' are equal, false otherwise.
    Defined in: CCAffineTransform.js.
    Parameters:
    {cc.AffineTransform} t1
    {cc.AffineTransform} t2
    Returns:
    {Boolean} Constructor
  • <static> {cc.AffineTransform} cc.AffineTransformIdentity()

    Defined in: CCAffineTransform.js.
    Returns:
    {cc.AffineTransform} Constructor
  • <static> {cc.AffineTransform} cc.AffineTransformInvert(t)

    Defined in: CCAffineTransform.js.
    Parameters:
    {cc.AffineTransform} t
    Returns:
    {cc.AffineTransform} Constructor
  • <static> {cc.AffineTransform} cc.AffineTransformMake(a, b, c, d, tx, ty)

    Defined in: CCAffineTransform.js.
    Parameters:
    {Number} a
    {Number} b
    {Number} c
    {Number} d
    {Number} tx
    {Number} ty
    Returns:
    {cc.AffineTransform} Constructor
  • <static> {cc.AffineTransform} cc.AffineTransformMakeIdentity()

    Defined in: CCAffineTransform.js.
    Returns:
    {cc.AffineTransform} Constructor
  • <static> {cc.AffineTransform} cc.AffineTransformRotate(aTransform, anAngle)

    Defined in: CCAffineTransform.js.
    Parameters:
    {cc.AffineTransform} aTransform
    {Number} anAngle
    Returns:
    {cc.AffineTransform} Constructor
  • <static> {cc.AffineTransform} cc.AffineTransformScale(t, sx, sy)

    Defined in: CCAffineTransform.js.
    Parameters:
    {cc.AffineTransform} t
    {Number} sx
    {Number} sy
    Returns:
    {cc.AffineTransform} Constructor
  • <static> {cc.AffineTransform} cc.AffineTransformTranslate(t, tx, ty)

    Defined in: CCAffineTransform.js.
    Parameters:
    {cc.AffineTransform} t
    {Number} tx
    {Number} ty
    Returns:
    {cc.AffineTransform} Constructor
  • <static> {Array} cc.arrayAppendObjectsToIndex(arr, addObjs, index)
    Inserts some objects at index
    Defined in: CCScheduler.js.
    Parameters:
    {Array} arr
    {Array} addObjs
    {Number} index
    Returns:
    {Array}
  • <static> cc.arrayRemoveArray(arr, minusArr)
    Removes from arr all values in minusArr. For each Value in minusArr, the first matching instance in arr will be removed.
    Defined in: CCScheduler.js.
    Parameters:
    {Array} arr
    Source Array
    {Array} minusArr
    minus Array
  • <static> cc.arrayRemoveObject(arr, delObj)
    Searches for the first occurance of object and removes it. If object is not found the function has no effect.
    Defined in: CCScheduler.js.
    Parameters:
    {Array} arr
    Source Array
    {*} delObj
    remove object
  • <static> {Boolean} cc.arrayVerifyType(arr, type)
    Verify Array's Type
    Defined in: CCScheduler.js.
    Parameters:
    {Array} arr
    {function} type
    Returns:
    {Boolean}
  • <static> cc.associateWithNative(jsObj, superclass)
    Function added for JS bindings compatibility. Not needed in cocos2d-html5.
    Defined in: CCCommon.js.
    Parameters:
    {object} jsObj
    subclass
    {object} superclass
  • <static> {Number} cc.bezierAt(a, b, c, d, t)

    Defined in: CCActionInterval.js.
    Parameters:
    {Number} a
    {Number} b
    {Number} c
    {Number} d
    {Number} t
    Returns:
    {Number}
  • <static> {cc.Point} cc.CardinalSplineAt(p0, p1, p2, p3, tension, t)

    Returns the Cardinal Spline position for a given set of control points, tension and time CatmullRom Spline formula:
    s(-ttt + 2tt - t)P1 + s(-ttt + tt)P2 + (2ttt - 3tt + 1)P2 + s(ttt - 2tt + t)P3 + (-2ttt + 3tt)P3 + s(ttt - tt)P4


    Defined in: CCActionCatmullRom.js.
    Parameters:
    {cc.Point} p0
    {cc.Point} p1
    {cc.Point} p2
    {cc.Point} p3
    {Number} tension
    {Number} t
    Returns:
    {cc.Point}
  • <static> cc.CGAffineToGL(trans, mat)
    convert an affine transform object to a kmMat4 object
    Defined in: TransformUtils.js.
    Parameters:
    {cc.AffineTransform} trans
    {cc.kmMat4} mat
  • <static> {Number} cc.clampf(value, min_inclusive, max_inclusive)
    Clamp a value between from and to.
    Defined in: CCPointExtension.js.
    Parameters:
    {Number} value
    {Number} min_inclusive
    {Number} max_inclusive
    Returns:
    {Number}
  • <static> {Array|object} cc.clone(obj)
    copy an new object
    Defined in: CCCommon.js.
    Parameters:
    {object|Array} obj
    source object
    Returns:
    {Array|object}
  • <static> {cc.Color} cc.color(r, g, b, a)

    Defined in: CCTypes.js.
    Parameters:
    {Number|String|cc.Color} r
    {Number} g
    {Number} b
    {Number} a
    Returns:
    {cc.Color}
  • <static> {Boolean} cc.colorEqual(color1, color2)
    returns true if both ccColor3B are equal. Otherwise it returns false.
    Defined in: CCTypes.js.
    Parameters:
    {cc.Color} color1
    {cc.Color} color2
    Returns:
    {Boolean} true if both ccColor3B are equal. Otherwise it returns false.
  • <static> {String} cc.colorToHex(color)
    convert Color to a string of color for style. e.g. cc.color(255,6,255) to : "#ff06ff"
    Defined in: CCTypes.js.
    Parameters:
    {cc.Color} color
    Returns:
    {String}
  • <static> cc.CONTENT_SCALE_FACTOR()

    On Mac it returns 1;
    On iPhone it returns 2 if RetinaDisplay is On. Otherwise it returns 1


    Defined in: CCMacro.js.
  • <static> {Array} cc.copyArray(arr)
    copy an array's item to a new array (its performance is better than Array.slice)
    Defined in: CCCommon.js.
    Parameters:
    {Array} arr
    Returns:
    {Array}
  • <static> cc.defineGetterSetter(proto, prop, getter, setter, getterName, setterName)
    Common getter setter configuration function
    Defined in: CCCommon.js.
    Parameters:
    {Object} proto
    A class prototype or an object to config
    {String} prop
    Property name
    {function} getter
    Getter function for the property
    {function} setter
    Setter function for the property
    {String} getterName
    Name of getter function for the property
    {String} setterName
    Name of setter function for the property
  • <static> {Number} cc.DEGREES_TO_RADIANS(angle)
    converts degrees to radians
    Defined in: CCMacro.js.
    Parameters:
    {Number} angle
    Returns:
    {Number}
  • <static> cc.DISABLE_DEFAULT_GL_STATES()

    Disable default GL states:
    - GL_TEXTURE_2D
    - GL_TEXTURE_COORD_ARRAY
    - GL_COLOR_ARRAY


    Defined in: CCMacro.js.
  • <static> cc.ENABLE_DEFAULT_GL_STATES()

    GL states that are enabled:
    - GL_TEXTURE_2D
    - GL_VERTEX_ARRAY
    - GL_TEXTURE_COORD_ARRAY
    - GL_COLOR_ARRAY


    Defined in: CCMacro.js.
  • <static> {Array} cc.generateTextureCacheForColor(texture)
    generate texture's cache for texture tint
    Defined in: CCSprite.js.
    Parameters:
    {HTMLImageElement} texture
    Returns:
    {Array}
  • <static> {HTMLCanvasElement} cc.generateTintImage(texture, tintedImgCache, color, rect, renderCanvas)
    generate tinted texture lighter: The source and destination colors are added to each other, resulting in brighter colors, moving towards color values of 1 (maximum brightness for that color).
    Defined in: CCSprite.js.
    Parameters:
    {HTMLImageElement} texture
    {Array} tintedImgCache
    {cc.Color} color
    {cc.Rect} rect
    {HTMLCanvasElement} renderCanvas Optional
    Returns:
    {HTMLCanvasElement}
  • <static> {HTMLCanvasElement} cc.generateTintImage2(texture, color, rect)
    generate tinted texture source-in: Where source and destination overlaps and both are opaque, the source is displayed. Everywhere else transparency is displayed.
    Defined in: CCSprite.js.
    Parameters:
    {HTMLImageElement} texture
    {cc.Color} color
    {cc.Rect} rect
    Returns:
    {HTMLCanvasElement}
  • <static> {Array} cc.getControlPointAt(controlPoints, pos)
    returns a point from the array
    Defined in: CCActionCatmullRom.js.
    Parameters:
    {Array} controlPoints
    {Number} pos
    Returns:
    {Array}
  • <static> cc.glBindTexture2D(textureId)
    If the texture is not already bound, it binds it.
    If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly.
    Defined in: CCGLStateCache.js.
    Parameters:
    {cc.Texture2D} textureId
  • <static> cc.glBindTexture2DN(textureUnit, textureId)
    If the texture is not already bound to a given unit, it binds it.
    If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly.
    Defined in: CCGLStateCache.js.
    Parameters:
    {Number} textureUnit
    {cc.Texture2D} textureId
  • <static> cc.glBindVAO(vaoId)
    If the vertex array is not already bound, it binds it.
    If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindVertexArray() directly.
    Defined in: CCGLStateCache.js.
    Parameters:
    vaoId
  • <static> cc.glBlendFunc(sfactor, dfactor)
    Uses a blending function in case it not already used.
    If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glBlendFunc() directly.
    Defined in: CCGLStateCache.js.
    Parameters:
    {Number} sfactor
    {Number} dfactor
  • <static> cc.glBlendResetToCache()
    Resets the blending mode back to the cached state in case you used glBlendFuncSeparate() or glBlendEquation().
    If CC_ENABLE_GL_STATE_CACHE is disabled, it will just set the default blending mode using GL_FUNC_ADD.
    Defined in: CCGLStateCache.js.
  • <static> cc.glDeleteProgram(program)
    Deletes the GL program. If it is the one that is being used, it invalidates it.
    If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glDeleteProgram() directly.
    Defined in: CCGLStateCache.js.
    Parameters:
    {WebGLProgram} program
  • <static> cc.glDeleteTexture(textureId)
    It will delete a given texture. If the texture was bound, it will invalidate the cached.
    If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly.
    Defined in: CCGLStateCache.js.
    Parameters:
    {WebGLTexture} textureId
  • <static> cc.glDeleteTextureN(textureUnit, textureId)
    It will delete a given texture. If the texture was bound, it will invalidate the cached for the given texture unit.
    If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly.
    Defined in: CCGLStateCache.js.
    Parameters:
    {Number} textureUnit
    {WebGLTexture} textureId
  • <static> cc.glEnable(flags)
    It will enable / disable the server side GL states.
    If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glEnable() directly.
    Defined in: CCGLStateCache.js.
    Parameters:
    {Number} flags
  • <static> cc.glEnableVertexAttribs(flags)

    Will enable the vertex attribs that are passed as flags.
    Possible flags:
    cc.VERTEX_ATTRIB_FLAG_POSITION
    cc.VERTEX_ATTRIB_FLAG_COLOR
    cc.VERTEX_ATTRIB_FLAG_TEX_COORDS

    These flags can be ORed. The flags that are not present, will be disabled.


    Defined in: CCGLStateCache.js.
    Parameters:
    {cc.VERTEX_ATTRIB_FLAG_POSITION | cc.VERTEX_ATTRIB_FLAG_COLOR | cc.VERTEX_ATTRIB_FLAG_TEX_OORDS} flags
  • <static> cc.glInvalidateStateCache()
    Invalidates the GL state cache.
    If CC_ENABLE_GL_STATE_CACHE it will reset the GL state cache.
    Defined in: CCGLStateCache.js.
  • <static> cc.GLToCGAffine(mat, trans)
    Convert a kmMat4 object to an affine transform object
    Defined in: TransformUtils.js.
    Parameters:
    {cc.kmMat4} mat
    {cc.AffineTransform} trans
  • <static> cc.glUseProgram(program)
    Uses the GL program in case program is different than the current one.
    If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glUseProgram() directly.
    Defined in: CCGLStateCache.js.
    Parameters:
    {WebGLProgram} program
  • <static> {cc.Color} cc.hexToColor(hex)
    convert a string of color for style to Color. e.g. "#ff06ff" to : cc.color(255,6,255)
    Defined in: CCTypes.js.
    Parameters:
    {String} hex
    Returns:
    {cc.Color}
  • <static> cc.IMEKeyboardNotificationInfo(begin, end, duration)
    IME Keyboard Notification Info structure
    Defined in: CCIMEDispatcher.js.
    Parameters:
    {cc.Rect} begin
    the soft keyboard rectangle when animatin begin
    {cc.Rect} end
    the soft keyboard rectangle when animatin end
    {Number} duration
    the soft keyboard animation duration
  • <static> cc.INCREMENT_GL_DRAWS(addNumber)

    Increments the GL Draws counts by one.
    The number of calls per frame are displayed on the screen when the CCDirector's stats are enabled.


    Defined in: CCMacro.js.
    Parameters:
    {Number} addNumber
  • <static> {Boolean} cc.isspace_unicode(ch)

    Defined in: CCLabelBMFont.js.
    Parameters:
    {String} ch
    Returns:
    {Boolean} weather the character is a whitespace character.
  • <static> cc.kmAABB(min, max)
    A struture that represents an axis-aligned bounding box.
    Defined in: aabb.js.
    Parameters:
    min
    max
  • <static> cc.kmAABBAssign(pOut, pIn)
    Assigns pIn to pOut, returns pOut.
    Defined in: aabb.js.
    Parameters:
    pOut
    pIn
  • <static> cc.kmAABBContainsPoint(pPoint, pBox)
    Returns KM_TRUE if point is in the specified AABB, returns KM_FALSE otherwise.
    Defined in: aabb.js.
    Parameters:
    pPoint
    pBox
  • <static> cc.kmAABBScale(pOut, pIn, s)
    Scales pIn by s, stores the resulting AABB in pOut. Returns pOut
    Defined in: aabb.js.
    Parameters:
    pOut
    pIn
    s
  • <static> cc.kmMat4()

    A 4x4 matrix

    mat =
    | 0 4 8 12 |
    | 1 5 9 13 |
    | 2 6 10 14 |
    | 3 7 11 15 |


    Defined in: mat4.js.
  • <static> cc.kmMat4AreEqual(pMat1, pMat2)
    Returns KM_TRUE if the 2 matrices are equal (approximately)
    Defined in: mat4.js.
    Parameters:
    pMat1
    pMat2
  • <static> cc.kmMat4Assign(pOut, pIn)
    Assigns the value of pIn to pOut
    Defined in: mat4.js.
    Parameters:
    pOut
    pIn
  • <static> cc.kmMat4ExtractRotation(pOut, pIn)
    Extract a 3x3 rotation matrix from the input 4x4 transformation. Stores the result in pOut, returns pOut
    Defined in: mat4.js.
    Parameters:
    pOut
    pIn
  • <static> cc.kmMat4Fill(pOut, pMat)
    Fills a kmMat4 structure with the values from a 16 element array of floats
    Defined in: mat4.js.
    Parameters:
    pOut
    pMat
  • <static> cc.kmMat4GetForwardVec3(pOut, pIn)
    Extract the forward vector from a 4x4 matrix. The result is stored in pOut. Returns pOut.
    Defined in: mat4.js.
    Parameters:
    pOut
    pIn
  • <static> cc.kmMat4GetRightVec3(pOut, pIn)
    Extract the right vector from a 4x4 matrix. The result is stored in pOut. Returns pOut.
    Defined in: mat4.js.
    Parameters:
    pOut
    pIn
  • <static> cc.kmMat4GetUpVec3(pOut, pIn)
    Get the up vector from a matrix. pIn is the matrix you wish to extract the vector from. pOut is a pointer to the kmVec3 structure that should hold the resulting vector
    Defined in: mat4.js.
    Parameters:
    pOut
    pIn
  • <static> cc.kmMat4Identity(pOut)
    Sets pOut to an identity matrix returns pOut
    Defined in: mat4.js.
    Parameters:
    pOut
  • <static> cc.kmMat4Inverse(pOut, pM)
    Calculates the inverse of pM and stores the result in pOut.
    Defined in: mat4.js.
    Parameters:
    pOut
    pM
  • <static> cc.kmMat4IsIdentity(pIn)
    Returns KM_TRUE if pIn is an identity matrix KM_FALSE otherwise
    Defined in: mat4.js.
    Parameters:
    pIn
  • <static> cc.kmMat4LookAt(pOut, pEye, pCenter, pUp)
    Builds a translation matrix in the same way as gluLookAt() the resulting matrix is stored in pOut. pOut is returned.
    Defined in: mat4.js.
    Parameters:
    pOut
    pEye
    pCenter
    pUp
  • <static> cc.kmMat4Multiply(pOut, pM1, pM2)
    Multiplies pM1 with pM2, stores the result in pOut, returns pOut
    Defined in: mat4.js.
    Parameters:
    pOut
    pM1
    pM2
  • <static> cc.kmMat4OrthographicProjection(pOut, left, right, bottom, top, nearVal, farVal)
    Creates an orthographic projection matrix like glOrtho
    Defined in: mat4.js.
    Parameters:
    pOut
    left
    right
    bottom
    top
    nearVal
    farVal
  • <static> cc.kmMat4PerspectiveProjection(pOut, fovY, aspect, zNear, zFar)
    Creates a perspective projection matrix in the same way as gluPerspective
    Defined in: mat4.js.
    Parameters:
    pOut
    fovY
    aspect
    zNear
    zFar
  • <static> cc.kmMat4RotationAxisAngle(pOut, axis, radians)
    Build a rotation matrix from an axis and an angle. Result is stored in pOut. pOut is returned.
    Defined in: mat4.js.
    Parameters:
    pOut
    axis
    radians
  • <static> cc.kmMat4RotationPitchYawRoll(pOut, pitch, yaw, roll)
    Builds a rotation matrix from pitch, yaw and roll. The resulting matrix is stored in pOut and pOut is returned
    Defined in: mat4.js.
    Parameters:
    pOut
    pitch
    yaw
    roll
  • <static> cc.kmMat4RotationQuaternion(pOut, pQ)
    Converts a quaternion to a rotation matrix, the result is stored in pOut, returns pOut
    Defined in: mat4.js.
    Parameters:
    pOut
    pQ
  • <static> cc.kmMat4RotationToAxisAngle(pAxis, radians, pIn)
    Take the rotation from a 4x4 transformation matrix, and return it as an axis and an angle (in radians) returns the output axis.
    Defined in: mat4.js.
    Parameters:
    pAxis
    radians
    pIn
  • <static> cc.kmMat4RotationTranslation(pOut, rotation, translation)
    Build a 4x4 OpenGL transformation matrix using a 3x3 rotation matrix, and a 3d vector representing a translation. Assign the result to pOut, pOut is also returned.
    Defined in: mat4.js.
    Parameters:
    pOut
    rotation
    translation
  • <static> cc.kmMat4RotationX(pOut, radians)
    Builds an X-axis rotation matrix and stores it in pOut, returns pOut
    Defined in: mat4.js.
    Parameters:
    pOut
    radians
  • <static> cc.kmMat4RotationY(pOut, radians)
    Builds a rotation matrix using the rotation around the Y-axis The result is stored in pOut, pOut is returned.
    Defined in: mat4.js.
    Parameters:
    pOut
    radians
  • <static> cc.kmMat4RotationZ(pOut, radians)
    Builds a rotation matrix around the Z-axis. The resulting matrix is stored in pOut. pOut is returned.
    Defined in: mat4.js.
    Parameters:
    pOut
    radians
  • <static> cc.kmMat4Scaling(pOut, x, y, z)
    Builds a scaling matrix
    Defined in: mat4.js.
    Parameters:
    pOut
    x
    y
    z
  • <static> cc.kmMat4Translation(pOut, x, y, z)
    Builds a translation matrix. All other elements in the matrix will be set to zero except for the diagonal which is set to 1.0
    Defined in: mat4.js.
    Parameters:
    pOut
    x
    y
    z
  • <static> cc.kmMat4Transpose(pOut, pIn)
    Sets pOut to the transpose of pIn, returns pOut
    Defined in: mat4.js.
    Parameters:
    pOut
    pIn
  • <static> cc.kmPlaneClassifyPoint(pIn, pP)
    Returns POINT_INFRONT_OF_PLANE if pP is infront of pIn. Returns POINT_BEHIND_PLANE if it is behind. Returns POINT_ON_PLANE otherwise
    Defined in: plane.js.
    Parameters:
    pIn
    pP
  • <static> cc.kmPlaneFromPoints(pOut, p1, p2, p3)
    Creates a plane from 3 points. The result is stored in pOut. pOut is returned.
    Defined in: plane.js.
    Parameters:
    pOut
    p1
    p2
    p3
  • <static> cc.kmQuaternionRotationBetweenVec3(pOut, vec1, vec2, fallback)
    Adapted from the OGRE engine! Gets the shortest arc quaternion to rotate this vector to the destination vector.
    Defined in: quaternion.js.
    Parameters:
    pOut
    vec1
    vec2
    fallback
  • <static> cc.kmSQR(s)
    Returns the square of s (e.g. s*s)
    Defined in: utility.js.
    Parameters:
    {Number} s
  • <static> cc.lerp(a, b, r)

    Linear interpolation between 2 numbers, the ratio sets how much it is biased to each end


    Defined in: CCMacro.js.
    cc.lerp(2,10,0.5)//returns 6
    cc.lerp(2,10,0.2)//returns 3.6
    Parameters:
    {Number} a
    number A
    {Number} b
    number B
    {Number} r
    ratio between 0 and 1
  • <static> {Number} cc.NextPOT(x)

    Defined in: CCRenderTexture.js.
    Parameters:
    {Number} x
    Returns:
    {Number} Constructor
  • <static> cc.NODE_DRAW_SETUP(node)
    Helpful macro that setups the GL server state, the correct GL program and sets the Model View Projection matrix
    Defined in: CCMacro.js.
    Parameters:
    {cc.Node} node
    setup node
  • <static> cc.openURL(url)
    Open an URL address
    Defined in: miniFramework.js.
    Parameters:
    url
  • <static> {cc.Point} cc.p(x, y)
    Helper macro that creates a cc.Point.
    Defined in: CCGeometry.js.
    var point1 = cc.p();
    var point2 = cc.p(100,100,100,100);
    var point3 = cc.p(point2);
    Parameters:
    {Number|cc.Point} x
    a Number or a size object
    {Number} y
    Returns:
    {cc.Point}
  • <static> {cc.Point} cc.pAdd(v1, v2)
    Calculates sum of two points.
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} v1
    {cc.Point} v2
    Returns:
    {cc.Point}
  • <static> cc.pAddIn(v1, v2)
    adds one point to another (inplace)
    Defined in: CCPointExtension.js.
    Parameters:
    v1
    v2
  • <static> {Number} cc.pAngle(a, b)

    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} a
    {cc.Point} b
    Returns:
    {Number} the angle in radians between two vector directions
  • <static> {Number} cc.pAngleSigned(a, b)

    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} a
    {cc.Point} b
    Returns:
    {Number} the signed angle in radians between two vector directions
  • <static> {cc.Point} cc.pClamp(p, min_inclusive, max_inclusive)
    Clamp a point between from and to.
    Defined in: CCPointExtension.js.
    Parameters:
    {Point} p
    {Number} min_inclusive
    {Number} max_inclusive
    Returns:
    {cc.Point}
  • <static> {cc.Point} cc.pCompMult(a, b)
    Multiplies a nd b components, a.x*b.x, a.y*b.y
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} a
    {cc.Point} b
    Returns:
    {cc.Point}
  • <static> {cc.Point} cc.pCompOp(p, opFunc)
    Run a math operation function on each point component
    Math.abs, Math.fllor, Math.ceil, Math.round.
    Defined in: CCPointExtension.js.
    //For example: let's try to take the floor of x,y
    var p = cc.pCompOp(cc.p(10,10),Math.abs);
    Parameters:
    {cc.Point} p
    {Function} opFunc
    Returns:
    {cc.Point}
  • <static> {Number} cc.pCross(v1, v2)
    Calculates cross product of two points.
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} v1
    {cc.Point} v2
    Returns:
    {Number}
  • <static> {cc.pLength} cc.pDistance(v1, v2)
    Calculates the distance between two points
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} v1
    {cc.Point} v2
    Returns:
    {cc.pLength}
  • <static> {Number} cc.pDistanceSQ(point1, point2)
    Calculates the square distance between two points (not calling sqrt() )
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} point1
    {cc.Point} point2
    Returns:
    {Number}
  • <static> {Number} cc.pDot(v1, v2)
    Calculates dot product of two points.
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} v1
    {cc.Point} v2
    Returns:
    {Number}
  • <static> {cc.Point} cc.pForAngle(a)
    Converts radians to a normalized vector.
    Defined in: CCPointExtension.js.
    Parameters:
    {Number} a
    Returns:
    {cc.Point}
  • <static> {cc.Point} cc.pFromSize(s)
    Quickly convert cc.Size to a cc.Point
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Size} s
    Returns:
    {cc.Point}
  • <static> {Boolean} cc.pFuzzyEqual(a, b, variance)

    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} a
    {cc.Point} b
    {Number} variance
    Returns:
    {Boolean} if points have fuzzy equality which means equal with some degree of variance.
  • <static> cc.pIn(v1, v2)
    copies the position of one point to another
    Defined in: CCPointExtension.js.
    Parameters:
    v1
    v2
  • <static> {cc.Point} cc.pIntersectPoint(A, B, C, D)
    ccpIntersectPoint return the intersection point of line A-B, C-D
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} A
    {cc.Point} B
    {cc.Point} C
    {cc.Point} D
    Returns:
    {cc.Point}
  • <static> {Number} cc.pLength(v)
    Calculates distance between point an origin
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} v
    Returns:
    {Number}
  • <static> {Number} cc.pLengthSQ(v)
    Calculates the square length of a cc.Point (not calling sqrt() )
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} v
    Returns:
    {Number}
  • <static> {cc.pAdd} cc.pLerp(a, b, alpha)
    Linear Interpolation between two points a and b alpha == 0 ? a alpha == 1 ? b otherwise a value between a..b
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} a
    {cc.Point} b
    {Number} alpha
    Returns:
    {cc.pAdd}
  • <static> {Boolean} cc.pLineIntersect(A, B, C, D, retP)
    A general line-line intersection test
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} A
    A is the startpoint for the first line P1 = (p1 - p2).
    {cc.Point} B
    B is the endpoint for the first line P1 = (p1 - p2).
    {cc.Point} C
    C is the startpoint for the second line P2 = (p3 - p4).
    {cc.Point} D
    D is the endpoint for the second line P2 = (p3 - p4).
    {cc.Point} retP
    retP.x is the range for a hitpoint in P1 (pa = p1 + s*(p2 - p1)),
    retP.y is the range for a hitpoint in P3 (pa = p2 + t*(p4 - p3)).
    Returns:
    {Boolean} indicating successful intersection of a line
    note that to truly test intersection for segments we have to make
    sure that s & t lie within [0..1] and for rays, make sure s & t > 0
    the hit point is p3 + t * (p4 - p3);
    the hit point also is p1 + s * (p2 - p1);
  • <static> {cc.pMult} cc.pMidpoint(v1, v2)
    Calculates midpoint between two points.
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} v1
    {cc.Point} v2
    Returns:
    {cc.pMult}
  • <static> {cc.Point} cc.pMult(point, floatVar)
    Returns point multiplied by given factor.
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} point
    {Number} floatVar
    Returns:
    {cc.Point}
  • <static> cc.pMultIn(point, floatVar)
    multiplies the point with the given factor (inplace)
    Defined in: CCPointExtension.js.
    Parameters:
    point
    floatVar
  • <static> {cc.Point} cc.pNeg(point)
    Returns opposite of point.
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} point
    Returns:
    {cc.Point}
  • <static> {cc.Point} cc.pNormalize(v)
    Returns point multiplied to a length of 1.
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} v
    Returns:
    {cc.Point}
  • <static> cc.pNormalizeIn(v)
    normalizes the point (inplace)
    Defined in: CCPointExtension.js.
    Parameters:
    v
  • <static> cc.POINT_PIXELS_TO_POINTS(pixels)
    Converts a Point in pixels to points
    Defined in: CCMacro.js.
    Parameters:
    {Point} pixels
  • <static> {cc.Point} cc.POINT_POINTS_TO_PIXELS(points)
    Converts a Point in points to pixels
    Defined in: CCMacro.js.
    Parameters:
    {cc.Point} points
    Returns:
    {cc.Point}
  • <static> {cc.Point} cc.PointApplyAffineTransform(point, t)

    Defined in: CCAffineTransform.js.
    Parameters:
    {cc.Point} point
    {cc.AffineTransform} t
    Returns:
    {cc.Point} Constructor
  • <static> {Boolean} cc.pointEqualToPoint(point1, point2)

    Defined in: CCGeometry.js.
    Parameters:
    {cc.Point} point1
    {cc.Point} point2
    Returns:
    {Boolean}
  • <static> {cc.Point} cc.pPerp(point)
    Calculates perpendicular of v, rotated 90 degrees counter-clockwise -- cross(v, perp(v)) >= 0
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} point
    Returns:
    {cc.Point}
  • <static> {cc.pMult} cc.pProject(v1, v2)
    Calculates the projection of v1 over v2.
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} v1
    {cc.Point} v2
    Returns:
    {cc.pMult}
  • <static> {cc.Point} cc.pRotate(v1, v2)
    Rotates two points.
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} v1
    {cc.Point} v2
    Returns:
    {cc.Point}
  • <static> {cc.Point} cc.pRotateByAngle(v, pivot, angle)
    Rotates a point counter clockwise by the angle around a pivot
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} v
    v is the point to rotate
    {cc.Point} pivot
    pivot is the pivot, naturally
    {Number} angle
    angle is the angle of rotation cw in radians
    Returns:
    {cc.Point} the rotated point
  • <static> {cc.Point} cc.pRPerp(point)
    Calculates perpendicular of v, rotated 90 degrees clockwise -- cross(v, rperp(v)) <= 0
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} point
    Returns:
    {cc.Point}
  • <static> {Boolean} cc.pSameAs(A, B)
    check to see if both points are equal
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} A
    A ccp a
    {cc.Point} B
    B ccp b to be compared
    Returns:
    {Boolean} the true if both ccp are same
  • <static> {Boolean} cc.pSegmentIntersect(A, B, C, D)
    ccpSegmentIntersect return YES if Segment A-B intersects with segment C-D.
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} A
    {cc.Point} B
    {cc.Point} C
    {cc.Point} D
    Returns:
    {Boolean}
  • <static> {cc.Point} cc.pSub(v1, v2)
    Calculates difference of two points.
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} v1
    {cc.Point} v2
    Returns:
    {cc.Point}
  • <static> cc.pSubIn(v1, v2)
    subtracts one point from another (inplace)
    Defined in: CCPointExtension.js.
    Parameters:
    v1
    v2
  • <static> {Number} cc.pToAngle(v)
    Converts a vector to radians.
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} v
    Returns:
    {Number}
  • <static> {cc.Point} cc.pUnrotate(v1, v2)
    Unrotates two points.
    Defined in: CCPointExtension.js.
    Parameters:
    {cc.Point} v1
    {cc.Point} v2
    Returns:
    {cc.Point}
  • <static> cc.pZeroIn(v)
    sets the position of the point to 0
    Defined in: CCPointExtension.js.
    Parameters:
    v
  • <static> {Number} cc.RADIANS_TO_DEGREES(angle)
    converts radians to degrees
    Defined in: CCMacro.js.
    Parameters:
    {Number} angle
    Returns:
    {Number}
  • <static> {number} cc.rand()
    get a random number from 0 to 0xffffff
    Defined in: CCActionGrid3D.js.
    Returns:
    {number}
  • <static> {Number} cc.RANDOM_0_1()
    returns a random float between 0 and 1
    Defined in: CCMacro.js.
    Returns:
    {Number}
  • <static> {Number} cc.RANDOM_MINUS1_1()
    returns a random float between -1 and 1
    Defined in: CCMacro.js.
    Returns:
    {Number}
  • <static> {cc.Rect} cc.rect(x, y, w, h)
    Return a new Rect
    Defined in: CCGeometry.js.
    var rect1 = cc.rect();
    var rect2 = cc.rect(100,100,100,100);
    var rect3 = cc.rect(rect2);
    Parameters:
    {Number|cc.Rect} x
    a number or a rect object
    {Number} y
    {Number} w
    {Number} h
    Returns:
    {cc.Rect}
  • <static> cc.RECT_PIXELS_TO_POINTS(pixel)
    Converts a rect in pixels to points
    Defined in: CCMacro.js.
    Parameters:
    {cc.Rect} pixel
  • <static> cc.RECT_POINTS_TO_PIXELS(point)
    Converts a rect in points to pixels
    Defined in: CCMacro.js.
    Parameters:
    {cc.Rect} point
  • <static> {cc.Rect} cc.RectApplyAffineTransform(rect, anAffineTransform)

    Defined in: CCAffineTransform.js.
    Parameters:
    {cc.Rect} rect
    {cc.AffineTransform} anAffineTransform
    Returns:
    {cc.Rect} Constructor
  • <static> {Boolean} cc.rectContainsPoint(rect, point)

    Defined in: CCGeometry.js.
    Parameters:
    {cc.Rect} rect
    {cc.Point} point
    Returns:
    {Boolean}
  • <static> {Boolean} cc.rectContainsRect(rect1, rect2)

    Defined in: CCGeometry.js.
    Parameters:
    {cc.Rect} rect1
    {cc.Rect} rect2
    Returns:
    {Boolean}
  • <static> {Boolean} cc.rectEqualToRect(rect1, rect2)

    Defined in: CCGeometry.js.
    Parameters:
    {cc.Rect} rect1
    {cc.Rect} rect2
    Returns:
    {Boolean}
  • <static> {Number} cc.rectGetMaxX(rect)
    return the rightmost x-value of 'rect'
    Defined in: CCGeometry.js.
    Parameters:
    {cc.Rect} rect
    Returns:
    {Number}
  • <static> {Number} cc.rectGetMaxY(rect)
    Return the topmost y-value of `rect'
    Defined in: CCGeometry.js.
    Parameters:
    {cc.Rect} rect
    Returns:
    {Number}
  • <static> {Number} cc.rectGetMidX(rect)
    return the midpoint x-value of 'rect'
    Defined in: CCGeometry.js.
    Parameters:
    {cc.Rect} rect
    Returns:
    {Number}
  • <static> {Number} cc.rectGetMidY(rect)
    Return the midpoint y-value of `rect'
    Defined in: CCGeometry.js.
    Parameters:
    {cc.Rect} rect
    Returns:
    {Number}
  • <static> {Number} cc.rectGetMinX(rect)
    return the leftmost x-value of 'rect'
    Defined in: CCGeometry.js.
    Parameters:
    {cc.Rect} rect
    Returns:
    {Number}
  • <static> {Number} cc.rectGetMinY(rect)
    Return the bottommost y-value of `rect'
    Defined in: CCGeometry.js.
    Parameters:
    {cc.Rect} rect
    Returns:
    {Number}
  • <static> {cc.Rect} cc.rectIntersection(rectA, rectB)
    Returns the overlapping portion of 2 rectangles
    Defined in: CCGeometry.js.
    Parameters:
    {cc.Rect} rectA
    {cc.Rect} rectB
    Returns:
    {cc.Rect}
  • <static> {Boolean} cc.rectIntersectsRect(rectA, rectB)

    Defined in: CCGeometry.js.
    Parameters:
    {cc.Rect} rectA
    {cc.Rect} rectB
    Returns:
    {Boolean}
  • <static> {Boolean} cc.rectOverlapsRect(rectA, rectB)

    Defined in: CCGeometry.js.
    Parameters:
    {cc.Rect} rectA
    {cc.Rect} rectB
    Returns:
    {Boolean}
  • <static> {cc.Rect} cc.rectUnion(rectA, rectB)
    Returns the smallest rectangle that contains the two source rectangles.
    Defined in: CCGeometry.js.
    Parameters:
    {cc.Rect} rectA
    {cc.Rect} rectB
    Returns:
    {cc.Rect}
  • <static> cc.RENDER_IN_SUBPIXEL(A)

    Defined in: CCSprite.js.
    Parameters:
    A
  • <static> {Array} cc.reverseControlPoints(controlPoints)
    returns a new copy of the array reversed.
    Defined in: CCActionCatmullRom.js.
    Parameters:
    controlPoints
    Returns:
    {Array}
  • <static> cc.reverseControlPointsInline(controlPoints)
    reverse the current control point array inline, without generating a new one
    Defined in: CCActionCatmullRom.js.
    Parameters:
    controlPoints
  • <static> cc.setProjectionMatrixDirty()
    sets the projection matrix as dirty
    Defined in: CCGLStateCache.js.
  • <static> {cc.Size} cc.size(w, h)

    Defined in: CCGeometry.js.
    var size1 = cc.size();
    var size2 = cc.size(100,100,100,100);
    var size3 = cc.size(size2);
    Parameters:
    {Number|cc.Size} w
    width or a size object
    {Number} h
    height
    Returns:
    {cc.Size}
  • <static> {cc.Size} cc.SIZE_PIXELS_TO_POINTS(sizeInPixels)
    Converts a size in pixels to points
    Defined in: CCMacro.js.
    Parameters:
    {cc.Size} sizeInPixels
    Returns:
    {cc.Size}
  • <static> {cc.Size} cc.SIZE_POINTS_TO_PIXELS(sizeInPoints)
    Converts a Size in points to pixels
    Defined in: CCMacro.js.
    Parameters:
    {cc.Size} sizeInPoints
    Returns:
    {cc.Size}
  • <static> {cc.Size} cc.SizeApplyAffineTransform(size, t)

    Defined in: CCAffineTransform.js.
    Parameters:
    {cc.Size} size
    {cc.AffineTransform} t
    Returns:
    {cc.Size} Constructor
  • <static> {Boolean} cc.sizeEqualToSize(size1, size2)

    Defined in: CCGeometry.js.
    Parameters:
    {cc.Size} size1
    {cc.Size} size2
    Returns:
    {Boolean}
  • <static> cc.SWAP(x, y, ref)

    simple macro that swaps 2 variables
    modified from c++ macro, you need to pass in the x and y variables names in string,
    and then a reference to the whole object as third variable


    Defined in: CCMacro.js.
    Parameters:
    x
    y
    ref
  • <static> {cc.Tex2F} cc.tex2(u, v)
    helper macro that creates an Tex2F type
    Defined in: CCTypes.js.
    Parameters:
    {Number} u
    {Number} v
    Returns:
    {cc.Tex2F}
  • <static> cc.tgaDestroy(psInfo)
    releases the memory used for the image
    Defined in: CCTGAlib.js.
    Parameters:
    {cc.ImageTGA} psInfo
  • <static> {Boolean} cc.tgaLoadHeader(buffer, bufSize, psInfo)
    load the image header field from stream. We only keep those that matter!
    Defined in: CCTGAlib.js.
    Parameters:
    {Array} buffer
    {Number} bufSize
    {cc.ImageTGA} psInfo
    Returns:
    {Boolean}
  • <static> {Boolean} cc.tgaLoadImageData(buffer, bufSize, psInfo)
    loads the image pixels. You shouldn't call this function directly
    Defined in: CCTGAlib.js.
    Parameters:
    {Array} buffer
    {Number} bufSize
    {cc.ImageTGA} psInfo
    Returns:
    {Boolean}
  • <static> cc.tgaRGBtogreyscale(psInfo)
    converts RGB to grayscale
    Defined in: CCTGAlib.js.
    Parameters:
    {cc.ImageTGA} psInfo
  • <static> cc.utf8_trim_from(str, index)
    Trims str st str=[0, index) after the operation. Return value: the trimmed string.
    Defined in: CCLabelBMFont.js.
    Parameters:
    {Array} str
    he string to trim
    {Number} index
    the index to start trimming from.
  • <static> cc.utf8_trim_ws(str)

    Defined in: CCLabelBMFont.js.
    Parameters:
    {Array} str
  • <static> {cc.V2F_C4B_T2F_Quad} cc.V2F_C4B_T2F_QuadZero()
    helper function to create a cc.V2F_C4B_T2F_Quad
    Defined in: CCTypes.js.
    Returns:
    {cc.V2F_C4B_T2F_Quad}
  • <static> cc.v2fzero()
    Code copied & pasted from SpacePatrol game https://github.com/slembcke/SpacePatrol Renamed and added some changes for cocos2d
    Defined in: CCDrawNode.js.
  • <static> cc.V3F_C4B_T2F_QuadCopy(sourceQuad)

    Defined in: CCTypes.js.
    Parameters:
    sourceQuad
  • <static> {cc.V3F_C4B_T2F_Quad} cc.V3F_C4B_T2F_QuadZero()
    helper function to create a cc.V3F_C4B_T2F_Quad
    Defined in: CCTypes.js.
    Returns:
    {cc.V3F_C4B_T2F_Quad}
  • <static> {cc.Vertex2F} cc.Vertex2(x, y)
    helper macro that creates an Vertex2F type
    Defined in: CCTypes.js.
    Parameters:
    {Number} x
    {Number} y
    Returns:
    {cc.Vertex2F}
  • <static> {cc.Vertex3F} cc.vertex3(x, y, z)
    helper macro that creates an Vertex3F type
    Defined in: CCTypes.js.
    Parameters:
    {Number} x
    {Number} y
    {Number} z
    Returns:
    {cc.Vertex3F}
  • <static> {Object} cc.vertexLineIntersect(Ax, Ay, Bx, By, Cx, Cy, Dx, Dy)
    returns wheter or not the line intersects
    Defined in: CCVertex.js.
    Parameters:
    {Number} Ax
    {Number} Ay
    {Number} Bx
    {Number} By
    {Number} Cx
    {Number} Cy
    {Number} Dx
    {Number} Dy
    Returns:
    {Object}
  • <static> cc.vertexLineToPolygon(points, stroke, vertices, offset, nuPoints)
    converts a line to a polygon
    Defined in: CCVertex.js.
    Parameters:
    {Float32Array} points
    {Number} stroke
    {Float32Array} vertices
    {Number} offset
    {Number} nuPoints