Log In  

I am printing on coordenates > 128, and the text is adjusted with camera().
However, if I

camera(0,128)
print("text\nwith\nlines",0,135)

But if I do the following, the text gets a scroll automatically, and you can only see the last line.

camera(0,128)
cursor(0,135)
print("text\nwith\nlines")

Is this a bug, or is this expected? It's rather annoying and not quite what I would have expected.

P#51222 2018-04-02 17:06 ( Edited 2018-04-02 21:06)

Printing without coords engages the scrollable text area functionality.

Problem is, you're trying to print text outside of the legal scrollable text area. You should expect undefined behavior.

What I mean is, your cursor(0,135) isn't setting up a legal state for printing to the scrollable text area. The legal area for that is (0-124,0-122). The fact that you're using this illegal state is the real source of the problem.

If you want to be able to print outside of the scrollable text area, you have to use print() in coordinate mode, e.g. print("abc",12,34).


Elaboration:

This is partially because PICO-8 relaxes some of the restrictions you'd find on a real hardware platform. Text mode would not allow you to set pixel offsets on a real platform. You'd be stuck with setting your cursor to columns 0-31 and rows 0-20. Trying to set it to something outside that range would produce an error before you could even get unwanted behavior.

P#51231 2018-04-03 01:21 ( Edited 2018-04-03 05:31)

Thanks a lot for explanation.
I ended up not using cursor, and just print with the coordinates.

P#51346 2018-04-05 15:19 ( Edited 2018-04-05 19:19)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-20 02:25:51 | 0.005s | Q:10