Type Method

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.

sec

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:

let action = SKAction.rotate(byAngle: -radians, duration: sec)

See Also

Animating the Rotation of a Node

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

Creates an action that rotates the node counterclockwise to an absolute angle.