Skip to content

Commit 3b98cf5

Browse files
authored
Merge pull request #68 from nini22P/main
update effects docs
2 parents 758bdd7 + 8f20630 commit 3b98cf5

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

src/en/webgal-script/special-effect.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ Add effects using `pixiPerform`.
2626
pixiPerform:rain; // Add a rain effect
2727
```
2828

29-
Note: After the effect takes effect, if it is not initialized, the effect will continue to run.
29+
Note: After the effect takes effect, if it is not re initialized, the effect will continue to run.
3030

3131
### List of Built-in Effects
3232

3333
| Effect | Command |
3434
| :--- | :--- |
3535
| Rain | pixiPerform:rain; |
3636
| Snow | pixiPerform:snow; |
37+
| Heavy Snow | pixiPerform:heavySnow; |
3738
| Cherry Blossoms | pixiPerform:cherryBlossoms; |
3839

3940
### Superimpose Effects
@@ -53,9 +54,11 @@ Initialize using `pixiInit` to clear all effects that have been applied.
5354

5455
You can download the source code, then find `/Core/gameScripts/pixiPerformScripts/` and create a new `PIXI.Container` to create the effects you need.
5556

57+
The effects container is divided into a foreground container and a background container, and the foreground container is used here as an example.
58+
5659
``` ts
5760
// Get the current Pixi effect Container
58-
const effectsContainer = RUNTIME_GAMEPLAY.pixiStage!.effectsContainer!;
61+
const effectsContainer = WebGAL.gameplay.pixiStage!.foregroundEffectsContainer!;
5962
// Call the Pixi App method, which may be useful for determining screen size, etc.
6063
const app = RUNTIME_GAMEPLAY.pixiStage!.currentApp!;
6164
// Create a container for custom effects
@@ -79,7 +82,7 @@ function myPerform() {
7982
}
8083

8184
// Register
82-
registerPerform('myPerform', () => myPerform(parameters));
85+
registerPerform('myPerform', { fg: () => myPerform(parameters) });
8386
```
8487

8588
Finally, compile WebGAL with support for your custom effects
@@ -91,5 +94,5 @@ yarn run build;
9194
This way, you can call your effects in the script
9295

9396
``` ws
94-
pixiPerform:your new effect;
97+
pixiPerform:myPerform;
9598
```

src/ja/webgal-script/special-effect.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ pixiInit;
2626
pixiPerform:rain; // 雨のエフェクトを追加する
2727
```
2828

29-
注意:エフェクトを適用した後、初期化しないと、エフェクトは常に実行されます。
29+
注意:エフェクトを適用した後、再度初期化しないと、エフェクトは常に実行されます。
3030

3131
### プリセットエフェクト一覧
3232

3333
| エフェクト | コマンド |
3434
| :--- | :-------------------------- |
3535
|| pixiPerform:rain; |
3636
|| pixiPerform:snow; |
37+
| 大雪 | pixiPerform:heavySnow; |
3738
|| pixiPerform:cherryBlossoms; |
3839

3940
### エフェクトを重ねる
@@ -53,9 +54,11 @@ pixiPerform:snow;
5354

5455
ソースコードをダウンロードして `/Core/gameScripts/pixiPerformScripts/` に移動し、必要なエフェクトを作成するために `PIXI.Container` を新規作成します。
5556

57+
エフェクトコンテナは前景コンテナと背景コンテナに分割され、ここでは前景コンテナを例としています。
58+
5659
``` ts
5760
// 現在の Pixi エフェクト Container を取得する
58-
const effectsContainer = RUNTIME_GAMEPLAY.pixiStage!.effectsContainer!;
61+
const effectsContainer = WebGAL.gameplay.pixiStage!.foregroundEffectsContainer!;
5962
// Pixi App の呼び出し方法で、画面のサイズなどを決定するのに役立ちます
6063
const app = RUNTIME_GAMEPLAY.pixiStage!.currentApp!;
6164
// カスタムエフェクトのコンテナを作成する
@@ -79,7 +82,7 @@ function myPerform() {
7982
}
8083

8184
// 登録する
82-
registerPerform('myPerform', () => myPerform(パラメータ));
85+
registerPerform('myPerform', { fg: () => myPerform(パラメータ) });
8386
```
8487

8588
最後に、カスタムエフェクトをサポートする WebGAL をコンパイルします。
@@ -91,5 +94,5 @@ yarn run build;
9194
これで、スクリプトでエフェクトを呼び出すことができます。
9295

9396
``` ws
94-
pixiPerform:新しいエフェクト;
97+
pixiPerform:myPerform;
9598
```

src/webgal-script/special-effect.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ pixiInit;
2626
pixiPerform:rain; // 添加一个下雨的特效
2727
```
2828

29-
注意:特效作用后,如果没有初始化,特效会一直运行。
29+
注意:特效作用后,如果没有重新初始化,特效会一直运行。
3030

3131
### 预制特效列表
3232

3333
| 效果 | 指令 |
3434
| :--- | :-------------------------- |
35-
| 下雨 | pixiPerform:rain; |
36-
| 下雪 | pixiPerform:snow; |
35+
|| pixiPerform:rain; |
36+
|| pixiPerform:snow; |
37+
| 大雪 | pixiPerform:heavySnow; |
3738
| 樱花 | pixiPerform:cherryBlossoms; |
3839

3940
### 叠加特效
@@ -53,11 +54,13 @@ pixiPerform:snow;
5354

5455
你可以下载源代码,然后找到 `/Core/gameScripts/pixiPerformScripts/` 然后新建一个 `PIXI.Container` 用于制作你所需要的特效。
5556

57+
特效层分为前景层和背景层,这里以前景层为例。
58+
5659
``` ts
5760
// 获取当前的 Pixi 效果 Container
58-
const effectsContainer = RUNTIME_GAMEPLAY.pixiStage!.effectsContainer!;
61+
const effectsContainer = WebGAL.gameplay.pixiStage!.foregroundEffectsContainer!;
5962
// 调用 Pixi App 的方式,对确定屏幕尺寸等可能有用
60-
const app = RUNTIME_GAMEPLAY.pixiStage!.currentApp!;
63+
const app = WebGAL.gameplay.pixiStage!.currentApp!;
6164
// 创建自定义特效的container
6265
const container = new PIXI.Container();
6366
// 添加特效
@@ -79,7 +82,7 @@ function myPerform() {
7982
}
8083

8184
// 注册
82-
registerPerform('myPerform', () => myPerform(参数));
85+
registerPerform('myPerform', { fg: () => myPerform(参数) });
8386
```
8487

8588
最后,编译出支持你自定义特效的 WebGAL
@@ -91,5 +94,5 @@ yarn run build;
9194
这样,你就可以在脚本中调用你的特效了
9295

9396
``` ws
94-
pixiPerform:你的新特效;
97+
pixiPerform:myPerform;
9598
```

0 commit comments

Comments
 (0)