Ticker Command

Lightwing will render professional, presentation quality tickers directly from scripts or RSS channels, in any available font, size, color, with or without font effects and/or drop-shadows with no additional software required. This makes changing ticker content as simple as editing the script. The Ticker command supports limited 3D features as well, including perspective projections and effects. The Ticker command does not support CSV channels.

The mandatory parameters for Ticker commands are a font name and either a constant line of text or a text variable name, which are defined with the type option. There must be a matching font file in the fonts folder with a PVR extension. Font names should also have a size suffix preceded by an underscore. The size suffix specifies the height that the font will be rendered at in pixels.

Many fonts are provided in the Lightwing SDK in sizes 10 through 200 pixels on 10 pixel height increments. The best way to preview and select fonts is to run the TestFonts.lws test script provided in the Lightwing SDK. Refer to the section on Converting Fonts for information on adding new fonts.

    Example of a Page with some Ticker Commands
    
    page: PageName    time: 1, 10
        ticker : OpenSansBold_40    type: "Hello World!"
        ticker: OpenSansRegular_80    type: DateLong
        ticker: GalatiaRegular_100    time 1, 5    rate: 10    loop: on    position: 0, 50    align: CenterCenter    type: "Hello World!"

Special effects can also be applied to fonts. These effects can enhance the appearance of fonts and make them visually more effective. The best way to preview and select font effects is to run the TestFontEffects.lws test script provided in the Lightwing SDK.

Time Option

Defines the start and duration times for the ticker in seconds. If not specified, the default start and duration times will be the same as for the page that this ticker is on. These can be specified as either floating-point values in seconds or integer (sexagesimal) clock time durations. Refer to the Page command for examples.

Start times can be prefixed with a plus symbol (+) which means the new start time is the sum of the specified time and the start time from the previous Ticker command on the same page. This allows Ticker commands to be duplicated in the script without the need to manually add time values.

Fade Option

Defines the time in seconds for ticker to fade-in and fade-out, when it appears and disappears, respectively. Sexagesimal format can not be used here because these animations should never be more than a few seconds at most.

Box Option

Defines the name of an associated box from which many parameters will be inherited as defaults for the ticker. The specified box must precede the ticker on the same page. Inherited parameters include time, position, size, scale, rotate, alignment and touch event options. Any of these can still be overridden with specific command options.

Defines the vertical alignment for the ticker. The horizontal part of the alignment is ignored for tickers.

Text and Ticker Alignments

        Names              Short            Uses
        
        TopLeft                  tl                Left Justified Text    
        TopCenter             tc               Centered Text
        TopRight               tr                Right Justified Text    
        CenterLeft            cl                Left Justified Text    
        CenterCenter       cc               Centered Text
        CenterRight          cr                Right Justified Text
        BottomLeft           bl                Left Justified Text    
        BottomCenter      bc               Centered Text
        BottomRight         br              Right Justified Text

Position Option

Defines the position the ticker will be drawn on the display. The align option also affects this position. The default position for ticker is 0.0, 0.0, 0.0, which is the top left corner of the display and at the front of the coordinate space depth.

Any position coordinate can be prefixed with a plus symbol (+) to define the new position as the sum of the specified coordinate and the same position coordinate from the previous Ticker command on the same page. This allows Ticker commands to be duplicated in the script without the need to manually add position values.

Scale Option

Defines horizontal and vertical scaling factors for the ticker. This can be used to stretch or reduce the font for tickers in either direction. This can also be used to enlarge fonts beyond the sizes at which they are provided in the Lightwing SDK. However, scaling fonts excessively will reduce their quality. The default scaling factors for tickers are 1.0, 1.0, which disables scaling. Lightwing automatically scales all fonts down by half (in both directions) when run windowed on Windows to approximate their size relative to the window. On multi-panel displays, Lightwing automatically scales all fonts up by the vertical number of panels in the display. For example, on an 8 x 2 panel display, font sizes are doubled because the vertical height of the display is 2 panels.

Rotate Option

Defines rotation angles for the ticker in degrees. Up to three floating-point values can be specified, which correspond to rotations on the x, y and z axis, respectively. Positive degree values indicate clockwise rotation, whereas negative values indicate counter-clockwise rotation. The default rotations are 0.0, 0.0, 0.0 degrees. This option should not be used in combination with the jump, call, return or touch options for the Ticker command as rotations will cause misalignment between apparent ticker positions and touch boundaries.

