Category: Landscape
Since engine version: 8.0 OC
ExecutePXS
Description
Advances PXS (flying material pixels) by the specified amount of frames. This is meant for rainy or snowy scenarios to start with a screen full of precipitation.
Syntax
bool ExecutePXS(int frames, proplist callback);
Parameters
- frames:
- How many frames to execute
- callback:
- [opt] For each executed frame, call
callback->Timer(i)
, 0 ≤ i <frames
Remark
The
callback
parameter is chosen to allow passing simple effects.Example
local snowfx = new Effect { Timer = func() { CastPXS("Snow", 2, 0, Random(LandscapeWidth()), 0, RandomX(90, 270)); } }; func Initialize() { var fx = CreateEffect(snowfx, 1, 1); ExecutePXS(100, fx); }
Creates a snowing effect and executes it for 100 frames so that the game starts with a snowy screen.
See also: CastPXS