User Tools

Site Tools


gauges:dynamic_images

Dynamic Images in Gauges

Using dynamic images you can make your gauges change the appearance based on data values. Those can be changed either by user request or normal data.
The extended Tag looks as follows:

<Element id="mybackground">
  <Image Name="default.png" Dynamic="background{VALUE}.png">
    <Value Minimum="0" Maximum="3">(G:BACKGROUND) ABS 4 MOD</Value>
  </Image>
</Element>

When displaying the image on the gauge, SPAD.neXt will evaluate the expression (<Value></Value>) and replace {VALUE} in the Dynamic-Tag with the result, and then load the resulting image from the ArtDirectory.

“default.png” will be loaded when rendering thumbnail, before variables are initialized or if loading of the dynamic image fails.

In the example the result will be evaluated as

   PositiveValueOf(BACKGROUND) modulo 4

which will result in a value of 0..3. So SPAD.neXt will load the image background0.png … background3.png from the ArtDirectory
The Prefix G: means that this Variable will be saved, and reused whenever this gauge is loaded. (Persistence of settings)

gauges/dynamic_images.txt · Last modified: 2019/08/19 14:23 by c0nnex