q5play
    Preparing search index...

    Function createTextImage

    • 📘 Creates an image from a string of text.

      Parameters

      • str: string

        string of text

      • OptionalwrapWidth: number

        maximum line width in characters

      • OptionallineLimit: number

        maximum number of lines

      Returns Image

      an image object representing the rendered text

      await Canvas(200);
      textSize(96);

      let img = createTextImage('🐶');
      img.filter(INVERT);

      q5.draw = function () {
      image(img, -45, -90);
      };