macro
枚举
模块: _decorator 父模块: cc
Predefined constants
索引
INVALID_INDEX
NODE_TAG_INVALID
PI
PI2
FLT_MAX
FLT_MIN
RAD
DEG
UINT_MAX
REPEAT_FOREVER
FLT_EPSILON
ONE
ZERO
SRC_ALPHA
SRC_ALPHA_SATURATE
SRC_COLOR
DST_ALPHA
DST_COLOR
ONE_MINUS_SRC_ALPHA
ONE_MINUS_SRC_COLOR
ONE_MINUS_DST_ALPHA
ONE_MINUS_DST_COLOR
ONE_MINUS_CONSTANT_ALPHA
ONE_MINUS_CONSTANT_COLOR
LINEAR
BLEND_DST
WEB_ORIENTATION_PORTRAIT
WEB_ORIENTATION_LANDSCAPE_LEFT
WEB_ORIENTATION_PORTRAIT_UPSIDE_DOWN
WEB_ORIENTATION_LANDSCAPE_RIGHT
ORIENTATION_PORTRAIT
ORIENTATION_LANDSCAPE
ORIENTATION_AUTO
VERTEX_ATTRIB_FLAG_NONE
VERTEX_ATTRIB_FLAG_POSITION
VERTEX_ATTRIB_FLAG_COLOR
VERTEX_ATTRIB_FLAG_TEX_COORDS
VERTEX_ATTRIB_FLAG_POS_COLOR_TEX
GL_ALL
VERTEX_ATTRIB_POSITION
VERTEX_ATTRIB_COLOR
VERTEX_ATTRIB_TEX_COORDS
VERTEX_ATTRIB_MAX
UNIFORM_PMATRIX
UNIFORM_MVMATRIX
UNIFORM_MVPMATRIX
UNIFORM_TIME
UNIFORM_SINTIME
UNIFORM_COSTIME
UNIFORM_RANDOM01
UNIFORM_SAMPLER
UNIFORM_MAX
SHADER_POSITION_TEXTURECOLOR
SHADER_SPRITE_POSITION_TEXTURECOLOR
SHADER_POSITION_TEXTURECOLORALPHATEST
SHADER_SPRITE_POSITION_TEXTURECOLORALPHATEST
SHADER_POSITION_COLOR
SHADER_SPRITE_POSITION_COLOR
SHADER_POSITION_TEXTURE
SHADER_POSITION_TEXTURE_UCOLOR
SHADER_POSITION_TEXTUREA8COLOR
SHADER_POSITION_UCOLOR
SHADER_POSITION_LENGTHTEXTURECOLOR
UNIFORM_PMATRIX_S
UNIFORM_MVMATRIX_S
UNIFORM_MVPMATRIX_S
UNIFORM_TIME_S
UNIFORM_SINTIME_S
UNIFORM_COSTIME_S
UNIFORM_RANDOM01_S
UNIFORM_SAMPLER_S
UNIFORM_ALPHA_TEST_VALUE_S
ATTRIBUTE_NAME_COLOR
ATTRIBUTE_NAME_POSITION
ATTRIBUTE_NAME_TEX_COORD
ITEM_SIZE
CURRENT_ITEM
ZOOM_ACTION_TAG
NORMAL_TAG
SELECTED_TAG
DISABLE_TAG
FIX_ARTIFACTS_BY_STRECHING_TEXEL
FIX_ARTIFACTS_BY_STRECHING_TEXEL_TMX
DIRECTOR_STATS_POSITION
DIRECTOR_FPS_INTERVAL
COCOSNODE_RENDER_SUBPIXEL
SPRITEBATCHNODE_RENDER_SUBPIXEL
AUTO_PREMULTIPLIED_ALPHA_FOR_PNG
OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA
TEXTURE_NPOT_SUPPORT
USE_LA88_LABELS
SPRITE_DEBUG_DRAW
LABELBMFONT_DEBUG_DRAW
LABELATLAS_DEBUG_DRAW
ENABLE_STACKABLE_ACTIONS
ENABLE_GL_STATE_CACHE
TOUCH_TIMEOUT
BATCH_VERTEX_COUNT
ENABLE_GC_FOR_NATIVE_OBJECTS
ENABLE_TILEDMAP_CULLING
DOWNLOAD_MAX_CONCURRENT
ENABLE_TRANSPARENT_CANVAS
ENABLE_CULLING
BLEND_SRC
Details
INVALID_INDEX
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1149 |
NODE_TAG_INVALID
Default Node tag
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1155 |
PI
PI is the ratio of a circle's circumference to its diameter.
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1162 |
PI2
PI * 2
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1169 |
FLT_MAX
Maximum float value
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1176 |
FLT_MIN
Minimum float value
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1183 |
RAD
PI / 180
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1190 |
DEG
One degree
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1197 |
UINT_MAX
Maximum unsigned int value
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1204 |
REPEAT_FOREVER
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1211 |
FLT_EPSILON
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1217 |
ONE
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1224 |
ZERO
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1230 |
SRC_ALPHA
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1236 |
SRC_ALPHA_SATURATE
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1242 |
SRC_COLOR
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1248 |
DST_ALPHA
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1254 |
DST_COLOR
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1260 |
ONE_MINUS_SRC_ALPHA
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1266 |
ONE_MINUS_SRC_COLOR
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1272 |
ONE_MINUS_DST_ALPHA
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1278 |
ONE_MINUS_DST_COLOR
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1284 |
ONE_MINUS_CONSTANT_ALPHA
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1290 |
ONE_MINUS_CONSTANT_COLOR
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1296 |
LINEAR
the constant variable equals gl.LINEAR for texture
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1302 |
BLEND_DST
default gl blend dst function. Compatible with premultiplied alpha images.
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1309 |
WEB_ORIENTATION_PORTRAIT
Device oriented vertically, home button on the bottom (UIDeviceOrientationPortrait)
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1319 |
WEB_ORIENTATION_LANDSCAPE_LEFT
Device oriented horizontally, home button on the right (UIDeviceOrientationLandscapeLeft)
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1326 |
WEB_ORIENTATION_PORTRAIT_UPSIDE_DOWN
Device oriented vertically, home button on the top (UIDeviceOrientationPortraitUpsideDown)
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1333 |
WEB_ORIENTATION_LANDSCAPE_RIGHT
Device oriented horizontally, home button on the left (UIDeviceOrientationLandscapeRight)
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1340 |
ORIENTATION_PORTRAIT
Oriented vertically
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1347 |
ORIENTATION_LANDSCAPE
Oriented horizontally
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1354 |
ORIENTATION_AUTO
Oriented automatically
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1361 |
VERTEX_ATTRIB_FLAG_NONE
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1377 |
VERTEX_ATTRIB_FLAG_POSITION
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1382 |
VERTEX_ATTRIB_FLAG_COLOR
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1387 |
VERTEX_ATTRIB_FLAG_TEX_COORDS
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1392 |
VERTEX_ATTRIB_FLAG_POS_COLOR_TEX
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1397 |
GL_ALL
GL server side states
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1403 |
VERTEX_ATTRIB_POSITION
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1411 |
VERTEX_ATTRIB_COLOR
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1416 |
VERTEX_ATTRIB_TEX_COORDS
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1421 |
VERTEX_ATTRIB_MAX
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1426 |
UNIFORM_PMATRIX
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1433 |
UNIFORM_MVMATRIX
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1438 |
UNIFORM_MVPMATRIX
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1443 |
UNIFORM_TIME
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1448 |
UNIFORM_SINTIME
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1453 |
UNIFORM_COSTIME
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1458 |
UNIFORM_RANDOM01
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1463 |
UNIFORM_SAMPLER
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1468 |
UNIFORM_MAX
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1473 |
SHADER_POSITION_TEXTURECOLOR
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1480 |
SHADER_SPRITE_POSITION_TEXTURECOLOR
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1485 |
SHADER_POSITION_TEXTURECOLORALPHATEST
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1490 |
SHADER_SPRITE_POSITION_TEXTURECOLORALPHATEST
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1495 |
SHADER_POSITION_COLOR
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1500 |
SHADER_SPRITE_POSITION_COLOR
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1505 |
SHADER_POSITION_TEXTURE
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1510 |
SHADER_POSITION_TEXTURE_UCOLOR
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1515 |
SHADER_POSITION_TEXTUREA8COLOR
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1520 |
SHADER_POSITION_UCOLOR
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1525 |
SHADER_POSITION_LENGTHTEXTURECOLOR
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1530 |
UNIFORM_PMATRIX_S
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1537 |
UNIFORM_MVMATRIX_S
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1542 |
UNIFORM_MVPMATRIX_S
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1547 |
UNIFORM_TIME_S
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1552 |
UNIFORM_SINTIME_S
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1557 |
UNIFORM_COSTIME_S
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1562 |
UNIFORM_RANDOM01_S
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1567 |
UNIFORM_SAMPLER_S
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1572 |
UNIFORM_ALPHA_TEST_VALUE_S
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1577 |
ATTRIBUTE_NAME_COLOR
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1584 |
ATTRIBUTE_NAME_POSITION
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1589 |
ATTRIBUTE_NAME_TEX_COORD
meta | description |
---|---|
类型 | String |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1594 |
ITEM_SIZE
default size for font size
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1601 |
CURRENT_ITEM
default tag for current item
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1608 |
ZOOM_ACTION_TAG
default tag for zoom action tag
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1614 |
NORMAL_TAG
default tag for normal
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1620 |
SELECTED_TAG
default selected tag
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1627 |
DISABLE_TAG
default disabled tag
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1634 |
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 expand the texture's border with the same color by 1 pixel
Affected nodes:
- _ccsg.Sprite
Disabled by default. To enabled set it to 1.
To modify it, in Web engine please refer to CCMacro.js, in JSB please refer to CCConfig.h
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1642 |
FIX_ARTIFACTS_BY_STRECHING_TEXEL_TMX
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 expand the texture's border with the same color by 1 pixel
Affected nodes:
- _ccsg.TMXLayer
Enabled by default. To disabled set it to 0.
To modify it, in Web engine please refer to CCMacro.js, in JSB please refer to CCConfig.h
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1664 |
DIRECTOR_STATS_POSITION
Position of the FPS (Default: 0,0 (bottom-left corner))
To modify it, in Web engine please refer to CCMacro.js, in JSB please refer to CCConfig.h
meta | description |
---|---|
类型 | Vec2 |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1686 |
DIRECTOR_FPS_INTERVAL
Seconds 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
To modify it, in Web engine please refer to CCMacro.js, in JSB please refer to CCConfig.h
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1693 |
COCOSNODE_RENDER_SUBPIXEL
If enabled, the ccsg.Node objects (_ccsg.Sprite, _ccsg.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.
To modify it, in Web engine please refer to CCMacro.js, in JSB please refer to CCConfig.h
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1706 |
SPRITEBATCHNODE_RENDER_SUBPIXEL
If enabled, the _ccsg.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.
To modify it, in Web engine please refer to CCMacro.js, in JSB please refer to CCConfig.h
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1718 |
AUTO_PREMULTIPLIED_ALPHA_FOR_PNG
Automatically premultiply alpha for PNG resources
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1730 |
OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA
If most of your images 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.
To modify it, in Web engine please refer to CCMacro.js, in JSB please refer to CCConfig.h
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1738 |
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.
To modify it, in Web engine please refer to CCMacro.js, in JSB please refer to CCConfig.h
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1750 |
废弃(Deprecated) | This value will be removed in 1.1 and NPOT textures will be loaded by default if the device supports it. |
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.
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1769 |
SPRITE_DEBUG_DRAW
If enabled, all subclasses of _ccsg.Sprite will draw a bounding box
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
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1781 |
LABELBMFONT_DEBUG_DRAW
If enabled, all subclasses of cc.LabelBMFont will draw a bounding box
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.
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1795 |
LABELATLAS_DEBUG_DRAW
If enabled, all subclasses of cc.LabelAtlas will draw a bounding box
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.
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1806 |
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.
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1817 |
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, instead of the the GL ones:
- cc.gl.useProgram() instead of glUseProgram()
- cc.gl.deleteProgram() instead of glDeleteProgram()
- cc.gl.blendFunc() instead of glBlendFunc()
If this functionality is disabled, then cc.gl.useProgram(), cc.gl.deleteProgram(), cc.gl.blendFunc() will call the GL ones, without using the cache.
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.
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1827 |
TOUCH_TIMEOUT
用于甄别一个触点对象是否已经失效,并且可以被移除的延时时长 添加这个时长的原因是 X5 内核在微信浏览器中出现的一个 bug。 在这个环境下,如果用户将一个触点从底向上移出页面区域,将不会触发任何 touch cancel 或 touch end 事件,而这个触点会被永远当作停留在页面上的有效触点。 重复这样操作几次之后,屏幕上的触点数量将达到我们的事件系统所支持的最高触点数量,之后所有的触摸事件都将被忽略。 所以这个新的机制可以在触点在一定时间内没有任何更新的情况下视为失效触点并从事件系统中移除。 当然,这也可能移除一个真实的触点,如果用户的触点真的在一定时间段内完全没有移动(这在当前手机屏幕的灵敏度下会很难)。 你可以修改这个值来获得你需要的效果,默认值是 5000 毫秒。
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1844 |
BATCH_VERTEX_COUNT
最大可以被单次批处理渲染的顶点数量。
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1866 |
ENABLE_GC_FOR_NATIVE_OBJECTS
仅限 JSB 有意义,使用 JS 对象生命周期来控制 C++ 对象,或是相反,这标示了两种不同的内存模型, 它的值被 native 宏 CC_ENABLE_GC_FOR_NATIVE_OBJECTS 所控制,修改 JS 宏的值不会产生任何效果。
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1875 |
ENABLE_TILEDMAP_CULLING
是否开启瓦片地图的自动裁减功能。瓦片地图如果设置了 skew, rotation 的话,需要手动关闭,否则渲染会出错。
meta | description |
---|---|
类型 | Boolean |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1887 |
DOWNLOAD_MAX_CONCURRENT
下载任务的最大并发数限制,在安卓平台部分机型或版本上可能需要限制在较低的水平
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1897 |
ENABLE_TRANSPARENT_CANVAS
用于设置 Canvas 背景是否支持 alpha 通道,默认为 false,这样可以有更高的性能表现。 如果你希望 Canvas 背景是透明的,并显示背后的其他 DOM 元素,你可以在
cc.game.run
之前将这个值设为 true。 仅支持 Web
meta | description |
---|---|
类型 | Boolean |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1907 |
ENABLE_CULLING
是否开启自动裁减功能,开启裁减功能将会把在屏幕外的物体从渲染队列中去除掉。 如果游戏中的动态物体比较多的话,建议将此选项关闭。 如果游戏中的静态物体比较多的话,建议将此选项打开。
meta | description |
---|---|
类型 | Boolean |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1923 |
BLEND_SRC
默认的混合源模式
meta | description |
---|---|
类型 | Number |
定义于 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCMacro.js:1957 |