animate(withNormalTextures:timePerFrame:)
Creates an action that animates changes to a sprite’s normal texture.
Declaration
class func animate(withNormalTextures textures: [SKTexture], timePerFrame sec: TimeInterval) -> SKActionParameters
- textures:
An array of textures to use.
- sec:
The amount of time that each texture is displayed.
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 animates through the array of textures. The sprite’s normalTexture property is changed to the next texture in the array. The action then pauses for the specified time before continuing. The action continues until it has finished animating through all of the textures in the array. The total duration of the action is the number of textures multiplied by the frame interval.
This action is reversible; the resulting action animates through the same textures from last to first.
See Also
Animating a Node’s Texture
resize(byWidth:height:duration:)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:resize:restore:)colorize(with:colorBlendFactor:duration:)colorize(withColorBlendFactor:duration:)