<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKAction/resize(byWidth:height:duration:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKAction(cm)resizeByWidth:height:duration:"
  },
  "title" : "resize(byWidth:height:duration:)"
}
-->

# resize(byWidth:height:duration:)

Creates an action that adjusts the size of a sprite.

```
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`](/documentation/SpriteKit/SKSpriteNode) object. When the action executes, the sprite’s [`size`](/documentation/SpriteKit/SKSpriteNode/size) property animates to its new value.

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

```swift
let action = SKAction.resize(byWidth: -width, height: -height, duration: sec)
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)