Namespace cc
- Defined in: CCClass.js
Method Summary
Field Detail
Defined in: CCAction.js.
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.
Defined in: CCTexture2D.js.
Defined in: CCTexture2D.js.
Defined in: CCTexture2D.js.
Defined in: CCTexture2D.js.
Defined in: CCTexture2D.js.
Defined in: CCTexture2D.js.
Defined in: CCTexture2D.js.
Defined in: CCTexture2D.js.
Defined in: CCTexture2D.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCMacro.js.
Defined in: CCMacro.js.
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.
Defined in: CCControl.js.
Defined in: CCControl.js.
Defined in: CCControl.js.
Defined in: CCMenuItem.js.
Defined in: CCConfig.js.
Defined in: CCMenu.js.
Defined in: CCSpriteBatchNode.js.
Defined in: CCDirector.js.
Defined in: CCMacro.js.
Defined in: CCDirector.js.
Defined in: CCDirector.js.
Defined in: CCDirector.js.
Defined in: CCDirector.js.
Defined in: CCDirector.js.
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.
Defined in: CCDirector.js.
Defined in: CCDirector.js.
Defined in: CCDirector.js.
Defined in: CCDirector.js.
Defined in: CCConfig.js.
Defined in: CCMenuItem.js.
Defined in: CCDirector.js.
Defined in: CCEditBox.js.
Defined in: CCEditBox.js.
Defined in: CCEditBox.js.
Defined in: CCEditBox.js.
Defined in: CCEditBox.js.
Defined in: CCEditBox.js.
Defined in: CCEditBox.js.
Defined in: CCEditBox.js.
Defined in: CCEditBox.js.
Defined in: CCEditBox.js.
Defined in: CCEditBox.js.
Defined in: CCEditBox.js.
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.
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.
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.
Defined in: CCEventManager.js.
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.
Defined in: CCMacro.js.
Defined in: CCMacro.js.
Defined in: CCCommon.js.
Defined in: CCCommon.js.
Defined in: CCCommon.js.
Defined in: CCCommon.js.
Defined in: CCCommon.js.
Defined in: CCCommon.js.
Defined in: CCGLStateCache.js.
Defined in: CCGrabber.js.
Defined in: CCRenderTexture.js.
Defined in: CCRenderTexture.js.
Defined in: CCRenderTexture.js.
Defined in: CCMacro.js.
Defined in: CCConfig.js.
Defined in: CCMenuItem.js.
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
Defined in: CCEditBox.js.
Defined in: CCEditBox.js.
Defined in: CCEditBox.js.
Defined in: CCEditBox.js.
Defined in: CCEditBox.js.
Defined in: CCLabelBMFont.js.
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.
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.
Defined in: aabb.js.
Defined in: CCMenu.js.
Defined in: CCMenu.js.
Defined in: CCMenu.js.
Defined in: aabb.js.
Defined in: CCNode.js.
Defined in: CCNode.js.
Defined in: CCNode.js.
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.
Defined in: CCMenuItem.js.
Defined in: CCMacro.js.
Defined in: CCMacro.js.
Defined in: CCMacro.js.
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.
Defined in: CCParticleSystem.js.
Defined in: CCParticleBatchNode.js.
Defined in: CCParticleSystem.js.
Defined in: CCParticleSystem.js.
Defined in: CCParticleSystem.js.
Defined in: CCParticleSystem.js.
Defined in: CCParticleSystem.js.
Defined in: CCParticleSystem.js.
Defined in: CCParticleSystem.js.
Defined in: CCParticleSystem.js.
Defined in: CCParticleSystem.js.
Defined in: CCParticleSystem.js.
Use case: Attach an emitter to an sprite, and you want that the emitter follows the sprite.
Defined in: CCParticleSystem.js.
Defined in: CCMacro.js.
Defined in: CCPointExtension.js.
Defined in: CCScheduler.js.
Defined in: CCProgressTimer.js.
Defined in: CCProgressTimer.js.
Defined in: CCProgressTimer.js.
Defined in: CCProgressTimer.js.
Defined in: CCMacro.js.
Defined in: CCMacro.js.
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.
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.
Defined in: CCNode.js.
Defined in: CCTransition.js.
Defined in: CCTransitionProgress.js.
Defined in: CCMenuItem.js.
Defined in: CCGLProgram.js.
Defined in: CCShaders.js.
Defined in: CCShaders.js.
Defined in: CCShaders.js.
Defined in: CCShaders.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCShaders.js.
Defined in: CCShaders.js.
Defined in: CCShaders.js.
Defined in: CCShaders.js.
Defined in: CCShaders.js.
Defined in: CCShaders.js.
Defined in: CCGLProgram.js.
Defined in: CCShaders.js.
Defined in: CCShaders.js.
Defined in: CCShaders.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCShaders.js.
Defined in: CCShaders.js.
Defined in: CCShaders.js.
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.
Defined in: CCSprite.js.
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.
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.
Defined in: CCMacro.js.
Defined in: CCClippingNode.js.
Defined in: CCTableView.js.
Defined in: CCTableView.js.
Defined in: CCTableView.js.
Defined in: CCTableView.js.
Defined in: CCTypes.js.
Defined in: CCTypes.js.
Defined in: CCTypes.js.
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.
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.
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.
Defined in: CCTGAlib.js.
Defined in: CCTGAlib.js.
Defined in: CCTGAlib.js.
Defined in: CCTGAlib.js.
Defined in: CCTGAlib.js.
Defined in: CCTGAlib.js.
Defined in: CCTMXXMLParser.js.
Defined in: CCTMXXMLParser.js.
Defined in: CCTMXXMLParser.js.
Defined in: CCTMXXMLParser.js.
Defined in: CCTMXTiledMap.js.
Defined in: CCTMXTiledMap.js.
Defined in: CCTMXTiledMap.js.
Defined in: CCTMXXMLParser.js.
Defined in: CCTMXXMLParser.js.
Defined in: CCTMXXMLParser.js.
Defined in: CCTMXXMLParser.js.
Defined in: CCTMXXMLParser.js.
Defined in: CCTMXXMLParser.js.
Defined in: CCTMXXMLParser.js.
Defined in: CCTMXXMLParser.js.
Defined in: CCTMXXMLParser.js.
Defined in: CCTMXXMLParser.js.
Defined in: CCTMXXMLParser.js.
Defined in: CCTransition.js.
Defined in: CCTransition.js.
Defined in: CCTransition.js.
Defined in: CCTransition.js.
Defined in: CCInputManager.js.
Defined in: CCMacro.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
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.
Defined in: CCGLProgram.js.
Defined in: CCGLStateCache.js.
Defined in: CCGLStateCache.js.
Defined in: CCGLStateCache.js.
Defined in: CCGLStateCache.js.
Defined in: CCGLStateCache.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCGLProgram.js.
Defined in: CCTypes.js.
Defined in: CCTypes.js.
Defined in: CCTypes.js.
Defined in: CCVisibleRect.js.
Defined in: CCMacro.js.
Defined in: CCMenuItem.js.
Method Detail
-
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
-
- 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
-
Defined in: CCAffineTransform.js.- Returns:
- {cc.AffineTransform} Constructor
-
Defined in: CCAffineTransform.js.- Parameters:
- {cc.AffineTransform} t
- Returns:
- {cc.AffineTransform} Constructor
-
Defined in: CCAffineTransform.js.- Parameters:
- {Number} a
- {Number} b
- {Number} c
- {Number} d
- {Number} tx
- {Number} ty
- Returns:
- {cc.AffineTransform} Constructor
-
Defined in: CCAffineTransform.js.- Returns:
- {cc.AffineTransform} Constructor
-
Defined in: CCAffineTransform.js.- Parameters:
- {cc.AffineTransform} aTransform
- {Number} anAngle
- Returns:
- {cc.AffineTransform} Constructor
-
Defined in: CCAffineTransform.js.- Parameters:
- {cc.AffineTransform} t
- {Number} sx
- {Number} sy
- Returns:
- {cc.AffineTransform} Constructor
-
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}
-
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.- 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}
-
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.- 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.- 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
-
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. -
<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()
-
<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
-
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}
-
Calculates sum of two points.
Defined in: CCPointExtension.js.- 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.- Returns:
- {Number} the angle in radians between two vector directions
-
<static> {Number} cc.pAngleSigned(a, b)
Defined in: CCPointExtension.js.- Returns:
- {Number} the signed angle in radians between two vector directions
-
Clamp a point between from and to.
Defined in: CCPointExtension.js.- Parameters:
- {Point} p
- {Number} min_inclusive
- {Number} max_inclusive
- Returns:
- {cc.Point}
-
Multiplies a nd b components, a.x*b.x, a.y*b.y
Defined in: CCPointExtension.js.- Returns:
- {cc.Point}
-
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.- Returns:
- {Number}
-
Calculates the distance between two points
Defined in: CCPointExtension.js.- Returns:
- {cc.pLength}
-
<static> {Number} cc.pDistanceSQ(point1, point2)Calculates the square distance between two points (not calling sqrt() )
Defined in: CCPointExtension.js.- Returns:
- {Number}
-
<static> {Number} cc.pDot(v1, v2)Calculates dot product of two points.
Defined in: CCPointExtension.js.- Returns:
- {Number}
-
Converts radians to a normalized vector.
Defined in: CCPointExtension.js.- Parameters:
- {Number} a
- Returns:
- {cc.Point}
-
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.- 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
-
ccpIntersectPoint return the intersection point of line A-B, C-D
Defined in: CCPointExtension.js.- 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}
-
Linear Interpolation between two points a and b alpha == 0 ? a alpha == 1 ? b otherwise a value between a..b
Defined in: CCPointExtension.js.- 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);
-
Calculates midpoint between two points.
Defined in: CCPointExtension.js.- Returns:
- {cc.pMult}
-
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
-
Returns opposite of point.
Defined in: CCPointExtension.js.- Parameters:
- {cc.Point} point
- Returns:
- {cc.Point}
-
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
-
Converts a Point in points to pixels
Defined in: CCMacro.js.- Parameters:
- {cc.Point} points
- Returns:
- {cc.Point}
-
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.- Returns:
- {Boolean}
-
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}
-
Calculates the projection of v1 over v2.
Defined in: CCPointExtension.js.- Returns:
- {cc.pMult}
-
Rotates two points.
Defined in: CCPointExtension.js.- Returns:
- {cc.Point}
-
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
-
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.- 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.- Returns:
- {Boolean}
-
Calculates difference of two points.
Defined in: CCPointExtension.js.- 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}
-
Unrotates two points.
Defined in: CCPointExtension.js.- 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}
-
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
-
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.- Returns:
- {Boolean}
-
<static> {Boolean} cc.rectContainsRect(rect1, rect2)
Defined in: CCGeometry.js.- Returns:
- {Boolean}
-
<static> {Boolean} cc.rectEqualToRect(rect1, rect2)
Defined in: CCGeometry.js.- 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}
-
Returns the overlapping portion of 2 rectangles
Defined in: CCGeometry.js.- Returns:
- {cc.Rect}
-
<static> {Boolean} cc.rectIntersectsRect(rectA, rectB)
Defined in: CCGeometry.js.- Returns:
- {Boolean}
-
<static> {Boolean} cc.rectOverlapsRect(rectA, rectB)
Defined in: CCGeometry.js.- Returns:
- {Boolean}
-
Returns the smallest rectangle that contains the two source rectangles.
Defined in: CCGeometry.js.- 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. -
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}
-
Converts a size in pixels to points
Defined in: CCMacro.js.- Parameters:
- {cc.Size} sizeInPixels
- Returns:
- {cc.Size}
-
Converts a Size in points to pixels
Defined in: CCMacro.js.- Parameters:
- {cc.Size} sizeInPoints
- Returns:
- {cc.Size}
-
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.- 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
-
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
-
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
-
helper function to create a cc.V3F_C4B_T2F_Quad
Defined in: CCTypes.js.- Returns:
- {cc.V3F_C4B_T2F_Quad}
-
helper macro that creates an Vertex2F type
Defined in: CCTypes.js.- Parameters:
- {Number} x
- {Number} y
- Returns:
- {cc.Vertex2F}
-
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