Your welcome
I wrapped it into a couple of handy functions
spr1=createsprite(0)
SetSpriteSize(spr1, 100, 100)
SetSpritePosition(spr1, 200, 200)
SetSpriteAngle(spr1, 45)
do
mouse_x=getpointerx()
mouse_y=getpointery()
if GetSpriteHitTest(spr1, mouse_x, mouse_y)
print(WorldToSpriteX(spr1, mouse_x, mouse_y))
print(WorldToSpriteY(spr1, mouse_x, mouse_y))
endif
Sync()
loop
Function WorldToSpriteX(sprite_id, world_x, world_y)
if GetSpriteExists(sprite_id)
width=GetSpriteWidth(sprite_id)
sprite_x=GetSpriteXFromWorld( sprite_id, world_x, world_y)-width/2
ExitFunction Round(Abs(Abs(sprite_x)-width))
endif
EndFunction -1
Function WorldToSpriteY(sprite_id, world_x, world_y)
if GetSpriteExists(sprite_id)
height=GetSpriteWidth(sprite_id)
sprite_y=GetSpriteXFromWorld( sprite_id, world_x, world_y)-height/2
ExitFunction Round(Abs(Abs(sprite_y)-height))
endif
EndFunction -1