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) -> SKActionParameters
- 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
resize(toHeight:duration:)resize(toWidth:duration:)resize(toWidth:height:duration:)setTexture(_:)setTexture(_:resize:)animate(with:timePerFrame:)animate(with:timePerFrame:resize:restore:)setNormalTexture(_:)setNormalTexture(_:resize:)animate(withNormalTextures:timePerFrame:)animate(withNormalTextures:timePerFrame:resize:restore:)colorize(with:colorBlendFactor:duration:)colorize(withColorBlendFactor:duration:)