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

    Variable global

    global: {
        canvasContext: CanvasRenderingContext2D;
        paintRectangle: Rectangle;
        scriptArgs: string;
        parentIcon: DynamicIcon;
        logger: Logger;
        DI: DI;
        Point: typeof Point;
        Rectangle: Rectangle;
        Size: Size;
        Vect2d: Vect2d;
        Canvas: Canvas;
        DOMMatrix: DOMMatrix;
        DOMPoint: DOMPoint;
        DOMRect: DOMRect;
        Image: Image;
        ImageData: ImageData;
        Path2D: Path2D;
        loadImage: typeof loadImage;
        loadImageData: typeof loadImageData;
    }

    Additional global scope variables, classes, and utility functions which are available in the scripting environment.

    Although global is described here as a "variable" type, it is really the global scope which is documented. No prefix or import is required to use these variables/types.

    The documentation here just provides links to the actual type references (also found in the left navigation bar). Click on the types (on right side) for full details.

    Type declaration

    • canvasContext: CanvasRenderingContext2D

      The canvas context to draw into.

    • paintRectangle: Rectangle

      A class representing a rectangle with x, y, width, & height properties describing the area to draw into. This is typically the same width & height as the main icon instance, with x and y both 0.

    • scriptArgs: string

      Argument string specified in the "Run Custom Script" action's "Arguments" field or via "Update Value" action.

    • parentIcon: DynamicIcon

      A class representing the current icon instance that is running this script. It has useful properties such as name, width & height.

    • logger: Logger

      A class for writing output to the Dynamic Icons plugin log file.

    • DI: DI

      The DI namespace object contains static utility functions, enumerations, and constructors for custom Dynamic Icons elements. See DI for details.

    • Point: typeof Point
    • Rectangle: Rectangle
    • Size: Size
    • Vect2d: Vect2d
    • Canvas: Canvas
    • DOMMatrix: DOMMatrix
    • DOMPoint: DOMPoint
    • DOMRect: DOMRect
    • Image: Image
    • ImageData: ImageData
    • Path2D: Path2D
    • loadImage: typeof loadImage
    • loadImageData: typeof loadImageData