Skip to content

Commit

Permalink
修正部分文档错误 (#1205)
Browse files Browse the repository at this point in the history
  • Loading branch information
xunyi0 committed Apr 17, 2020
1 parent d3e784f commit 6704941
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion en/components/richtext.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ There are two ways to set the color of RichText:
1. Selected the node and set the overall color of RichText in **Node -> Color** of the **Properties**
2. Use BBCode to set colors on the inside of RichText separately

**Note**: The two cannot be mixed. If mixed, the color set in the first way will prevail.
**Note**: The two cannot be mixed. If mixed, the color set in the **second** way will prevail at runtime.

## Cache Mode (New in v2.3)

Expand Down
5 changes: 2 additions & 3 deletions en/getting-started/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,9 @@ For details, please refer to the [custom_material](https://github.com/cocos-crea

The parameters passed in for `this.unschedule(callBack, target)` must be consistent with those passed in for `this.schedule(callBack, target)`. That is, the `callBack` must be the same function object, and the `target` must also be the same object. If the parameters passed in are different, the scheduler cannot be stopped properly.

### When playing Audio on the iOS browser, if you switch the foreground and background, it is likely that you cannot pause and resume playback normally
### When playing Web Audio on the iOS browser, if you switch the foreground and background, it is likely that you cannot pause and resume playback normally

This problem is caused by the `AudioScheduledSourceNode` of Web Audio. Because the `suspend` method of `AudioContext` only pauses the **specified** Audio on the Web Desktop, but pauses **all** Audio on the Web Mobile.<br>
Since fixing this problem on the engine is too hack and not universal enough, it will not be repaired. Developers can fix it by adding the following code to the project script:
This problem is caused by the `AudioScheduledSourceNode` of Web Audio. The `suspend` method of `WebAudioContext` only pauses the **specified** Audio on the Web Desktop, but pauses **all** Audio on the Web Mobile. Therefore, fixing this problem on the engine is too hack and not universal enough, it will not be repaired. Developers can fix it by adding the following code to the project script:

```js
if (cc.sys.isBrowser && cc.sys.os === cc.sys.OS_IOS) {
Expand Down
2 changes: 1 addition & 1 deletion zh/components/richtext.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ RichText 组件用来显示一段带有不同样式效果的文字,你可以
1. 选中节点,在 **属性检查器****Node -> Color** 中设置 RichText 的整体颜色
2. 使用 bbcode 对 RichText 内部分别设置颜色

**注意**:两者不可混用,如果混用了,将以第一种方式设置的颜色为准
**注意**:两者不可混用,如果混用了,运行时将以 **第二种** 方式设置的颜色为准

## 文本缓存类型(Cache Mode)

Expand Down
5 changes: 2 additions & 3 deletions zh/getting-started/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,9 @@ material.setProperty("diffuseTexture", texture);

受 Electron 底层 bug 影响,Mac 系统上 Cocos Creator 程序坞图标概率性变小。可以在终端上输入命令行:`defaults write com.apple.dock contents-immutable -bool false; killall Dock`,回车之后即可重启程序坞。

### Audio 在 iOS 的浏览器上播放时,如果切换前后台,大概率会出现无法正常暂停和恢复播放的问题
### Web Audio 在 iOS 的浏览器上播放时,如果切换前后台,大概率会出现无法正常暂停和恢复播放的问题

这个问题是 Web Audio 的 `AudioScheduledSourceNode` 引起的。因为 `AudioContext``suspend` 方法在 Web Desktop 平台只会暂停 **指定的** Audio,而在 Web Mobile 平台会暂停 **所有的** Audio。<br>
在引擎上修复该问题过于 Hack 且不够通用,便不做修复,开发者可以通过在项目脚本中加入以下代码修复:
这个问题是 Web Audio 的 `AudioScheduledSourceNode` 引起的。`WebAudioContext``suspend` 方法在 Web Desktop 平台只会暂停 **指定的** Audio,而在 Web Mobile 平台会暂停 **所有的** Audio。因此在引擎上修复该问题过于 Hack 且不够通用,便不做修复,开发者可以通过在项目脚本中加入以下代码修复:

```js
if (cc.sys.isBrowser && cc.sys.os === cc.sys.OS_IOS) {
Expand Down

0 comments on commit 6704941

Please sign in to comment.