Is there a way of changing the origin point of a sprite/object to be central?
in Love i would use getHeight()/2
P#35066 2017-01-06 08:59 ( Edited 2017-01-06 15:23)
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 |
P#35069 2017-01-06 10:23 ( Edited 2017-01-06 15:30)
[Please log in to post a comment]