Report post

Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.

Users reporting for no reason may be locked out.


Post

Posted by Nick Thissen
on
Probably the easiest way is indeed to have your pictures contain a solid background that will cover over the actual numbers. Although that will only work if your graphic is non-transparent.

The better way that supports any kind of look is probably to use a script that checks if the dynamic image is found, and then hide/show the appropriate label. You can probably do that best as a Converter script for the dynamic image. That way the script should run only when the data for the dynamic image changes, and then it can take appropriate action to hide/show the correct labels.

Not tested, but something close to this may work:

using System;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemesSDK.Data.Results;
using System.Collections.Generic;
using System.Linq;

namespace Scripts
{
public class CarNumberScript : IScript
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
// Get the label running this converter script
// This label is showing the dynamic image
var label = item as Label;
if (label == null)
return null;

// Get the 'default carnumber' label to show instead
var index = 3; // The index (0-based) of your label in the template subwidget's list of labels
var subwidget = label.Parent;
var defaultLabel = subwidget.Labels[index];

// Check if the dynamic image was found
var path = label.DynamicBackground.GetAbsolutePath(item.Theme);
if (System.IO.File.Exists(path))
{
// Show dynamic image label
defaultLabel.IsVisible = false;
label.IsVisible = true;
}
else
{
// Show regular label
defaultLabel.IsVisible = true;
label.IsVisible = false;
}

return null;
}
}
}