It's been a while since I did any rotations, but as I recall you generally want to rotate around the center point of the image and then translate it the position on the screen where you want it to appear. This means you have to shift the image down and left by half the height and width putting the 0,0 point at the center of the image. Here's the code I used for the Video Poker screensaver:
x = rnd(dsize.w)
y = rnd(dsize.h)
r = rnd(180) - 90
item = [{ url:url,TargetRect:{x:Int(-cardw/2), y:Int(-cardh/2), w:cardw, h:cardh},TargetRotation:r,TargetTranslation:{x:x,y:y}}]
canvas.SetLayer(1,item)
Hope this helps!
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.