q5play
    Preparing search index...

    Function line

    • 🧑‍🎨 Draws a line on the canvas.

      To draw lines with rounded stroke caps, use capsule instead.

      Parameters

      • x1: number

        x-coordinate of the first point

      • y1: number

        y-coordinate of the first point

      • x2: number

        x-coordinate of the second point

      • y2: number

        y-coordinate of the second point

      Returns void

      await Canvas(200, 100);
      stroke('lime');
      line(-80, -30, 80, 30);