Class RotateToAction

All Implemented Interfaces:
Pool.Poolable

public class RotateToAction extends TemporalAction
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 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)