SKSpriteNode使用APNG进行纹理处理

时间:2017-10-21 04:31:20

标签: swift sprite-kit skspritenode

是否可以将func customerAddToCartItemsDownloadJsonWithURl(cartApi: String){ let url = URL(string: cartApi) var request = URLRequest(url: url! as URL) request.httpMethod = "POST" let cartNumber = customerCartId?.replacingOccurrences(of: "\\", with: "") let parameters : [String: Any] = ["cartItem": [ "quote_id": "\(customerCartId!)", "sku": "\(itemCode!)", "qty":"1" ] ] print(customerCartId) print(parameters) print(cartNumber) do { request.httpBody = try JSONSerialization.data(withJSONObject: parameters, options: .prettyPrinted) } catch let error { print(error.localizedDescription) } request.addValue("application/json", forHTTPHeaderField: "Content-Type") request.addValue("Bearer \(self.customerKeyToken!)", forHTTPHeaderField: "Authorization") let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data, error == nil else { print("error=\(String(describing: error))") return } if let httpStatus = response as? HTTPURLResponse, httpStatus.statusCode != 200 { print("statusCode should be 200, but is \(httpStatus.statusCode)") print("response = \(String(describing: response))") } let responseString = String(data: data, encoding: .utf8) print("responseString = \(responseString!)") } task.resume() } 格式用作APGN的纹理?

1 个答案:

答案 0 :(得分:0)

简单回答,不,不是本地的。 APNG不是广泛使用的格式,因此不受支持。您需要找到第3个库来为您处理APNG,或者将您的APNG分成单独的PNG文件。