atmosphere
Module(s): vncanvas-base, vncanvas-atmo
Description: Adds special or animated atmospheric effects.
atmosphere, {param} |
This displays special
atmospheric effects to enhance the scene. Note for simple atmospheric effects,
such as non-scrolling cloud or fog, use "overlay". Multiple atmosphere effects can be used simultaneously, but only one of each type. Parameters are given as {param:value, param:value, ...} |
| Parameter | Attributes and Description |
|---|---|
|
rain: number or "action"
snow: number or "action"
cloud: "path_to_image" or "action"
beam: radius or "action"
|
Use one of the specified effects.
RAIN creates a rainfall effect using the given rainfall count. Use 0-100 for drizzle, 100-500 for normal, 500 above for heavy. Note: "rain" uses particle generators, so might be heavy on resources. SNOW creates a snowfall effect using the given count. Note: Snow is similar to rain, only the graphic is changed. CLOUD draws the given image (preferably a semi-transparent image) on the viewport and optionally scrolls it. If the image is smaller than the viewport, it is automatically tiled. BEAM acts like a beam of light (e.g flashlight) with the specified radius. It creates a temporary mask to hide the other scene elements. Use, for example, on dark night scenes with hidden elements. Tip: When the beam is stopped, so is the temporary mask, causing the scene behind it to appear. If this is not the desired effect, create an overlay layer with the same color as the mask, prior to stopping the beam. Valid actions are "start" and "stop". Default if not given is "start". |
|
direction:angle_in_degrees
|
Optional, for "rain", "snow" or "cloud" only
Angles are referenced from +x axis (right) in clockwise rotation.
For "rain" or "snow", specifies fall direction. For best results, limit angle to 45 to 135 degrees. If not given, default is 90 or vertical down. For "cloud", scrolls the image across viewport. If not given, image is not scrolled. |
|
mask:"color"
|
Optional, for "beam" only
The mask color for the beam. Default is black if not given.
|
The first atmosphere call starts "rain". The second starts a cloud scrolling left. The third shows
a beam of light with the given radius that follows mouse movement.
chapter = [
...
atmosphere, {rain:100},
atmosphere, {cloud:"image/cloud.png", direction:180},
atmosphere, {beam:150, mask:"black"},
...
atmosphere, {rain:"stop"},
atmosphere, {cloud:"stop"},
/* Create a temporary overlay to prepare for stopping beam */
overlay, {image:"image/black.png", effect:"dissolve"},
atmosphere, {beam:"stop"},
...
/* To restart a rain effect, specify a rainfall count */
atmosphere, {rain:100, direction:60},
...
/* To restart a cloud effect the same as previous, just use start */
atmosphere, {cloud:"start"},
...
/* To restart a beam effect, specify a radius */
atmosphere, {beam: 200},
...
];