Ortho Option

Defines if the ticker is drawn using an orthographic or perspective projection. This parameter can be specified as off or on. For tickers, this is on by default, so tickers will appear the same size regardless of their depth position. This is best for most tickers, unless an X or Y axis rotation is also applied, in which case a perspective projection can give tickers a 3D appearance. Lightwing does not support perspective text or tickers on multi-panel displays.

Color Option

Defines a color for the ticker. This may include an optional alpha value to blend the ticker with the background. The colors can be specified in one of three different formats, float values with a range of 0.0 to 1.0, integer values with a range of 0 to 255 or as a six or eight digit hexadecimal value preceded with a hash symbol (HTML style). For all of these formats, the ordering of the values is red, green, blue and alpha. The alpha parameter is optional. The default color for tickers is opaque white (1.0, 1.0, 1.0, 1.0 or 255, 255, 255, 255 or #FFFFFFFF).

Type Option

Defines either a constant text string or a variable name to be drawn in the font specified for this ticker. Constant strings must be enclosed within a pair of double quote symbols, “like this”. Double quote symbols can also be used within a constant text string simply by repeating the double quote symbols. If the string does not begin with a double quote, it is assumed to be the name of a text variable and must match one of the variable names supported by Lightwing, which are listed in the table below.

Text variable names are resolved and replaced with information that is current at the time the ticker is drawn. Many of the supported variables have additional requirements. For example, time and date variables depend on the NTP (Network Time Protocol) configuration (in /etc/ntp.conf) which requires an active internet connection and the correct time zone configuration (in /etc/init.d/timezone). Use of any of the RSS variables requires the RSS option to be specified also.

Text and Ticker Variable Names

        Names                                                Examples of Resolved Text
        
        Year                                                     2015
        Month                                                 1
        MonthName                                       January
        Week                                                    1
        Day                                                       1
        DayName                                            Thursday
        Hours12                                              12
        Hours24                                              24
        AmPm                                                  AM
        Minutes                                               10
        Seconds                                               20
        Clock12                                                12:10 AM
        ClockSeconds12                                 12:10:20 AM
        Clock24                                                24:10
        ClockSeconds24                                 24:10:20
        DateFull                                               Thu, Jan 1, 2015
        DateShort                                            Jan 1, 2015
        DateLong                                             Thursday, January 1, 2015
        DateNumeric                                      1/1/2015
        TimeZone                                            CST6CDT
        FramesPerSecond                              60
        Version                                                 1.2
        TouchX                                                 50
        TouchY                                                 50
        TrackControlFloat1                            50.0
        TrackControlFloat2                            50.00
        TrackControlFloat3                            50.000
        TrackControlFloat4                            50.0000
        TrackControlInteger                          50
        TrackControlHex                                ABCDEF00
        RssChannelTitle                                  NPR News         
        RssChannelDescription                     Latest Headlines         
        RssChannelLink                                   http://www.npr.org/rss/rss.php?id=1001         
        RssChannelCopyright                         Copyright 2015 NPR         
        RssChannelItems                                100         
        RssItemTitle                                         Star Trek Returns         
        RssItemDescription                            Space, the final frontier. These are ...         
        RssItemLink                                        http://www.npr.org/star_trek_story/...
        CsvItem                                                 Item
        CsvRow                                                  Item1    Item2    Item3    Item4
        CsvColumn
        CsvBlock

Constant and variable text strings can be up to 1000 characters in length per ticker command. Tickers always use only a single line on the display. They can not wrap. Backslash symbols can be used to break long ticker commands into multiple lines within scripts, but this does not affect how tickers are drawn on the display.

Length Option

Defines the maximum number of characters that will be drawn on the display for a constant or variable ticker. If a ticker exceeds this length, it will be truncated.

RSS Option

Defines the name of an RSS channel that will provide the dynamic data to resolve the RSS variables used by this Ticker command. This RSS channel must have already been established with an RSS command at the top of the script with a matching RSS channel name.

Rate Option

Defines the rate at which a ticker animation scrolls across the display independent of its length. This is specified as a floating-point value. The default scroll rate for tickers is defined by the time it takes to scroll the entire length of the ticker across the entire display once. Therefore, it is affected by the length of the ticker as well as the time duration of the ticker, which defaults to the duration time for the page, if not specified.

This option allows the scroll rate to be defined independent of the ticker length and time duration. A rate value of 1.0 means it will take 100 seconds for the start of the ticker to scroll across the display. A rate value of 10.0 means it will take 10 seconds for the start of the ticker to scroll across the display. A rate value of 100.0 means it will take 1 second for the start of the ticker to scroll across the display. A rate value of 0.0 is valid but means that the ticker will not move at all, so it will be stuck off the display.

Loop Option

Enables or disables repeating a ticker animation continuously. This parameter can be specified as off or on.  It is off by default. When this option is used with a ticker that displays RSS channel information, Lightwing automatically steps the RssItem variables to display the next item from the channel each time the ticker animation completes a loop cycle. This allows a single page to display all the items for an RSS channel, if enough time is available to cycle through all of the items.

Touch Option

Defines the polarity for which touch screen events will be recognized for the ticker. Touch events for tickers have precedence over events for backgrounds and boxes, but can be superseded by events for objects.

This parameter can be specified as on, off, both or dir. The default is on. A touch on event means a finger has made contact with the touch screen. A touch off event means a finger has broken contact with the touch screen. Touch both means that both on and off touch events are recognized. This option requires that a jump, call or return option must also be specified for the page command to define the branch page that will be executed when the touch event is detected.

The dir touch option allows one of several branch pages to be selected based on swipe direction. A touch swipe event is when a finger is dragged on the display at least 10% of the width or height of the display and released. The dominate direction of movement at the point of release selects the branch page. One of four swipe directions can be detected, left, right, top and bottom. This requires that either two or four branch pages be defined for the touch branch option for the page. The best practice is to define all four page names, even if only two are actually needed. The dir option can not be used with the return option.

Touch events are not recognized during page transitions.

Jump Option

Defines a branch page to execute when a touch event occurs on the ticker with the correct polarity. The polarity is defined by the touch option. This feature is only available if a supported touch screen is connected to the Lightwing player and configured properly. This option is similar to the Jump command, except that no branch condition options can be used here.

Call Option

Defines a branch page to execute when a touch event occurs on the ticker with the correct polarity. The polarity is defined by the touch option. This feature is only available if a supported touch screen is connected to the Lightwing player and configured properly. This option is similar to the Call command, except that no branch condition options can be used here.

Return Option

Defines that a branch page from the call stack will be executed when a touch event occurs on the ticker with the correct polarity. The polarity is defined by the touch option. This feature is only available if a supported touch screen is connected to the Lightwing player and configured properly. This option is similar to the Return command, except that no branch condition options can be used here.

Toggle Option

Defines a toggle control which enables and disables the ticker and its touch events. If a toggle control name is specified with this option, the ticker will only be drawn when the toggle control is active, otherwise the ticker is invisible and its touch events are not processed either. This toggle control name must be defined either on the same page or the current global page. However, toggle controls can be defined before or after the Ticker command, provided they are defined on the same page.

Track Option

Defines a track control whose numeric value will be displayed to resolve a track control variable. One of the text variable names which begin with TrackControl must be specified for the Type option, as well. This track control name must have been defined previously on the same page.

Effect Option

Defines an effect to be used to draw the font for a Ticker command instead of the default font effect (Font.pfx). A PFX extension is appended to the end of this name to construct the file name of the effect. Font effects are located in the same folder as image effects, but have file names that begin with Font. Image and font effects are not interchangeable because fonts are stored in a compact 8 bits per pixel format, so only effects that have names beginning with Font can be used with the Ticker commands. A font effect can specify a custom font image, but the font effects supplied in the Lightwing SDK specify Default images, which means the font name given as the first parameter to the Ticker command will be used.

Arg0 Option

Defines effect-specific parameters for a selected font effect for a Ticker command. Up to four floating-point values are passed to the effect to draw the font. The meaning of these values depends on the selected font effect. These parameters are required by some font effects, but ignored by the default font effect. To determine the appropriate values for a particular effect, refer to the notes in the individual effect files.

   Example of a Ticker Command with a Font Effect and Arguments
  
        ticker: GalatiaBold_200    effect: FontColorBlocks    arg0: 1.0, 0.0, 0.0, 1.0    type: "Hello World!"

 

 

<   Text Command                                             Introduction                                            Toggle Command   >