Fandom

Pico-8 Wiki

Draw zoomed sprite (zspr)

162pages on
this wiki
Add New Page
Comments2 Share

I find the syntax of sspr involves too much work, so I wrote a wrapper function that requires less arguments and less thinking. So... 

zspr

Arguments:

--n: standard sprite number

--w: number of sprite blocks wide to grab

--h: number of sprite blocks high to grab

--dx: destination x coordinate

--dy: destination y coordinate

--dz: destination scale/zoom factor

 function zspr(n,w,h,dx,dy,dz)

  sx = 8 * (n % 16)

  sy = 8 * flr(n / 16)

  sw = 8 * w

  sh = 8 * h

  dw = sw * dz

  dh = sh * dz



  sspr(sx,sy,sw,sh, dx,dy,dw,dh)

end

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.