When using multiscreen mode, the following function (which should print a scaled text) turned out to render only on the first screen:
function scale_text(str,x,y,c,scale) memcpy(0x4300,0x0,0x0200) memset(0x0,0,0x0200) -- draw to spr mem at 0x0000 poke(0x5f55,0x00) print(str,0,0,7) -- draw to screen mem again poke(0x5f55,0x60) local w,h = #str*4,5 pal(7,c) palt(0,true) sspr(0,0,w,h,x,y,w*scale,h*scale) pal() memcpy(0x0,0x4300,0x0200) end |
Just like normal printing, I expected this to work in multiscreen with the following calling code:
poke(0x5f36,1) scrs_w, scrs_h = 3,1; scr_ix = 0; _camera = camera function camera(x,y) x = x or 0 y = y or 0 local dx=flr(scr_ix % scrs_w) local dy=flr(scr_ix / scrs_w) _camera(x+128*dx, y+128*dy) end function _draw() scr_ix = stat(3) camera(0,0) cls(scr_ix+5) [ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=130328#p) |
Hi,
on a Mac (Big Sur) I did some experiments with drawing a 3D starfield using lines.
However, PICO-8 regularly crashes completely (play around with the 6 buttons for the star speed in all 3 directions) and a debug with lldb on the Mac terminal uncovered the following:
So there seems to be a problem in 0.2.2 with line drawing somewhere.
I hope this can be fixed for the upcoming 0.2.2b
- Martin