Scripting Tutorial

Welcome! This is the right place to start to learn how to create custom digital signs with Lightwing. These scripts are the most important part of learning how to use Lightwing to create custom digital signs and kiosks quickly with professional results. 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 lines. The convention is to tabulate them into consistent columns and leave a blank line after each page for easier reading.

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   >