I'm trying to make a little platform game, for educational purposes only. I tried to animate a character with an SKTextures array as follows:
let animation: SKAction = SKAction.animate(
with: frames.map {
let texture : SKTexture = SKTexture(imageNamed: $0)
texture.filteringMode = SKTextureFilteringMode.nearest
return texture
},
timePerFrame: 0.15
)
framesvariable is an array of SKTextures. I used mapto set the filtering mode for each texture. This works fine and dandy, but I found that I can create animations (actions) in ActionEditor in Xcode with the AnimateWithTextures action. And here is my problem. This is much more efficient, but I cannot change the filtering mode of textures in animations in ActionEditor . I looked at the SKTexture class and saw this:
open class SKTexture : NSObject, NSCopying, NSCoding {
...
open var filteringMode: SKTextureFilteringMode
...
}
, open , , , . filteringMode SKTextureFilteringMode.nearest SKTextures, ActionEditor , .
, , - , .