Properties

PRIORITY_NON_SYSTEM Number

Minimum priority level for user scheduling.
最低优先级用户调度.

图像格式

FMT_JPG Number

JPG

FMT_PNG Number

PNG

FMT_TIFF Number

TIFF

FMT_RAWDATA Number

RAWDATA

FMT_WEBP Number

WEBP

FMT_UNKNOWN Number

UNKNOWN

FIX_ARTIFACTS_BY_STRECHING_TEXEL Number

If enabled, the texture coordinates will be calculated by using this formula: 
- texCoord.left = (rect.x * 2 + 1) / (texture.width * 2); 
- texCoord.right = texCoord.left + (rect.width * 2 - 2)/(texture.width * 2); 
如果启用,纹理坐标将利用这个公式计算.

The same for bottom and top. 
顶部和底部同理.

This formula prevents artifacts by using 99% of the texture. 
这个公式可以防止工件使用99%的纹理.
The "correct" way to prevent artifacts is by using the spritesheet-artifact-fixer.py or a similar tool.
为了防止工件的“正确”的方法是通过使用spritesheet-artifact-fixer.py或类似的工具.

### artifacts 有点难翻译。###

Affected nodes: 
受影响的节点:
- _ccsg.Sprite / cc.SpriteBatchNode and subclasses: cc.LabelBMFont, cc.TMXTiledMap 
- cc.LabelAtlas 
- cc.QuadParticleSystem 
- cc.TileMap 

To enabled set it to 1. Disabled by default.
启用设置为1。默认禁用.
To modify it, in Web engine please refer to CCConfig.js, in JSB please refer to CCConfig.h
修改Web引擎,请参阅ccconfig.js, JSB请参阅ccconfig.h

DIRECTOR_STATS_POSITION Vec2

Position of the FPS (Default: 0,0 (bottom-left corner))
FPS位置(默认为 0,0(左下角))

To modify it, in Web engine please refer to CCConfig.js, in JSB please refer to CCConfig.h
修改Web引擎,请参阅ccconfig.js, JSB请参阅ccconfig.h.

DIRECTOR_FPS_INTERVAL Number

Seconds between FPS updates.
FPS更新秒间隔.

0.5 seconds, means that the FPS number will be updated every 0.5 seconds.
0.5秒,意味着FPS将每0.5秒更新一次.

Having a bigger number means a more reliable FPS.
有一个更大的数字意味着一个更可靠的FPS.

Default value: 0.1f
默认值: 0.1f.

To modify it, in Web engine please refer to CCConfig.js, in JSB please refer to CCConfig.h
修改Web引擎,请参阅ccconfig.js, JSB请参阅ccconfig.h.

COCOSNODE_RENDER_SUBPIXEL Number

If enabled, the ccsg.Node objects (_ccsg.Sprite, _ccsg.Label,etc) will be able to render in subpixels.
如果启用,该节点对象(_ccsg.sprite,_ccsg.Label,等等)可以在子像素渲染。

If disabled, integer pixels will be used.
如果禁用,将使用整数像素.

To enable set it to 1. Enabled by default.
启用设置为1。默认启用.

To modify it, in Web engine please refer to CCConfig.js, in JSB please refer to CCConfig.h
修改Web引擎,请参阅ccconfig.js, JSB请参阅ccconfig.h.

SPRITEBATCHNODE_RENDER_SUBPIXEL Number

If enabled, the _ccsg.Sprite objects rendered with cc.SpriteBatchNode will be able to render in subpixels.
如果启用,通过cc.SpriteBatchNode渲染的_ccsg.Sprite可以在子像素渲染。

If disabled, integer pixels will be used.
如果禁用,将使用整数像素.

To enable set it to 1. Enabled by default.
启用设置为1。默认启用.

To modify it, in Web engine please refer to CCConfig.js, in JSB please refer to CCConfig.h
修改Web引擎,请参阅ccconfig.js, JSB请参阅ccconfig.h.

AUTO_PREMULTIPLIED_ALPHA_FOR_PNG Number

Automatically premultiply alpha for PNG resources.
为PNG资源自动使用`Premultiplied Alpha`.

Premultiplied Alpha介绍

OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA Number

