Contents

resize(byWidth:height:duration:)

Creates an action that adjusts the size of a sprite.

Declaration

class func resize(byWidth width: CGFloat, height: CGFloat, duration: TimeInterval) -> SKAction

Parameters

  • width:

    The amount to add to the sprite’s width.

  • height:

    The amount to add to the sprite’s height.

  • duration:

    The duration of the animation.

Return Value

A new action object.

Discussion

This action can only be executed by a SKSpriteNode object. When the action executes, the sprite’s size property animates to its new value.

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

See Also

Animating a Node’s Texture