I'm pretty sure this is a bug; I'm on pico8 0.2.6b / linux
You can turn on character wrapping with 0x5f36 / 24374, but it acts unexpectedly when you move the camera:
cls(1) poke(0x5f36,0x80) --turn on character wrapping msg='0123456789abcdefghijklmnopqrstuvwxyz' ?msg,0,0,12 camera(16,0) ?msg,16,12,13 |
Expected behavior: both prints should wrap at the edge of the screen.
Actual behavior:
There's a similar issue with p8scii "\^r" wrapping:
cls(1) msg='\^rf0123456789abcdefghijklmnopqrstuvwxyz' --note p8scii wrap at start ?msg,0,0,13 camera(16,0) ?msg,16,18,14 |
I won't talk about the p8scii as I've never seriously looked at it so far.
About the wrapping, this is what I would expect, but the print(msg) without extra parameter is not.
When there's no wrapping enabled, print(msg) and print(msg,x,y) behave differently :
print(msg) is the oldscool print from the dumb terminal/Basic times. It prints forward and scrolls the screen if the bottom is reached.
print(msg,x,y) is more modern, you have control over the placement, no associated automatic scrolling.
What I would expect with wrapping enabled :
print(msg) : prints and wraps when reaching the screen border, and scrolls when reaching the screen bottom. This is not what we get for the wrapping.
print(msg,x,y) prints at the given coordinates. The placement of the camera should be a simple offset that doesn't influence where the letters are placed relative to the origin, so wrapping at x=128 is the expected behavior. This also gives better control as you can adjust width with print coordinates, and adjust onscreen placement with camera.
So to me, the unexpected behavior is that print(msg) is screen aware in y, but not in x. The fact that print(msg,x,y) doesn't change letter placement or scroll the screen depending on the camera is fine with me.
[Please log in to post a comment]