Type Method

speed(by:duration:)

Creates an action that changes how fast the node executes actions by a relative value.

Declaration

class func speed(by speed: CGFloat, duration: TimeInterval) -> SKAction

Parameters

speed

The amount to add to the node’s speed.

sec

The duration of the animation.

Return Value

A new action object.

Discussion

When the action executes, the node’s speed property animates to the new value.

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

let action = SKAction.speed(by: -speed, duration: sec)

See Also

Controling the Action's Speed

class func speed(to: CGFloat, duration: TimeInterval) -> SKAction

Creates an action that changes how fast the node executes actions.