screen

Module(s): vncanvas-base, vncanvas-cmds
Description: Perform some special screen actions.

screen, {param}
Perform some special screen actions that are somehow standard features of visual novel engines.
Parameters are given as {param:value, param:value, ...}
Parameter Attributes and Description
shake: number
fall: number
snap: "image_format"
Use one of the given actions.

SHAKE shakes the screen horizontally. The magnitude of the shake is determined by the amplitude given and the duration of the shake. To ensure that shaking gradually decreases over time, a time factor is multiplied to the given parameter. However, this also makes the actual shake initially large for long shake durations. So adjust accordingly.

FALL is like shake except the movement is vertical.

SNAP takes a snapshot of the stage in the given format. It then automatically opens a new window (or tab) to display the snapshot, which can be saved as a normal image. Standard browser security restriction applies (e.g. popup or new window blocking, and canvas content saving).
Valid formats are "png" and "jpeg" (are more needed?).

Note: As a security feature, browsers normally do not allow canvas capture (using toDataURL) if canvas contains images from other domains. The same security exception however may also appear on local play. As a workaround, try setting up a local webserver (e.g. Apache) and play from http://localhost/path_to_your_game.
duration:number
Optional, for 'shake' and 'fall' only
The duration of the shake in seconds.
The following performs the given screen actions.
  
chapter = [

	...
	/* shakes the screen for approximately 2 seconds */
	screen, {shake:10, duration:2},
	...
	/* takes a snapshot of the current stage */
	screen, {snap:"png"},
];