How do you rotate an object 360 with a transition?

I was using transition.to(dv.sprite, {time=400, rotation=360 }) to spin an object 360, however this does not work as expected. The first time, I will get a rotation. The second time I won’t. I believe the reason is because the rotation property describes a specific angle from the original angle.

I tried using rotate, but that breaks because rotate is a method and not a property. Anyone have any ideas of how to do this properly?

Thanks [import]uid: 8945 topic_id: 12585 reply_id: 312585[/import]

you have to rset the rotation to 0 or add another 360 to make it 720 [import]uid: 7911 topic_id: 12585 reply_id: 46010[/import]

how about this
[lua]local rect = display.newRect(200,200,100,100)
local function callMe()
transition.to(rect,{rotation = rect.rotation + 360,time = 2000})
end
Runtime:addEventListener(“tap”,callMe)[/lua]

:slight_smile: [import]uid: 12482 topic_id: 12585 reply_id: 46013[/import]

That worked perfectly. Brain Fart has been relieved. Thanks :slight_smile: [import]uid: 8945 topic_id: 12585 reply_id: 46015[/import]

you welcome

:slight_smile: [import]uid: 12482 topic_id: 12585 reply_id: 46017[/import]