q5play
    Preparing search index...

    Function text

    • 📘 Renders text on the canvas.

      Parameters

      • str: string

        string of text to display

      • x: number

        x-coordinate of the text's position

      • y: number

        y-coordinate of the text's position

      • OptionalwrapWidth: number

        maximum line width in characters

      • OptionallineLimit: number

        maximum number of lines

      Returns void

      await Canvas(200, 100);
      background('silver');

      textSize(32);
      text('Hello, world!', -88, 10);
      await Canvas(200);
      background(0.8);
      textSize(20);

      let info =
      'q5.js was designed to make creative coding fun and accessible for artists, designers, educators, and beginners.';

      text(info, -88, -70, 20);
      //
      //