导演类。
对检查测试条件进行检查,如果条件不为 true 则输出错误消息
The condition to check on
A JavaScript string containing zero or more substitution strings.
JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.
输出错误消息到 Cocos Creator 编辑器的 Console 或运行时页面端的 Console 中。
A JavaScript string containing zero or more substitution strings.
JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.
通过 error id 和必要的参数来获取错误信息。
是否显示 FPS 信息和部分调试信息。
输出一条消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。
A JavaScript string containing zero or more substitution strings.
JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.
设置是否在左下角显示 FPS 和部分调试。
输出警告消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。
A JavaScript string containing zero or more substitution strings.
JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.
One degree
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:
- 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
A minimal float value
PI / 180
A maximum value of number
自动监听触摸、鼠标事件并在下一次事件触发时尝试进入全屏模式
The element to request full screen state
callback function when full screen state changed
退出全屏模式
Success or not
当前是否处在全屏状态下
初始化函数
尝试使当前节点进入全屏模式,很多浏览器不允许程序触发这样的行为,必须在一个用户交互回调中才会生效。 如果希望更简单一些,可以尝试用 {{autoFullScreen}} 来自动监听用户触摸事件并在下一次触摸事件中尝试进入全屏模式。
The element to request full screen state
callback function when full screen state changed
Audio support in the browser
MULTI_CHANNEL : Multiple audio while playing - If it doesn't, you can only play background music WEB_AUDIO : Support for WebAudio - Support W3C WebAudio standards, all of the audio can be played AUTOPLAY : Supports auto-play audio - if Don‘t support it, On a touch detecting background music canvas, and then replay REPLAY_AFTER_TOUCH : The first music will fail, must be replay after touchstart USE_EMPTIED_EVENT : Whether to use the emptied event to replace load callback DELAY_CREATE_CTX : delay created the context object - only webAudio NEED_MANUAL_LOOP : loop attribute failure, need to perform loop manually
May be modifications for a few browser version
Clean a script in the JS VM, only available in native platforms
在控制台打印当前的主要系统信息
Dumps rooted objects, only available in native platforms
强制进行 JS 内存垃圾回收,尽在原生平台有效
获取当前设备的电池电量,如果电量无法获取,默认将返回 1
获取当前设备的网络类型, 如果网络类型无法获取,默认将返回 cc.sys.NetworkType.LAN
检查一个对象是否非空或在原生平台有效, 在 Web 平台,只要对象非空或非 Undefined 就会返回 true,在原生平台,我们会检查当前 JS 对象和其绑定的原生对象是否都有效
The object to be checked
获取当前时间(毫秒为单位)
尝试打开一个 web 页面,并非在所有平台都有效
Restart the JS VM, only available in native platforms
Generated using TypeDoc
!en Emit when design resolution changed. !zh 当设计分辨率改变时发送。