Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修正部分文档错误 #1205

Merged
merged 1 commit into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
修正部分文档错误
  • Loading branch information
xunyi0 committed Apr 17, 2020
commit 9ce2ec01d0d9d4ff4e9d5ec88fbf2606301b530f
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