Is it possible to create an SKAction for SKSpriteNode in SpriteKit that generates the same effect as “Photoshop” with the Edit->Transform->Distort option?
There is none to do exactly what you describe. Instead, you can export multiple sprite images from a photo editing tool like Photoshop, and use an animation action like class func animate(with: [SKTexture], timePerFrame: TimeInterval).
This is a little more work, but should achieve the desired effect.
3
Answers
I solve with this implementation:
Swift 5
The list of available
SKAction
‘s is here: https://developer.apple.com/reference/spritekit/skactionThere is none to do exactly what you describe. Instead, you can export multiple sprite images from a photo editing tool like Photoshop, and use an animation action like
class func animate(with: [SKTexture], timePerFrame: TimeInterval)
.This is a little more work, but should achieve the desired effect.
You can create a skew using a 1×1 warp mesh. This is supported in iOS10.0+.
This extension receives the skew angle in degrees, and distorts around the anchor point of the given sprite.
Swift 4.2
Example animation: