Skip to content

print()

Displays text in the command line console.

print() is helpful for printing values while debugging. Each call to print() creates a new line of text.

Calling printToScreen() will turn on displaying the output of print() functions in your program window. This is particularly helpful if you are running your L5 program without a text console output, for example by dragging and dropping your program's folder onto the Love application.

Note: Call print() on its own to print a blank line.

Examples

print example 1

require("L5")

function setup()
  size(100, 100)

  -- Prints "hello, world" to the console.
  print('hello, world')

  -- Turns on print console display on program window
  printToScreen()
end

Syntax

print(contents)

Parameters

Parameter
contents Any: content to print to the console.

This reference page contains content adapted from p5.js and Processing by p5.js Contributors and Processing Foundation, licensed under CC BY-NC-SA 4.0.