Log In  

Hi all.

Now that I'm understanding ZEP's new 2ndary Font handler, is there any easy way to determine the # of pixels across in a text statement like, "Example" would take ? Particularly for if the font is proportional.

cls()
print("example",64-PixelLength("example")/2,32,7)
P#119201 2022-10-17 00:14 ( Edited 2022-10-17 03:32)

2

yes, since the introduction of custom fonts print returns rightmost x coordinate: https://www.lexaloffle.com/dl/docs/pico-8_manual.html#PRINT

P#119205 2022-10-17 01:45

Ah ! Well that's novel, @merwok. In fact I seem to remember using that in my INPUT function. I guess I figured it wouldn't work for proportional text.

a=print("Amazing Grace.")
?a

Nicely done and verified. Strangely if you use it x=print() it visually prints the contents anyways.

Yes you can print off the screen but that's just odd. I figured it would only set the variable and disregard the output.

Thanks. That was incredibly helpful ! :)

P#119207 2022-10-17 03:32

[Please log in to post a comment]