Class RotateToAction
java.lang.Object
com.prineside.tdi2.scene2d.Action
com.prineside.tdi2.scene2d.actions.TemporalAction
com.prineside.tdi2.scene2d.actions.RotateToAction
- All Implemented Interfaces:
Pool.Poolable
Sets the actor's rotation from its current value to a specific value.
By default, the rotation will take you from the starting value to the specified value via simple subtraction. For example,
setting the start at 350 and the target at 10 will result in 340 degrees of movement.
If the action is instead set to useShortestDirection instead, it will rotate straight to the target angle, regardless of where
the angle starts and stops. For example, starting at 350 and rotating to 10 will cause 20 degrees of rotation.
- Author:
- Nathan Sweet
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
boolean
void
setRotation
(float rotation) void
setUseShortestDirection
(boolean useShortestDirection) Methods inherited from class com.prineside.tdi2.scene2d.actions.TemporalAction
act, finish, getDuration, getInterpolation, getTime, isComplete, isReverse, reset, restart, setDuration, setInterpolation, setReverse, setTime
-
Constructor Details
-
RotateToAction
public RotateToAction() -
RotateToAction
public RotateToAction(boolean useShortestDirection) - Parameters:
useShortestDirection
- Set to true to move directly to the closest angle
-
-
Method Details
-
getRotation
public float getRotation() -
setRotation
public void setRotation(float rotation) -
isUseShortestDirection
public boolean isUseShortestDirection() -
setUseShortestDirection
public void setUseShortestDirection(boolean useShortestDirection)
-