If most of your images have pre-multiplied alpha, set it to 1 (if you are going to use .PNG/.JPG file images).
如果你的大多数图像都使用 Premultiplied Alpha, 设置为1.(如果你打算使用PNG / JPG文件的图像.)

Only set to 0 if ALL your images by-pass Apple UIImage loading system (eg: if you use libpng or PVR images)
只有当你的所有图像通过Apple UIImage系统加载, 设置为0.
(例如:如果你使用libpng或PVR图片)

To enable set it to a value different than 0. Enabled by default.
启用值: ~= 0, 默认启用.

To modify it, in Web engine please refer to CCConfig.js, in JSB please refer to CCConfig.h
修改Web引擎,请参阅ccconfig.js, JSB请参阅ccconfig.h.

TEXTURE_ATLAS_USE_TRIANGLE_STRIP Number

Use GL_TRIANGLE_STRIP instead of GL_TRIANGLES when rendering the texture atlas.
当绘制纹理地图集时, 使用GL_TRIANGLE_STRIP代替GL_TRIANGLES.

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.
启用值: ~= 0, 默认禁用.

To modify it, in Web engine please refer to CCConfig.js, in JSB please refer to CCConfig.h
修改Web引擎,请参阅ccconfig.js, JSB请参阅ccconfig.h.

TEXTURE_ATLAS_USE_VAO Number

By default, cc.TextureAtlas (used by many cocos2d classes) will use VAO (Vertex Array Objects).
默认情况下,cc.textureatlas(许多cocos2d类使用)将使用VAO(顶点数组对象)。

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.
所以,某些情况下,你可能需要数百个VAB对象,或许禁用它是个好主意。

To disable it set it to 0. disable by default.(Not Supported on WebGL)
启用值: ~= 0, 默认禁用.(WebGL不支持)

To modify it, in Web engine please refer to CCConfig.js, in JSB please refer to CCConfig.h
修改Web引擎,请参阅ccconfig.js, JSB请参阅ccconfig.h.

RETINA_DISPLAY_FILENAME_SUFFIX String

It's the suffix that will be appended to the files in order to load "retina display" images.
加载“Retina Display”图像,后缀将会附加在文件中.

On an iPhone4 with Retina Display support enabled, the file @"sprite-hd.png" will be loaded instead of @"sprite.png".
在支持Retina Display的IPhone4上启用,加载“sprite.png”会被“sprite-hd.png”代替。

If the file doesn't exist it will use the non-retina display image.
如果文件不存在,将使用“non-retina display”图像.

USE_LA88_LABELS Number

If enabled, it will use LA88 (Luminance Alpha 16-bit textures) for CCLabelTTF objects. 
如果启用,CCLabelTTF对象将使用LA88(亮度α16位纹理)。

If it is disabled, it will use A8 (Alpha 8-bit textures). 
如果禁用,CCLabelTTF对象将使用A8(α8位纹理)。

LA88 textures are 6% faster than A8 textures, but they will consume 2x memory. 
LA88纹理比A8纹理速度快6%,但是有2倍内存消耗.

This feature is enabled by default.
默认情况下启用此功能。

SPRITE_DEBUG_DRAW Number

If enabled, all subclasses of _ccsg.Sprite will draw a bounding box.
如果启用,所有_ccsg.Sprite的子类将绘制包围盒.

Useful for debugging purposes only. It is recommend 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 纹理框
启用值: ~= 0, 默认禁用.

SPRITEBATCHNODE_DEBUG_DRAW Number

If enabled, all subclasses of _ccsg.Sprite that are rendered using an cc.SpriteBatchNode draw a bounding box.
如果启用,所有使用cc.SpriteBatchNode绘制的_ccsg.Sprite的子类将绘制包围盒.

Useful for debugging purposes only. It is recommend to leave it disabled.
仅用于调试目的。建议禁用它。

To enable set it to a value different than 0. Disabled by default.
启用值: ~= 0, 默认禁用.

LABELBMFONT_DEBUG_DRAW Number

If enabled, all subclasses of cc.LabelBMFont will draw a bounding box. 
如果启用,所有cc.LabelBMFont的子类将绘制包围盒.

