【发布时间】:2016-05-05 17:22:01
【问题描述】:
我收到以下代码错误:
func prepareAnimationForDictionary(settings: NSDictionary,repeated: Bool) -> SKAction {
let atlas: SKTextureAtlas =
SKTextureAtlas(named: settings["AtlasFileName"] as! String)
let textureNames:NSArray = settings["Frames"] as! NSArray
let texturePack: NSMutableArray = []
for texPath in textureNames {
texturePack.addObject(atlas.textureNamed(texPath as! String))
}
let timePerFrame: NSTimeInterval = Double(1.0/(settings["FPS"]
as! Float))
let anim:SKAction = SKAction.animateWithTextures(texturePack,
timePerFrame: timePerFrame) // the error I get is here
if repeated {
return SKAction.repeatActionForever(anim)
}else{
return anim
}
【问题讨论】:
标签: ios swift sprite-kit