Scripting Tutorial

Welcome! This is the best place to start to learn how to create custom digital signs and touch-kiosks quickly and with professional results with Lightwing. Each file in this tutorial series builds incrementally on this basic example and these files can be copied to start your project. Lightwing scripting was designed to make creating custom digital signs and kiosks easy and fun. It is intuitive yet powerful and does not require experience with any programming languages.

First, notice that Lightwing scripts always have a .lws extension. Lightwing relies heavily upon filename extensions to identify different file types.

Next, notice that text that begins with double slash symbols at the left (//) are comments, so Lightwing will not try to parse that text.

The actual script code begins with the version command below. This should always be the first command to define the version of the Lightwing software this script is intended to run on.

This example displays a sequence of full-screen background images of the planets. Each image is displayed for 3 seconds and there is an animated fade transition between the images which adds 1 second for each page. Command and option keywords are always all-lower case and end with colon symbols (:). The colons are essential! There are usually one or more parameters to the right of the colons. Multiple parameters can be separated with commas, spaces or both. Parameters can be numeric, such as time values, or alphanumeric strings which can name pages, files or variables. These are capitalized to distinguish them from the command keywords.

Every page must begin with a page command and have a unique name, which are the planet names here. The additional keywords, time and image are called command options and may appear in any order on the command line. The convention is to tabulate them into consistent columns and leave a blank line after each page for easier reading.

The time option requires two values, the first value defines the time duration (in seconds) for the page to transition from the previous page and the second value defines the remaining duration time for the page. The total time for the page is the sum of these two values. These parameters can be specified as integers or decimal float values or traditional time values using colon symbols, such as 1:30, which means one hour and 30 seconds. If both values are zero, the page will have infinite time (never expire).

The image option defines the file name of the image that will be used for the page background. The image file type is indicated by the extension and can be .jpg, .png, .pvr or .bmp. The default is .pvr. Background images should have the same resolution as the display for maximum quality, but this is not required because Lightwing automatically scales background images to fit the display, if needed. The image option can be omitted, in which case a solid background color will be displayed instead. The background color can be defined with the color option, which is not shown in this example.

Lightwing always executes pages in sequential order, starting at the top, until a branching command is found. In this example, only the last page has a branching command. That jump command makes this example a continuous loop by branching back to the first page after completing the last page. The time required for each iteration of this loop is (1 + 3) x 9 = 36 seconds.

The subsequent examples in this tutorial series show how to place text, tickers, objects, images, videos, touch controls and more on these pages with additional commands. Also refer to the online Scripting Guide for more details about these commands.

// Scripting Tutorial - Introduction

version: 1.0

page: Mercury     time: 1, 3    image: PlanetMercuryBackground.pvr

page: Venus         time: 1, 3    image: PlanetVenusBackground.pvr

page: Earth          time: 1, 3    image: PlanetEarthBackground.pvr

page: Mars           time: 1, 3    image: PlanetMarsBackground.pvr

page: Jupiter       time: 1, 3    image: PlanetJupiterBackground.pvr

page: Saturn       time: 1, 3    image: PlanetSaturnBackground.pvr

page: Uranus      time: 1, 3    image: PlanetUranusBackground.pvr

page: Neptune    time: 1, 3    image: PlanetNeptuneBackground.pvr

page: Pluto          time: 1, 3    image: PlanetPlutoCharonBackground.pvr
      jump: Mercury

 

 

<   Scripting Guide                                             Introduction                                            Page Transitions   >