macro Class

Module: _decorator Parent Module: cc

Predefined constants

Index

Properties

Details

Properties

RAD

PI / 180

meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:37
DEG

One degree

meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:44
REPEAT_FOREVER
meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:51
FLT_EPSILON
meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:57
MIN_ZINDEX

Minimum z index value for node

meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:63
MAX_ZINDEX

Maximum z index value for node

meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:70
ONE
meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:78
ZERO
meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:84
SRC_ALPHA
meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:90
SRC_ALPHA_SATURATE
meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:96
SRC_COLOR
meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:102
DST_ALPHA
meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:108
DST_COLOR
meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:114
ONE_MINUS_SRC_ALPHA
meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:120
ONE_MINUS_SRC_COLOR
meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:126
ONE_MINUS_DST_ALPHA
meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:132
ONE_MINUS_DST_COLOR
meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:138
ONE_MINUS_CONSTANT_ALPHA
meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:144
ONE_MINUS_CONSTANT_COLOR
meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:150
ORIENTATION_PORTRAIT

Oriented vertically

meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:157
ORIENTATION_LANDSCAPE

Oriented horizontally

meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:164
ORIENTATION_AUTO

Oriented automatically

meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:171
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 component:
- cc.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
Type Number
Defined in cocos2d/core/platform/CCMacro.js:185
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
Type Vec2
Defined in cocos2d/core/platform/CCMacro.js:207
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
Type Number
Defined in cocos2d/core/platform/CCMacro.js:214
TOUCH_TIMEOUT

The timeout to determine whether a touch is no longer active and should be removed. The reason to add this timeout is due to an issue in X5 browser core, when X5 is presented in wechat on Android, if a touch is glissed from the bottom up, and leave the page area, no touch cancel event is triggered, and the touch will be considered active forever. After multiple times of this action, our maximum touches number will be reached and all new touches will be ignored. So this new mechanism can remove the touch that should be inactive if it's not updated during the last 5000 milliseconds. Though it might remove a real touch if it's just not moving for the last 5 seconds which is not easy with the sensibility of mobile touch screen. You can modify this value to have a better behavior if you find it's not enough.

meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:224
BATCH_VERTEX_COUNT

The maximum vertex count for a single batched draw call.

meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:246
ENABLE_TILEDMAP_CULLING

Whether or not enabled tiled map auto culling. If you set the TiledMap skew or rotation, then need to manually disable this, otherwise, the rendering will be wrong.

meta description
Type Boolean
Defined in cocos2d/core/platform/CCMacro.js:255
DOWNLOAD_MAX_CONCURRENT

The max concurrent task number for the downloader

meta description
Type Number
Defined in cocos2d/core/platform/CCMacro.js:265
ENABLE_TRANSPARENT_CANVAS

Boolean that indicates if the canvas contains an alpha channel, default sets to false for better performance. Though if you want to make your canvas background transparent and show other dom elements at the background, you can set it to true before cc.game.run. Web only.

meta description
Type Boolean
Defined in cocos2d/core/platform/CCMacro.js:275
ENABLE_WEBGL_ANTIALIAS

Boolean that indicates if the WebGL context is created with antialias option turned on, default value is false. Set it to true could make your game graphics slightly smoother, like texture hard edges when rotated. Whether to use this really depend on your game design and targeted platform, device with retina display usually have good detail on graphics with or without this option, you probably don't want antialias if your game style is pixel art based. Also, it could have great performance impact with some browser / device using software MSAA. You can set it to true before cc.game.run. Web only.

meta description
Type Boolean
Defined in cocos2d/core/platform/CCMacro.js:290
ENABLE_CULLING

Whether or not enable auto culling. This feature have been removed in v2.0 new renderer due to overall performance consumption. We have no plan currently to re-enable auto culling. If your game have more dynamic objects, we suggest to disable auto culling. If your game have more static objects, we suggest to enable auto culling.

meta description
Type Boolean
Defined in cocos2d/core/platform/CCMacro.js:312
Deprecated since v2.0
CLEANUP_IMAGE_CACHE

Whether or not clear dom Image object cache after uploading to gl texture. Concretely, we are setting image.src to empty string to release the cache. Normally you don't need to enable this option, because on web the Image object doesn't consume too much memory. But on WeChat Game platform, the current version cache decoded data in Image object, which has high memory usage. So we enabled this option by default on WeChat, so that we can release Image cache immediately after uploaded to GPU.

meta description
Type Boolean
Defined in cocos2d/core/platform/CCMacro.js:330
SHOW_MESH_WIREFRAME

Whether or not show mesh wire frame.

meta description
Type Boolean
Defined in cocos2d/core/platform/CCMacro.js:348
ROTATE_ACTION_CCW

Set cc.RotateTo/cc.RotateBy rotate direction. If need set rotate positive direction to counterclockwise, please change setting to : cc.macro.ROTATE_ACTION_CCW = true;

meta description
Type Boolean
Defined in cocos2d/core/platform/CCMacro.js:358
SUPPORT_TEXTURE_FORMATS

!en The image format supported by the engine defaults, and the supported formats may differ in different build platforms and device types. Currently all platform and device support ['.webp', '.jpg', '.jpeg', '.bmp', '.png'], The iOS mobile platform also supports the PVR format。 !zh 引擎默认支持的图片格式,支持的格式可能在不同的构建平台和设备类型上有所差别。 目前所有平台和设备支持的格式有 ['.webp', '.jpg', '.jpeg', '.bmp', '.png']. 另外 Ios 手机平台还额外支持了 PVR 格式。

meta description
Type [String]
Defined in cocos2d/core/platform/CCMacro.js:374

results matching ""

    No results matching ""