Forum Discussion
renojim
12 years agoCommunity Streaming Expert
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:
Hope this helps!
-JT
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