@@ -26,14 +26,15 @@ Add effects using `pixiPerform`.
2626pixiPerform: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
5455You 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.
6063const 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
8588Finally, compile WebGAL with support for your custom effects
@@ -91,5 +94,5 @@ yarn run build;
9194This way, you can call your effects in the script
9295
9396``` ws
94- pixiPerform:your new effect ;
97+ pixiPerform:myPerform ;
9598```
0 commit comments