cursor( x, y )

Sets the text cursor position for print().

The x coordinate of the upper left corner.
The y coordinate of the upper left corner.

The draw state maintains a cursor location for printing text with the print() function. Pico-8 uses this to maintain a scrolling display, especially for the command prompt.

The cls() function resets the cursor position to (0, 0). Calling print() with explicit coordinate arguments sets the cursor to that location.

See print() for an explanation of the text cursor behavior.

Examples Edit

-- set the cursor position to (20, 24).
cursor(20, 24)
print('line one')
print('line two')
print('line three')

See also Edit