Skip to content

Commit

Permalink
Merge pull request cocos#2993 from dumganhar/384-update-doc
Browse files Browse the repository at this point in the history
Update 3.8 docs, rename 3.8.5 to 3.8.4
  • Loading branch information
MrKylinGithub authored Jul 19, 2024
2 parents 4991c03 + 7f2dcbc commit 239f58e
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion versions/3.8/en/tween/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ This chapter contains the following sections:

## Example

Please see [GitHub](https://github.com/cocos/cocos-test-projects/tree/v3.8.5/assets/cases/tween) for sample code for using tweens.
Please see [GitHub](https://github.com/cocos/cocos-test-projects/tree/v3.8.4/assets/cases/tween) for sample code for using tweens.
32 changes: 16 additions & 16 deletions versions/3.8/en/tween/tween-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tween(this.node.position)

> [!TIP]
>
> Supported since v3.8.5
> Supported since v3.8.4
```ts
tween(this.node).to(1, { angle: ()=>90 ).start();
Expand All @@ -56,7 +56,7 @@ tween(this.node).to(1, { angle: 90 ).start();
> [!TIP]
>
> Supported since v3.8.5
> Supported since v3.8.4
- For a specific property of the current action
Expand Down Expand Up @@ -90,7 +90,7 @@ tween(this.node).to(1, { angle: 90, position: v3(90, 90, 90) }, {
> [!TIP]
>
> Supported since v3.8.5
> Supported since v3.8.4
- For a specific property of the current action
Expand Down Expand Up @@ -217,7 +217,7 @@ tween(this.node)
> [!TIP]
>
> Supported from v3.8.5: `union(fromId)`
> Supported from v3.8.4: `union(fromId)`
The `union(fromId)` method merges actions from a specified identifier to the current action into a single sequence action. It is often used in conjunction with `id`, `repeat`, and `repeatForever`. The sample code is as follows:
Expand Down Expand Up @@ -355,7 +355,7 @@ The usage of `repeatForever` interface is similar to `repeat`, but it becomes pe
> [!TIP]
>
> Supported since v3.8.5
> Supported since v3.8.4
The `id` interface is used to assign a numerical identifier to the preceding action. Ensure that **identifiers are unique**, as the tween system will directly use the first action found during internal searches.
Expand All @@ -373,7 +373,7 @@ tween(this.node)
> [!TIP]
>
> Supported since v3.8.5
> Supported since v3.8.4
The `reverse` interface has three overloaded implementations:
Expand Down Expand Up @@ -539,7 +539,7 @@ srcTween.clone(find("Cone")).start();
> [!TIP]
>
> Starting from v3.8.5, it is supported to clone tweens without passing the `target` parameter, meaning the cloned tween directly uses the original target.
> Starting from v3.8.4, it is supported to clone tweens without passing the `target` parameter, meaning the cloned tween directly uses the original target.
Example:
Expand All @@ -552,7 +552,7 @@ const clonedTween = srcTween.clone(); // clonedTween's target is also the this.n
> [!TIP]
>
> Supported from v3.8.5
> Supported from v3.8.4
If you want to handle actions like `position`, `contentSize`, and `color` simultaneously in a tween chain, with their targets being different—node, UITransform component on the node, and Sprite component on the node respectively, you can achieve this using the following code:
Expand Down Expand Up @@ -663,7 +663,7 @@ Tween.stopAllByTarget(node1); // t1 and t3 are associated with node1, so they wi
> [!TIP]
>
> Supported from v3.8.5
> Supported from v3.8.4
Manual pause and resume:
Expand All @@ -684,13 +684,13 @@ t.resume(); // Resume the tween t
> [!IMPORTANT]
>
> From v3.8.5, if the tween target is of type Node, the tween will automatically pause and resume based on the Node's active state.
> From v3.8.4, if the tween target is of type Node, the tween will automatically pause and resume based on the Node's active state.
## Scaling Tween Time
> [!TIP]
>
> Supported from v3.8.5
> Supported from v3.8.4
```ts
tween(this.node)
Expand All @@ -705,7 +705,7 @@ In the above example, `timeScale` is set to 0.5. The `to` action's duration is 1
> [!TIP]
>
> Supported from v3.8.5
> Supported from v3.8.4
```ts
const t = tween(this.node)
Expand All @@ -720,7 +720,7 @@ console.log(t.duration); // Outputs 2
> [!TIP]
>
> Supported from v3.8.5
> Supported from v3.8.4
The `update` interface is used to add a custom action.
Expand Down Expand Up @@ -763,7 +763,7 @@ tween(this.node)
> [!TIP]
>
> Supported from v3.8.5
> Supported from v3.8.4
The `start` interface can receive a `startTime` parameter, in seconds, to start the tween from a specific time. All tweens before this time will be executed immediately.
Expand All @@ -783,7 +783,7 @@ In the above example, two `to` actions are created with a total duration of 2 se
> [!TIP]
>
> Supported from v3.8.5
> Supported from v3.8.4
When the target of tween is `Node`, it will listen to its destruction event for automatic destruction of tween, and the call to `target` method will also update the listener automatically.
Expand Down Expand Up @@ -815,4 +815,4 @@ To stop and destroy the tween, the following methods are available.
Tween.stopAllByTarget(this.node); // Destroy all tweens on this node
```
> **Note**: In versions prior to v3.8.5, remember to stop the corresponding tweens when switching scenes. From v3.8.5, the engine will handle this automatically.
> **Note**: In versions prior to v3.8.4, remember to stop the corresponding tweens when switching scenes. From v3.8.4, the engine will handle this automatically.
2 changes: 1 addition & 1 deletion versions/3.8/en/tween/tween-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Interface

The interfaces supported from `v3.8.5` onwards include: `reverse`, `id`, `union(fromId?: number)`, `timeScale`, `pause`, `resume`, `pauseAllByTarget`, `resumeAllByTarget`, `update`, `start(time)`, `duration`.
The interfaces supported from `v3.8.4` onwards include: `reverse`, `id`, `union(fromId?: number)`, `timeScale`, `pause`, `resume`, `pauseAllByTarget`, `resumeAllByTarget`, `update`, `start(time)`, `duration`.

| Interface | Description |
| :---------------- | :----------------------------------------------------------- |
Expand Down
2 changes: 1 addition & 1 deletion versions/3.8/zh/tween/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@

## 范例

更多关于 Tween 具体的使用方法,详情请参考范例 **Tween**[GitHub](https://github.com/cocos/cocos-test-projects/tree/v3.8.5/assets/cases/tween))。
更多关于 Tween 具体的使用方法,详情请参考范例 **Tween**[GitHub](https://github.com/cocos/cocos-test-projects/tree/v3.8.4/assets/cases/tween))。

32 changes: 16 additions & 16 deletions versions/3.8/zh/tween/tween-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tween(this.node.position)

> [!TIP]
>
> 从 v3.8.5 开始支持
> 从 v3.8.4 开始支持
```ts
tween(this.node).to(1, { angle: ()=>90 ).start();
Expand All @@ -56,7 +56,7 @@ tween(this.node).to(1, { angle: 90 ).start();
> [!TIP]
>
> 从 v3.8.5 开始支持
> 从 v3.8.4 开始支持
- 针对当前动作的某个属性
Expand Down Expand Up @@ -90,7 +90,7 @@ tween(this.node).to(1, { angle: 90, position: v3(90, 90, 90) }, {
> [!TIP]
>
> 从 v3.8.5 开始支持
> 从 v3.8.4 开始支持
- 针对当前动作的某个属性
Expand Down Expand Up @@ -217,7 +217,7 @@ tween(this.node)
> [!TIP]
>
> 从 v3.8.5 开始支持:`union(fromId)`
> 从 v3.8.4 开始支持:`union(fromId)`
`union(fromId)` 方法会将从某个标识的的动作到当前的所有动作合并为一个顺序动作(Sequence),常与 `id``repeat``repeatForever` 配合使用,示例代码如下:
Expand Down Expand Up @@ -353,7 +353,7 @@ tween(this.node)
> [!TIP]
>
> 从 v3.8.5 开始支持
> 从 v3.8.4 开始支持
接口 `id` 用于给前一个动作添加一个 `number` 类型的标识,注意 **标识不要有重复** ,否则缓动系统内部搜索标识的时候将直接使用第一个表示的动作。
Expand All @@ -371,7 +371,7 @@ tween(this.node)
> [!TIP]
>
> 从 v3.8.5 开始支持
> 从 v3.8.4 开始支持
`reverse` 接口有 3 个重载实现,分别为:
Expand Down Expand Up @@ -537,7 +537,7 @@ srcTween.clone(find("Cone")).start();
> [!TIP]
>
> 从 v3.8.5 开始支持在 clone 的时候不传递 target 参数,即复制生成的新缓动直接使用原来的 target
> 从 v3.8.4 开始支持在 clone 的时候不传递 target 参数,即复制生成的新缓动直接使用原来的 target
示例如下:
Expand All @@ -550,7 +550,7 @@ const clonedTween = srcTween.clone(); // clonedTween 的 target 也是 this.node
> [!TIP]
>
> 从 v3.8.5 开始支持
> 从 v3.8.4 开始支持
如果要在一个缓动链式调用中同时处理 position, contentSize, color 动作,它们的目标分别为:节点、节点上的 UITransform 组件、节点上的 Sprite 组件,可以通过如下代码实现:
Expand Down Expand Up @@ -661,7 +661,7 @@ Tween.stopAllByTarget(node1); // t1 和 t3 关联了 node1,因此它们将被
> [!TIP]
>
> 从 v3.8.5 开始支持
> 从 v3.8.4 开始支持
手动暂停恢复:
Expand All @@ -682,13 +682,13 @@ t.resume(); // 恢复缓动 t
> [!IMPORTANT]
>
> 从 v3.8.5 开始,如果缓动目标是 Node 类型,那么缓动会根据 Node 的 active 状态自动暂停恢复。
> 从 v3.8.4 开始,如果缓动目标是 Node 类型,那么缓动会根据 Node 的 active 状态自动暂停恢复。
## 缩放缓动时间
> [!TIP]
>
> 从 v3.8.5 开始支持
> 从 v3.8.4 开始支持
```ts
tween(this.node)
Expand All @@ -703,7 +703,7 @@ tween(this.node)
> [!TIP]
>
> 从 v3.8.5 开始支持
> 从 v3.8.4 开始支持
```ts
const t = tween(this.node)
Expand All @@ -718,7 +718,7 @@ console.log(t.duration); // 将输出 2
> [!TIP]
>
> 从 v3.8.5 开始支持
> 从 v3.8.4 开始支持
`update` 接口用于添加一个自定义动作。
Expand Down Expand Up @@ -762,7 +762,7 @@ tween(this.node)
> [!TIP]
>
> 从 v3.8.5 开始支持
> 从 v3.8.4 开始支持
`start` 接口可接收 startTime 参数,单位为秒,用于从某个时间开始缓动,此时间前的所有缓动将被立马执行完毕。
Expand All @@ -782,7 +782,7 @@ const t = tween(this.node)
> [!TIP]
>
> 从 v3.8.5 开始支持
> 从 v3.8.4 开始支持
当缓动目标为 `Node` 时,将会监听其销毁事件进行缓动的自动销毁,调用 `target` 方法也会自动更新监听。
Expand Down Expand Up @@ -814,4 +814,4 @@ const t = tween(this.node)
Tween.stopAllByTarget(this.node); // 销毁该节点上的所有缓动
```
> **注意**:在 v3.8.5 之前的版本,切换场景时记得停止相应的缓动。v3.8.5 及之后的版本,引擎会自动处理。
> **注意**:在 v3.8.4 之前的版本,切换场景时记得停止相应的缓动。v3.8.4 及之后的版本,引擎会自动处理。
2 changes: 1 addition & 1 deletion versions/3.8/zh/tween/tween-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### 接口说明

`v3.8.5` 开始支持的接口有:reverse, id, union(fromId?: number), timeScale, pause, resume, pauseAllByTarget, resumeAllByTarget, update, start(time) , duration。
`v3.8.4` 开始支持的接口有:reverse, id, union(fromId?: number), timeScale, pause, resume, pauseAllByTarget, resumeAllByTarget, update, start(time) , duration。

| 接口 | 功能说明 |
| :---------------- | :------------------------------------------ |
Expand Down

0 comments on commit 239f58e

Please sign in to comment.