From 8f20630e623236ba215282b27365e5861a17720e Mon Sep 17 00:00:00 2001 From: 22 <60903333+nini22P@users.noreply.github.com> Date: Thu, 15 May 2025 18:00:08 +0800 Subject: [PATCH] update effects docs --- src/en/webgal-script/special-effect.md | 11 +++++++---- src/ja/webgal-script/special-effect.md | 11 +++++++---- src/webgal-script/special-effect.md | 17 ++++++++++------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/en/webgal-script/special-effect.md b/src/en/webgal-script/special-effect.md index 25ea3bf92..ca5448e28 100644 --- a/src/en/webgal-script/special-effect.md +++ b/src/en/webgal-script/special-effect.md @@ -26,7 +26,7 @@ Add effects using `pixiPerform`. pixiPerform:rain; // Add a rain effect ``` -Note: After the effect takes effect, if it is not initialized, the effect will continue to run. +Note: After the effect takes effect, if it is not re initialized, the effect will continue to run. ### List of Built-in Effects @@ -34,6 +34,7 @@ Note: After the effect takes effect, if it is not initialized, the effect will c | :--- | :--- | | Rain | pixiPerform:rain; | | Snow | pixiPerform:snow; | +| Heavy Snow | pixiPerform:heavySnow; | | Cherry Blossoms | pixiPerform:cherryBlossoms; | ### Superimpose Effects @@ -53,9 +54,11 @@ Initialize using `pixiInit` to clear all effects that have been applied. You can download the source code, then find `/Core/gameScripts/pixiPerformScripts/` and create a new `PIXI.Container` to create the effects you need. +The effects container is divided into a foreground container and a background container, and the foreground container is used here as an example. + ``` ts // Get the current Pixi effect Container -const effectsContainer = RUNTIME_GAMEPLAY.pixiStage!.effectsContainer!; +const effectsContainer = WebGAL.gameplay.pixiStage!.foregroundEffectsContainer!; // Call the Pixi App method, which may be useful for determining screen size, etc. const app = RUNTIME_GAMEPLAY.pixiStage!.currentApp!; // Create a container for custom effects @@ -79,7 +82,7 @@ function myPerform() { } // Register -registerPerform('myPerform', () => myPerform(parameters)); +registerPerform('myPerform', { fg: () => myPerform(parameters) }); ``` Finally, compile WebGAL with support for your custom effects @@ -91,5 +94,5 @@ yarn run build; This way, you can call your effects in the script ``` ws -pixiPerform:your new effect; +pixiPerform:myPerform; ``` \ No newline at end of file diff --git a/src/ja/webgal-script/special-effect.md b/src/ja/webgal-script/special-effect.md index 08c1afcb0..47f4c05a9 100644 --- a/src/ja/webgal-script/special-effect.md +++ b/src/ja/webgal-script/special-effect.md @@ -26,7 +26,7 @@ pixiInit; pixiPerform:rain; // 雨のエフェクトを追加する ``` -注意:エフェクトを適用した後、初期化しないと、エフェクトは常に実行されます。 +注意:エフェクトを適用した後、再度初期化しないと、エフェクトは常に実行されます。 ### プリセットエフェクト一覧 @@ -34,6 +34,7 @@ pixiPerform:rain; // 雨のエフェクトを追加する | :--- | :-------------------------- | | 雨 | pixiPerform:rain; | | 雪 | pixiPerform:snow; | +| 大雪 | pixiPerform:heavySnow; | | 桜 | pixiPerform:cherryBlossoms; | ### エフェクトを重ねる @@ -53,9 +54,11 @@ pixiPerform:snow; ソースコードをダウンロードして `/Core/gameScripts/pixiPerformScripts/` に移動し、必要なエフェクトを作成するために `PIXI.Container` を新規作成します。 +エフェクトコンテナは前景コンテナと背景コンテナに分割され、ここでは前景コンテナを例としています。 + ``` ts // 現在の Pixi エフェクト Container を取得する -const effectsContainer = RUNTIME_GAMEPLAY.pixiStage!.effectsContainer!; +const effectsContainer = WebGAL.gameplay.pixiStage!.foregroundEffectsContainer!; // Pixi App の呼び出し方法で、画面のサイズなどを決定するのに役立ちます const app = RUNTIME_GAMEPLAY.pixiStage!.currentApp!; // カスタムエフェクトのコンテナを作成する @@ -79,7 +82,7 @@ function myPerform() { } // 登録する -registerPerform('myPerform', () => myPerform(パラメータ)); +registerPerform('myPerform', { fg: () => myPerform(パラメータ) }); ``` 最後に、カスタムエフェクトをサポートする WebGAL をコンパイルします。 @@ -91,5 +94,5 @@ yarn run build; これで、スクリプトでエフェクトを呼び出すことができます。 ``` ws -pixiPerform:新しいエフェクト; +pixiPerform:myPerform; ``` \ No newline at end of file diff --git a/src/webgal-script/special-effect.md b/src/webgal-script/special-effect.md index 5fd268eee..0b73b36a7 100644 --- a/src/webgal-script/special-effect.md +++ b/src/webgal-script/special-effect.md @@ -26,14 +26,15 @@ pixiInit; pixiPerform:rain; // 添加一个下雨的特效 ``` -注意:特效作用后,如果没有初始化,特效会一直运行。 +注意:特效作用后,如果没有重新初始化,特效会一直运行。 ### 预制特效列表 | 效果 | 指令 | | :--- | :-------------------------- | -| 下雨 | pixiPerform:rain; | -| 下雪 | pixiPerform:snow; | +| 雨 | pixiPerform:rain; | +| 雪 | pixiPerform:snow; | +| 大雪 | pixiPerform:heavySnow; | | 樱花 | pixiPerform:cherryBlossoms; | ### 叠加特效 @@ -53,11 +54,13 @@ pixiPerform:snow; 你可以下载源代码,然后找到 `/Core/gameScripts/pixiPerformScripts/` 然后新建一个 `PIXI.Container` 用于制作你所需要的特效。 +特效层分为前景层和背景层,这里以前景层为例。 + ``` ts // 获取当前的 Pixi 效果 Container -const effectsContainer = RUNTIME_GAMEPLAY.pixiStage!.effectsContainer!; +const effectsContainer = WebGAL.gameplay.pixiStage!.foregroundEffectsContainer!; // 调用 Pixi App 的方式,对确定屏幕尺寸等可能有用 -const app = RUNTIME_GAMEPLAY.pixiStage!.currentApp!; +const app = WebGAL.gameplay.pixiStage!.currentApp!; // 创建自定义特效的container const container = new PIXI.Container(); // 添加特效 @@ -79,7 +82,7 @@ function myPerform() { } // 注册 -registerPerform('myPerform', () => myPerform(参数)); +registerPerform('myPerform', { fg: () => myPerform(参数) }); ``` 最后,编译出支持你自定义特效的 WebGAL @@ -91,5 +94,5 @@ yarn run build; 这样,你就可以在脚本中调用你的特效了 ``` ws -pixiPerform:你的新特效; +pixiPerform:myPerform; ```