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

    Function circularLabelsPath

    • Returns a Path2D object containing a full or partial circle of labels, like the markings for a compass or speedometer.

      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 center coordinate

      • y: number

        Vertical center coordinate

      • rx: number

        Horizontal radius in pixels

      • ry: number

        Vertical radius in pixels

      • from: number

        Degrees to start from; 0° points north. Can be negative.

      • to: number

        Degrees to end at (eg. 0, 360 to draw a full circle, 0, 180 for half circle, etc). 0° points north. Can be negative.

      • labels: string[]

        The array of label strings to use; First label is drawn at start position (from), and the rest are spread out evenly between start and end angles.

      • position: -1 | 1

        Set to -1 to position the labels towards the inside of the arc, or 1 towards the outside.

      • rotate: number = 0

        Degrees of rotation to apply to labels. If rotateToAngle == 0 then the angle is an offset from horizontal, otherwise it is the offset from the rotated label angle.

      • rotateToAngle: number = 0

        Set to 1 to rotate the labels so they face inward towards the center of the arc, -1 to rotate so they face away from center, or 0 (default) to keep the labels horizontal.

      Returns Path2D