Zum Inhalt springen
AppgineeringAppgineering
Shop
Schreibgeschützt3 Beiträge · 3,179 Aufrufe · Erstellt 29 Mar 2022, 17:38

Scripting and Generated Images

Archiviert: Diskussion auf Discord verlagertDiscord
Josh L.Ursprünglicher Verfasser
#1

Is there a way to use the new generated images in a script? Basically want to have a script that says "if dynamic image exists, use it, otherwise use generated image." A baseline script would be helpful but honestly just need to know how to call on the generated images in a script form.

Nick ThissenAppgineering
#2

You could try the following to set the type of image and enable it:

// 'widget' is any Widget, SubWidget or Label

// Set the image type. Available options: Car, CarNumber, Helmet, Club
widget.Background.ServerGeneratedBackgroundImage.Type = ServerGeneratedBackgroundImage.ServerGeneratedImageTypes.CarNumber;

// Enable it
widget.Background.ServerGeneratedBackgroundImage.Enabled = true;

However, I am not totally sure it would work, because the images are usually loaded on theme load. I am not sure if they will dynamically load properly if you enable them later, and it could also cause lag spikes. But feel free to try it.

#3

Worked in initial testing, will keep working on it to see if any hiccups come about. Thank you for the point in the right direction!

Dieser Thread ist archiviert.

Neue Antworten finden auf Discord statt.

Auf Discord weiterlesen