Hi, I am using the gtween module to make some transitions, but can't make a clockwise rotation. The sprite always rotatei
in counter clockwise direction.
..
local tween = GTween.new(self, 2,{rotation = -60, scaleX=2,scaleY=2},{ ease = easing.outExponential, repeatCount = 1} )
..
In my opinion this line should make a 60 degrees clockwise rotation. Has anyone solved this issue?
Thanks all.
Comments
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
It's because the rotation setting is a sort of heading and not an amount to rotate, so it's going from a heading of 180 to a heading of 60 and it looks like it goes different ways depending on which direction you do the 180 rotation.
If you want it to rotate 60 degrees then you need to add (for clockwise) or subtract (for anti-clockwise) the amount you want to turn from the sprite's current rotation which you get using getRotation().
This should give you the 60 degree clockwise you are looking for even if the object has been roatated beforehand:
Likes: paulocarrasco