Contents

setNormalTexture(_:resize:)

Creates an action that changes a sprite’s normal texture, possibly resizing the sprite.

Declaration

class func setNormalTexture(_ texture: SKTexture, resize: Bool) -> SKAction

Parameters

  • texture:

    The new texture to use on the sprite.

  • resize:

    If True, the sprite is resized to match the new texture. Otherwise, the size of the sprite is unchanged.

Return Value

A new action object.

Discussion

This action can only be executed by an SKSpriteNode object. When the action executes, the sprite’s normalTexture property changes immediately to the new texture and the sprite is resized to match.

See Also

Animating a Node’s Texture