Contents

setTexture(_:)

Creates an action that changes a sprite’s texture.

Declaration

class func setTexture(_ texture: SKTexture) -> SKAction

Parameters

  • texture:

    The new texture to use on the sprite.

Return Value

A new action object.

Discussion

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

This action is not reversible; the reverse of this action does nothing.

See Also

Animating a Node’s Texture