- Sets the left-margin cursor position for
- The x coordinate of the upper left corner of the line. The default is 0.
- The y coordinate of the upper left corner of the line. The default is 0.
- (Optional) The palette index to set the pen color to.
The coordinates passed in set the starting location of the next
print() call as well as setting the left margin for all subsequent calls.
print() for a more detailed explanation of the text cursor's behavior.
Other functions that affect the cursor Edit
cls() effectively also calls
print(str) without explicit coordinate arguments will adjust the cursor's Y value when required for newlines and scrolling.
print(str, x, y) with explicit coordinate arguments effectively also calls
cursor(x, y) after the entire string is printed.
Technical notes Edit
The current cursor position is memory-mapped and may be read or written directly:
- 0x5f26: cursor x position
- 0x5f27: cursor y position
- 0x5f25: pen color (see
-- set the cursor position to (20, 24). cursor(20, 24) print("line one") print("line two") print("line three") -- get the cursor position from its memory-mapped addresses cursor_x = peek(0x5f26) cursor_y = peek(0x5f27)