Dynamic Icons Scripting Reference - v1.3.0
    Preparing search index...

    Class DynamicIcon

    Stores a collection of ILayerElement types as layers and produces a composite image from all the layers when rendered.

    Index

    Accessors

    • get isTiled(): boolean

      true if the image should be split into parts before delivery, false otherwise. Checks if either of tile.x or tile.y are > 1.

      Returns boolean

    • get isEmpty(): boolean

      Returns true if icon has no layer elements.

      Returns boolean

    • get size(): SizeType

      This is the overall image size to generate. If the image will be delivered tiled, each tile will be a portion of this size.

      Returns SizeType

    • set size(v: SizeType): void

      Parameters

      Returns void

    • get width(): number

      Width component of overall image size.

      Returns number

    • set width(v: number): void

      Parameters

      • v: number

      Returns void

    • get height(): number

      Height component of overall image size.

      Returns number

    • set height(v: number): void

      Parameters

      • v: number

      Returns void

    Constructors

    Methods

    • Returns the number of element layers currently defined.

      Returns number

    • Returns element at index, if any, or undefined otherwise. Negative indexes count from the end, as in Array.prototype.at().

      Parameters

      • index: number

      Returns undefined | ILayerElement

    Properties

    name: string = ""

    the icon name is also used for the corresponding TP State ID

    tile: PointType = ...

    Specifies an optional grid to split the final image into multiple parts before sending to TP.

    delayGeneration: boolean = false

    true if icon was explicitly created with a "New" action, will require a corresponding "Render" action to actually draw it.

    gpuRendering: boolean = PluginSettings.defaultGpuRendering

    Whether to use GPU for rendering (on supported hardware). Passed to skia-canvas's Canvas::gpu property.

    outputCompressionOptions: PngOptions = ...

    Options for the 'sharp' lib image compression. These are passed to sharp.png() when generating PNG results. compressionLevel of 0 disables compression step entirely (sharp lib is never invoked, skia-canvas PNG-24 output is used directly). Default compressionLevel and quality are set in plugin settings and can be overridden in an icon "finalize" action. Default effort is set to 1 and palette to true. See https://sharp.pixelplumbing.com/api-output#png for option descriptions.