Useful for debugging purposes only. It is recommend to leave it disabled.
仅用于调试目的。建议禁用它。

To enable set it to a value different than 0. Disabled by default.
启用值: ~= 0, 默认禁用.

LABELATLAS_DEBUG_DRAW Number

If enabled, all subclasses of cc.LabelAtlas will draw a bounding box.
如果启用,所有cc.LabelAtlas的子类将绘制包围盒.

Useful for debugging purposes only. It is recommend to leave it disabled.
仅用于调试目的。建议禁用它。

To enable set it to a value different than 0. Disabled by default.
启用值: ~= 0, 默认禁用.

IS_RETINA_DISPLAY_SUPPORTED Number

Whether or not support retina display.
是否支持retina display。

DEFAULT_ENGINE String

Default engine。
默认引擎。

ENABLE_STACKABLE_ACTIONS Number

If enabled, actions that alter the position property (eg: CCMoveBy, CCJumpBy, CCBezierBy, etc..) will be stacked. 
如果启用,改变位置属性的操作(如:ccmoveby,ccjumpby,ccbezierby,等。)将堆积.

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. 
如果在节点上运行2个或多个“位置”动作,那么结束位置将是所有位置的总和。

If disabled, only the last run action will take effect.
如果禁用,只有最后一个运行操作将生效。

ENABLE_GL_STATE_CACHE Number

If enabled, cocos2d will maintain an OpenGL state cache internally to avoid unnecessary switches. 
如果启用,cocos2d将维持一个OpenGL状态缓存,避免不必要的开关。

In order to use them, you have to use the following functions, instead of the the GL ones: 
为了使用它们,你必须使用以下功能,取而代之的是GL的:
- 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. 
如果这个功能被禁用,ccGLUseProgram(),ccGLDeleteProgram(),ccGLBlendFunc()将调用GL接口,不使用缓存。

It is recommend 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.
如果你正在你的代码中使用GL ES 1.1,请把它禁用。一旦你的代码工作预期完成,打开它。

PI Number

PI is the ratio of a circle's circumference to its diameter.
一个圆的周长与其直径的比例.

UINT_MAX Number

maximum unsigned int value.
unsigned int最大值。

LINEAR Number

the constant variable equals gl.LINEAR for texture
gl.LINEAR常量.

BLEND_SRC Number

default gl blend src function. Compatible with premultiplied alpha images.
默认gl blend src函数。与premultiplied alpha图像兼容.

BLEND_DST Number

default gl blend dst function. Compatible with premultiplied alpha images.
默认gl blend dst函数。与premultiplied alpha图像兼容.

DEVICE_ORIENTATION_PORTRAIT Number

Device oriented vertically, home button on the bottom (UIDeviceOrientationPortrait)
面向垂直设备,home键在底部(UIDeviceOrientationPortrait)。

DEVICE_ORIENTATION_LANDSCAPE_LEFT Number

Device oriented horizontally, home button on the right (UIDeviceOrientationLandscapeLeft)
面向水平设备,home键在右部(UIDeviceOrientationLandscapeLeft)。

DEVICE_ORIENTATION_PORTRAIT_UPSIDE_DOWN Number

Device oriented vertically, home button on the top (UIDeviceOrientationPortraitUpsideDown)
面向垂直设备,home键在顶部(UIDeviceOrientationPortraitUpsideDown)。

DEVICE_ORIENTATION_LANDSCAPE_RIGHT Number

Device oriented horizontally, home button on the left (UIDeviceOrientationLandscapeRight)
面向水平设备,home键在左部(UIDeviceOrientationLandscapeLeft)。

DEVICE_MAX_ORIENTATIONS Number

In browsers, we only support 2 orientations by change window size.
在浏览器中,我们只支持2个方向改变窗口大小。

ITEM_SIZE Number

default size for font size
字体大小的默认大小。

CURRENT_ITEM Number

default tag for current item
当前项目默认标识。

ZOOM_ACTION_TAG Number

default tag for zoom action tag
缩放动作默认标识。

NORMAL_TAG Number

default tag for normal
正常默认标识。

SELECTED_TAG Number

default selected tag
选中默认标识。

DISABLE_TAG Number

default disabled tag
禁用默认标识。