I see, so you want to rotate the sprite around 0,0 on the sprite but position it by the centre?
Let me just add you to my awkward list... OK that's done
You could use my sprite to world functions to find out how far away it is from the position you want it to be then reposition...
rem use this in the loop after you rotated the sprite
sx# = targetX#-spriteToWorldX(spr,getSpriteWidth(spr)*0.5,getSpriteHeight(spr)*0.5)
sy# = targetY#-spriteToWorldY(spr,getSpriteWidth(spr)*0.5,getSpriteHeight(spr)*0.5)
setSpritePosition(spr,getSpriteX(spr)+sx#,getSpriteY(spr)+sy#)
rem put these after the loop
function spriteToWorldX(spr,x#,y#)
rem get sprite data
a# = getSpriteAngle(spr)
ox# = getSpriteXbyOffset(spr)
rem get display data
dw# = getVirtualWidth()
dh# = getVirtualHeight()
aspect# = (dw# / dh#)
if aspect# = 1.0
scaleX# = getSpriteWidth(spr)/100.0
aspect# = getDisplayAspect()
scaleY# = scaleX# * aspect#
else
aspect# = 1.0
i = getSpriteImageID(spr)
scaleX# = getSpriteWidth(spr)/getImageWidth(i)
scaleY# = getSpriteHeight(spr)/getImageHeight(i)
endif
rem calculate value
dx# = cos(a#) * (x# * scaleX#) - sin(a#) * (y# * scaleY#)
wx# = ox# + dx#
endfunction wx#
function spriteToWorldY(spr,x#,y#)
rem get sprite data
a# = getSpriteAngle(spr)
oy# = getSpriteYbyOffset(spr)
rem get display data
dw# = getVirtualWidth()
dh# = getVirtualHeight()
aspect# = (dw# / dh#)
if aspect# = 1.0
scaleX# = getSpriteWidth(spr)/100.0
aspect# = getDisplayAspect()
scaleY# = scaleX# * aspect#
else
aspect# = 1.0
i = getSpriteImageID(spr)
scaleX# = getSpriteWidth(spr)/getImageWidth(i)
scaleY# = getSpriteHeight(spr)/getImageHeight(i)
endif
rem calculate value
dy# = sin(a#) * (x# * scaleX#) + cos(a#) * (y# * scaleY#)
wy# = oy# + dy# * aspect#
endfunction wy#
I haven't tried this though so it might not work quite how you want...
Any chance you can post some example code?