Contents

rotate(byAngle:duration:)

Creates an action that rotates the node by a relative value.

Declaration

class func rotate(byAngle radians: CGFloat, duration: TimeInterval) -> SKAction

Parameters

  • radians:

    The amount to rotate the node, in radians.

  • duration:

    The duration of the animation.

Return Value

A new action object.

Discussion

When the action executes, the node’s zRotation property animates to the new angle.

This action is reversible; the reverse is created as if the following code is executed:

See Also

Animating the Rotation of a Node