Is there a way of changing the origin point of a sprite/object to be central?
in Love i would use getHeight()/2



I don't know exactly what you want to do, but for instance for a standard little 8 by 8 pixel sized sprite, just subtract 4.



there's no real sprite object, you just draw blocks from "sprite memory",
so you have to subtract your hotspot coords in the "sprite" from your destination coords, like Offler said
... or use those:
function sprc(n, x,y, w,h, fx,fy) w,h=w or 1,h or 1 spr(n, x-w*4,y-h*4, w,h, fx,fy) end function ssprc(sx,sy,sw,sh, dx, dy, dw, dh, fx,fy) dw,dh=dw or sw,dh or sh sspr(sx,sy,sw,sh, dx-dw/2,dy-dh/2,dw,dh, fx,fy) end |
[Please log in to post a comment]