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

    Function linearLabelsPath

    • Returns a Path2D object containing text labels arranged along a straight line, like the markings on a linear thermometer.

      Parameters

      • ctx: CanvasRenderingContext2D

        An instance of CanvasRenderContext2D to use for creation of paths for individual labels. It should already have all desired typography properties applied (font, etc).

      • x: number

        Horizontal starting coordinate

      • y: number

        Vertical starting coordinate

      • size: number

        Total length of path for labels. The labels will be spaced to fit within this size.

      • vertical: boolean

        The line of labels will be drawn vertically if true, horizontally otherwise.

      • labels: string[]

        The array of label strings to use; These will be spaced out evenly between the relevant starting coordinate and the given size.

      • position: -1 | 1

        Set to -1 to position the labels towards the top/left of the line, or 1 towards the bottom/right.

      • rotate: number = 0

        Degrees of rotation to apply to labels.

      • alignAuto: boolean = true

        true will automatically align the text based on line position and orientation. If false, assumes horizontal text alignment has already been set as desired.

      Returns Path2D