q5play
    Preparing search index...

    Function square

    • 🧑‍🎨 Draws a square or a rounded square.

      Also accepts 7 parameters to specify a corner radius for each corner, in the order: top-left, top-right, bottom-right, bottom-left.

      Parameters

      • x: number

        x-coordinate

      • y: number

        y-coordinate

      • size: number

        size of the sides of the square

      • Optionalrounded: number

        radius for all corners

      Returns void

      await Canvas(200);
      background(0.8);

      square(-70, -70, 40);
      square(-20, -20, 40, 10);
      square(30, 30, 40, 20, 4, 0, 8);